Re: New boothowto flag to prevent raid auto-root-configuration
Martin Husemann writes: > What do you think? Better naming suggestion also welcome. IMHO, root autoconfiguration should be limited to take effect only when booted device is included in its components. Since the current behavior is suprising and inconvinient (I sometimes boot system from pxeboot), my locally running system is modified so. enami.
re: New boothowto flag to prevent raid auto-root-configuration
> Martin Husemann writes: > > > What do you think? Better naming suggestion also welcome. > > IMHO, root autoconfiguration should be limited to take effect only when > booted device is included in its components. Since the current behavior > is suprising and inconvinient (I sometimes boot system from pxeboot), my > locally running system is modified so. this doesn't work for setups where the root and boot devices are not the same, which happens to be 2 of my systems. the root device is simply not visible at boot time. what would be great is if the normal selection was told when it has booted from a raid set, and it could find the right one and use that device. this could then work with "raidctl -A yes". that would allow the majority of installations to skip the forced root magic. do you think this would be easy based upon your current changes? since there are valid ways to run that require the forced magic without special kernel builds (or unwritten code) removing the code is not really an option. i think martin should commit his change. it would allow me to boot GENERIC on my dev machine that i otherwise have a forced root on nfs configuration for, as well as solve his install problem. .mrg.
Re: New boothowto flag to prevent raid auto-root-configuration
Martin Husemann wrote: > as described in PR 44774 (see > http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44774), 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). It looks like this is a similar problem to the one I raised here http://mail-index.NetBSD.org/tech-kern/2009/10/31/msg006410.html Instead of providing RB_NO_ROOT_OVERRIDE I would prefer something that actually _lets_ me override everything else from boot.cfg. Quoting Robert Elz from the mentioned thread: > FWIW, I think the code to allow the user to override that at boot > time would be a useful addition - while it is possible to boot, > "raidctl -A yes" or "raidctl -A no", and then reboot, or perhaps > "boot -a" on systems that support that, but that's a painful > sequence of operations for what should be a simple task. > > It should always be > 1. what the user explicitly asks for > 2. what the kernel has built in > 3. hacks like "ratdctl -A root" (or perhaps similar things for cgd etc) > 4. where I think I came from ciao Klaus
Re: New boothowto flag to prevent raid auto-root-configuration
On Mon, Apr 18, 2011 at 01:06:23PM +0200, Klaus . Heinz wrote: > Instead of providing RB_NO_ROOT_OVERRIDE I would prefer something that > actually _lets_ me override everything else from boot.cfg. Yes, I understand this wish (and it is not that hard to implement). However, I think both are quite orthogonal and should be discussed separately. Note that especially for the install CD setup, a rootstring passed from boot.cfg is *not* possible, as we do not know which CD drive is used for booting. Martin
Re: New boothowto flag to prevent raid auto-root-configuration
> Note that especially for the install CD setup, a rootstring passed from > boot.cfg is *not* possible, as we do not know which CD drive is used > for booting. FYI, see also PR port-i386/39998 and x86_autoconf.c: >> /* >> * XXX >> * There is no proper way to detect which unit is >> * recognized as a bootable CD-ROM drive by the BIOS. >> * Assume the first unit is the one. >> */ I.e. currently only root on cd0a works on x86 GENERIC anyway. --- Izumi Tsutsui
Re: New boothowto flag to prevent raid auto-root-configuration
On Mon, Apr 18, 2011 at 11:06:21PM +0900, Izumi Tsutsui wrote: > I.e. currently only root on cd0a works on x86 GENERIC anyway. One more bug to fix, but unrelated to this thread, isn't it? See also PR 43012. Martin
Re: New boothowto flag to prevent raid auto-root-configuration
On Mon, Apr 18, 2011 at 11:59:32PM +0900, Izumi Tsutsui wrote: > I thought passing "root on cd0a" from boot.cfg just worked on x86.. Maybe, but I'm not talking about x86 only. Martin
Re: New boothowto flag to prevent raid auto-root-configuration
On Mon, 18 Apr 2011 13:06:23 +0200 "Klaus . Heinz" wrote: > Martin Husemann wrote: > > > as described in PR 44774 (see > > http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44774), > > 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). > > It looks like this is a similar problem to the one I raised here > > http://mail-index.NetBSD.org/tech-kern/2009/10/31/msg006410.html > > Instead of providing RB_NO_ROOT_OVERRIDE I would prefer something that > actually _lets_ me override everything else from boot.cfg. So how about adding another flag like RB_ROOT_EXPLICIT OR RB_EXPLICIT_ROOT with the idea being that the user has to explicitly specify what the root is going to be? I think that addresses 1) below and would hopefully handle the pxeboot and NFS root situations. Maybe something like "RB_SET_ROOT" with a required option of "NFS" or "raid0" or "wd0a" or "pxe" or whatever would be the way to go? I've never liked the 'yank root away from the boot device that the system thinks it maybe booted from' hack in RAIDframe, so anything we can do to make it better is fine by me We may need both RB_NO_ROOT_OVERRIDE and this new flag in order to get everything covered, and I'm fine with that too... > Quoting Robert Elz from the mentioned thread: > > > FWIW, I think the code to allow the user to override that at boot > > time would be a useful addition - while it is possible to boot, > > "raidctl -A yes" or "raidctl -A no", and then reboot, or perhaps > > "boot -a" on systems that support that, but that's a painful > > sequence of operations for what should be a simple task. > > > > It should always be > > 1. what the user explicitly asks for > > 2. what the kernel has built in > > 3. hacks like "ratdctl -A root" (or perhaps similar things > > for cgd etc) 4. where I think I came from > > > ciao > Klaus Later... Greg Oster
Re: New boothowto flag to prevent raid auto-root-configuration
> > I.e. currently only root on cd0a works on x86 GENERIC anyway. > > One more bug to fix, but unrelated to this thread, isn't it? > See also PR 43012. I thought passing "root on cd0a" from boot.cfg just worked on x86.. --- Izumi Tsutsui
Re: New boothowto flag to prevent raid auto-root-configuration
Hello Martin. Doesn't boot -a already do this by allowing you to select the root filesystem and the init path? I'm certain I've booted systems running with raid roots off of cdroms for repair purposes. -Brian On Apr 18, 7:41am, Martin Husemann wrote: } Subject: New boothowto flag to prevent raid auto-root-configuration } } --6c2NcOVqGQ03X4Wi } Content-Type: text/plain; charset=us-ascii } Content-Disposition: inline } } Hi folks, } } as described in PR 44774 (see } http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44774), 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. } } Martin } } } --6c2NcOVqGQ03X4Wi } Content-Type: text/plain; charset=us-ascii } Content-Disposition: attachment; filename="rf.patch" } } 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 - 1.25 } +++ sys/reboot.h 18 Apr 2011 05:34:01 - } @@ -53,6 +53,9 @@ } #define RB_STRING 0x0400 /* use provided bootstr */ } #define RB_POWERDOWN(RB_HALT|0x800) /* turn power off (or at least halt) */ } #define RB_USERCONF 0x1000 /* change configured devices */ } +#define RB_NO_ROOT_OVERRIDE 0x2000 /* no automatic override of the booted } + * 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.c18 Mar 2011 23:53:26 - 1.284 } +++ dev/raidframe/rf_netbsdkintf.c18 Apr 2011 05:34:01 - } @@ -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)) } return; } } /* we found something bootable... */ } } --6c2NcOVqGQ03X4Wi-- >-- End of excerpt from Martin Husemann
Re: New boothowto flag to prevent raid auto-root-configuration
On Mon, Apr 18, 2011 at 10:32:59AM -0700, Brian Buhrow wrote: > Hello Martin. Doesn't boot -a already do this by allowing you to > select the root filesystem and the init path? I'm certain I've booted > systems running with raid roots off of cdroms for repair purposes. Yes, it does, but it requires user interaction (which I do not want to enforce on the standard install CDs). Martin