diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -163,6 +163,8 @@ #kern.ipc.nsfbufs="" # Set the number of sendfile(2) bufs #net.inet.tcp.tcbhashsize="" # Set the value of TCBHASHSIZE #vfs.root.mountfrom="" # Specify root partition +#vfs.mountroot.onfallback="ask" # Action to take if no root found: + # "ask" (mountroot prompt), "reboot" #vm.kmem_size="" # Sets the size of kernel memory (bytes) #debug.kdb.break_to_debugger="0" # Allow console to break into debugger. #debug.ktr.cpumask="0xf" # Bitmask of CPUs to enable KTR on diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -937,8 +937,13 @@ if (!(boothowto & RB_DFLTROOT)) sbuf_printf(sb, "%s\n", ROOTDEVNAME); #endif - if (!(boothowto & RB_ASKNAME)) + s = kern_getenv("vfs.mountroot.onfallback"); + if (s != NULL) { + sbuf_printf(sb, ".%s\n", s); + freeenv(s); + } else if (!(boothowto & RB_ASKNAME)) { sbuf_printf(sb, ".ask\n"); + } } static int