That script doesn't parse arguments right. The following diff tggether w/ the attached screen shot illustrates is: n22 ~ # diff /usr/share/genkernel/defaults/linuxrc.orig /usr/share/genkernel/defaults/linuxrc 39a40 > INIT_OPTS='' 64a66 > INIT_OPTS_NEW="$(echo $init_opts | cut -f2- -d=)" 939c941,944 < exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}" "$@" --- > echo ">>${INIT_OPTS}<<" > echo ">>${INIT_OPTS_NEW}<<" > sleep 20 > exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "\"${INIT_OPTS_NEW}\"" FWIW - even with the patched version I was unsuccessful in getting init_opts="init 2" working the grub kernel command line. If I add "init 2" to tje switch_root line in linuxrc - it works. *shrug* Unfortunately I do not have a virtual machine to test it further and now I'm really annoyed about that and me and the world ... grrrr BTW yep - "$@" circumvent/hide the bug but now /I'm really wondering about that wired (busybox ?) behaviour .
Created attachment 330452 [details] screen shot
Applying this diff now it works : n22 ~ # diff /usr/share/genkernel/defaults/linuxrc.orig /usr/share/genkernel/defaults/linuxrc 39a40 > INIT_OPTS='' 64c65 < INIT_OPTS=${x#*=} --- > INIT_OPTS="$(echo $init_opts | cut -f2- -d=)" 939c940 < exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}" --- > exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" ${INIT_OPTS} happy root cause analysis :-)
Created attachment 330482 [details, diff] Use init_opts from the environment It looks like you are using $init_opts as passed in the environment, rather than the value obtained from /proc/cmdline. If we do that, we can remove the logic in the case statement and just pass it along directly. Give this patch a try. Also, it should not be necessary to pass init_opts="init 2" in the command line; just init_opts="2" should do the trick. It does make a nice test case, however.
(In reply to comment #3) > Created attachment 330482 [details, diff] [details, diff] works :-) > line; just init_opts="2" should do the trick. It does make a nice test case, I used init_opts=2 because this construct ${x#*=} doesn't work with quoted arguments and/or spaces - see attachement in comment #1
/me assumes that the fix went into unstable versions only b/c 3.4.45.1 does not contain it, or ?
still an issue in latest genkernel version , this helps : # diff /usr/share/genkernel/defaults/linuxrc.orig /usr/share/genkernel/defaults/linuxrc941c941 < exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}" --- > exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" $init_opts Please note that "init 2" doesn't have a "=" therefore the usually argument parsing INIT_OPTS=${x#*=} won't work (BTW I'm the only one who "uses genkernel" && "sometimes boots a kernel with 'init 2'" ?). I'm wondering b/c no other seems to suffer from this issue, or ?
This bug has been ignored by the genkernel maintainers. Don't expect to see the fix in a release until you hear from one of them.
patch accepted, thanks!