tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

New boothowto flag to prevent raid auto-root-configuration

Hi folks,

as described in PR 44774 (see, it is
currently not possible to use a standard NetBSD install CD on a system
wich normally boots from raid (at least on i386, amd64 or sparc64, where
a stock GENERIC kernel is used).

To fix this, I'd like to introduce a new boothowto flag, that turns off
all magic to override the root device (for now: turns off the root part
of raidframe autoconfiguration, but could do similar things in the future
with LVM or whatever).

The patch attched does this. It will be accompanied by bootloader changes to
set this flag if a new keyword is present in /boot.cfg.

What do you think? Better naming suggestion also welcome.


Index: sys/reboot.h
RCS file: /cvsroot/src/sys/sys/reboot.h,v
retrieving revision 1.25
diff -c -u -r1.25 reboot.h
--- sys/reboot.h        25 Dec 2007 18:33:48 -0000      1.25
+++ sys/reboot.h        18 Apr 2011 05:34:01 -0000
@@ -53,6 +53,9 @@
 #define        RB_STRING       0x00000400      /* use provided bootstr */
 #define        RB_POWERDOWN    (RB_HALT|0x800) /* turn power off (or at least 
halt) */
 #define RB_USERCONF    0x00001000      /* change configured devices */
+#define        RB_NO_ROOT_OVERRIDE 0x00002000  /* no automatic override of the 
+                                        * device, like raidframes auto
+                                        * root configuration */
  * Extra autoboot flags (passed by boot prog to kernel). See also
Index: dev/raidframe/rf_netbsdkintf.c
RCS file: /cvsroot/src/sys/dev/raidframe/rf_netbsdkintf.c,v
retrieving revision 1.284
diff -c -u -r1.284 rf_netbsdkintf.c
--- dev/raidframe/rf_netbsdkintf.c      18 Mar 2011 23:53:26 -0000      1.284
+++ dev/raidframe/rf_netbsdkintf.c      18 Apr 2011 05:34:01 -0000
@@ -465,7 +465,7 @@
        /* if the user has specified what the root device should be
           then we don't touch booted_device or boothowto... */
-       if (rootspec != NULL)
+       if ((rootspec != NULL) || (boothowto & RB_NO_ROOT_OVERRIDE))
        /* we found something bootable... */

Home | Main Index | Thread Index | Old Index