Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iAvt2-00078b-Hc for mharc-grub-devel@gnu.org; Thu, 19 Sep 2019 08:50:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41468) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAvsc-0006KH-9M for grub-devel@gnu.org; Thu, 19 Sep 2019 08:49:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAvlB-0000Pj-A8 for grub-devel@gnu.org; Thu, 19 Sep 2019 08:42:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46580) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iAvlB-0000Ob-2o for grub-devel@gnu.org; Thu, 19 Sep 2019 08:42:09 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 17775C05FF87 for ; Thu, 19 Sep 2019 12:42:08 +0000 (UTC) Received: by mail-wm1-f72.google.com with SMTP id g82so1716306wmg.9 for ; Thu, 19 Sep 2019 05:42:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4Cw0WASaOApkzO9HsoD6/sM9LRg1eg/nDFoc29tG6vM=; b=VSJh4yvSgCu7D++rdCsL/sH3uRg/9+YV80wMTTi5586VxqOCJNCta+StYoNahT17hv lo2CuO7esZHCoJLGU65kJ7/cXEItORpIEOu2rp2pRKH2V9rfwQZEUijjd2lms5Qn20dE taPpOPRMpUVg1asd+3v5BAOUf7++Gna11Qpa2S952Vdn50vJzH6YggG/0eY5O6Q/Csha vajomOolpRR9w+UK1y41tM98w7HGL/vpiHzRGg1O0quKu3v5sNwpzMtqPLl7qMhxzuGr a/pd4JSEfvOYla/Mc6x8wbf3WIGLHfh34HAeJ4YNU22wrXc+Cr7n/zm3d5ZzqpL10d9/ YgdQ== X-Gm-Message-State: APjAAAWunbWnoHT7hjYKc7Ld60LxRSiV9mFDQ+oylKPsTNPkC02aEMgl Po6i2oxWuh3Igb8pMIfhSE+eLwnTaLfI4miDF0o+8dIAQ8H/GXA5f3VwByjN3EbMECVSoFLSTSf reLjJx0zy1Tg= X-Received: by 2002:adf:e7ca:: with SMTP id e10mr2694799wrn.234.1568896926829; Thu, 19 Sep 2019 05:42:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzltX7hDLom2NGB/itd6539ZXf297ShoFMq0A7AhD3yfQhwS9iq5ltt5M0221Ouqt0od56ZiA== X-Received: by 2002:adf:e7ca:: with SMTP id e10mr2694788wrn.234.1568896926621; Thu, 19 Sep 2019 05:42:06 -0700 (PDT) Received: from [192.168.1.13] ([90.168.169.92]) by smtp.gmail.com with ESMTPSA id s12sm14664693wra.82.2019.09.19.05.42.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Sep 2019 05:42:05 -0700 (PDT) Subject: Re: [PATCH] Fix bad test on GRUB_DISABLE_SUBMENU. To: Daniel Kiper Cc: grub-devel@gnu.org, Prarit Bhargava , Vladimir Serbinenko References: <20190917155210.4062-1-javierm@redhat.com> <20190918125327.icxk7ww4l3tolp3e@tomti.i.net-space.pl> From: Javier Martinez Canillas Message-ID: Date: Thu, 19 Sep 2019 14:42:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190918125327.icxk7ww4l3tolp3e@tomti.i.net-space.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 12:49:54 -0000 Hello Daniel, On 9/18/19 2:53 PM, Daniel Kiper wrote: > On Tue, Sep 17, 2019 at 05:52:10PM +0200, Javier Martinez Canillas wrote: >> From: Prarit Bhargava >> >> The file /etc/grub.d/10_linux does >> >> if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then >> >> when it should do >> >> if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xtrue ]; then >> >> which results in submenus in /boot/grub2/grub.cfg when >> GRUB_DISABLE_SUBMENU="yes". >> >> Resolves: rhbz#1063414 >> >> Signed-off-by: Prarit Bhargava >> Signed-off-by: Javier Martinez Canillas >> --- >> >> util/grub.d/10_linux.in | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in >> index 4532266be68..58defdbd83f 100644 >> --- a/util/grub.d/10_linux.in >> +++ b/util/grub.d/10_linux.in >> @@ -261,7 +261,11 @@ while [ "x$list" != "x" ] ; do >> fi >> fi >> >> - if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then >> + if [ "x${GRUB_DISABLE_SUBMENU}" = "xyes" ] || [ "x${GRUB_DISABLE_SUBMENU}" = "xy" ]; then >> + GRUB_DISABLE_SUBMENU="true" >> + fi >> + >> + if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xtrue ]; then >> linux_entry "${OS}" "${version}" simple \ >> "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" > > Well, I understand the problem but I do not like the patch. Why do you > introduce "yes" and do not use "true"? Except GRUB_BUTTON_CMOS_ADDRESS, > which is wrong IMO, all variables accept only true/false. So, if you > want to add "yes" then do that for all. Otherwise you make only confusion. Right, the problem is that as you said GRUB_DISABLE_SUBMENU is inconsistent with all the other options. But since most variables use "true", someone who's reading the docs might wrongly assume that by "y" it really meant "yes" (since for all others a word is used and not a letter). That's what happened in the bug reported. So this patch makes the option to support all of "y", "yes" and "true" to make sure that even if a user gets confused by the documentation, will be able to set it. I don't think that will cause confusion if we fix the doc to mention that GRUB_DISABLE_SUBMENU has to be set to "true" like all the other options and add a comment in 10_linux.in explaining why it checks for the three values. At the very least we need to keep supporting "y" besides "true" to avoid regressions for users that set to what the documentation used to mention. > And there are more files which has the same issue, e.g. util/grub.d/10_hurd.in > You are right, I'll change this in util/grub.d/10_hurd.in as well. > Daniel > Best regards, -- Javier Martinez Canillas Software Engineer - Desktop Hardware Enablement Red Hat