From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6ED821391DB for ; Sun, 16 Mar 2014 00:26:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9D5F7E0AD3; Sun, 16 Mar 2014 00:26:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E89F4E0ACC for ; Sun, 16 Mar 2014 00:26:24 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1E6FC33FB01 for ; Sun, 16 Mar 2014 00:26:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 6F048188EE for ; Sun, 16 Mar 2014 00:26:22 +0000 (UTC) From: "Richard Yao" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Richard Yao" Message-ID: <1394929520.5e2553af6a81e724fd9415b87a77004bdcaac31d.ryao@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts X-VCS-Directories: defaults/ X-VCS-Committer: ryao X-VCS-Committer-Name: Richard Yao X-VCS-Revision: 5e2553af6a81e724fd9415b87a77004bdcaac31d X-VCS-Branch: master Date: Sun, 16 Mar 2014 00:26:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8718ac66-98b8-4c70-bcb3-2b1ec7943451 X-Archives-Hash: f14bdb8dc0f75bc7400500c1564b3435 commit: 5e2553af6a81e724fd9415b87a77004bdcaac31d Author: Martin Dummer gmx net> AuthorDate: Mon Mar 10 22:36:05 2014 +0000 Commit: Richard Yao gentoo org> CommitDate: Sun Mar 16 00:25:20 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=5e2553af 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 gmx.net> Signed-off-by: Richard Yao gentoo.org> --- defaults/initrd.scripts | 6 ++++-- 1 file 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}"