Since I use a kernel + initramfs (created with genkernel) the grub command line parameter "init 2" is ignored completely. /me wonders whether this is a initrd issue or related to genkernel (3.4.24_p1) Reproducible: Always
What do you expect "init 2" on the kernel command line to actually do?
(In reply to comment #1) > What do you expect "init 2" on the kernel command line to actually do? That the runlevel "nonetwork" will be used instead of the runlevel "default"
On other distros, it's an init(8) script that parses the kernel command line and determines what runlevel to start, not the initrd let alone grub. /etc/inittab defines the "nonetwork" runlevel but rc(8) (from openrc) does not list it. It does list "single" which might be what you are looking for: "single Stops all services except for those in the _sysinit_ runlevel." where "sysinit" is the runlevel before boot, i.e. it does not mount physical filesystems, only the virtual ones (like /proc and /dev) needed to bring up the physical ones in the next runlevel, "boot".
Hhm, I did not understood the problem (but I can see it - gah). This grub entry boots my system into "nonetwork" runlevel : title Linux 3.4.3 w/o initrd root (hd0,0) kernel /kernel-genkernel-x86-3.4.3 root=/dev/sdb3 rootfstype=ext4 reboot=pci rootdelay=5 init 2 This grub entry boots my system _not_ into the "nonetwork" runlevel, instead the "default" is used title Linux 3.4.3 root (hd0,0) kernel /kernel-genkernel-x86-3.4.3 real_root=/dev/sdb3 rootfstype=ext4 reboot=pci resume=/dev/sdb2 init 2 initrd /initramfs-genkernel-x86-3.4.3 I wonder why in the 2nd example the "init" is ignored completely - regardless what I do specify. (BTW why do I need in addition the definition "resume=/dev/sdb2" for the initrd grub entry ? If I don#t do it, then suspend2disk won't wake up correctly, but the string is already a kernel configured option - feature or bug ?)
Hmm... when no initramfs is present, the kernel passes any unknown command line paramters to /sbin/init. With an initramfs, the /init script in the initramfs is responsible for passing any arguments to /sbin/init. It looks like genkernel handles this using the init_opts kernel command line parameter. Can you try adding init_opts=2 to your kernel command line in the grub config?
(In reply to comment #5) > Can you try adding init_opts=2 to your kernel command line in the grub > config? yes - was fully ignored
So can I assume it's a genkernel problem for now? :)
I believe this will be resolved if "$@" is added on the end of the switch_root command in linuxrc.
(In reply to comment #8) > I believe this will be resolved if "$@" is added on the end of the > switch_root command in linuxrc. yep - solved.
Marking CONFIRMED. My suggestion in comment 8 should be applied to the genkerenel source.
(In reply to comment #10) > Marking CONFIRMED. My suggestion in comment 8 should be applied to the > genkerenel source. I think we need to consider why init_opts=2 does not produce the desired result, but appending "$@" to the switch_root line does. Appending "$@" should cause us to pass genkernel-specific parameters that we would not necessarily want to pass to /sbin/init, but if that works, then passing init_opts="init 2" on the kernel commandline should also work.
This is fixed in genkernel HEAD: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=543181ebefddbd83850d667aa422991fbe8c3735
Personally, I think a better solution would be this: 1. Loop through "$@". 2. If an option is genkernel-specific, remove it. 3. Pass any remaining (unknown) arguments to init in the switch_root call. The current "init_opts" method does not allow more than one parameter to be passed to init.
(In reply to comment #13) > Personally, I think a better solution would be this: > > 1. Loop through "$@". > 2. If an option is genkernel-specific, remove it. > 3. Pass any remaining (unknown) arguments to init in the switch_root call. > > The current "init_opts" method does not allow more than one parameter to be > passed to init. The INIT_OPTS fix now papered out another bug. passing init_opts="init 2" (regardless, how is it quoted) - the switch_kernel staement crashes with something like "cannot found directory" - meaning a non-empty INIT_OPTS prevents a successful kernel boot.