Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kCybr-0006vL-3Q for mharc-grub-devel@gnu.org; Tue, 01 Sep 2020 01:13:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCybp-0006vD-9K for grub-devel@gnu.org; Tue, 01 Sep 2020 01:13:29 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]:33191) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCybn-000251-Rw for grub-devel@gnu.org; Tue, 01 Sep 2020 01:13:28 -0400 Received: by mail-ej1-x62e.google.com with SMTP id h4so9976874ejj.0 for ; Mon, 31 Aug 2020 22:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=byHOVujLp3Wc/tdlei8Wu0JfPTf87tWuKL/w5ZolOos=; b=kkA8CsEgwTUiTuVkZHgxfwBObldYgxqgZctjw1CQJFPnnHs9S1TzPIsD7LbWRwKzCh y3GNS0NxsUZiYrXPFjCaqtykbvaEo7L7l17r05wf6Wm7gUlypH6INR5gC/MM8TEp6bgF GhpSij3naacQ0BST0JqcP7uC3Nf1XblxUZg+KsZtUE8kojP381mvYypJ7AmR3yXILOmP 21ZARAlVHCXMGfHKK+n5JyJ1emFougXqRWI1CRNfjny9NCpbD99WXcbPP2HFElbPb5jN Un08SBAAJaGua925QYfE8/1iuXEW9vJPEYeD+oeEO8w+N9FYRp3CJbTEQZPu31f+xsVC ogWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=byHOVujLp3Wc/tdlei8Wu0JfPTf87tWuKL/w5ZolOos=; b=btxhcZ4uO/wpf6agwUZO2zK2M5I1qfldrK6t8/bFL7AxgBOlvnbgoN7bxvdbo5KUj9 gDsIQiE6KDiNVw49qBUSsYb7rdMaJmteUHsDTwmUkGr8H4mU1JWBlbtL+btuw6Gn5jej IpbXC1qRurZ7iaCRGZQ8bOispKDbLpHhGyk+Mpvf03DHRuRSHBgrbktQ3R/RRx8XQswN LxOBA7/XETkjlmknUE77LXkVbjEPtPTRFtKxdNVaHo97SRgCBK6uvxRX6kNBYvINadGR 94bP3ruDk7kXU0hrbe/0FFNLfpF9ojmEhVPovWVHOZJC9MhZ2baMYJUC8XeLSry8WOQG hYOw== X-Gm-Message-State: AOAM5315ww4ifWKzEOFOq0FNXiflEVe4aJfdSxz9+jO/q5r5zcmjti85 BkU8dHACW+mhLfHV83YvqMqipin/F29MXQ== X-Google-Smtp-Source: ABdhPJw2bfJbtfiSTx1djRAZhTGp33xteOcNCG7SfeP0sSu10Q2iXzp/3YfVkG4iUTwYD/Qiw3Aciw== X-Received: by 2002:a17:906:6b95:: with SMTP id l21mr3800605ejr.317.1598937205909; Mon, 31 Aug 2020 22:13:25 -0700 (PDT) Received: from winie.fritz.box (i59F521A7.versanet.de. [89.245.33.167]) by smtp.gmail.com with ESMTPSA id d24sm45607edp.17.2020.08.31.22.13.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 22:13:25 -0700 (PDT) From: Florian La Roche X-Google-Original-From: Florian La Roche To: grub-devel@gnu.org Cc: Florian La Roche Subject: [PATCH] If $hints is not set, we can reduce the output into grub.cfg from 5 lines to just 1 line. Date: Tue, 1 Sep 2020 07:13:20 +0200 Message-Id: <20200901051320.3591001-1-Florian.LaRoche@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=florian.laroche@googlemail.com; helo=mail-ej1-x62e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: Tue, 01 Sep 2020 05:13:29 -0000 --- 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" } -- 2.28.0