Re: A little question about safe mode

看板FB_current作者時間13年前 (2012/10/19 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串11/15 (看更多)
on 18/10/2012 18:20 Andriy Gapon said the following: > My guess is that the easiest way to avoid this ambiguity and the confusion that it > causes (like the problem you described above) is to prepend "/dev/", if it's > missing, right in vfs_mountroot.c before calling kernel_mount(). A patch (not tested): --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -676,6 +676,7 @@ static int parse_mount(char **conf) { char errmsg[255]; + char devbuf[MNAMELEN]; struct mntarg *ma; char *dev, *fs, *opts, *tok; int delay, error, timeout; @@ -693,6 +694,11 @@ parse_mount(char **conf) parse_advance(&tok); dev = tok; + if (dev[0] != '\0' && strncmp(dev, "/dev/", 5) != 0) { + snprintf(devbuf, sizeof(devbuf), "/dev/%s", dev); + dev = devbuf; + } + if (root_mount_mddev != -1) { /* Handle substitution for the md unit number. */ tok = strstr(dev, "md#"); -- Andriy Gapon _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1GW4FWBS (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1GW4FWBS (FB_current)