Summary: | sys-kernel/genkernel-3.4.49.2: genkernel/defaults/linuxrc does not handle init opts | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Toralf Förster <toralf> |
Component: | genkernel | Assignee: | Gentoo Genkernel Maintainers <genkernel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | floppym, zerochaos |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
screen shot
Use init_opts from the environment |
Description
Toralf Förster
2012-11-24 14:29:54 UTC
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! |