Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kIuWS-0005As-36 for mharc-grub-devel@gnu.org; Thu, 17 Sep 2020 10:04:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIuWL-000551-BM for grub-devel@gnu.org; Thu, 17 Sep 2020 10:04:22 -0400 Received: from dibed.net-space.pl ([84.10.22.86]:58385) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:192) (Exim 4.90_1) (envelope-from ) id 1kIuWF-0000v8-Ap for grub-devel@gnu.org; Thu, 17 Sep 2020 10:04:18 -0400 Received: from router-fw.i.net-space.pl ([192.168.52.1]:46992 "EHLO tomti.i.net-space.pl") by router-fw-old.i.net-space.pl with ESMTP id S1954082AbgIQOEH (ORCPT ); Thu, 17 Sep 2020 16:04:07 +0200 X-Comment: RFC 2476 MSA function at dibed.net-space.pl logged sender identity as: dkiper Date: Thu, 17 Sep 2020 16:04:03 +0200 From: Daniel Kiper To: Florian La Roche via Grub-devel Cc: Florian La Roche , Florian La Roche Subject: Re: [PATCH] If $hints is not set, we can reduce the output into grub.cfg from 5 lines to just 1 line. Message-ID: <20200917140403.docm3m7ilkcaanha@tomti.i.net-space.pl> References: <20200901051320.3591001-1-Florian.LaRoche@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200901051320.3591001-1-Florian.LaRoche@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Received-SPF: pass client-ip=84.10.22.86; envelope-from=dkiper@net-space.pl; helo=dibed.net-space.pl X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/17 09:41:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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, 17 Sep 2020 14:04:25 -0000 On Tue, Sep 01, 2020 at 07:13:20AM +0200, Florian La Roche via Grub-devel wrote: Missing SOB as previously... I can add it on your behalf if you are OK with it. Otherwise Reviewed-by: Daniel Kiper > --- > util/grub-mkconfig_lib.in | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in > index 2d80f14bf..301d1ac22 100644 > --- a/util/grub-mkconfig_lib.in > +++ b/util/grub-mkconfig_lib.in > @@ -158,11 +158,15 @@ prepare_grub_to_access_device () > fi > if [ "x${GRUB_DISABLE_UUID}" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then > hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints= > - echo "if [ x\$feature_platform_search_hint = xy ]; then" > - echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}" > - echo "else" > - echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}" > - echo "fi" > + if [ "x$hints" != x ]; then > + echo "if [ x\$feature_platform_search_hint = xy ]; then" > + echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}" > + echo "else" > + echo " search --no-floppy --fs-uuid --set=root ${fs_uuid}" > + echo "fi" > + else > + echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}" > + fi > fi > IFS="$old_ifs" > } Daniel