Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lIIKu-0007nr-PI for mharc-grub-devel@gnu.org; Fri, 05 Mar 2021 16:50:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIIKs-0007nW-ST for grub-devel@gnu.org; Fri, 05 Mar 2021 16:50:14 -0500 Received: from darkstar.slint.fr ([172.105.89.79]:37338) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIIKq-0002f5-PO for grub-devel@gnu.org; Fri, 05 Mar 2021 16:50:14 -0500 Received: from darkstar.example.slint (men75-h08-176-172-247-100.dsl.sta.abo.bbox.fr [176.172.247.100]) by darkstar.slint.fr (Postfix) with ESMTPSA id 8B70CBE497; Fri, 5 Mar 2021 21:48:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=slint.fr; s=default; t=1614977333; bh=YYySu2vRRe1Y0APfK8na4bAf+odF9RJ0mnr51P0YlBw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=EVQXCkzJG0jNCCg/1uli7m4RhuzmIqCOnGve8y7YbqZ1CiNgoaII4C1BfzPtSBHeX aGQF3mezQP1bZQdPNuu8Eh5c2/Tj6qJhuDuag4/anAkrPefxmmtxhj9pvmpG2g7ocK i3HB3TSTHMeBQbl4CmAwDUt5aZS1mSYbKZrLHAiACqTUyYiRX2a7duyITvKmmMtlfN CzkUARTb9d25zChnLAN/m0+G/YzhtteeDgnN2PY0R1BQm6muzyXuMvaF+WdOQOypLh XdqitinhviTdNHXaDci9VmNWYyXI+98WYGRkK07FP9AeWxEnMLSTHlXD4BS1Q9Fz5+ Jou6qDM3Ff7hA== Subject: Re: [PATCH] templates: Properly disable the os-prober by default To: =?UTF-8?Q?Philip_M=c3=bcller?= , daniel.kiper@oracle.com Cc: grub-devel@gnu.org, alexander.burmashev@oracle.com, glaubitz@physik.fu-berlin.de, lsorense@csclub.uwaterloo.ca, nyanko@10x.moe, helmut@manjaro.org, bernhard@manjaro.org, alastair.cooper@outlook.com References: <20210305211536.647354-1-philm@manjaro.org> From: Didier Spaier Message-ID: <998504f9-7885-b7a5-e807-b5047f4d7529@slint.fr> Date: Fri, 5 Mar 2021 22:49:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20210305211536.647354-1-philm@manjaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=172.105.89.79; envelope-from=didier@slint.fr; helo=darkstar.slint.fr X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Fri, 05 Mar 2021 21:50:15 -0000 Le 05/03/2021 à 22:15, Philip Müller a écrit : > - disable os-prober by default in grub-mkconfig.in by setting > GRUB_DISABLE_OS_PROBER to true > - fixes logic in 30_os-prober.in > > Reason for code shuffle in grub-mkconfig.in: > > The default was GRUB_DISABLE_OS_PROBER=false if you don't set > GRUB_DISABLE_OS_PROBER at all. To prevent os-prober from starting > we have to set it by default to true and shuffle GRUB_DISABLE_OS_PROBER > to executed by the script code section, but give the option to the user to > overwrite it with false, if he wants to execute os-prober after all. > > Everyone who added GRUB_DISABLE_OS_PROBER=true in grub.cfg can remove > it by now. > > Fixes: e3464147 templates: Disable the os-prober by default > --- > util/grub-mkconfig.in | 5 ++++- > util/grub.d/30_os-prober.in | 2 +- > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in > index d3e879b8e..f8cbb8d7a 100644 > --- a/util/grub-mkconfig.in > +++ b/util/grub-mkconfig.in > @@ -140,6 +140,9 @@ GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2 > GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" > GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true > > +# Disable os-prober by default due to security reasons. > +GRUB_DISABLE_OS_PROBER="true" > + > # Filesystem for the device containing our userland. Used for stuff like > # choosing Hurd filesystem module. > GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`" > @@ -201,6 +204,7 @@ export GRUB_DEVICE \ > GRUB_DEVICE_PARTUUID \ > GRUB_DEVICE_BOOT \ > GRUB_DEVICE_BOOT_UUID \ > + GRUB_DISABLE_OS_PROBER \ > GRUB_FS \ > GRUB_FONT \ > GRUB_PRELOAD_MODULES \ > @@ -242,7 +246,6 @@ export GRUB_DEFAULT \ > GRUB_BACKGROUND \ > GRUB_THEME \ > GRUB_GFXPAYLOAD_LINUX \ > - GRUB_DISABLE_OS_PROBER \ > GRUB_INIT_TUNE \ > GRUB_SAVEDEFAULT \ > GRUB_ENABLE_CRYPTODISK \ > diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in > index 80685b15f..a258ce71d 100644 > --- a/util/grub.d/30_os-prober.in > +++ b/util/grub.d/30_os-prober.in > @@ -26,7 +26,7 @@ export TEXTDOMAINDIR="@localedir@" > > . "$pkgdatadir/grub-mkconfig_lib" > > -if [ "x${GRUB_DISABLE_OS_PROBER}" = "xfalse" ]; then > +if [ "x${GRUB_DISABLE_OS_PROBER}" != "xfalse" ]; then > gettext_printf "os-prober will not be executed to detect other bootable partitions.\nSystems on them will not be added to the GRUB boot configuration.\nCheck GRUB_DISABLE_OS_PROBER documentation entry.\n" > exit 0 > fi Just tested against git master, works as expected. Thanks! Best regards, Didier