sys-apps/kexec-tools-2.0.4 doesn't work without a initrd. There is a bug in the test for initrd. The test for nonzero length of ${INITRD} is missing neccesary quotation marks, which result in this when run with -d + img=/boot/vmlinuz-3.8.5 + '[' -n ']' + '[' -z ']' + eerror 'Requested initrd: ' * Requested initrd: + eerror 'could not be found' * could not be found + return 1 + eend The solution is to add quotation-mark like this: --- files/kexec.init-2.0.4.~1~ 2013-03-27 12:50:55.000000000 +0100 +++ files/kexec.init-2.0.4 2013-03-29 17:23:15.774419925 +0100 @@ -80,7 +80,7 @@ fi fi - if [ -n ${INITRD}] && [ -z ${initrd} ]; then + if [ -n "${INITRD}" ] && [ -z "${initrd}" ]; then eerror "Requested initrd: ${INITRD}" eerror "could not be found" return 1
I also found missing quotes resulting in a "whith " in the message. local msg= - [ -n ${initrd} ] && \ + [ -n "${initrd}" ] && \ msg="with ${initrd}"
# checkbashisms /usr/portage/sys-apps/kexec-tools/files/kexec.init-2.0.4 possible bashism in /usr/portage/sys-apps/kexec-tools/files/kexec.init-2.0.4 line 92 (should be VAR="${VAR}foo"): [ -n "${KPARAM}" ] || KEXEC_OPT_ARGS+=" --reuse-cmdline"
+*kexec-tools-2.0.4-r1 (30 Mar 2013) + + 30 Mar 2013; Justin Lecher <jlec@gentoo.org> files/kexec.init-2.0.4, + -kexec-tools-2.0.4.ebuild, +kexec-tools-2.0.4-r1.ebuild: + Fix init script if no initrd is used, #463752 +
(In reply to comment #3) > +*kexec-tools-2.0.4-r1 (30 Mar 2013) > + > + 30 Mar 2013; Justin Lecher <jlec@gentoo.org> files/kexec.init-2.0.4, > + -kexec-tools-2.0.4.ebuild, +kexec-tools-2.0.4-r1.ebuild: > + Fix init script if no initrd is used, #463752 > + * QA Notice: shell script appears to use non-POSIX feature(s): * possible bashism in /etc/init.d/kexec line 84 (should be 'b = a'): * if [ -n "${INITRD}" ] && \ * ! [ "${INITRD}" == "${initrd}" ]; then * possible bashism in /etc/init.d/kexec line 93 (should be VAR="${VAR}foo"): * [ -n "${KPARAM}" ] || KEXEC_OPT_ARGS+=" --reuse-cmdline"
(In reply to comment #3) > +*kexec-tools-2.0.4-r1 (30 Mar 2013) > + > + 30 Mar 2013; Justin Lecher <jlec@gentoo.org> files/kexec.init-2.0.4, > + -kexec-tools-2.0.4.ebuild, +kexec-tools-2.0.4-r1.ebuild: > + Fix init script if no initrd is used, #463752 > + I can confirm that it works now. Thanks! The cosmetic glitch resulting in a message "with ", when $initrd is empty is still present though (see Comment 1). Not important at all, leave it like that unless you are making other changes also.
How do you check for POSIX compliance? + 01 Apr 2013; Justin Lecher <jlec@gentoo.org> files/kexec.init-2.0.4: + Fix bashism in init script, #463752 +