diff options
author | Martin Dummer <martin.dummer@gmx.net> | 2014-03-10 23:36:05 +0100 |
---|---|---|
committer | Richard Yao <ryao@gentoo.org> | 2014-03-15 20:25:20 -0400 |
commit | 5e2553af6a81e724fd9415b87a77004bdcaac31d (patch) | |
tree | 92089b8aa70f132a5ba645be31613337aaee12e7 | |
parent | Advertise zfs support in genkernel.conf (diff) | |
download | genkernel-5e2553af6a81e724fd9415b87a77004bdcaac31d.tar.gz genkernel-5e2553af6a81e724fd9415b87a77004bdcaac31d.tar.bz2 genkernel-5e2553af6a81e724fd9415b87a77004bdcaac31d.zip |
fix broken function prompt_user()
There is a mistake in the parameter check of function prompt_user()
which causes to exit the initramfs unconditionally when the function is
called with *correct* number of parameters (which then causes a kernel
panic)
This patch puts the parameter check into a readable if..then..fi block.
Signed-off-by: Martin Dummer <martin.dummer@gmx.net>
Signed-off-by: Richard Yao <ryao@gentoo.org>
-rw-r--r-- | defaults/initrd.scripts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 4b7c5ba..97997b3 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -446,9 +446,11 @@ prompt_user(){ eval local oldvalue='$'${1} - [ $# != 2 -a $# != 3 ] && \ + if [ $# != 2 -a $# != 3 ]; then bad_msg "Bad invocation of function prompt_user." - bad_msg "Please file a bug report with this message" && exit 1 + bad_msg "Please file a bug report with this message" + exit 1 + fi [ -n "${3}" ] && local explnt=" or : ${3}" || local explnt="." bad_msg "Could not find the ${2} in ${oldvalue}${explnt}" |