From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A654DEE49A4 for ; Sun, 10 Sep 2023 21:13:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfRjl-00019P-2e; Sun, 10 Sep 2023 17:12:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfRjk-00019F-0S for grub-devel@gnu.org; Sun, 10 Sep 2023 17:12:56 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfRjh-0000kv-Pm for grub-devel@gnu.org; Sun, 10 Sep 2023 17:12:55 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31c7912416bso4002832f8f.1 for ; Sun, 10 Sep 2023 14:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694380372; x=1694985172; darn=gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=Qbpk+47mjzwgbFrH6Hkib9cy3kpZBDY5klo4HqDslt0=; b=JVKowNgo2GlR4dtGm0xqIAtV4R/37a4sERz7/yfr61kYEneAbxBVC7delqrUQWMUHS A8CJ+Luswuq3Gz6iuugJ39NwUoUSwOFER2hx/YVBm3QBhPrnP8P9HFQZCZp+kDkC7n3i zzOineqSZEqaP7kv57QFT9tMcj4m5ep+pE2xKTRqrlXidUDj+AKUKS6/+AjmDICkdeDL oA+urYOmcPHvp8ZemJn0zHs1turtAPpgedEFKeJXbU1ZnBsmIgfkhP1ft4QdNPCuqFTp SB8BcDuZAf/y8DqAW2XYvoFk/IoEvE6y6K3pu2gKWCidHdHSAagTQiL/yN0RBVwSvvAI S1hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694380372; x=1694985172; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qbpk+47mjzwgbFrH6Hkib9cy3kpZBDY5klo4HqDslt0=; b=scyv8x5K57mxMMmhdjmA1QCrBo1Ewa4jC+GWINmsWWvpnQXX6rRXsw8ZkBWm4n94b2 VDfYd2nq+XCpKU78eTYWR8sHGUmNIj9eALrHDMNptkAslANsYsyw3YMjph/EZq/pCKed wnhfPN+GJ3CYBqRlRaw68UWHuss4qRuWtz0XMUOG/aN0hm2lJO2/9FEcWKodypP/WVu9 221Ib/IbSBBh3H4q+z1khoUWja/7qmD/xhPMDdKNPlaig+gQG694kToJCrEsIwGSJZxP ncGki1ImUoZAPrtq/z+8jqbXob+2DGC9rH+tVt1EvzaQ/j8GwK7/SUle6cW94zzkp0vM XbPw== X-Gm-Message-State: AOJu0Yywih+B8wIo4nRwFbHqGNBcSitNtjllkIZuBlZsrFvt9Jzw2EXR AvgqclTUCFBStArJxwp+XIkynHagNfU= X-Google-Smtp-Source: AGHT+IEsih+VFWU7cis2+1iQPNytKPDkMpuHG3Su+Hx46wXbZQxLLmuDP6JUwo6dYcFrt9QCmj9h4Q== X-Received: by 2002:adf:a394:0:b0:31f:9bd6:e8a8 with SMTP id l20-20020adfa394000000b0031f9bd6e8a8mr1744654wrb.11.1694380371525; Sun, 10 Sep 2023 14:12:51 -0700 (PDT) Received: from dj3ntoo (161.sub-97-139-114.myvzw.com. [97.139.114.161]) by smtp.gmail.com with ESMTPSA id q28-20020a056000137c00b0031989784d96sm8166764wrz.76.2023.09.10.14.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 14:12:49 -0700 (PDT) Date: Sun, 10 Sep 2023 16:12:44 -0500 From: Oskari Pirhonen To: darkpenguin Cc: grub-devel@gnu.org Subject: Re: [PATCH] Add support for specifying the boot device by label Message-ID: Mail-Followup-To: darkpenguin , grub-devel@gnu.org References: <28419e65-2e40-a4a4-b94f-aeacd62715c7@posteo.de> MIME-Version: 1.0 In-Reply-To: <28419e65-2e40-a4a4-b94f-aeacd62715c7@posteo.de> Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=xxc3ncoredxx@gmail.com; helo=mail-wr1-x430.google.com 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.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Content-Type: multipart/mixed; boundary="===============7351973047053801645==" Errors-To: grub-devel-bounces+grub-devel=archiver.kernel.org@gnu.org Sender: grub-devel-bounces+grub-devel=archiver.kernel.org@gnu.org --===============7351973047053801645== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Q77P/xORQOoq1ify" Content-Disposition: inline --Q77P/xORQOoq1ify Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 10, 2023 at 09:30:24 +0000, darkpenguin wrote: > Specifying the boot device by its label rather than its UUID can be > pretty useful in various situations (e.g. multiple test VMs). >=20 > This might have to be adapted a little to meet the coding standards I'm > not familiar with. Please feel free to improve it in any way you want. >=20 > This patch works for me on an older version of grub2 (=3D2.06-13 in Debian > Bookworm), but it's rather trivial, and only touches two parts that are > otherwise untouched for ages. >=20 > - Specify "GRUB_DISABLE_LINUX_UUID=3DLABEL" in /etc/default/grub > - It will attempt to use a label instead of UUID > - If a device with the necessary label is not found in > /dev/disk/by-label/ , it falls back to using UUID > - If you just assigned new labels, run 'partprobe' to populate > /dev/disk/by-label/ properly >=20 > The decision to reuse GRUB_DISABLE_LINUX_UUID was because: > 1) This is more of an addition on top of UUID rather than "disabling" > it, it still uses UUID internally, and it falls back to UUID > 2) I could not come up with a better way to do it I'm not a fan of overloading a "disable" var to mean "try something else first". Something like GRUB_DISABLE_LINUX_LABEL with the appropriate logic would make more sense IMO. > 3) I could not figure out how to source other variables from > /etc/defaults/grub and why not all of them are there. :) >=20 This looks to be in util/grub-mkconfig.in (lines 160-162 in git master at the time of writing): if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub fi The vars then get exported further down (lines 213-258) before running the various config snippets: # These are optional, user-defined variables. export GRUB_DEFAULT \ GRUB_HIDDEN_TIMEOUT \ GRUB_HIDDEN_TIMEOUT_QUIET \ GRUB_TIMEOUT \ GRUB_TIMEOUT_STYLE \ GRUB_DEFAULT_BUTTON \ # ... snip ... Hope that helps. - Oskari --Q77P/xORQOoq1ify Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQfOU+JeXjo4uxN6vCp8he9GGIfEQUCZP4xRwAKCRCp8he9GGIf ESJaAP4xOlzkj4CrI3w//wTTvMkHOjJOJbanycLQ0hHL6r7svgD/QvNiSTFFIX1b 9QQmNQHCL89VjQMRRFmQ3pcwF7/NIgU= =oO1+ -----END PGP SIGNATURE----- --Q77P/xORQOoq1ify-- --===============7351973047053801645== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KR3J1Yi1kZXZl bCBtYWlsaW5nIGxpc3QKR3J1Yi1kZXZlbEBnbnUub3JnCmh0dHBzOi8vbGlzdHMuZ251Lm9yZy9t YWlsbWFuL2xpc3RpbmZvL2dydWItZGV2ZWwK --===============7351973047053801645==--