From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1onAVd-00045n-3n for mharc-grub-devel@gnu.org; Mon, 24 Oct 2022 23:21:45 -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 1onAVX-00042J-RI for grub-devel@gnu.org; Mon, 24 Oct 2022 23:21:39 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onAVU-0006rF-Dh for grub-devel@gnu.org; Mon, 24 Oct 2022 23:21:39 -0400 Received: by mail-wr1-x42e.google.com with SMTP id l14so11572358wrw.2 for ; Mon, 24 Oct 2022 20:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=eTnwREWlqkIf0C+tQK1BYatGy5JJBtcEmRypgG1tfC8=; b=FFlo3E3AJ6gVOkkZ877m15eYpdvi+2vc0258y0EJSMrwws0Qo8aEbAQ3uYBO3mBpGV 29QAPHVYzNVTF4prYWv/UTK3lKC6OSvgQwp9ZfKhRazFNHnHbVdjntwpi+GwA5aCimBw MgCszF0dO8q2g+Nd0Uav92QDdAbINLMaNgdO7vkutDTjenvwxTS9C6/nl9FfzFnRTdel FG0ZIqArzUpturRNSoiqH5h93JmWsnlzcg/Ty1wnill8/+H/weU2I7c4LZ142npcYi5M 0oHYgDleI9J8zFhVLzTSRRNMpSASd8Le6RyNXEfVEPrXiGQ3Ea6Q2BreFCv+b7QD1YnW Fobg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=eTnwREWlqkIf0C+tQK1BYatGy5JJBtcEmRypgG1tfC8=; b=3dQh+vPk7366uSN0FmPrf7w1CJZI9Stl1SJG7imuEtFpUdFFSanxHGLyX1RwORw6ya ZwU3tdcICOwRiAVFUpCsEFtjRGbgs7KfE9f5CxTv52g5UPe6zoLMW2fu41RpuChxvZ6o 4mxkJXDvi8mkyd/YTKTh70QlSXBASAxi0o0T+glv6cjOYZHDubm7We9eLHLza1wY5yMR 0nVW7l6y9b3ZnXHsDhlJZ0x9kYTKbd7SzSuVxUYgdmOYzYOoqNyH6fiMoaugzM5wrLQV 3NAWE27B/mipLVxwPCchMKNGwbsth9e8w+j/ULtdCaREiwdkB+P8qS91CaH9YxCGVi5x TBRw== X-Gm-Message-State: ACrzQf0IXUNNn7D/ATzSDrJYL2Qq2DOuye+KGb0EMoY2bZKM3hY3bEQ4 bZ4vHzlrwIPkU3/uc1TapPFK2/tagnlIyg== X-Google-Smtp-Source: AMsMyM5XJApCOKG2D9tkZVO19Ozd/wp3HBGy2skSFF6/cK/qNc8usr9jwO5pYpUtNZW+RUggIAoVPw== X-Received: by 2002:a05:6000:a09:b0:236:6b18:6b30 with SMTP id co9-20020a0560000a0900b002366b186b30mr7544228wrb.356.1666668093838; Mon, 24 Oct 2022 20:21:33 -0700 (PDT) Received: from dj3ntoo (171.sub-72-110-15.myvzw.com. [72.110.15.171]) by smtp.gmail.com with ESMTPSA id h10-20020a05600c314a00b003b47b80cec3sm9933587wmo.42.2022.10.24.20.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 20:21:33 -0700 (PDT) Date: Mon, 24 Oct 2022 22:21:25 -0500 From: Oskari Pirhonen To: grub-devel@gnu.org Cc: Denton Liu , Daniel Kiper , mathieu.desnoyers@efficios.com, rharwood@redhat.com, samuel.thibault@ens-lyon.org, debian-bsd@lists.debian.org, xen-devel@lists.xenproject.org, Olaf Hering Subject: Re: [PATCH v5] templates: introduce GRUB_TOP_LEVEL_* vars Message-ID: Mail-Followup-To: grub-devel@gnu.org, Denton Liu , Daniel Kiper , mathieu.desnoyers@efficios.com, rharwood@redhat.com, samuel.thibault@ens-lyon.org, debian-bsd@lists.debian.org, xen-devel@lists.xenproject.org, Olaf Hering References: <20221024104642.251016-1-liu.denton@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="M+Fpb3cxK4PU3FTu" Content-Disposition: inline In-Reply-To: <20221024104642.251016-1-liu.denton@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=xxc3ncoredxx@gmail.com; helo=mail-wr1-x42e.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: , X-List-Received-Date: Tue, 25 Oct 2022 03:21:40 -0000 --M+Fpb3cxK4PU3FTu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 24, 2022 at 03:46:42 -0700, Denton Liu wrote: > A user may wish to use an image that is not sorted as the "latest" > version as the top-level entry. For example, in Arch Linux, if a user > has the LTS and regular kernels installed, `/boot/vmlinuz-linux-lts` > gets sorted as the "latest" compared to `/boot/vmlinuz-linux`, meaning > the LTS kernel becomes the top-level entry. However, a user may wish to > use the regular kernel as the top-level default with the LTS only > existing as a backup. >=20 > This need can be seen in Arch Linux's AUR with two user-submitted > packages[0][1] providing an update hook which patches > /etc/grub.d/10_linux to move the desired kernel to the top-level. This > patch serves to solve this in a more generic way. >=20 > Introduce the GRUB_TOP_LEVEL, GRUB_TOP_LEVEL_XEN and > GRUB_TOP_LEVEL_OS_PROBER variables to allow users to specify the > top-level entry. >=20 > Create grub_move_to_front() as a helper function which moves entries to > the front of a list. This function does the heavy lifting of moving > the menu entry to the front in each script. >=20 > In 10_netbsd, since there isn't an explicit list variable, extract the > items that are being iterated through into a list so that we can > optionally apply grub_move_to_front() to the list before the loop. >=20 > [0]: https://aur.archlinux.org/packages/grub-linux-default-hook > [1]: https://aur.archlinux.org/packages/grub-linux-rt-default-hook >=20 > Signed-off-by: Denton Liu Reviewed-by: Oskari Pirhonen I've tested it on Linux, but the other platforms and os-prober are still untested. - Oskari --M+Fpb3cxK4PU3FTu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQfOU+JeXjo4uxN6vCp8he9GGIfEQUCY1dWLwAKCRCp8he9GGIf EQlWAP9KzyNwrmNeoh+pUYxfKaD0KqahfOci3jRBPT5HTjkWsgD6Ags50AtOFgwZ xGBmMRE5PQwxdn1oBD84vPzhTLcF9wM= =b5NF -----END PGP SIGNATURE----- --M+Fpb3cxK4PU3FTu--