From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uPlbBgUSD2O4DQAAbAwnHQ (envelope-from ) for ; Wed, 31 Aug 2022 09:47:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qIODBQUSD2OasQAAG6o9tA (envelope-from ) for ; Wed, 31 Aug 2022 09:47:17 +0200 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 aspmx1.migadu.com (Postfix) with ESMTPS id BF8071FEBC for ; Wed, 31 Aug 2022 09:47:16 +0200 (CEST) Received: from localhost ([::1]:43658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTIRP-0003An-Du for larch@yhetil.org; Wed, 31 Aug 2022 03:47:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTIRD-0003Ab-Jz for guix-patches@gnu.org; Wed, 31 Aug 2022 03:47:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTIRC-00085B-DO for guix-patches@gnu.org; Wed, 31 Aug 2022 03:47:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTIRC-0003lA-9n for guix-patches@gnu.org; Wed, 31 Aug 2022 03:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57496] [PATCH 1/2] gnu: bootloader: Extend `' for chain-loader. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 31 Aug 2022 07:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57496 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57496@debbugs.gnu.org, typ22@foxmail.com Cc: tiantian Received: via spool by 57496-submit@debbugs.gnu.org id=B57496.166193197214369 (code B ref 57496); Wed, 31 Aug 2022 07:47:02 +0000 Received: (at 57496) by debbugs.gnu.org; 31 Aug 2022 07:46:12 +0000 Received: from localhost ([127.0.0.1]:38100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTIQN-0003jg-QX for submit@debbugs.gnu.org; Wed, 31 Aug 2022 03:46:12 -0400 Received: from lepiller.eu ([89.234.186.109]:53254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTIQK-0003jS-9D for 57496@debbugs.gnu.org; Wed, 31 Aug 2022 03:46:09 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id cc220c7b; Wed, 31 Aug 2022 07:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=AV5dfI59xAHP ZiUiRvd9Z9xfySegK/eKeEF7W5vnfKQ=; b=YhkrTVts1T7pfPlNXV7lKCVwlcTf DtXsg5ZminT6glWF7wDZB3EWWp7JHhCNpAOJquI3RNU5pyBObh5+NkCV1p3HABqA 2i5YS+4Xt6mKwmPYcfzHE1D66yISRmU+EjxvqeK1EcnTMtOfsyiTLpoZuumMWjxg lt27DXYLJQRyjLcI4fMsMSo4h3vNsyqgMisCjcuvlkftFn81UXXNNgPu3lxEY2GY gc6XMFOAe24r+fo5yL2lQW78J1vpayzZt7+a/z09R/HXytXy43++grsySmMGYX6y AxPKGKtghc+/cSdsDqlTa9Mp/9RJD6gl8OYIf9DPHQlzE+91IhqUZfgnOA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 65418b7f (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Wed, 31 Aug 2022 07:46:03 +0000 (UTC) Date: Wed, 31 Aug 2022 09:45:52 +0200 From: Julien Lepiller User-Agent: K-9 Mail for Android In-Reply-To: <9C7742D4-1097-46B1-BE10-19069D14B0A5@lepiller.eu> References: <9C7742D4-1097-46B1-BE10-19069D14B0A5@lepiller.eu> Message-ID: <87116428-5621-4D25-811D-696EE38889E1@lepiller.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661932036; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+YGs2dwNt0rpUmlVV+3JMekBRVQzFKO/hNGZiceF7vk=; b=kJ4qONDU1RhNI9QwKioO4jP8yiltFOjNy3RqjYraQDvEMRcd/bO5/o8UVNT10N+CilhUDg xLutettTGVBZGyj+sx8a5G2zkBp2hUKjnXg/CwSovgZtp7BjDPovhAF222LdeCsjtDeqdo 1JnOQC3WOVONky/yLXMwnAC13oDcWK+9CPi03vHsMsmQNKl3DMlcviikLVp09WOo9Zfp81 C3Q3SF/3UanX4zKsTpfMPY8IVmM0BgWa+DbExmhULLcZViiNjvKiL57j0ZJfqKGUov081u IgH9Katnkf/H/bqCc81VCkpRAsSepaqUqwUmQ6W9WjbUiiRSOzg2x/Oyd+dO/A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661932036; a=rsa-sha256; cv=none; b=XEOivVKcT+hEFFTXuSbDaxl41UfhNPLPg2+K59EeT3655ys9MYlo6Bw5Zk1Xt4ZfFVhuAj VExjiz8y/yQqe0LFz3vWVIWweJHa0jSGSlXIorqOdxjOTMitJM7eibQz5TozERggXTkmM4 LPh9Tc6ibuq8ojvmMgzPXWz9eC8vWB+Hek0Eb1+cjsOPB6SKe+VCC0EZy2s3BEWH4mv2L3 cAaaQ/RdwW8w4ek2EiufiM58Y+p/9xWbVZaguP8Yv1d/K+rg2Pbexe7UaV7oWPrJIxTfhC cakAzXVvFP48gOm0x0obInFSFmvyoTMh+Gw2JzZH/8Ryxjk0o4c/IcoIptsxKA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=YhkrTVts; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.71 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=YhkrTVts; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BF8071FEBC X-Spam-Score: 7.71 X-Migadu-Scanner: scn1.migadu.com X-TUID: MrFkh8oDOfkU Le 31 ao=C3=BBt 2022 09:18:44 GMT+02:00, Julien Lepiller a =C3=A9crit=C2=A0: >Hi tiantian! > >Thanks for the patches=2E It's a bit hard to follow since I'm not at a co= mputer, but here are some preliminary remarks=2E > >First, thanks for documenting the change in the manual, it's not somethin= g even I think about all the time ^^'=2E We'll have to rework the English a= bit but it's understandable :) > >I'm wondering why there are two patches? The first patch below seems docu= mented but the second patch does not have a changelog text=2E Shouldn't the= y be merged? They seem to be for the same thing=2E Nevesmind, I don't know how I missed it, there is a changelog for that pat= ch=2E I still think it could be merged with the first=2E Or any reason to k= eep it separate? > >>From what I understand, specifying chainloader with at least linux or lin= ux-multiboot will lead to chainloader being silently dropped=2E Maybe we sh= ould have an error message instead? > >I'm not too familiar with chainloading=2E Is using grub partition names l= ike (hd0,gpt1) the only way? We try to discourage using these names as they= can easily vary between reboots and your system unbootable=2E > >Otherwise, it looks fine at first glance, but untested :) > >Le 31 ao=C3=BBt 2022 07:27:48 GMT+02:00, typ22@foxmail=2Ecom a =C3=A9crit= =C2=A0: >>From: tiantian >> >>* gnu/bootloader=2Escm ()[chain-loader]: New field=2E >>(menu-entry->sexp, sexp->menu-entry): Support chain-loader=2E >>* doc/guix=2Etexi (Bootloader Configuration): Document it=2E >>--- >> doc/guix=2Etexi | 15 +++++++++++++++ >> gnu/bootloader=2Escm | 40 ++++++++++++++++++++++++++++++++++------ >> 2 files changed, 49 insertions(+), 6 deletions(-) >> >>diff --git a/doc/guix=2Etexi b/doc/guix=2Etexi >>index 957b9a668e=2E=2E69dcd9e7b9 100644 >>--- a/doc/guix=2Etexi >>+++ b/doc/guix=2Etexi >>@@ -37536,6 +37536,21 @@ Bootloader Configuration >> @dots{})) >> @end lisp >>=20 >>+@item @code{chain-loader} (default: @code{#f}) >>+A string that any accepted by @code{chainloader}=2E If there are items >>+other than @code{label} and @code{device}, it will have no effect=2E >>+ >>+@lisp >>+(bootloader >>+ (bootloader-configuration >>+ ;; @dots{} >>+ (menu-entries >>+ (list >>+ (menu-entry >>+ (label "GNU/Linux") >>+ (chain-loader "(hd0,gpt1)/EFI/GNULinux/grubx64=2Eefi")))))) >>+@end lisp >>+ >> @end table >> @end deftp >>=20 >>diff --git a/gnu/bootloader=2Escm b/gnu/bootloader=2Escm >>index 77c05e8946=2E=2E41f690a4dc 100644 >>--- a/gnu/bootloader=2Escm >>+++ b/gnu/bootloader=2Escm >>@@ -46,6 +46,7 @@ (define-module (gnu bootloader) >> menu-entry-multiboot-kernel >> menu-entry-multiboot-arguments >> menu-entry-multiboot-modules >>+ menu-entry-chain-loader >>=20 >> menu-entry->sexp >> sexp->menu-entry >>@@ -104,8 +105,11 @@ (define-record-type* >> (multiboot-arguments menu-entry-multiboot-arguments >> (default '())) ; list of string-valued gexp= s >> (multiboot-modules menu-entry-multiboot-modules >>- (default '()))) ; list of multiboot commands= , where >>+ (default '())) ; list of multiboot commands= , where >> ; a command is a list of >>+ (chain-loader menu-entry-chain-loader >>+ (default #f))) ; string, path of efi file >>+ >>=20 >> (define (menu-entry->sexp entry) >> "Return ENTRY serialized as an sexp=2E" >>@@ -117,8 +121,15 @@ (define (menu-entry->sexp entry) >> `(label ,(file-system-label->string label))) >> (_ device))) >> (match entry >>- (($ label device mount-point linux linux-arguments ini= trd #f >>- ()) >>+ ;; Fields of in the patterns is incomplete, >>+ ;; resulting in menu-entry with chain-loader incorrectly >>+ ;; matching the first=2E >>+ ;; To keep pattern is short and keep matching order, >>+ ;; judge an important field in each pattern=2E >>+ ;; Such as kernel=2E >>+ (($ label device mount-point >>+ (? identity linux) linux-arguments initrd >>+ #f ()) >> `(menu-entry (version 0) >> (label ,label) >> (device ,(device->sexp device)) >>@@ -127,14 +138,22 @@ (define (menu-entry->sexp entry) >> (linux-arguments ,linux-arguments) >> (initrd ,initrd))) >> (($ label device mount-point #f () #f >>- multiboot-kernel multiboot-arguments multiboot-mod= ules) >>+ (? identity multiboot-kernel) multiboot-arguments >>+ multiboot-modules) >> `(menu-entry (version 0) >> (label ,label) >> (device ,(device->sexp device)) >> (device-mount-point ,mount-point) >> (multiboot-kernel ,multiboot-kernel) >> (multiboot-arguments ,multiboot-arguments) >>- (multiboot-modules ,multiboot-modules))))) >>+ (multiboot-modules ,multiboot-modules))) >>+ (($ label device mount-point #f () #f #f () () >>+ (? identity chain-loader)) >>+ `(menu-entry (version 0) >>+ (label ,label) >>+ (device ,(device->sexp device)) >>+ (device-mount-point ,mount-point) >>+ (chain-loader ,chain-loader))))) >>=20 >> (define (sexp->menu-entry sexp) >> "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a >>@@ -171,7 +190,16 @@ (define (sexp->menu-entry sexp) >> (device-mount-point mount-point) >> (multiboot-kernel multiboot-kernel) >> (multiboot-arguments multiboot-arguments) >>- (multiboot-modules multiboot-modules))))) >>+ (multiboot-modules multiboot-modules))) >>+ (('menu-entry ('version 0) >>+ ('label label) ('device device) >>+ ('device-mount-point mount-point) >>+ ('chain-loader chain-loader) _ =2E=2E=2E) >>+ (menu-entry >>+ (label label) >>+ (device (sexp->device device)) >>+ (device-mount-point mount-point) >>+ (chain-loader chain-loader))))) >>=20 >> =0C>> >> ;;; >>--=20 >>2=2E37=2E2 >> >> >> >>