From unknown Sun Jul 13 03:50:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#57496 <57496@debbugs.gnu.org> To: bug#57496 <57496@debbugs.gnu.org> Subject: Status: [PATCH 0/2] Add support for chain-loader Reply-To: bug#57496 <57496@debbugs.gnu.org> Date: Sun, 13 Jul 2025 10:50:03 +0000 retitle 57496 [PATCH 0/2] Add support for chain-loader reassign 57496 guix-patches submitter 57496 typ22@foxmail.com severity 57496 normal tag 57496 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 01:25:44 2022 Received: (at submit) by debbugs.gnu.org; 31 Aug 2022 05:25:44 +0000 Received: from localhost ([127.0.0.1]:37956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTGES-0004Hb-34 for submit@debbugs.gnu.org; Wed, 31 Aug 2022 01:25:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:46328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTGEL-0004HN-T4 for submit@debbugs.gnu.org; Wed, 31 Aug 2022 01:25:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTGEK-00007R-IG for guix-patches@gnu.org; Wed, 31 Aug 2022 01:25:36 -0400 Received: from out203-205-221-242.mail.qq.com ([203.205.221.242]:37883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTGEC-0004n8-Op for guix-patches@gnu.org; Wed, 31 Aug 2022 01:25:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1661923516; bh=Lb1mAaj7JCIuzwCniTgi46ey3uNE9QHHliFlOLOp8ZQ=; h=From:To:Cc:Subject:Date; b=EsEj+wi+C4nbI8NsUfVdgHHItfm/pdqksaQOpmOqc4zhpt+sxxDWYRGN8L/GrkMn7 cUtonrJUYiqjmANTJkQIixB+5fhJbb1m0qlXMSFR3rxSIldmyXo1b64LOra5KC6vRx 8+5+ClXOhG7QR+AanOGc6jBPFLCSEgPWUowr3aEo= Received: from localhost.localdomain ([240e:398:28aa:8901:2e5d:53be:47ef:3da]) by newxmesmtplogicsvrszb7.qq.com (NewEsmtp) with SMTP id 60633E96; Wed, 31 Aug 2022 13:24:06 +0800 X-QQ-mid: xmsmtpt1661923446t9yb6gny8 Message-ID: X-QQ-XMAILINFO: OZZSS56D9fAjsWg8HbpvciaLmMmFx32fx6byK1eQCogi1D/5992mALZm5z58JG 3c/WSy23I5kFRW8SKX1EdCORyhaNgI6XSMWEmfgDQnGGZm7Jlk9EsGlNgJCd6hul0Wc/xxLBV/dU UbB+Ty9ugZMSe+TVtu1LPW6tcS1nYLzuOsolkQVUJXrEtighQzcgidG6WHp16EsWvsJ6ywhPIeAI 6R0cCU+xNqHXDvo77AIhrvDw+RY6AwqwYKOsl8mAeQvuuCQFiNcLFHKpW3/fz2KRxkv0gVc4U/Rn EqtFrvXY1Ll060eFhISn2PD3zXdU8CKlLmPnSDGZuOnogw39akVuEtClR4jk5Hw5exFCG5HCI3se penVkWg7rjFQ9q4kCR/5gpwVeII8ceBYp9eDtSBCzG+w2yX2yjTSqU+vSQhH6CLd8OpqJfvM/fiY Em7um0YwQPYuKUNmBiW8EgaOyPS1BQf+PYyoWvV0x8FtDOcm6lD5fbXOza5GBSPKTCxQFvQUkjzZ JghkBzR98klwitsEtrRj1m93/OrOtXJ3ufPLeETCo2+YcODnQOGs76S8K5MXKgdVdhzEanKclCGZ NRccDybV+DSdU0I0KnqPudyxi+0Nu+EFmu57KucIHLR43OQmWSf8UoXZMBmnfzUZDMEbucRsEN8N Yw5LoCJ9Psbr/TYJnnjMJHq3CTgi1vaicjqkKzKBJG5Zred2TX5hllLUMDgJyPXHIvNK8Hi4s8Li dGa4dmVLete7SkdBYeLC+7kUQIwVPgnfb8aliws1xdFmX5+MHitqaahyB65mKDgfOWK406kt34TC 5qbnafOiUncULF4FhckPc7g7Wgj7JVafWL+32WvtCKttlW9rzuaqOmedAGUbRoiyYdWL5dug3vmZ w1VOnU2KrLgn3vuBKiLNqqtT7fOBnPSqosP/Wtmmw9piuFmvvlo+9uVXIbOyOCuzLf0l0Sy+yzLF Z5SjfBjpATK2cutSXatBGGU12Y2kPuXUcNxiK9FhLiuag8dECq4SqJd+JggGPn From: typ22@foxmail.com To: guix-patches@gnu.org Subject: [PATCH 0/2] Add support for chain-loader Date: Wed, 31 Aug 2022 13:23:06 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=203.205.221.242; envelope-from=typ22@foxmail.com; helo=out203-205-221-242.mail.qq.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: submit Cc: tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) From: tiantian Hi Guix, I just started using guix system soon. I used archlinux before. Now I want to move from archlinux to guix system. It took me about 2 years to move from windows to archlinux, and now it may take me a long time to complete the moving from ArchLinx to guix system. During this period, guix system and archlinux will coexist on my computer. Therefore, it is necessary for me to easily enter another system in the boot interface. So I want to add support for chain-loader in menu-entry of guix system. Why do I want to use chainloader instead of linux and initrd? 1. guix system and archlinux are independent of each other in my computer. They are just on the same computer, but they have their own disk partitions. I also don't want them to interfere with each other. (I have no money to buy more computers. I just have one computer.) 2. If using linux and initrd, modify the boot arguments of one of them, which must be in the other system. I think it is strange and inconvenient. It's also not in line with the above idea of mutual independence and non-interference. 3. I am a novice. If an unexpected event occurs when using linux and initrd, I can't repair it quickly and timely. Is the chain-loader free? The chain-loader is a function of grub, and grub's protocol is GPL3. I think it is free. Although chain-loader can boot nonfree system like windows, it's like nonfree software can run on linux-libre, and linux-libre is free. If Guix think it's nonfree, I will only keep these changes in my computer. Here I want to express my thanks to Josselin Poiret. When I tried to start this task, I found that there was a bug with the menu-entry. When the device of menu-entry is UUID or file-system-label, an error will be reported by 'guix system' command. I can't fix it. Then I reported this bug in bug#57307. Thanks to Josselin Poiret fixing the bug, I can continue this task. My English is not good, I mainly rely on translation software. If I have any grammar problems and tone problems, please forgive me. I am sending these emails with respect. Thanks, tiantian tiantian (2): gnu: bootloader: Extend `' for chain-loader. gnu: bootloader: grub: Add support for chain-loader. doc/guix.texi | 15 +++++++++ gnu/bootloader.scm | 40 ++++++++++++++++++---- gnu/bootloader/grub.scm | 73 ++++++++++++++++++++++++----------------- 3 files changed, 92 insertions(+), 36 deletions(-) base-commit: 6beadc82df204f315d06ea35f2e232bb32f8e440 -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 01:29:26 2022 Received: (at 57496) by debbugs.gnu.org; 31 Aug 2022 05:29:26 +0000 Received: from localhost ([127.0.0.1]:37962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTGI1-0004NA-PI for submit@debbugs.gnu.org; Wed, 31 Aug 2022 01:29:26 -0400 Received: from out203-205-221-245.mail.qq.com ([203.205.221.245]:57648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTGHy-0004Mn-LF for 57496@debbugs.gnu.org; Wed, 31 Aug 2022 01:29:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1661923754; bh=l3WqtlHsmlayI/r65QJVGOTW9ezhMw6hDkM+AZZ4syM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TB+/I5q1IDcROpeQq5aOH/yNY+ntO8eQEumnBWYWdAMuYAEMLYUZcFVvrortq/uN+ +TyGQS7YBU40JUIU46aVmXphziPoREs+HPyxszCACMwu8y/VHNYFTXGRYK2E6mmA+N fi/bKlCwI2apWX9NTP0ZWVUoOHsVGXiEsRpbwROU= Received: from localhost.localdomain ([240e:398:28aa:8901:2e5d:53be:47ef:3da]) by newxmesmtplogicsvrszc13.qq.com (NewEsmtp) with SMTP id 74C1A441; Wed, 31 Aug 2022 13:29:12 +0800 X-QQ-mid: xmsmtpt1661923753txl4feeyn Message-ID: X-QQ-XMAILINFO: NY/MPejODIJVVFZ/t8blm1PLwF0iPCE+SkP0q+o55nayHjDtADX6DB6OEodvg/ 22Zo7iqTABouUWg/pFSskBYZnXgTJUFv3Jk3Dm6+T5+ZCq6RfseVK9BWITVcYFZGuLnP1r10iou0 YoLYPQXtLNSCiikRWcRY4k1lwlfoIMB09sERf7XXNiZzjdZ7VQgrSqe7MJDxURLUngJUJ0h1IsCV Tzil+uOSbOePnclLFUvOLE3EBtMLUokCF7a7HlI5gRphblOgb5x5b+GAeFuDTb0kPzJjHQ1IsgWh 5o/x/RiTXABImIhKUi0uem3ewxF0KaqEL3W330SlUI5voslZ1K4ZldtH56/iDwuXn33I6ml44ca2 iZupPgf1IeOwauhXeO4F7QdWyT1w/bG2J64tYjAItS9rCF+OrpX4nhjVspzE5J1NR0tLpdVtvU7z ZIsOpL3OF6Q2RXYC0dFXS/EcTUS+wmjAUBsYnDjjQQrKhDCCeYKnrZp1RTc5dKYQagkGIV60uDeY 2xs2YaQFasdORcHXaArPhuKPt1DTUnS3Sg9WKxYJ/Fjde9tDBrj/TATUWfKjYMaNlfThVnRCMprB McHt9vWzRdLvPwjOI8icUL9GpSOS0kfh9kJqnGJop/lewyzsy93psg2cAgsk+MFxVunWfE2gdM4r f+an404k3sZyMkXVaPHzUvrQGnsNa9nnLlsCEXV8RjWMNp8GJgg/NqP6MESHXZro9ufma4vzRkib gg86sQVDz+RUfLvZEZxzKLI3Elr3G7mi3ZQaQwCJTI2pAsPvbmoicFiKvxQX0Sjdn2ZQF3tSXUE7 50/LcMopCUOGuPiaGg3EDYA3xXRYTWNrqikSKdAJgvN6rEmhY9vZz3ewpLwXH2PJFRZCkKZXkx5u xsbmedcvYkVod7RzYtvOeZXUyqK0QzEz8XkU+lc9aaLtifrlZktNDNCexuwpLj05VBcIVE+Bw8Pa 10V0+TgXc= From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH 2/2] gnu: bootloader: grub: Add support for chain-loader. Date: Wed, 31 Aug 2022 13:27:49 +0800 X-OQ-MSGID: <24b02b2230f2eeebebbd86ac2048587178e48953.1661918557.git.typ22@foxmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- gnu/bootloader/grub.scm | 73 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+), 30 delet [...] Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.245 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- gnu/bootloader/grub.scm | 73 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+), 30 delet [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.245 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- gnu/bootloader/grub.scm | 73 ++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 4f18c9b518..7283257354 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -374,44 +374,57 @@ (define* (grub-configuration-file config entries (let ((label (menu-entry-label entry)) (linux (menu-entry-linux entry)) (device (menu-entry-device entry)) - (device-mount-point (menu-entry-device-mount-point entry))) - (if linux - (let ((arguments (menu-entry-linux-arguments entry)) - (linux (normalize-file linux - device-mount-point - store-directory-prefix)) - (initrd (normalize-file (menu-entry-initrd entry) - device-mount-point - store-directory-prefix))) - ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. - ;; Use the right file names for LINUX and INITRD in case - ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a - ;; separate partition. - - ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and - ;; initrd paths, to allow booting from a Btrfs subvolume. - #~(format port "menuentry ~s { + (device-mount-point (menu-entry-device-mount-point entry)) + (multiboot-kernel (menu-entry-multiboot-kernel entry)) + (chain-loader (menu-entry-chain-loader entry))) + (cond + (linux + (let ((arguments (menu-entry-linux-arguments entry)) + (linux (normalize-file linux + device-mount-point + store-directory-prefix)) + (initrd (normalize-file (menu-entry-initrd entry) + device-mount-point + store-directory-prefix))) + ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. + ;; Use the right file names for LINUX and INITRD in case + ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a + ;; separate partition. + + ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and + ;; initrd paths, to allow booting from a Btrfs subvolume. + #~(format port "menuentry ~s { ~a linux ~a ~a initrd ~a }~%" - #$label - #$(grub-root-search device linux) - #$linux (string-join (list #$@arguments)) - #$initrd)) - (let ((kernel (menu-entry-multiboot-kernel entry)) - (arguments (menu-entry-multiboot-arguments entry)) - (modules (menu-entry-multiboot-modules entry)) - (root-index 1)) ; XXX EFI will need root-index 2 - #~(format port " + #$label + #$(grub-root-search device linux) + #$linux (string-join (list #$@arguments)) + #$initrd))) + (multiboot-kernel + (let ((kernel (menu-entry-multiboot-kernel entry)) + (arguments (menu-entry-multiboot-arguments entry)) + (modules (menu-entry-multiboot-modules entry)) + (root-index 1)) ; XXX EFI will need root-index 2 + #~(format port " menuentry ~s { multiboot ~a root=device:hd0s~a~a~a +}~%" + #$label + #$kernel + #$root-index (string-join (list #$@arguments) " " 'prefix) + (string-join (map string-join '#$modules) + "\n module " 'prefix)))) + (chain-loader + #~(format port " +menuentry ~s { + ~a + chainloader ~a }~%" #$label - #$kernel - #$root-index (string-join (list #$@arguments) " " 'prefix) - (string-join (map string-join '#$modules) - "\n module " 'prefix)))))) + #$(grub-root-search device chain-loader) + #$chain-loader))))) (define (crypto-devices) (define (crypto-device->cryptomount dev) -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 01:29:26 2022 Received: (at 57496) by debbugs.gnu.org; 31 Aug 2022 05:29:26 +0000 Received: from localhost ([127.0.0.1]:37964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTGI2-0004NC-8s for submit@debbugs.gnu.org; Wed, 31 Aug 2022 01:29:26 -0400 Received: from out203-205-251-53.mail.qq.com ([203.205.251.53]:44151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTGHy-0004Ml-On for 57496@debbugs.gnu.org; Wed, 31 Aug 2022 01:29:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1661923753; bh=YvBUoWlPOQpN6m/Zs0gmk08A/wr8imaac6gY2QgvJFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pbLOFxGjw+msaB3gRNa8tuymN4+hVjBsw8lFQZ1IxWp1B4BiyTYpqijOaEnjVunpb +BCIKNy41zoXiONzpuKsRkJ30ysiURsk2LO6FATqNpACPOz09jYA4MksovKD9XVSJw yUjxPwx6GDdaAeQc0KcL4jbcflnx1BkiF+HFH4FY= Received: from localhost.localdomain ([240e:398:28aa:8901:2e5d:53be:47ef:3da]) by newxmesmtplogicsvrszc13.qq.com (NewEsmtp) with SMTP id 74C1A441; Wed, 31 Aug 2022 13:29:12 +0800 X-QQ-mid: xmsmtpt1661923752t6meqwzqw Message-ID: X-QQ-XMAILINFO: M0PjjqbLT90wI0Wt5GFIEcGCT2HlTJImmfiQy2dvf0QGZcOVBPqRx/TjJIDDCB Q8X0otG3CmxTH0efCf5lKdgbGnE8/ZirmFD7h3X29vzAzPlB9tKfu/Xl3pYLK0zhFin2i7gU0iZn tyudY6eNmYUy2cWalXdVmx7f4MMIcUmcyYlKulzcq9sj6ViMDk7f/c8wu7Ifgwa26mDdIsaGC47R aEQpWAqfxllkqatmlig8nUeV6x3b1Tlesr9q9j4VbCMGWnqiU+YoTUWJjGy7JTwIjNkQHixRTpuc ZTyTPWRKYm8hwUFKrzAjQKYqly5dpGplv+yLk8oPDy9V5gtuF4SUT4jDtqUUKN23HvsoUZ5v5HMz uqYx4ZqSuIOIVrjknZ0tXgUOg40lJvvW9qzCatBh7eTzB91HWRsKn1KP8Lt+FMPQnmZak9lIsvrz hjnEnEPytrNWb7iNsW1pZuQcuiDfl4QC8fV5mceI2T6yQoyjNg/gu0+eJE9hA5dS/5Vb4HPAHP+C 7iTKTGhyO1II/I3iTXHtctfATdV0Qrh3jZv7zdxWYaPTfzrRw8mC2t2kc3cKlsFVCozW7Cb7RSlX Ga2Zrvpg4G774ZzQGjxMIjj7bK37SMxwbxhqFCDauEOB5MTmZPkQfhJ4iJfbdS5MhcQrrdIBsx2C e28aknVMNE2ly1rAQRLM88fxw4s0NX8+kxNHWS7ZpcEzvZYa/iVkYaJXTHD0OpzfTfHmu/zHqSbp wbQTsQ/bHhBcSyYMCmHWtimv7l/oGQEejwez77jCX9RAVuz5x2TdLv6iCh5cJimX7ua0ga401VAX 1/oMg7RrqLVPPJ9Vk2FWyinkWg6XDcMHKSeT8MNvVRts1UszFzIMZL3qGoE8UHJSke7TPsXHwZ7U CvHUviop7qHpekscdsTPAEMZFau6hb/uSkFHy/JOKEFvCDEJXI7oe4Jd6CElgcr8FIr3lwPwGtRs vpVLkQCsy0zPbfPqfyCQ== From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH 1/2] gnu: bootloader: Extend `' for chain-loader. Date: Wed, 31 Aug 2022 13:27:48 +0800 X-OQ-MSGID: <1216b5f648977e9fdc39f94215d4d8226d2b42df.1661918557.git.typ22@foxmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. --- doc/guix.texi | 1 [...] Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.251.53 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. --- doc/guix.texi | 1 [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.251.53 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. --- doc/guix.texi | 15 +++++++++++++++ gnu/bootloader.scm | 40 ++++++++++++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 957b9a668e..69dcd9e7b9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37536,6 +37536,21 @@ Bootloader Configuration @dots{})) @end lisp +@item @code{chain-loader} (default: @code{#f}) +A string that any accepted by @code{chainloader}. If there are items +other than @code{label} and @code{device}, it will have no effect. + +@lisp +(bootloader + (bootloader-configuration + ;; @dots{} + (menu-entries + (list + (menu-entry + (label "GNU/Linux") + (chain-loader "(hd0,gpt1)/EFI/GNULinux/grubx64.efi")))))) +@end lisp + @end table @end deftp diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 77c05e8946..41f690a4dc 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -46,6 +46,7 @@ (define-module (gnu bootloader) menu-entry-multiboot-kernel menu-entry-multiboot-arguments menu-entry-multiboot-modules + menu-entry-chain-loader menu-entry->sexp sexp->menu-entry @@ -104,8 +105,11 @@ (define-record-type* (multiboot-arguments menu-entry-multiboot-arguments (default '())) ; list of string-valued gexps (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 + (define (menu-entry->sexp entry) "Return ENTRY serialized as an sexp." @@ -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 initrd #f - ()) + ;; Fields of in the patterns is incomplete, + ;; resulting in menu-entry with chain-loader incorrectly + ;; matching the first. + ;; To keep pattern is short and keep matching order, + ;; judge an important field in each pattern. + ;; Such as kernel. + (($ 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-modules) + (? 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))))) (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) _ ...) + (menu-entry + (label label) + (device (sexp->device device)) + (device-mount-point mount-point) + (chain-loader chain-loader))))) ;;; -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 03:19:46 2022 Received: (at 57496) by debbugs.gnu.org; 31 Aug 2022 07:19:46 +0000 Received: from localhost ([127.0.0.1]:38086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTI0n-00036J-M7 for submit@debbugs.gnu.org; Wed, 31 Aug 2022 03:19:46 -0400 Received: from lepiller.eu ([89.234.186.109]:53242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTI0k-000369-V7 for 57496@debbugs.gnu.org; Wed, 31 Aug 2022 03:19:44 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 0705ca46; Wed, 31 Aug 2022 07:18:55 +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=HzY+Zjj9x0sM sy08oL9PxweeDDBLaKZAijexVGVXNPg=; b=ONHTbxoSfYPh9pK2yWYLk9kFuFme VVzX0gC+DIgYM0a47v1FGutp6L5RxRgKH9TVHH3GEJ1Tqp6Mqw2j2BsF8ZCvO619 JvFZpI5gk34hNRgiuwv6UguNywN1USqB8adxHcaXOWfMiX9stUBJE/oe45mDQdpD H+sZM6SfNQOQ6ePgXFruwjzp5tNibfWf/808bd6CpzNBqBbHaX/1z5XyfCkCQmn8 xWqb/HqUe5tCRIi6uEdBhQlsuJiK35PAw0jyBUST2vk5auhR7jfR18NjHk/sGi0Y 7JWFGcO1orQxVXCrSncg3E2p10kf6VpvfQxcQSSxfiUYDNGmZxO/dQxEjQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 0b11d695 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Wed, 31 Aug 2022 07:18:55 +0000 (UTC) Date: Wed, 31 Aug 2022 09:18:44 +0200 From: Julien Lepiller To: guix-patches@gnu.org, typ22@foxmail.com, 57496@debbugs.gnu.org Subject: =?US-ASCII?Q?Re=3A_=5Bbug=2357496=5D_=5BPATCH_1/2=5D_gnu=3A_bootloade?= =?US-ASCII?Q?r=3A_Extend_=60=3Cmenu-entry=3E=27_for_chain-loader=2E?= User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <9C7742D4-1097-46B1-BE10-19069D14B0A5@lepiller.eu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----4UEM5TVXXD88THP6UYK2I3663N93C1 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57496 Cc: tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) ------4UEM5TVXXD88THP6UYK2I3663N93C1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi tiantian! Thanks for the patches=2E It's a bit hard to follow since I'm not at a com= puter, but here are some preliminary remarks=2E First, thanks for documenting the change in the manual, it's not something= 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 docum= ented but the second patch does not have a changelog text=2E Shouldn't they= be merged? They seem to be for the same thing=2E From=20what I understand, specifying chainloader with at least linux or linu= x-multiboot will lead to chainloader being silently dropped=2E Maybe we sho= uld have an error message instead? I'm not too familiar with chainloading=2E Is using grub partition names li= ke (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 gexps > (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 init= rd #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-modu= les) >+ (? 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 > > > > ------4UEM5TVXXD88THP6UYK2I3663N93C1 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi tiantian!

Thanks for the patches=2E It's= a bit hard to follow since I'm not at a computer, but here are some prelim= inary remarks=2E

First, thanks for documenting the change in the man= ual, it's not something even I think about all the time ^^'=2E We'll have t= o rework the English a bit but it's understandable :)

I'm wondering = why there are two patches? The first patch below seems documented but the s= econd patch does not have a changelog text=2E Shouldn't they be merged? The= y seem to be for the same thing=2E

From what I understand, specifyin= g chainloader with at least linux or linux-multiboot will lead to chainload= er being silently dropped=2E Maybe we should have an error message instead?=

I'm not too familiar with chainloading=2E Is using grub partition n= ames like (hd0,gpt1) the only way? We try to discourage using these names a= s 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=2E= com a =C3=A9crit=C2=A0:
From: tiantian <typ22@foxmail=2Ecom&=
gt;

* gnu/bootloader=2Escm (<menu-entry>)[chain-loader]: New f= ield=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
inde= x 957b9a668e=2E=2E69dcd9e7b9 100644
--- a/doc/guix=2Etexi
+++ b/doc/g= uix=2Etexi
@@ -37536,6 +37536,21 @@ Bootloader Configuration
= @dots{}))
@end lisp

+@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 e= ffect=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
@en= d deftp

diff --git a/gnu/bootloader=2Escm b/gnu/bootloader=2Escmindex 77c05e8946=2E=2E41f690a4dc 100644
--- a/gnu/bootloader=2Escm
+= ++ b/gnu/bootloader=2Escm
@@ -46,6 +46,7 @@ (define-module (gnu bootload= er)
menu-entry-multiboot-kernel
menu-entry-= multiboot-arguments
menu-entry-multiboot-modules
+ = menu-entry-chain-loader

menu-entry->sexp
= sexp->menu-entry
@@ -104,8 +105,11 @@ (define-record-type= * <menu-entry>
(multiboot-arguments menu-entry-multiboot-argume= nts
(default '())) ; list of string-valued = gexps
(multiboot-modules menu-entry-multiboot-modules
- = (default '()))) ; list of multiboot commands, where
+ = (default '())) ; list of multiboot commands, where=
; a command is a list of &l= t;string>
+ (chain-loader menu-entry-chain-loader
+ = (default #f))) ; string, path of efi file
+

(= define (menu-entry->sexp entry)
"Return ENTRY serialized as an sex= p=2E"
@@ -117,8 +121,15 @@ (define (menu-entry->sexp entry)
= `(label ,(file-system-label->string label)))
(_ device))) (match entry
- (($ <menu-entry> label device mount-point li= nux linux-arguments initrd #f
- ())
+ ;; Field= s of <menu-entry> 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+ (($ <menu-entry> label device mount-point
+ = (? identity linux) linux-arguments initrd
+ #f = ())
`(menu-entry (version 0)
(label ,label)<= br> (device ,(device->sexp device))
@@ -127,14 +138= ,22 @@ (define (menu-entry->sexp entry)
(linux-arg= uments ,linux-arguments)
(initrd ,initrd)))
(= ($ <menu-entry> label device mount-point #f () #f
- = multiboot-kernel multiboot-arguments multiboot-modules)
+ = (? 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)
(mul= tiboot-arguments ,multiboot-arguments)
- (multiboot-mod= ules ,multiboot-modules)))))
+ (multiboot-modules ,mult= iboot-modules)))
+ (($ <menu-entry> 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-loade= r)))))

(define (sexp->menu-entry sexp)
"Turn SEXP, an sex= p as returned by 'menu-entry->sexp', into a <menu-entry>
@@ -17= 1,7 +190,16 @@ (define (sexp->menu-entry sexp)
(device-mount-p= oint mount-point)
(multiboot-kernel multiboot-kernel)
(= multiboot-arguments multiboot-arguments)
- (multiboot-modules multi= boot-modules)))))
+ (multiboot-modules multiboot-modules)))
+ = (('menu-entry ('version 0)
+ ('label label) ('device d= evice)
+ ('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)))))=


;;;
--
2=2E37=2E= 2




------4UEM5TVXXD88THP6UYK2I3663N93C1-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 03:46:12 2022 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 To: 57496@debbugs.gnu.org, typ22@foxmail.com Subject: =?US-ASCII?Q?Re=3A_=5Bbug=2357496=5D_=5BPATCH_1/2=5D_gnu=3A_bootloade?= =?US-ASCII?Q?r=3A_Extend_=60=3Cmenu-entry=3E=27_for_chain-loader=2E?= 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-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57496 Cc: tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 >> >> >> >> From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 15:34:15 2022 Received: (at 57496) by debbugs.gnu.org; 31 Aug 2022 19:34:15 +0000 Received: from localhost ([127.0.0.1]:40514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTTTa-0006B9-9r for submit@debbugs.gnu.org; Wed, 31 Aug 2022 15:34:15 -0400 Received: from lepiller.eu ([89.234.186.109]:53288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTTTX-0006Ay-F9 for 57496@debbugs.gnu.org; Wed, 31 Aug 2022 15:34:13 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 89b08bdb; Wed, 31 Aug 2022 19:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=9K7RtLkMCo3Q TPDwLQcTRv5FHe8J3trEtJbpJ3Q3CMg=; b=kpBlndJmb//dqkOFGO0WV+WtTVJH pO5fkFkwbPL66iB+p+zDkvAzXxmuhANMvlcnqGdc5Dr6I7z4zbXJ2d/35LKUHppo 8sv4UnCwZqQLXrGttH8A2Sc4AtE9OpPP78iPo22K+gf5ahtQcvnq9h5OxQC5dmSS RX87sr7tiliEsjzX5a6/UzNtWaJ4fU3QwomXXXROUR1FeVM+li1P/X4VsSgj2vdI A6m92xgyeOrF5BtHid82p08dnOUvRK1fGCdTpL/QC0ieMZ95wTFtfJvLCOp6MvOT hkiFRWkPabfWMVCv+fiE48NvhafWrn7D5O0IPXrktl13f5eP0o2TWQRsOw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 289f2752 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Wed, 31 Aug 2022 19:34:08 +0000 (UTC) Date: Wed, 31 Aug 2022 21:34:06 +0200 From: Julien Lepiller To: tiantian Subject: Re: [bug#57496] [PATCH 1/2] gnu: bootloader: Extend `' for chain-loader. Message-ID: <20220831213406.3ec92474@sybil.lepiller.eu> In-Reply-To: References: <55016216-84d9-e2e6-8bf5-0efdfa0e6ac1@foxmail.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57496 Cc: 57496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le Thu, 1 Sep 2022 01:55:34 +0800, tiantian a =C3=A9crit : > Dear Mr/Ms Lepiller, >=20 > I'm sorry. I didn't notice the wrong sender name. You don't have to apologize. I received your email and I didn't even notice the sender name :) >=20 > Because my patch was replied so quickly for the first time, I am > excited and hope to reply as soon as possible. >=20 > After the last installation of icedove, the mail client on my > computer, I don't know why icedove lost all configuration information > this time, so I log in again. Icedove defaults to the desktop user > name I set for testing the guix system. In a hurry, I didn't notice > the mistake. >=20 > I checked the contents of the email and tried to make the meaning > accurate. Without noticing that the name of the sender of the mail is > wrong. >=20 > I'm not sure if the previous mail was intercepted in the trash, so I > forward it. >=20 > My mistake was really stupid. I sincerely apologize for disturbing > you. >=20 > Sincerely, > tiantian >=20 > -------- Forwarded Message -------- > Subject: Re: [bug#57496] [PATCH 1/2] gnu: bootloader: Extend > `' for chain-loader. Date: Wed, 31 Aug 2022 20:22:55 +0800 > From: user in guix system > To: Julien Lepiller , 57496@debbugs.gnu.org >=20 > Hi, >=20 > On 2022/8/31 15:18, Julien Lepiller wrote: > > Hi tiantian! > > > > Thanks for the patches. It's a bit hard to follow since I'm not at a > > computer, but here are some preliminary remarks. > > > > First, thanks for documenting the change in the manual, it's not > > something even I think about all the time ^^'. We'll have to rework > > the English a bit but it's understandable :) > > =20 >=20 > My English is not good. Thank you for correcting the document. Let's try something like this: @item @code{chain-loader} (default: @code{#f}) A string that can be accepted by @code{grub}'s @code{chainloader} directive. This has no effect if either @code{linux} or @code{linux-multiboot} fields are specified. The following is an example of chainloading a different GNU/Linux system. >=20 > > I'm wondering why there are two patches? The first patch below seems > > documented but the second patch does not have a changelog text. > > Shouldn't they be merged? They seem to be for the same thing. > > =20 >=20 > I have little submission experience and my English isn't good, so I > refer to the submission history of multiboot. As you can see, my > submission also imitates it. However, I did not modify > like it. On the one hand, I did not understand the > role of . on the other hand, it has successfully > passed the tests on my computer, such as reconfigure, > switch-generation and roll-back. I didn't know about boot-parameters. It sounds like they are related to guix deploy, which I don't use. I think we can still go with your patch, and later add chainloading in boot-parameters if needed. >=20 > If it is better to merge into the first, there is no problem. How can > I do this? Should I send v2 here after local merge, or other? >=20 > commit 1244491a0d5334e1589159a2ff67bbc967b9648b > Author: Jan (janneke) Nieuwenhuizen > Date: Tue May 26 18:09:01 2020 +0200 >=20 > bootloader: grub: Add support for multiboot. >=20 > * gnu/bootloader/grub.scm (grub-configuration-file): Add support > for multiboot. >=20 > commit 912b857ede450828805e09bb718658f79c40703a > Author: Jan (janneke) Nieuwenhuizen > Date: Tue May 26 17:38:30 2020 +0200 >=20 > system: Add 'multiboot-modules' field to . >=20 > * gnu/system.scm ()[multiboot-modules]: New > field. (read-boot-parameters): Initialize it. > (operating-system-multiboot-modules, hurd-multiboot-modules): > New procedure. (operating-system-boot-parameters): Cater for > multiboot the Hurd and initialize it; avoid initrd in that case. > (operating-system-kernel-file): Cater for for Gnumach (the Hurd) > besides Linux. (boot-parameters->menu-entry): Use it to support a > multiboot . >=20 > commit 21acd8d6c11b85d06c82b168807b35cb7d2d0adf > Author: Jan (janneke) Nieuwenhuizen > Date: Tue May 26 16:54:18 2020 +0200 >=20 > bootloader: Extend `' for multiboot. >=20 > * gnu/bootloader.scm > ()[multiboot-kernel,multiboot-arguments, > multiboot-modules]: New fields. [linux,initrd]: Add default value > '#f'. (menu-entry->sexp, sexp->menu-entry): Support multiboot entry. > * doc/guix.texi (Bootloader Configuration): Document them. >=20 OK, I see now. I don't really understand why they were separate, but let's keep them separate for now. > > From what I understand, specifying chainloader with at least linux > > or linux-multiboot will lead to chainloader being silently dropped. > > Maybe we should have an error message instead? > > =20 >=20 > Yes. Thank you for asking this question. I didn't think about it > before. What I can think of now is to complete pattern as follows. > When the chainloader and Linux or multiboot are specified at the same > time, it will report an error message. >=20 > But I feel that this is not elegant, it will make code difficult to > read. I am a beginner of scheme. Could you give me some advice? >=20 > --- >8 --- =20 >=20 > (match entry > (($ label device mount-point linux linux-arguments > initrd #f () () #f) > `(menu-entry (version 0) > (label ,label) > (device ,(device->sexp device)) > (device-mount-point ,mount-point) > (linux ,linux) > (linux-arguments ,linux-arguments) > (initrd ,initrd))) > (($ label device mount-point #f () #f > multiboot-kernel multiboot-arguments > multiboot-modules #f) > `(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))) > (($ label device mount-point #f () #f #f () () > chain-loader) > `(menu-entry (version 0) > (label ,label) > (device ,(device->sexp device)) > (device-mount-point ,mount-point) > (chain-loader ,chain-loader)))) >=20 > --- <8 --- I prefer this variant where the pattern is explicit. As with what we have today, if the user specifies more than one of linux, linux-multiboot and chainloader, they get an unhelpful "no matching pattern" error. This could be done later if you don't have time, but I would suggest to fix it by adding a default case that matches all incorrect cases, like so: (_ (raise (condition (&message (message (G_ "Your error message here")))))) Have a look at other "&message" conditions for inspiration. Also I noticed that if all of linux, linux-multiboot and chainloader are #f, then the first pattern matches and will lead to a different error message. I haven't tested so I'm not sure what we get, but it might be interresting to match on all of them being #f, and print a different message. Again, this can be done later. >=20 > > I'm not too familiar with chainloading. Is using grub partition > > names like (hd0,gpt1) the only way? We try to discourage using > > these names as they can easily vary between reboots and your system > > unbootable.=20 >=20 > It can also use device to specify the disk partition. The following is > the menu-entry that I am using. >=20 > --- >8 --- =20 >=20 > (menu-entries > (list > (menu-entry > (label "ArchLinux") > (device (uuid "1C31-A17C" 'fat)) > (chain-loader "/EFI/ArchLinux/grubx64.efi")))) >=20 > --- <8 --- >=20 > The examples in the document were written before the bug#57307 was > fixed. At that time, only this example passed the test on my > computer. I didn't take into account that the example was bad. I'm > sorry. This new example is perfect. Could you add it to your next patch? >=20 > I'm sorry, because I don't know how to paste the code snippet in the > mail. After seeing your reply, after a long search, no good example > was found. I don't know if there is a problem when I write the code > snippet like this. If there is any problem, I'm sorry. They came out fine. I don't use anything fancy to read emails, so I don't really care. I think emacs might have something to show snippets of code better. >=20 > Thank you very much for checking and correcting my patches. Could you send a v2 with the changes we discussed so far? Thanks, Julien >=20 > Thanks, > tiantian >=20 >=20 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 15:52:26 2022 Received: (at 57496) by debbugs.gnu.org; 31 Aug 2022 19:52:26 +0000 Received: from localhost ([127.0.0.1]:40543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTTlB-0006fy-Pv for submit@debbugs.gnu.org; Wed, 31 Aug 2022 15:52:26 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:44994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTTl7-0006fm-T4 for 57496@debbugs.gnu.org; Wed, 31 Aug 2022 15:52:23 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by andre.telenet-ops.be with bizsmtp id EKs42800820ykKC01KsGFG; Wed, 31 Aug 2022 21:52:20 +0200 Message-ID: <2f6a4ba8-6fa6-7452-6cbc-17733b7e71d8@telenet.be> Date: Wed, 31 Aug 2022 21:52:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US To: typ22@foxmail.com, 57496@debbugs.gnu.org References: From: Maxime Devos Subject: Re: [bug#57496] [PATCH 0/2] Add support for chain-loader In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------49o9RbI09kmtui62vsvQDfdV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1661975540; bh=2ndO2RpOLQdGeFyoMhrnQt1BZjrgSkgVqqXMxfQeOR4=; h=Date:To:References:From:Subject:In-Reply-To; b=aOaulY3ByUKsYDwZHOd1L0Rg+dRrqvYwfRsVdHiSCYI7TfveaW30iTBe2hfO1a7dv +Htnxk4w8VyUaLfB6FWN+GjIrgPB7Y8LhtmnU+bK/x93YplRU0XvcFq//FvvXv4tAF Fu+XiGnkcLnWn8EDKwmQn8Ewfb8Nd8lVLdg3j3RtJU/Qz8884Jx8kRX6wTB5ZR1A3s 0HsHHaQRwng6I172q8WALLc2ePGq5iojCVmJeYt3Q1fKd2H9LXyShPLa95cVnS95x4 /rXu9Quu1oBs0lh4Q13vmo6bgA8Ekrt3n7iv0NfuEAw2HJxIXTTyAXBNx+fGZT1ToM QLmB4UrYScgAQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 57496 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------49o9RbI09kmtui62vsvQDfdV Content-Type: multipart/mixed; boundary="------------7T00Kgnd1Gq190umbX0UZag0"; protected-headers="v1" From: Maxime Devos To: typ22@foxmail.com, 57496@debbugs.gnu.org Message-ID: <2f6a4ba8-6fa6-7452-6cbc-17733b7e71d8@telenet.be> Subject: Re: [bug#57496] [PATCH 0/2] Add support for chain-loader References: In-Reply-To: --------------7T00Kgnd1Gq190umbX0UZag0 Content-Type: multipart/mixed; boundary="------------g77GT82PLV0dzHmIpanyFYOS" --------------g77GT82PLV0dzHmIpanyFYOS Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 PiBXaHkgZG8gSSB3YW50IHRvIHVzZSBjaGFpbmxvYWRlciBpbnN0ZWFkIG9mIGxpbnV4IGFu ZCBpbml0cmQ/DQo+DQo+IDEuIGd1aXggc3lzdGVtIGFuZCBhcmNobGludXggYXJlIGluZGVw ZW5kZW50IG9mIGVhY2ggb3RoZXIgaW4gbXkgY29tcHV0ZXIuDQo+IFRoZXkgYXJlIGp1c3Qg b24gdGhlIHNhbWUgY29tcHV0ZXIsIGJ1dCB0aGV5IGhhdmUgdGhlaXIgb3duIGRpc2sgcGFy dGl0aW9ucy4NCj4gSSBhbHNvIGRvbid0IHdhbnQgdGhlbSB0byBpbnRlcmZlcmUgd2l0aCBl YWNoIG90aGVyLg0KPiAoSSBoYXZlIG5vIG1vbmV5IHRvIGJ1eSBtb3JlIGNvbXB1dGVycy4g SSBqdXN0IGhhdmUgb25lIGNvbXB1dGVyLikNClNvdW5kcyBhIHByYWN0aWNhbCBzeXN0ZW0g dG8gbWUuDQoNCk9uIDMxLTA4LTIwMjIgMDc6MjMsIHR5cDIyQGZveG1haWwuY29tIHdyb3Rl Og0KPiBJcyB0aGUgY2hhaW4tbG9hZGVyIGZyZWU/DQo+DQo+IFRoZSBjaGFpbi1sb2FkZXIg aXMgYSBmdW5jdGlvbiBvZiBncnViLCBhbmQgZ3J1YidzIHByb3RvY29sIGlzIEdQTDMuDQo+ IEkgdGhpbmsgaXQgaXMgZnJlZS4gQWx0aG91Z2ggY2hhaW4tbG9hZGVyIGNhbiBib290IG5v bmZyZWUgc3lzdGVtIGxpa2Ugd2luZG93cywNCj4gaXQncyBsaWtlIG5vbmZyZWUgc29mdHdh cmUgY2FuIHJ1biBvbiBsaW51eC1saWJyZSwgYW5kIGxpbnV4LWxpYnJlIGlzIGZyZWUuDQo+ DQo+IElmIEd1aXggdGhpbmsgaXQncyBub25mcmVlLCBJIHdpbGwgb25seSBrZWVwIHRoZXNl IGNoYW5nZXMgaW4gbXkgY29tcHV0ZXIuDQoNCkkgZG8gYmVsaWV2ZSBpdCBjb3VudHMgYXMg ZnJlZSwgZXNwZWNpYWxseSBnaXZlbiB0aGF0IGl0IGNhbiBiZSB1c2VkIHRvIA0KYm9vdCBp bnRvIG90aGVyIGZyZWUgc3lzdGVtcyAoZS5nLiwgVHJpc3F1ZWwpIGFuZCB0aGF0IHlvdSBl eGFtcGxlIHVzYWdlIA0KaXMgZm9yIGJvb3RpbmcgaW50byBhIGxhcmdlbHktZnJlZSBzeXN0 ZW0uDQoNCkdyZWV0aW5ncywNCk1heGltZS4NCg== --------------g77GT82PLV0dzHmIpanyFYOS Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------g77GT82PLV0dzHmIpanyFYOS-- --------------7T00Kgnd1Gq190umbX0UZag0-- --------------49o9RbI09kmtui62vsvQDfdV Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYw+75AUDAAAAAAAKCRBJ4+4iGRcl7lb7 AP9v2/xqL91sB+PLcYCjXMWNl6KCRiAFT9KeIjzgjqFyoQEAjck/QDxfSenKC6fSlgLmT1Hj4ND9 93oiPl1WsWhwLwQ= =NZ+q -----END PGP SIGNATURE----- --------------49o9RbI09kmtui62vsvQDfdV-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 23:50:39 2022 Received: (at 57496) by debbugs.gnu.org; 1 Sep 2022 03:50:39 +0000 Received: from localhost ([127.0.0.1]:40830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTbDz-0006K7-8F for submit@debbugs.gnu.org; Wed, 31 Aug 2022 23:50:39 -0400 Received: from out162-62-57-252.mail.qq.com ([162.62.57.252]:41701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTbDu-0006Je-LC for 57496@debbugs.gnu.org; Wed, 31 Aug 2022 23:50:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662004225; bh=sqt04XIdmMx5m4kvae7xf9WbWCZ21NbUW96Tos4Rwc8=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=P8ZSf7uZGsxyjGJTRLFoojGv5a2g0vGZ9wiVHP5mmPj8MHpZKMC1ZeUa91eErUsZS owx43HyLX7IU3gMf8s5IdaDoasCZsUe3D7nd+f9OhUZs931D8/A75MaqRBaDknYAAC awI7tdNcGJKzne9HvTPn5zGRPLBmIIvOES/Q46ww= Received: from guix-pc ([240e:398:28aa:8901:2e5d:53be:47ef:3da]) by newxmesmtplogicsvrszc14.qq.com (NewEsmtp) with SMTP id C97318C3; Thu, 01 Sep 2022 11:50:23 +0800 X-QQ-mid: xmsmtpt1662004223to7goyjla Message-ID: X-QQ-XMAILINFO: NvwY87CbqCKFsbStepyZB80PXFLNiLwooNyZhvq/6dR4EQ1/C+J142GCVbE3rr f4fNRnrcxizrzDRqLOvAb7w/D/S+fJ9ncYiQmBJEvcAGdvIjZWdq+FgtaFYiPkmffB6TkNmo+RAX Rmq6fPw6Ar/vFhVZB1nB8epQa1gJUY6OrcRnJ6RN8BPotSFpMLyIeuAb/JM9KqxjhPsKBsGtCvsG 8v3gLEURMyEpVWxdM3CfvTOvFQT5ixXfGZuXHkmZV90hRzYC3gY5DujHct/Aa357oMM7fRwI2JP/ fUuCXwxtVQE8q58O1oLML1rl4RmE8vaMz6x4JXILla/ZNo9bTYz1LF3+BTW1AYIE+Tp1zjeSMWg0 aJf+/yjjZ3U1CXbrRa6rp/c4R7CCfIzsxJI9jPs0ml6i1Djan0leZw7JuR/phH3wa+9Ovk3nNlO0 taEPmc/KpswQDZ6XCytOvId7auRn9ddAmU8bIOlRGm5OEp5RE/8k8q0979ju8bzAY80ezIfSlGho bVQUzPCJXWkuRfYDgOIctKorJSIxENdyf5ONVZViRqNdLrYvoUwqVAyicLAdRr33354utEByPVgz 4ArJbDZ8DlH+xavsazhDTLiUTm4ZhCTWlDJYPB7bN0iNibXqV96zlq/7ijqbwjtBGVsBcUstWEAs Ij6y/3s3qdFX9+XDU7TcmR+7HsCJBOiD+V+bRxfyl1QBme/Cj0YVgZHYOuoKizrd9rd1VWVGZzAM n6mh6PC8ZRj8JXhfDw88Zkje81llWq6XdlRLm5Cd0ZV1Mf9ybQpAvNNF6qI3yYZfN4FEnFyOLOOu UeeRWIkozfVYS7Ifo4eRKJO6jggY7G0jhuKgQrZfH/WmeRa5vk001InNr60r5Ucu56lfKuSUdno8 cGQgsudtzq8g2w7N1wFJXgHvfJ48MpzlLs+lkctENVwGgtJmesIEWbIcDzcOM2oDMQbBQqtPNsuE gRpGreBnYYxJzopzLlPKWZ9/CqssRU References: <55016216-84d9-e2e6-8bf5-0efdfa0e6ac1@foxmail.com> <20220831213406.3ec92474@sybil.lepiller.eu> User-agent: mu4e 1.8.9; emacs 28.1 From: tiantian To: Julien Lepiller Subject: Re: [bug#57496] [PATCH 1/2] gnu: bootloader: Extend `' for chain-loader. Date: Thu, 01 Sep 2022 10:33:51 +0800 In-reply-to: <20220831213406.3ec92474@sybil.lepiller.eu> Message-ID: <7xy1v37ny8.fsf@foxmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Julien Lepiller writes: > Le Thu, 1 Sep 2022 01:55:34 +0800, > tiantian a écrit : > >> Dear Mr/Ms Lepiller, >> >> I'm sorry. I didn't notice the wrong sender name. > > You don't have to apologize. I received your email an [...] Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.252 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.252 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: 57496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Julien Lepiller writes: > Le Thu, 1 Sep 2022 01:55:34 +0800, > tiantian a écrit : > >> Dear Mr/Ms Lepiller, >> >> I'm sorry. I didn't notice the wrong sender name. > > You don't have to apologize. I received your email an [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.252 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.252 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hi, Julien Lepiller writes: > Le Thu, 1 Sep 2022 01:55:34 +0800, > tiantian a =C3=A9crit : > >> Dear Mr/Ms Lepiller, >>=20 >> I'm sorry. I didn't notice the wrong sender name. > > You don't have to apologize. I received your email and I didn't even > notice the sender name :) > Thank you for your generosity. > > Let's try something like this: > > @item @code{chain-loader} (default: @code{#f}) > A string that can be accepted by @code{grub}'s @code{chainloader} > directive. This has no effect if either @code{linux} or > @code{linux-multiboot} fields are specified. The following is an > example of chainloading a different GNU/Linux system. > Thank you for your help. I will change it in next patch. But I have a little doubt. 'linux-multiboot' has never appeared in the documentation. Will it be difficult to understand the document? I don't know much about multiboot. I haven't seen the "linux-" prefix in multiboot before. Does multiboot only support linux? > > OK, I see now. I don't really understand why they were separate, but > let's keep them separate for now. > OK, I will keep them separate. > > I prefer this variant where the pattern is explicit. > > As with what we have today, if the user specifies more than one of > linux, linux-multiboot and chainloader, they get an unhelpful "no > matching pattern" error. > > This could be done later if you don't have time, but I would suggest to > fix it by adding a default case that matches all incorrect cases, like > so: > > (_ (raise (condition (&message (message (G_ "Your error message > here")))))) > > Have a look at other "&message" conditions for inspiration. > > Also I noticed that if all of linux, linux-multiboot and chainloader > are #f, then the first pattern matches and will lead to a different > error message. I haven't tested so I'm not sure what we get, but it > might be interresting to match on all of them being #f, and print a > different message. Again, this can be done later. > Thank you for your suggestions. I will use in the pattern to specify all fields of in next patch. I didn't know how to throw an error message before. I may need to spend time reading code and learning. If possible, I will implement it in v3 patch. >> It can also use device to specify the disk partition. The following is >> the menu-entry that I am using. >>=20 >> --- >8 ---=20=20 >>=20 >> (menu-entries >> (list >> (menu-entry >> (label "ArchLinux") >> (device (uuid "1C31-A17C" 'fat)) >> (chain-loader "/EFI/ArchLinux/grubx64.efi")))) >>=20 >> --- <8 --- >>=20 >> The examples in the document were written before the bug#57307 was >> fixed. At that time, only this example passed the test on my >> computer. I didn't take into account that the example was bad. I'm >> sorry. > > This new example is perfect. Could you add it to your next patch? > No problem. In order to avoid the possible controversy over the Linux distribution, I will change ArchLinux to GNU/Linux. > > Could you send a v2 with the changes we discussed so far? > > Thanks, > Julien > No problem. I will finish v2 patch as soon as possible. The mail server seems to have rejected my last mail, which is not displayed in the mail list. I hope this email can be displayed normally. Thanks, tiantian From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 31 23:53:36 2022 Received: (at 57496) by debbugs.gnu.org; 1 Sep 2022 03:53:36 +0000 Received: from localhost ([127.0.0.1]:40834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTbGq-0006OZ-07 for submit@debbugs.gnu.org; Wed, 31 Aug 2022 23:53:36 -0400 Received: from out162-62-58-211.mail.qq.com ([162.62.58.211]:44311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTbGn-0006OG-D2 for 57496@debbugs.gnu.org; Wed, 31 Aug 2022 23:53:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662004404; bh=YzQGYykx5dU96VuP/AGs5zsLyIb40o9xFDoyDnqzF34=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=JfymRxOoMnF9d62LXtzAo3SgnI0pLA9wUsfp/ijTNRtuyHKF6+nozh/92RnA7ijVR qQ1icn/gEgFAD7oHOSnFfl5qyLKQ9z7utsfzAdv5lZmsSE4DspFSwj3c9C9dKMWOs3 oo+xACNZEioT+0DILQs6ob/hIkiK2+X5FXW9yq2U= Received: from guix-pc ([240e:398:28aa:8901:2e5d:53be:47ef:3da]) by newxmesmtplogicsvrsza5.qq.com (NewEsmtp) with SMTP id D56942D8; Thu, 01 Sep 2022 11:53:22 +0800 X-QQ-mid: xmsmtpt1662004402tk9ahxr2u Message-ID: X-QQ-XMAILINFO: OEgU9iHXvJ5F/ldtIkpoEtnM5bReC6o6UKcr3ebRQTo5VhSjRD1dt7Ghn3M/CH 8/f12+QmU12wmBxMeBK/mvG5XbrAnhJcC3PgE10oHhF/4XnEPyvNZla6QjF6hHeGOVkR9C5rNUSv 6U+TPgI28XMchFEPBEFmEGgp8udUTp3leroOEF4GKHxu3RDXd4AAgv0goCBMyA62Q/GBGTSPni45 j8gEXtBXHEsfPVQnKVkggrMsxi+PXY0do4ClQYcs6RyOPvCwKmV+qJK9GRlq8EjVd9THrTG6dvIS Zg6ytrq9/3Fukn+21jsguUysDzKAcP6ffXgtBJHkHUWwpsNbk1f1PJUsnHEctIn03a3SGdN4mSCa Rg4VGwQ1iD5DPvu+xxP0a4SD95WI18ALdoSYmdMjwEgg4oNTf7t3l3Tap9LaodzXO6Gjd7F6qSMe 25j2BMqMgpEb6NXqvxRN/0bIIliVCkidzjN+rlyOqGcM1woY6SFT9vfsHROTiclgSTnzOJomQY0y ifUuIC8mszbtwtG8sMQUSmyFDbtXrCqFz5ZljtxDYxFNWg6Q1YDRSq6gOmG25S4gY8kGvHF0ky+I WchWP5TNHRgLdoTrP0IyVsQKavY4b6Bn8xWqIBlZ00o7tfNb+IhSzsFxHo0AQ+ldrtwMRS46iup7 HsF+P4w0WeKa/eY4REG94GRuzXK2P+/ueXhJc6MUOaDwpn7RAY9fD1qw9Pduo8kTB9qlpqGSNKik KCIHSQoB3CoK1zuSjxCPbOsyTNQpWwywezrN7GsnfX7cphn2uOzPCRQBk8X30ldsIITG3T0QFkoc OKXvJGBsn0bKYlDDpOLqAzAIQDfaHrLCfm/cK2qn+umJ6xNmuDj+mxXqp+8Pk7/bDIMLDdunE1EQ xP9skZXGuZ5XlOTfcPfUGPqEGo9EJaAuSdbon4/AF2DjH0kyFFO8E2R9Ntlgv3iDBq5aDhKtfAJa IvQgyeKEoNWDu5sF0Frf6Aa+o9qEwwcgnbqIhD6hsSeBf75vSYTLZqdfjp1lm0 References: <2f6a4ba8-6fa6-7452-6cbc-17733b7e71d8@telenet.be> User-agent: mu4e 1.8.9; emacs 28.1 From: tiantian To: Maxime Devos Subject: Re: [bug#57496] [PATCH 0/2] Add support for chain-loader Date: Thu, 01 Sep 2022 11:51:51 +0800 In-reply-to: <2f6a4ba8-6fa6-7452-6cbc-17733b7e71d8@telenet.be> Message-ID: <7xtu5r7nt9.fsf@foxmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Maxime Devos writes: > [[PGP Signed Part:Undecided]] >> Why do I want to use chainloader instead of linux and initrd? >> >> 1. guix system and archlinux are independent of each other in my computer. >> They are just on th [...] Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.58.211 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: 57496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Maxime Devos writes: > [[PGP Signed Part:Undecided]] >> Why do I want to use chainloader instead of linux and initrd? >> >> 1. guix system and archlinux are independent of each other in my computer. >> They are just on th [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.58.211 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hi, Maxime Devos writes: > [[PGP Signed Part:Undecided]] >> Why do I want to use chainloader instead of linux and initrd? >> >> 1. guix system and archlinux are independent of each other in my computer. >> They are just on the same computer, but they have their own disk partitions. >> I also don't want them to interfere with each other. >> (I have no money to buy more computers. I just have one computer.) > Sounds a practical system to me. > > On 31-08-2022 07:23, typ22@foxmail.com wrote: >> Is the chain-loader free? >> >> The chain-loader is a function of grub, and grub's protocol is GPL3. >> I think it is free. Although chain-loader can boot nonfree system like windows, >> it's like nonfree software can run on linux-libre, and linux-libre is free. >> >> If Guix think it's nonfree, I will only keep these changes in my computer. > > I do believe it counts as free, especially given that it can be used > to boot into other free systems (e.g., Trisquel) and that you example > usage is for booting into a largely-free system. > > Greetings, > Maxime. > > [2. OpenPGP public key --- application/pgp-keys; OpenPGP_0x49E3EE22191725EE.asc]... > > [[End of PGP Signed Part]] Thank you for your support. thanks, tiantian From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 01 02:07:37 2022 Received: (at 57496) by debbugs.gnu.org; 1 Sep 2022 06:07:37 +0000 Received: from localhost ([127.0.0.1]:40929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTdMX-0003j5-D0 for submit@debbugs.gnu.org; Thu, 01 Sep 2022 02:07:37 -0400 Received: from out162-62-58-216.mail.qq.com ([162.62.58.216]:40675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTdMR-0003ih-1k for 57496@debbugs.gnu.org; Thu, 01 Sep 2022 02:07:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662012441; bh=SsO0yw3IWx4S7Zt6XoEv8cNabDCsWEZhp2icrQaSPLw=; h=From:To:Cc:Subject:Date; b=EDfEJz03ubWE5ns1KwcffDejcyk1pjKr1Jc93e4jt7EijrWoQf7Sg9Pwu5YtrCqtj VQ16lt+5H7Cyz3rUOs0ORhOSv3F72y6cjdG7+NLprUHbJ4WypC1vKryN//aG9kVUIR h55luuR0YO9JtBz0Ta1wZSuii6CtZE6a/w89RQt8= Received: from localhost.localdomain ([240e:398:28aa:8901:2e5d:53be:47ef:3da]) by newxmesmtplogicsvrsza8.qq.com (NewEsmtp) with SMTP id 1D3814E2; Thu, 01 Sep 2022 14:07:19 +0800 X-QQ-mid: xmsmtpt1662012439twdwxlczr Message-ID: X-QQ-XMAILINFO: N26DAMVpW7UE8z1FnMpNkIXgdk+jWk3l/qrz93gldkk/y180eNQy01yItFu0ZI 84RSeclE6jCqabSUlEgXt5dXxCkdQ6Do4w7kzhYEdNAFyvWPZqXJBERB64wiiZBNTCkavtgpT8zC 1lgYo9yx6xa7lzFXPQXQ2RT7ZAhpFr9YA3b3Om5ozm1OGCOyRXS3+VQr9bCdx5NvWNP72BLcF8iQ wdArPJyGZbiY+MHZ4TpAFvglbz18YzkkacXdny3o2CjsM4HYOuHyHghVSxN/3bcMFI1j1rpj2qFE 2CvDFuRp36B4C+7GmYDI8da4YO8xIC6y9kjIMGWa8WUZy8SR7wA5Z1t8QPxMK63b+Sk7sMNpQAqT ZdcqX6ev6SuTJoprN6OJ2wezLha7IkmT3weCpKoSTRmV6atFm5FZcqPA32ZLtDezMnJ0gRLOXRgJ 1xGIm/XNS0ChTakTsmtOUNVIPdad7zOs9xKSt46uQ2B1qtS8YWSwDQ73x4pkbkxSrNJa3guIZSg8 4aWfnq+32qy99dWFYsPwF4o9EHRki+9w8Q2/lS3Mz6uIQQLeqTeyLfBtS4dPRY7AJyi+EBNYR4Yv QhcdYbuhx8lT8YoVRslvif5EqbvsQ3PZCONdnBgxA/7O3pv9N93QBShDBzxgNtNYUS5rHALe8Ems hS7hTj0V4u3ApYHyGHXApL3MWwZJ1cBTOGoBjonUujn1OrJEz4YtBPTMFFHu0T03ElLNP97sLBY+ Vj4c82o7/z8NFtDNiQBSwl3XJSj/tpex/YG00Z2nZD8qZ4TSUDW4RX2aNBcfRWYmflkadFJFTiOB OajEzMB86EOT8lgCXP0Nj3RA/5wCu58RyaOxDZC4kf1nmAqWexYrSpcbZ70LeRLhKSy6fF0uqFov 9qOjq8Wyhn5rXaZGYUbKIJ0e7ppKhgDsvdsU9z8ANVpjqe3TCDm9/5mQ+fCbBCcHyMbG2cqau2pV hUfMuRQEzDiXLOGE3XDAtJrGIW61APlCGIvqrhH6JSV+3N8aBZzGw2x4z448J8/ZPUopnq4IQ= From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH v2 1/2] gnu: bootloader: Extend `' for chain-loader. Date: Thu, 1 Sep 2022 14:03:14 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. --- Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.58.216 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: Julien Lepiller , tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. --- Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.58.216 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. --- Correct the document and specify all fields of in the pattern of menu-entry->sexp. Now still judge linux, multiboot-kernel and chain-loader. Because if don't judge, the menu-entry that all of linux, linux-multiboot and chainloader are #f will match the first one. Then produce Error message: guix system: error: #: invalid G-expression input This error message does not help. doc/guix.texi | 18 ++++++++++++++++++ gnu/bootloader.scm | 34 ++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 957b9a668e..3f0317ba60 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37536,6 +37536,24 @@ Bootloader Configuration @dots{})) @end lisp +@item @code{chain-loader} (default: @code{#f}) +A string that can be accepted by @code{grub}'s @code{chainloader} +directive. This has no effect if either @code{linux} or +@code{linux-multiboot} fields are specified. The following is an +example of chainloading a different GNU/Linux system. + +@lisp +(bootloader + (bootloader-configuration + ;; @dots{} + (menu-entries + (list + (menu-entry + (label "GNU/Linux") + (device (uuid "1C31-A17C" 'fat)) + (chain-loader "/EFI/GNULinux/grubx64.efi")))))) +@end lisp + @end table @end deftp diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 77c05e8946..03c18ad0c9 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -46,6 +46,7 @@ (define-module (gnu bootloader) menu-entry-multiboot-kernel menu-entry-multiboot-arguments menu-entry-multiboot-modules + menu-entry-chain-loader menu-entry->sexp sexp->menu-entry @@ -104,8 +105,11 @@ (define-record-type* (multiboot-arguments menu-entry-multiboot-arguments (default '())) ; list of string-valued gexps (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 + (define (menu-entry->sexp entry) "Return ENTRY serialized as an sexp." @@ -117,8 +121,9 @@ (define (menu-entry->sexp entry) `(label ,(file-system-label->string label))) (_ device))) (match entry - (($ label device mount-point linux linux-arguments initrd #f - ()) + (($ label device mount-point + (? identity linux) linux-arguments initrd + #f () () #f) `(menu-entry (version 0) (label ,label) (device ,(device->sexp device)) @@ -127,14 +132,22 @@ (define (menu-entry->sexp entry) (linux-arguments ,linux-arguments) (initrd ,initrd))) (($ label device mount-point #f () #f - multiboot-kernel multiboot-arguments multiboot-modules) + (? identity multiboot-kernel) multiboot-arguments + multiboot-modules #f) `(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))))) (define (sexp->menu-entry sexp) "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a @@ -171,7 +184,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) _ ...) + (menu-entry + (label label) + (device (sexp->device device)) + (device-mount-point mount-point) + (chain-loader chain-loader))))) ;;; base-commit: 6beadc82df204f315d06ea35f2e232bb32f8e440 -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 01 02:08:15 2022 Received: (at 57496) by debbugs.gnu.org; 1 Sep 2022 06:08:15 +0000 Received: from localhost ([127.0.0.1]:40934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTdN8-0003kK-Tm for submit@debbugs.gnu.org; Thu, 01 Sep 2022 02:08:15 -0400 Received: from out162-62-57-49.mail.qq.com ([162.62.57.49]:49329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTdN5-0003k1-8Q for 57496@debbugs.gnu.org; Thu, 01 Sep 2022 02:08:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662012483; bh=mqgUZOfI1m3e4AZZBbv7sM++22VKoKxajGTlnm9JE5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VrZn4ttGfXaKg28fMM/P5f1//1+uEE5tJSpDF5tGWg4fqfAouetymgjbDhi+TQbB3 9ikFLkgfLGDkL23r0LwbJgAzqu5y6QNCjDDb3/H0MWYk2vr6On9vywlIcU3kKQtar3 qqhotFxg8NOCsAg3cWiBmmJJetKS8d6VPdDAZYbc= Received: from localhost.localdomain ([240e:398:28aa:8901:2e5d:53be:47ef:3da]) by newxmesmtplogicsvrsza8.qq.com (NewEsmtp) with SMTP id 1D3814E2; Thu, 01 Sep 2022 14:07:19 +0800 X-QQ-mid: xmsmtpt1662012440tnn6l8rr7 Message-ID: X-QQ-XMAILINFO: NJ/+omVLhVgarxyTT2DPiqDdjK5D7iWWm/wiu17EWGa3dsoW6CoGRxj2wQZxM2 9WbX5jx2PvaFw5EvsPqR+8zT0GeXZmw8nYE8Cw0pNcLJd4rElYWm5Qffwo0hadSgvtW33d0EOdUJ CoMaoFOCVvGr8fb8xmKwj4z8ysJiYE+pL4b7MemMtLZkPzf6HiVnU5EXaoFOXRDwBTfPFaMg533N +9UryUg9RWB22pxwWqn1qj1N56ATHmbaOWJys+wQXVKqr7YqnWVo9qC0oR2y5AicyNBC76T99+J1 c7EeffW74odvyXmvD68aSJiLa/L2vROPTro/kRG7M7rF4FrZxFpudgjGmTANai/3UE05IyS1es5n fNK5CP/ikk/nGcPwrbWUbQt9Fs1wpUnXyLyKN+UsJh9Zf5GFxzd+ddYcWCSNLDp/JmS/QLASbvsN PY9TTlhMY9snk3sVCDAjOhjrdbDmlfhfziSg0dYP75t0Ei+RYlZvcwYqBChq7V6oBVAJ9FuDEQHA hxIoBshSoIIdkmMP4VGkWPHqnxFKQzxrt0YB9EFVKfimYKdHN4dmfhJEBifhT+wrnIFjAA5n/5Gj AwHk/5d9quaSZcTkOOQ2kK3M0t7h5U5ojdGMFhBYYSoChWy5G8h4ctpuPKgWB6yaCBea3FkC0opx WOfy2dvCWDaFnfDn6DnPe7N3Ftia+s2SHe9VdUjK1pbg7P0G+ynVm5x5QPXp6OxFrzk9p2RcI0Mg KV56Ildwvht9miJ6U0pm8bbvXJl4bhLHVs6ytBdvT+jjfA695j4mZbrX/hJHEkgHJVVZ1nS1nsD3 G/OareOZIxg2FxMTbSl8poqx5bmykV0u9+/zLjMt5UKSrzUNT0zZElzGqFTdLtKZ22kSKV9dnzTU jjmXVIvB3bOOs1qI8PBKByn2RHV02lbQItgQdbR9gsJ5YqDw4mRpNefD7erbU56SPCjwEp/Ly0a1 q84jDJ2bDFJV68VK8wkwB7ZA7ImXWA2OHdLUmMHsH0b6IkPIqWkdqeME6xL7hgVH9/vwJ8Yeg= From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH v2 2/2] gnu: bootloader: grub: Add support for chain-loader. Date: Thu, 1 Sep 2022 14:03:16 +0800 X-OQ-MSGID: <91016c9aa9267b0b19fdb30f203cc78db9c4162e.1662010955.git.typ22@foxmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- It is no different from v1 patch. Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.49 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.49 listed in list.dnswl.org] 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: Julien Lepiller , tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- It is no different from v1 patch. Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.49 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.49 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- It is no different from v1 patch. gnu/bootloader/grub.scm | 73 ++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 4f18c9b518..7283257354 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -374,44 +374,57 @@ (define* (grub-configuration-file config entries (let ((label (menu-entry-label entry)) (linux (menu-entry-linux entry)) (device (menu-entry-device entry)) - (device-mount-point (menu-entry-device-mount-point entry))) - (if linux - (let ((arguments (menu-entry-linux-arguments entry)) - (linux (normalize-file linux - device-mount-point - store-directory-prefix)) - (initrd (normalize-file (menu-entry-initrd entry) - device-mount-point - store-directory-prefix))) - ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. - ;; Use the right file names for LINUX and INITRD in case - ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a - ;; separate partition. - - ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and - ;; initrd paths, to allow booting from a Btrfs subvolume. - #~(format port "menuentry ~s { + (device-mount-point (menu-entry-device-mount-point entry)) + (multiboot-kernel (menu-entry-multiboot-kernel entry)) + (chain-loader (menu-entry-chain-loader entry))) + (cond + (linux + (let ((arguments (menu-entry-linux-arguments entry)) + (linux (normalize-file linux + device-mount-point + store-directory-prefix)) + (initrd (normalize-file (menu-entry-initrd entry) + device-mount-point + store-directory-prefix))) + ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. + ;; Use the right file names for LINUX and INITRD in case + ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a + ;; separate partition. + + ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and + ;; initrd paths, to allow booting from a Btrfs subvolume. + #~(format port "menuentry ~s { ~a linux ~a ~a initrd ~a }~%" - #$label - #$(grub-root-search device linux) - #$linux (string-join (list #$@arguments)) - #$initrd)) - (let ((kernel (menu-entry-multiboot-kernel entry)) - (arguments (menu-entry-multiboot-arguments entry)) - (modules (menu-entry-multiboot-modules entry)) - (root-index 1)) ; XXX EFI will need root-index 2 - #~(format port " + #$label + #$(grub-root-search device linux) + #$linux (string-join (list #$@arguments)) + #$initrd))) + (multiboot-kernel + (let ((kernel (menu-entry-multiboot-kernel entry)) + (arguments (menu-entry-multiboot-arguments entry)) + (modules (menu-entry-multiboot-modules entry)) + (root-index 1)) ; XXX EFI will need root-index 2 + #~(format port " menuentry ~s { multiboot ~a root=device:hd0s~a~a~a +}~%" + #$label + #$kernel + #$root-index (string-join (list #$@arguments) " " 'prefix) + (string-join (map string-join '#$modules) + "\n module " 'prefix)))) + (chain-loader + #~(format port " +menuentry ~s { + ~a + chainloader ~a }~%" #$label - #$kernel - #$root-index (string-join (list #$@arguments) " " 'prefix) - (string-join (map string-join '#$modules) - "\n module " 'prefix)))))) + #$(grub-root-search device chain-loader) + #$chain-loader))))) (define (crypto-devices) (define (crypto-device->cryptomount dev) -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 01 23:37:58 2022 Received: (at 57496) by debbugs.gnu.org; 2 Sep 2022 03:37:58 +0000 Received: from localhost ([127.0.0.1]:44574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTxVF-0002Lu-HU for submit@debbugs.gnu.org; Thu, 01 Sep 2022 23:37:58 -0400 Received: from out203-205-221-155.mail.qq.com ([203.205.221.155]:54569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTxVA-0002LZ-UT for 57496@debbugs.gnu.org; Thu, 01 Sep 2022 23:37:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662089864; bh=uEFEP+r3JPHu2K+bJZavlSwb4dnXkmI4a38xnrDLYb8=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=qjQSWIpBCUoeI4tIZgZYB0alYWf1bFDAg6fz1GoM0ZhItZHjzxSrKK2ZzBtN34lJG 5vyycFjMO4sbjZKBL7/IqfVVi2BJYkeWGAc1bTXCkDK8ScLudeLaIGvNyuvB/kUKIR j8JmHOl633XoNKzexFESXlO1CteO26fiFTFp6YLk= Received: from guix-pc ([240e:398:28aa:8901:2e5d:53be:47ef:3da]) by newxmesmtplogicsvrsza8.qq.com (NewEsmtp) with SMTP id 96A8F8E5; Fri, 02 Sep 2022 11:37:42 +0800 X-QQ-mid: xmsmtpt1662089862t9vazfz6k Message-ID: X-QQ-XMAILINFO: ORuEwgb9eurkKnyOHDS9QBwGxKGlyiOdY7S5hCj1ytRsTPuiZN4S47Sru0fFfk YTNkft5y54T33XtYufbRvb+Qm/tcupMS11uhEUWCXuTe2YxgUsXDtGxoA8yKljhchRhFBAhOpfcJ I/juH0IHgSlc91IwzL4EgF5/AV4MWNWnJOxomNQbxZ6O0XH3yzu16XlMHU+1HmqqfvcICwzhTJWo UNzmvbbBrMGngKzM4mDG7QSIEoBMSB8avqziVZ7O9emOI79iRTdAW5zd0MZclWZrf1R+Wi5Go/qu Z5DpQAl/nNsVQRLkiEdZYsCy5toN0nM3PBFInschMw8tLkPywwe1W+YHwP4KmZQTwaDwxRSqSz+8 ZEoDSk3jlm4HmtJq4W/4eTw8UKCvWeT0FGY2nL+TS04TinGCHDne9ejxRg6q5VEoxrKdHoq38Q79 xNP4MxcnQUNGmvBSgIVpZIf2X7WrvXDlT+LVrVVfI2iBrj5fiUoA8qW2QbHthJ1hr+m3xRhmD5vn 2rwY/0tD8RZ6GCJnPWdLk9LOTbOWJkLhSZOH9/nEq95n7X+sV8f1i/n3c0kWYJEQyPDylmDfrEEM VmCUHcEedz0wQNGlXgH788nQwqNvPmVfcxZhJYRcbqzwreBMc4BySS2rV3nuI4E+7PI8Ti7dSWR4 9soDcTYEt+Nnp7Y/TOWBWEFsAi2qR8vTdT7qso1s14jLsrS++vUKFxgm2XvtSBBdM/KxjMJPV+Zf mtTF54OItS2R+h8HkZaelH2XqGxh/1s6Gmm+KaHAHBc2z4Pm9+lGjxFOs7Z3N3vRdc7/2hoNrFz7 2bP/mrFt4HQY63PUQVQP/WhyoSkCe/OnWA7Do/dk//svmIYKS6P7DNW29OWLSDLCosYRqhf2Rsvj 6hEvkl5ut4bdREiKU1DXTDEbAKQLtWcDErOQIitlgVlkGK3Rs7hJcUZtiHOe1qQFvBngh9Y7x8iL fGeLidxiVYa7+omATZjegMBXPUYeZz References: <55016216-84d9-e2e6-8bf5-0efdfa0e6ac1@foxmail.com> <20220831213406.3ec92474@sybil.lepiller.eu> <7xy1v37ny8.fsf@foxmail.com> User-agent: mu4e 1.8.9; emacs 28.1 From: tiantian To: Julien Lepiller Subject: Re: [bug#57496] [PATCH 1/2] gnu: bootloader: Extend `' for chain-loader. Date: Fri, 02 Sep 2022 09:04:15 +0800 In-reply-to: <7xy1v37ny8.fsf@foxmail.com> Message-ID: <7xfshacupl.fsf@foxmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Lepiller, >> >> Let's try something like this: >> >> @item @code{chain-loader} (default: @code{#f}) >> A string that can be accepted by @code{grub}'s @code{chainloader} >> directive. This has no effect if eithe [...] Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.155 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [203.205.221.155 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: 57496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Lepiller, >> >> Let's try something like this: >> >> @item @code{chain-loader} (default: @code{#f}) >> A string that can be accepted by @code{grub}'s @code{chainloader} >> directive. This has no effect if eithe [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.155 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [203.205.221.155 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hi Lepiller, >> >> Let's try something like this: >> >> @item @code{chain-loader} (default: @code{#f}) >> A string that can be accepted by @code{grub}'s @code{chainloader} >> directive. This has no effect if either @code{linux} or >> @code{linux-multiboot} fields are specified. The following is an >> example of chainloading a different GNU/Linux system. >> > > Thank you for your help. I will change it in next patch. > > But I have a little doubt. 'linux-multiboot' has never appeared in the > documentation. Will it be difficult to understand the document? I don't > know much about multiboot. I haven't seen the "linux-" prefix in > multiboot before. Does multiboot only support linux? > After reviewing some documents of grub. How about changing "linux-multiboot" to "multiboot" or "multiboot-kernel" in the document? The first is because multiboot is used in grub manual. The scecond is because multiboot-kernel is a field that appears in guix manual. like this: @item @code{chain-loader} (default: @code{#f}) A string that can be accepted by @code{grub}'s @code{chainloader} directive. This has no effect if either @code{linux} or @code{multiboot} fields are specified. The following is an example of chainloading a different GNU/Linux system. or @item @code{chain-loader} (default: @code{#f}) A string that can be accepted by @code{grub}'s @code{chainloader} directive. This has no effect if either @code{linux} or @code{multiboot-kernel} fields are specified. The following is an example of chainloading a different GNU/Linux system. >> >> I prefer this variant where the pattern is explicit. >> >> As with what we have today, if the user specifies more than one of >> linux, linux-multiboot and chainloader, they get an unhelpful "no >> matching pattern" error. >> >> This could be done later if you don't have time, but I would suggest to >> fix it by adding a default case that matches all incorrect cases, like >> so: >> >> (_ (raise (condition (&message (message (G_ "Your error message >> here")))))) >> >> Have a look at other "&message" conditions for inspiration. >> >> Also I noticed that if all of linux, linux-multiboot and chainloader >> are #f, then the first pattern matches and will lead to a different >> error message. I haven't tested so I'm not sure what we get, but it >> might be interresting to match on all of them being #f, and print a >> different message. Again, this can be done later. >> > > Thank you for your suggestions. I will use in the pattern to specify all > fields of in next patch. > I didn't know how to throw an error message before. I may need to spend > time reading code and learning. If possible, I will implement it in v3 > patch. > You should be right. There are many situations that I need to check. I can't find a case in menu-entry->sexp to solve it. So, I wrote a function alone. After I have preliminarily completed the function that checks menu-entry, I found that it seems that the explicit pattern is more readable than my individual function. The procedure that check menu-entry will check that there is no boot, different fields of boot are mixed, and there are multiple boot modes. I haven't tested it yet. The expected effect is as follows. --- start examples ---- (menu-entry (label "example") (linux "...") (initrd "...")) Pass check, and no error messages are reported. (menu-entry (label "example") (linux #f) (initrd #f)) (menu-entry (label "example") (linux "...") (initrd #f)) Becase initrd is required, they report the same error message as following. Please select one of following. 1. boot directly (linux + linux-arguments + linux-modules) 2. multiboot (multiboot-kernel + multiboot-arguments + multiboot-modules) 3. chain-loader(chain-loader) (menu-entry (label "example") (linux "...") (linux-arguments '(...)) (initrd "...") (chain-loader "...")) Becase It is complete for boot directly by linux and complete for chainloader, reporting the message as following. Please don't have more than one boot methods 1. boot directly (linux + linux-arguments + linux-modules) 2. multiboot (multiboot-kernel + multiboot-arguments + multiboot-modules) 3. chain-loader(chain-loader) (menu-entry (label "example") (linux "...") (initrd "...") (multiboot-kernel "...")) Becase multiboot-kernel shouldn't appear in the boot mode of linux and the boot mode of multiboot is incomplete, reporting the message as following. Please don't mix them. 1. boot directly (linux + linux-arguments + linux-modules) 2. multiboot (multiboot-kernel + multiboot-arguments + multiboot-modules) 3. chain-loader(chain-loader) --- end examples --- But the procedure lead more difficult to read and understand the code. Maybe it's because my code level is not enough. For the current code, I'm not sure if the error message is worth the performance it consumes and the code that becomes difficult to understand. The check of the procedure is not strong. It only checks whether some fields are set, but not whether the contents of the fields are correct. And I think the most important point is that the procedure just check menu-entry. menu-entry->sexp still need to check linux, multiboot and chain-loader. if not check, An incorrect match will occur in menu-entry->sexp, and an error message that is not helpful may be reported by 'guix system'. I think it might be good to use the menu-entry->sexp in v2 patch. Should I keep menu-entry->sexp of v2 in v3 patch, in addition to adding some necessary comments? The code of the procedure is following. --- >8 --- (define (check-menu-entry entry) (define (all-correct? fields) "Returns a pair according to the number of #t in the FIELDS. If all of the FIELDS are #t, the pair is (#t . #t). If the part of FIELDS is #t, the pair is (#t . #t). If all of the FIELDS aren't #t, the pair is (#f . #f)." (let ((total (length fields)) (right (length (filter identity fields)))) (cond ((= right 0) (cons #f #f)) ((< right total) (cons #t #f)) ((= right total) (cons #t #t))))) (define (get-all-correct-amount boot-methods right-number) (match boot-methods (((_ . #t) rest ...) (get-all-correct-amount rest (1+ right-number))) (((_ . #f) rest ...) (get-all-correct-amount rest right-number)) (() right-number))) (define (get-part-correct-amount boot-methods number) (match boot-methods (((_ . #t) rest ...) (get-part-correct-amount rest number)) (((#t . #f) rest ...) (get-part-correct-amount rest (1+ number))) (((#f . #f) rest ...) (get-part-correct-amount rest number)) (() number))) (match-record entry (label linux initrd multiboot-kernel multiboot-arguments multiboot-modules chain-loader) (let* ((linux-boot? (all-correct? (list linux initrd))) (multiboot? (all-correct? (list multiboot-kernel (not (null? multiboot-arguments)) (not (null? multiboot-modules))))) (chain-loader? (all-correct? (list chain-loader))) (boot-method-all-amount (get-all-correct-amount (list linux-boot? multiboot? chain-loader?) 0)) (boot-method-part-amount (get-part-correct-amount (list linux-boot? multiboot? chain-loader?) 0)) (selects " 1. boot directly (linux + linux-arguments + linux-modules) 2. multiboot (multiboot-kernel + multiboot-arguments + multiboot-modules) 3. chain-loader(chain-loader)\n") ((raise-message (lambda (message) (raise (condition (&message (format #f (G_ "invalid menu-entry: ~a~%~a~%~a~%") entry message selects)))))))) (match (list boot-method-part-amount boot-method-all-amount) ((0 0) (raise-message "Please select one of following.")) ((0 1) #t) ((0 (? (lambda (n) (> n 1)) _)) (raise-message "Plase don't have more than one boot method.")) (((? (lambda (n) (> n 0)) _) _) (raise-message "Plese don't mix them.")))))) --- 8< --- Without any exceptions, v3 patch may be the last version. So how can I modify the submission information to record your help to me? I would like to express my sincere thanks to you.I look forward to your reply. Thanks, tiantian From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 16:08:44 2022 Received: (at 57496) by debbugs.gnu.org; 3 Sep 2022 20:08:44 +0000 Received: from localhost ([127.0.0.1]:43114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUZRb-000186-Bt for submit@debbugs.gnu.org; Sat, 03 Sep 2022 16:08:44 -0400 Received: from lepiller.eu ([89.234.186.109]:53516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUZRX-00017u-UE for 57496@debbugs.gnu.org; Sat, 03 Sep 2022 16:08:42 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 07141860; Sat, 3 Sep 2022 20:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=1t/9SIIupQAM q/EXaQD9mV+JscEKh2n4SyZ5Sz72zLI=; b=iqO6UQ8+mfwM6+SXbeAfitUGFkqr 9p9cCSjh0KIJaUQ2e+u8lr8Rd76xk/JR46xg8yMmJZ7uRHgQ6PY3GmmL+yTFEjxL RxEhTboMDe9J4M9jy67cpjB8dJ+6a3iDn2uc8RF9rHtiDNTUkFMIGYpnp1bOJgKD AREdUXQydAhACeigwdADvNI9yZtWFluU4PKO5fLsh+DnbzFOJFwnzxHMAA6bUDEX ACwCp7tIYR3Jcukkpzgd9Ej4tSCD9Vo7A/Z8wfZ7bsud7DrFffUKzyTrTNjd+6wV v/tu84o4MtweyNn30dW0gNTJQjZozFjDv6m+eJfPsWr2VsteKe4bOwUSvg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id ed258201 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sat, 3 Sep 2022 20:08:37 +0000 (UTC) Date: Sat, 3 Sep 2022 22:08:35 +0200 From: Julien Lepiller To: tiantian Subject: Re: [bug#57496] [PATCH 1/2] gnu: bootloader: Extend `' for chain-loader. Message-ID: <20220903220835.52d60d1d@sybil.lepiller.eu> In-Reply-To: References: <55016216-84d9-e2e6-8bf5-0efdfa0e6ac1@foxmail.com> <20220831213406.3ec92474@sybil.lepiller.eu> <7xy1v37ny8.fsf@foxmail.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57496 Cc: 57496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi tiantian, Le Fri, 02 Sep 2022 09:04:15 +0800, tiantian a =C3=A9crit : > Hi Lepiller, Please call me Julien, I'm more used to being called by my first name. >=20 > After reviewing some documents of grub. How about changing > "linux-multiboot" to "multiboot" or "multiboot-kernel" in the > document? The first is because multiboot is used in grub manual. The > scecond is because multiboot-kernel is a field that appears in guix > manual. >=20 > like this: >=20 > @item @code{chain-loader} (default: @code{#f}) > A string that can be accepted by @code{grub}'s @code{chainloader} > directive. This has no effect if either @code{linux} or > @code{multiboot} fields are specified. The following is an > example of chainloading a different GNU/Linux system. >=20 > or >=20 > @item @code{chain-loader} (default: @code{#f}) > A string that can be accepted by @code{grub}'s @code{chainloader} > directive. This has no effect if either @code{linux} or > @code{multiboot-kernel} fields are specified. The following is an > example of chainloading a different GNU/Linux system. You're right, I made a mistake here, I meant the multiboot-kernel field, like that second example. I have no problem pushing the patches you have so far without any error message, although I can still see one issue. In the grub manual I see this example of chain-loading: menuentry "Windows" { insmod chain insmod ntfs set root=3D(hd0,1) chainloader +1 } which I cannot reproduce. I've used "chainloader +1" (by writing my own grub.cfg manually) with Haiku which is another free OS (though I think it uses nonfree blobs for hardware), so I think we should support this use case too, not just booting another EFI entry. When I=C2=A0set chain-loader "+1", I=C2=A0get the following grub config: menuentry "haiku" {=20 chainloader +1 } With no root. I think this is because of our grub-root-search procedure, which doesn't work in that case. Do you have any ideas how to support that use-case? If it's too complex I'm fine leaving it behind for now. It should not slow us down. >=20 > There are many situations that I need to check. I can't find a case in > menu-entry->sexp to solve it. So, I wrote a function alone. After I > have preliminarily completed the function that checks menu-entry, I > found that it seems that the explicit pattern is more readable than my > individual function. >=20 > The procedure that check menu-entry will check that there is no boot, > different fields of boot are mixed, and there are multiple boot > modes. I haven't tested it yet. The expected effect is as follows. >=20 > --- start examples ---- >=20 Those examples are nice :) >=20 > --- end examples --- >=20 > But the procedure lead more difficult to read and understand the > code. Maybe it's because my code level is not enough. For the current > code, I'm not sure if the error message is worth the performance it > consumes and the code that becomes difficult to understand. The check > of the procedure is not strong. It only checks whether some fields > are set, but not whether the contents of the fields are correct. >=20 > And I think the most important point is that the procedure just check > menu-entry. menu-entry->sexp still need to check linux, multiboot and > chain-loader. if not check, An incorrect match will occur in > menu-entry->sexp, and an error message that is not helpful may be > reported by 'guix system'. >=20 > I think it might be good to use the menu-entry->sexp in v2 patch. > Should I keep menu-entry->sexp of v2 in v3 patch, in addition to > adding some necessary comments? Let's keep the code from v2. >=20 > The code of the procedure is following. >=20 > --- >8 --- =20 >=20 > (define (check-menu-entry entry) > (define (all-correct? fields) > "Returns a pair according to the number of #t in the FIELDS. > If all of the FIELDS are #t, the pair is (#t . #t). If the part of > FIELDS is #t, the pair is (#t . #t). If all of the FIELDS aren't #t, > the pair is (#f . #f)." > (let ((total (length fields)) > (right (length (filter identity > fields)))) > (cond ((=3D right 0) (cons #f #f)) > ((< right total) (cons #t #f)) > ((=3D right total) (cons #t #t))))) > (define (get-all-correct-amount boot-methods right-number) > (match boot-methods > (((_ . #t) rest ...) > (get-all-correct-amount rest (1+ right-number))) > (((_ . #f) rest ...) > (get-all-correct-amount rest right-number)) > (() right-number))) > (define (get-part-correct-amount boot-methods number) > (match boot-methods > (((_ . #t) rest ...) > (get-part-correct-amount rest number)) > (((#t . #f) rest ...) > (get-part-correct-amount rest (1+ number))) > (((#f . #f) rest ...) > (get-part-correct-amount rest number)) > (() number))) > (match-record entry > (label > linux initrd multiboot-kernel multiboot-arguments > multiboot-modules chain-loader) > (let* ((linux-boot? > (all-correct? (list linux initrd))) > (multiboot? > (all-correct? > (list multiboot-kernel > (not (null? multiboot-arguments)) > (not (null? multiboot-modules))))) > (chain-loader? > (all-correct? (list chain-loader))) > (boot-method-all-amount > (get-all-correct-amount > (list linux-boot? > multiboot? > chain-loader?) > 0)) > (boot-method-part-amount > (get-part-correct-amount > (list linux-boot? > multiboot? > chain-loader?) 0)) > (selects " > 1. boot directly (linux + linux-arguments + linux-modules) > 2. multiboot (multiboot-kernel + multiboot-arguments + > multiboot-modules) 3. chain-loader(chain-loader)\n") > ((raise-message > (lambda (message) > (raise (condition > (&message > (format #f > (G_ "invalid menu-entry: ~a~%~a~%~a~%") > entry message selects)))))))) > (match (list boot-method-part-amount boot-method-all-amount) > ((0 0) > (raise-message "Please select one of following.")) > ((0 1) #t) > ((0 (? (lambda (n) (> n 1)) _)) > (raise-message "Plase don't have more than one boot > method.")) (((? (lambda (n) (> n 0)) _) _) > (raise-message "Plese don't mix them.")))))) >=20 > --- 8< --- Maybe it would be easier to have something like this: (define (check-menu-entry menu-entry) (define all-linux-fields (and (menu-entry-linux menu-entry) (menu-entry-linux-arguments menu-entry) (menu-entry-linux-modules menu-entry))) (define all-multiboot-fields ...) (define all-chainload-fields ...) (define count-methods (+ (if all-linux-fields 1 0) (if all-multiboot-fields 1 0) (if all-chainload-fields 1 0))) (define (report err) (raise (condition (&message (message (format #f (G_ "invalid menu-entry: ~a" err)))) (&fix-hint (hint (G_ "Please chose only one of: @enumerate @item direct boot by specifying fields @code{linux}, @code{linux-arguments} and @code{linux-modules}, @item multiboot by specifying fields @code{multiboot-kernel}, @code{multiboot-arguments} and @code{multiboot-modules}, @item chain-loader by specifying field @code{chain-loader}. @end enumerate")))))) (cond ((and (not all-linux-fields) (not all-multiboot-fields) (not all-chainload-fields)) (report (G_ "No boot method was chosen for this menu entry."))) ((> count-methods 1) (report (G_ "More than two boot methods were selected for this menu entry."))) (else #t))) This is untested, so there might be bugs :) Note that we need to have all strings translatable (with G_). In any case, that new code for error messages should go in a third, separate patch. >=20 > Without any exceptions, v3 patch may be the last version. So how can I > modify the submission information to record your help to me? You don't have to because I didn't contribute much to that patch, and I will sign it off when commiting. If you take the code above as is and don't modify it too much, then you can add something like this at the end of the commit message (only for the patch that contains my code): Co-Authored-By: Julien Lepiller >=20 > I would like to express my sincere thanks to you.I look forward to > your reply. >=20 > Thanks, > tiantian From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 09:54:54 2022 Received: (at 57496) by debbugs.gnu.org; 4 Sep 2022 13:54:55 +0000 Received: from localhost ([127.0.0.1]:43702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUq5O-0001JS-54 for submit@debbugs.gnu.org; Sun, 04 Sep 2022 09:54:54 -0400 Received: from out162-62-57-252.mail.qq.com ([162.62.57.252]:50225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUq5I-0001JB-Rd for 57496@debbugs.gnu.org; Sun, 04 Sep 2022 09:54:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662299678; bh=88/yggXcZz+RNFqFNJMyX1P8baGaLu31VwuE1RK9k4Q=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=Y+RgVOwHlUGzaWzG70W51PsBnsZ79CypxDn9Ad2Rd49M58+H57rlQF8ufUBnIoCTx 5x+7o6dz7TO5IQc01VYnxP6pnkjgXlwZfjkbt1fUM8Jwhga3N2Pr4iqRUANYXCEIJY tWCvG7BIA4pSdSLNxw/OQ2lSL5L88BoZyJa1mZDo= Received: from guix-pc ([240e:398:28a4:3121:5ae1:85dd:ab7b:103f]) by newxmesmtplogicsvrszc13.qq.com (NewEsmtp) with SMTP id DA4B486C; Sun, 04 Sep 2022 21:54:36 +0800 X-QQ-mid: xmsmtpt1662299676tpufax31z Message-ID: X-QQ-XMAILINFO: OLnGMPzD2sDVLbiq8ukbNSjpy4lgCFRKS+4Axa6u/SjS6mS6U4P/ED++eRxkXg zp8OBlrCh7r0e6j2wZXUqmpGhFnh/zbpv/md99eStKeY+4qLYZMACEV0zolZGSI1M0/89iK9tX6p kXHl51S9FPyAM7g932jHZIfPma8wdXdQXEpieVSbWj4GjtGaE1XyCtMo4QDTk02thTBCVARMklwL 19SKjzJezfnHJvDqDI1FbpAGCtcCoMyx8KiiNmGonShmk5jx/rc1fe3dQbjZT6pAdQ0B3zY7iVH2 uxN4VphilkaYR0HwvqDDI3uC84YETwPQM3+sDEHjgIquq1ncTO2cTIKjRxhT0Rp7PfAEnbeFfHMk eAdl4FGO0OLYFoDjhnBtcbK5TshWgWEnsKPog7vaevXSnC1nNLrYIdx2G7s8iRsm+zdJ5o1/pnqq KA2Igfh6EiYMEK2qKKzt3M9vu5OMkJX/jAmiSyAmdXOFx3V+R7r9K3bFII2hfeq6Z9AbcQOF9/3b 62x+QPMSuuGKRjZQhClWUXeOatqByHO2Q0t0mpc6sYXXDj+T+YvndmEmPCiGnPN1WmbhWNBvyhI8 Idbc7d/nWB2QCq2KgTQVIybwhDF3U8+I8F89OWPe+IzplQl4H9383p9YgQumFVFppc/2o/h8PXgv 9liMiR1Ob88rVUUk+2tYIgc7/M6bSuQxSfiTcrN1UOePMcfDD7wO1u4n1bIRczQ9Gl++IhuGUXci eXvkdDZPBrURNx8gLOu4SAyRGzOVK4cB5KIbzM0wvSbQKsHCQLLbxHQC5R/t7IXju2KH9r/dOTSD qCnIfBmHDIEY300N+Pv8UQPI9jO4NsHRezaR0N/exjBSWPouFrScV6J4dTFg3wPZ6Gn7sqzJ6NAR CCsG9trH9m+NMn1f0gYWV/draFIeCvwsUYg4LZ9PQjHE/yeb/Nv4pd3lTJs52GmZyZLgLEEvm8sb kAcKviXYHs/Afz6pULRugiEL+edP4BLSR0VqUHkSA= References: <55016216-84d9-e2e6-8bf5-0efdfa0e6ac1@foxmail.com> <20220831213406.3ec92474@sybil.lepiller.eu> <7xy1v37ny8.fsf@foxmail.com> <20220903220835.52d60d1d@sybil.lepiller.eu> User-agent: mu4e 1.8.9; emacs 28.1 From: tiantian To: Julien Lepiller Subject: Re: [bug#57496] [PATCH 1/2] gnu: bootloader: Extend `' for chain-loader. Date: Sun, 04 Sep 2022 21:09:35 +0800 In-reply-to: <20220903220835.52d60d1d@sybil.lepiller.eu> Message-ID: <7xbkrv9rdv.fsf@foxmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Julien, Julien Lepiller writes: > Hi tiantian, > > Le Fri, 02 Sep 2022 09:04:15 +0800, > tiantian a écrit : > >> Hi Lepiller, > > Please call me Julien, I'm more used to being called by my first name. > Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.252 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.252 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: 57496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Julien, Julien Lepiller writes: > Hi tiantian, > > Le Fri, 02 Sep 2022 09:04:15 +0800, > tiantian a écrit : > >> Hi Lepiller, > > Please call me Julien, I'm more used to being called by my first name. > Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.252 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.252 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hi Julien, Julien Lepiller writes: > Hi tiantian, > > Le Fri, 02 Sep 2022 09:04:15 +0800, > tiantian a =C3=A9crit : > >> Hi Lepiller, > > Please call me Julien, I'm more used to being called by my first name. > Ok. If I have offended you before, please forgive me. > > You're right, I made a mistake here, I meant the multiboot-kernel > field, like that second example. > OK, I'll write the second one in the document. > > I have no problem pushing the patches you have so far without any error > message, although I can still see one issue. In the grub manual I see > this example of chain-loading: > > menuentry "Windows" { > insmod chain > insmod ntfs > set root=3D(hd0,1) > chainloader +1 > } > > which I cannot reproduce. I've used "chainloader +1" (by writing my own > grub.cfg manually) with Haiku which is another free OS (though I think > it uses nonfree blobs for hardware), so I think we should support this > use case too, not just booting another EFI entry. When I=C2=A0set > chain-loader "+1", I=C2=A0get the following grub config: > > menuentry "haiku" {=20 > > chainloader +1 > } > > With no root. I think this is because of our grub-root-search > procedure, which doesn't work in that case. > > Do you have any ideas how to support that use-case? If it's too complex > I'm fine leaving it behind for now. It should not slow us down. > For the present `grub-root-search', I should not try to modify it for the time being. Because the device field may be associated with the boot-parameters, and modifying it may require more work. I have never used 'chainloader +1'. But if you just want to specify root device by the form like '(hd0,1)', you can try like this: (chain-loader "(hd0,1)+1") You may get some help from this article. (https://blog.cykerway.com/posts/2016/12/27/grub-chainloader-1.html) You may also get some help from "16.3.10 chainloader" and "13.3 How to specify block lists" in grub manual. I can't test these on my computer because I don't know how to use them. I hope these will help you. >>=20 >> There are many situations that I need to check. I can't find a case in >> menu-entry->sexp to solve it. So, I wrote a function alone. After I >> have preliminarily completed the function that checks menu-entry, I >> found that it seems that the explicit pattern is more readable than my >> individual function. >>=20 >> The procedure that check menu-entry will check that there is no boot, >> different fields of boot are mixed, and there are multiple boot >> modes. I haven't tested it yet. The expected effect is as follows. >>=20 >> --- start examples ---- >>=20 > > Those examples are nice :) > Thank you for your praise. >>=20 >> --- end examples --- >>=20 >> But the procedure lead more difficult to read and understand the >> code. Maybe it's because my code level is not enough. For the current >> code, I'm not sure if the error message is worth the performance it >> consumes and the code that becomes difficult to understand. The check >> of the procedure is not strong. It only checks whether some fields >> are set, but not whether the contents of the fields are correct. >>=20 >> And I think the most important point is that the procedure just check >> menu-entry. menu-entry->sexp still need to check linux, multiboot and >> chain-loader. if not check, An incorrect match will occur in >> menu-entry->sexp, and an error message that is not helpful may be >> reported by 'guix system'. >>=20 >> I think it might be good to use the menu-entry->sexp in v2 patch. >> Should I keep menu-entry->sexp of v2 in v3 patch, in addition to >> adding some necessary comments? > > Let's keep the code from v2. > I thought so before, but your code has brought me new inspiration. Perhaps, it will have some fine-tuning. > > Maybe it would be easier to have something like this: > > (define (check-menu-entry menu-entry) > (define all-linux-fields > (and (menu-entry-linux menu-entry) > (menu-entry-linux-arguments menu-entry) > (menu-entry-linux-modules menu-entry))) > (define all-multiboot-fields > ...) > (define all-chainload-fields > ...) > (define count-methods > (+ (if all-linux-fields 1 0) > (if all-multiboot-fields 1 0) > (if all-chainload-fields 1 0))) > > (define (report err) > (raise > (condition > (&message > (message > (format #f (G_ "invalid menu-entry: ~a" err)))) > (&fix-hint > (hint > (G_ "Please chose only one of: > @enumerate > @item direct boot by specifying fields @code{linux}, > @code{linux-arguments} and @code{linux-modules}, > @item multiboot by specifying fields @code{multiboot-kernel}, > @code{multiboot-arguments} and @code{multiboot-modules}, > @item chain-loader by specifying field @code{chain-loader}. > @end enumerate")))))) > > (cond > ((and (not all-linux-fields) (not all-multiboot-fields) > (not all-chainload-fields)) > (report (G_ "No boot method was chosen for this menu entry."))) > ((> count-methods 1) > (report (G_ "More than two boot methods were selected for this > menu entry."))) > (else #t))) > > This is untested, so there might be bugs :) > > Note that we need to have all strings translatable (with G_). > > In any case, that new code for error messages should go in a third, > separate patch. > Thanks your help. When I first add and test your check-menu-entry, I was amazed by its good-looking error reporting information. I like the error message. But I still have to work out the situation that linux,linux-argumet and initrd are set, and multiboot-kernel are also set, which can pass the check, but it will fail to match in menu-entry->sexp. Yes, multiboot-kernel shouldn't be ignored silently. But error message of no match is simple and crude. And It is also inconsistent with the previous exquisite error reporting information. When thinking about how to solve this problem, I get inspiration from it. It correct my previous wrong ideas. Mistakes are always various, and it is difficult for us to consider all of them. But the correctness is certain, and we can consider it more easily. I should not try to cover all the error cases, because it is very difficult. Even if it succeeds, the code is too complex and difficult to read. However, as long as I rule out the right situations, the rest is the wrong situation. "There are many situations that I need to check. I can't find a case in menu-entry->sexp to solve it." It is caused by my wrong thinking direction. So I split `check-menu-entry', merge the checked part intoe the pattern of `menu-entry->sexp', and separate the function of reporting error information into a procedure `report menu entry error'. Then add 'else' to the pattern in `menu-entry->sexp' to report error message. About the error message,I give up to point out what might be wrong, but display `menu-entry' and hint message. There are two main reasons: 1. As mentioned above, errors are unpredictable, and wrong error reporting information may mislead users. 2. The error is not caused by `menu-entry->sexp', but by an external procedure. This needs to display the `menu-entry' accepted by `menu-entry->sexp' to let the user know. Thank you for your code's inspiration. And your hint information is really great. I use your code about error message directly. >>=20 >> Without any exceptions, v3 patch may be the last version. So how can I >> modify the submission information to record your help to me? > > You don't have to because I didn't contribute much to that patch, and I > will sign it off when commiting. If you take the code above as is and > don't modify it too much, then you can add something like this at the > end of the commit message (only for the patch that contains my code): > > Co-Authored-By: Julien Lepiller > No, you give me great help. you correct the document, give me advice of using the pattern, and take time to find bug of my code and give me some advice how to work out it. Thanks your help. I will add "Co-Authored-By: Julien Lepiller " to commit messages of my first and third patch. Thanks, tiantian From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 10:11:05 2022 Received: (at 57496) by debbugs.gnu.org; 4 Sep 2022 14:11:05 +0000 Received: from localhost ([127.0.0.1]:45350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUqL3-00026l-DQ for submit@debbugs.gnu.org; Sun, 04 Sep 2022 10:11:05 -0400 Received: from out203-205-251-59.mail.qq.com ([203.205.251.59]:35468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUqKw-000267-RW for 57496@debbugs.gnu.org; Sun, 04 Sep 2022 10:11:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662300648; bh=G4FEa442sPdPuGY1IG3f0JLxBXg7O63LNy2nI3xq674=; h=From:To:Cc:Subject:Date; b=w/d+0rC/VkUcMdowtRjPogbwAd5iaTuBnyn0RJYiKwD7rRjpLjKSW9Hx5hJiyeS3p rgGJ8sDjPco5J4VZ6OP9CrSuiGb6GDPf3AgirLTUtPDgcIl7Ye+mKOQfDbbdH2aYxX MIP29ye80XC4ndxzby425w3g5TL0AFm8qjkfqyAU= Received: from localhost.localdomain ([240e:398:28a4:3121:5ae1:85dd:ab7b:103f]) by newxmesmtplogicsvrsza7.qq.com (NewEsmtp) with SMTP id 2AE98672; Sun, 04 Sep 2022 22:10:46 +0800 X-QQ-mid: xmsmtpt1662300646tz9c64rkf Message-ID: X-QQ-XMAILINFO: N7h1OCCDntujfjVLzS6KDocet6VOKMUeFcrXIUQe2SpklwHTfUz6VA2INI1TDe 8KN6Wt8kaar7183n4PQ//naS22t7vEkQKMB2ZYoTKkpuOR9HVxaFmGeCsLw6529nH68z5i8xp8vE A0KbnKi7udMKdpkx3jNR+2j1mHA67e2T9rXmY0zEGWDdDKHLtZ21CQwUKW8UiSEt/D8PsUiQEO+2 Axp7AnoW7RMt8LVECEnuHPMjbGETqxrjXf7y1UjVEv4QMFm0l04hRdAnM54++3g07jHhlg9us/Fr jVu8bqvS1Y+TwqMDwdDtJbau2UIe6Ns6R2dmAXNPFfbhxFIbwL2jFBp6akYVPRtTAopkFm9i1JJf 50VUhK8RftjlR5r+MlFIfKIszT7BqeD00ILuAEWhHtILeggsoLvIfN97JCsVmHKOkDj32FEXRap9 TFCeR7HxG0UBA7bMcfLkb9eK/t0U12VhBNaey2Z3ABRQIOT/LZqoW1B3hY0fDqvpAeZIKkSBnpCl oqbRC3JGPeRfbajv5/FGvk6+Go9Mw4IKWKeerQRMjLOYA4KBBSlmXVGu+p8dLqI2f3RZr28P85Z4 kgBidvK7HxY0Qmm1Ms2aN+sTPQL7mUeEdD6tGCf0jfKrrOG9w25Bo1hS+0PFdsvZ9aa3kgXGAXHz AQMRlPzfhYT9IN0ihGkKdiZrrUlUk7jp9ARf57qniiOjuH2R5epR586MSy+05TFkL/l93UiwL1iG UoUJ3TO85U1NS/ITh0TZIhi8BifZIrBRlfhPXQCHY+ThaNfjtt4fURSyRO6Afh0Z9NPNx0fUSZ98 eSXk5ECNHEWBkznnlHn9kvfnnHeqQwCQwn2jBXjRbppPo9LYVKW7gTn5jgBBJ9wAsKyiteEUQjAD kfzCJ5HU4XSY55uaixmOk43fqjEI1EflfztjZKEiFlRU9LIOnpfIUx/QprEvI3BuKEGZ0HmaXVER J/YhhRLIDDKAMEpHcMLQ== From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH v3 1/3] gnu: bootloader: Extend `' for chain-loader. Date: Sun, 4 Sep 2022 22:04:26 +0800 X-OQ-MSGID: <849b9ddea2a18dc4b2fd05450f0c90e3e5a05421.1662298270.git.typ22@foxmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. Co-Authored-By: Julien Lepiller --- v2: Correct the document and specify all fields of in the pattern of menu-entry->sexp. Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.251.59 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: julien@lepiller.eu, tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. Co-Authored-By: Julien Lepiller --- v2: Correct the document and specify all fields of in the pattern of menu-entry->sexp. Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.251.59 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. Co-Authored-By: Julien Lepiller --- v2: Correct the document and specify all fields of in the pattern of menu-entry->sexp. Now still judge linux, multiboot-kernel and chain-loader. Because if don't judge, the menu-entry that all of linux, linux-multiboot and chainloader are #f will match the first one. Then produce Error message: guix system: error: #: invalid G-expression input This error message does not help. v3: correct the document and delete an extra blank line. all: The documents are mainly corrected by Julien Lepiller. Thank you here. doc/guix.texi | 18 ++++++++++++++++++ gnu/bootloader.scm | 33 +++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 957b9a668e..cc64a7ed70 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37536,6 +37536,24 @@ Bootloader Configuration @dots{})) @end lisp +@item @code{chain-loader} (default: @code{#f}) +A string that can be accepted by @code{grub}'s @code{chainloader} +directive. This has no effect if either @code{linux} or +@code{multiboot-kernel} fields are specified. The following is an +example of chainloading a different GNU/Linux system. + +@lisp +(bootloader + (bootloader-configuration + ;; @dots{} + (menu-entries + (list + (menu-entry + (label "GNU/Linux") + (device (uuid "1C31-A17C" 'fat)) + (chain-loader "/EFI/GNULinux/grubx64.efi")))))) +@end lisp + @end table @end deftp diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 77c05e8946..9e8b545d10 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -46,6 +46,7 @@ (define-module (gnu bootloader) menu-entry-multiboot-kernel menu-entry-multiboot-arguments menu-entry-multiboot-modules + menu-entry-chain-loader menu-entry->sexp sexp->menu-entry @@ -104,8 +105,10 @@ (define-record-type* (multiboot-arguments menu-entry-multiboot-arguments (default '())) ; list of string-valued gexps (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 (define (menu-entry->sexp entry) "Return ENTRY serialized as an sexp." @@ -117,8 +120,9 @@ (define (menu-entry->sexp entry) `(label ,(file-system-label->string label))) (_ device))) (match entry - (($ label device mount-point linux linux-arguments initrd #f - ()) + (($ label device mount-point + (? identity linux) linux-arguments initrd + #f () () #f) `(menu-entry (version 0) (label ,label) (device ,(device->sexp device)) @@ -127,14 +131,22 @@ (define (menu-entry->sexp entry) (linux-arguments ,linux-arguments) (initrd ,initrd))) (($ label device mount-point #f () #f - multiboot-kernel multiboot-arguments multiboot-modules) + (? identity multiboot-kernel) multiboot-arguments + multiboot-modules #f) `(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))))) (define (sexp->menu-entry sexp) "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a @@ -171,7 +183,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) _ ...) + (menu-entry + (label label) + (device (sexp->device device)) + (device-mount-point mount-point) + (chain-loader chain-loader))))) ;;; base-commit: 6beadc82df204f315d06ea35f2e232bb32f8e440 -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 10:11:14 2022 Received: (at 57496) by debbugs.gnu.org; 4 Sep 2022 14:11:14 +0000 Received: from localhost ([127.0.0.1]:45353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUqLB-000277-TO for submit@debbugs.gnu.org; Sun, 04 Sep 2022 10:11:14 -0400 Received: from out162-62-57-87.mail.qq.com ([162.62.57.87]:46507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUqL9-00026d-Fd for 57496@debbugs.gnu.org; Sun, 04 Sep 2022 10:11:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662300662; bh=/38v54AvXd9X7OuutWCFaOGhyI/aaDiJEgK2pAlddnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=v2F53S2S8EOy8ck7A2FGtQ+kVkjaS/gr78q0pDMlZgDAStExc1pNerh95Ms3u4Dqt a4PqjeLIktSbwGcLh9WdbyVdC4nWhOsWExQxJbXTpZDmrEzZtZQ9T7l8nnVEJGJnvP tmyszcWoBPHlr52JjEcqp+iNYAM1EkMN0DVKy9AY= Received: from localhost.localdomain ([240e:398:28a4:3121:5ae1:85dd:ab7b:103f]) by newxmesmtplogicsvrsza7.qq.com (NewEsmtp) with SMTP id 2AE98672; Sun, 04 Sep 2022 22:10:46 +0800 X-QQ-mid: xmsmtpt1662300648tqh8qzgbo Message-ID: X-QQ-XMAILINFO: NhUkPfKlCtQwloY8YTzs8tbh79+gV6jt/NE3+lW75DqNJJ7vYjdrNYhvyNjgfr McIKZA0C4DcP5jAJj9CJ22mUYyes7d7QS8fiH8rLQRC6mELjy7MOT6MLbKAzLsz/kStJRLOo2aC+ 9NlZb1tKmk/mNa9oPeWhdfmc/kgzgEE7tYqUb9YgGAm9xD1rnaw/oyn2OUHc1H45qUaEHb5AIed+ P/E30lGMiwOp2DkxtipwU7cwzj5s+IlU1hbPq1Ol4QurYCFXLdTiDO+F5BOLVj5J88meHone4nYZ v6BwhW6e4t3k5/ztRKFLkGQvY/AInEAsQROmTVpJT1yF2crmXx7qX0PPAFCAIzGLEExRpBevuH8C Dx4HggIyG0WxCKaDkbqZqZAaKKNZGyI0UVaV+TrzeVaNSJa8S8dloaLFbgCzdVp9zl3h1WdmQf0b Yi9yIRd++0nCSOG/dVZC/VwftwkcZFEEIZTWohrlaszkfe7nQbCPWpgdzFODRHA1JxDCtpxNrHMQ fQb6m688WxGhCMXj9rRYXhN0qWQehJXV+fItBzi52ZK+lM0dtdbAW5vSdVvzcWk24j12kcpbiIFf q1NYK4UsHwuciMlOTpHNwHxynM80Lgyu9ytB59cxR9CuITlYa0PbhDIi7Ykt/UCKiLr0YNCKTEvw 4ikk3YcFYJdVANPpMg93U/Sx/kCxE+lwTjfxRDMP87YrY3PHIj1m6bds0HNbZzfVKfmtYJ67xJSM MHPxiF6FpCnG1QDox9zdl7kOvqQDLOWUa4HkjTWrE6h7lnGBUGm7mpv0nO0vzAW9z8W1QrXWkDBE +MPdCLljiBuMsg7m7OE21iVgPRemrBun6bi7hVwuLqNLY+m+P7z5o+Ure74TEjSIxEBEKAMC54pg wmB20kGz+iaQIsJdqni+wAC/KS4gleShW4ASA/IreVUaAkLh7/V72sjvjDsDf4upW9riZ1TnoqZ5 MPA5SxpS1xGJN23bsvhQ== From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH v3 2/3] gnu: bootloader: grub: Add support for chain-loader. Date: Sun, 4 Sep 2022 22:04:28 +0800 X-OQ-MSGID: <47c28682c4fe87a8ec53bf3c9687c1cf011d880c.1662298270.git.typ22@foxmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <849b9ddea2a18dc4b2fd05450f0c90e3e5a05421.1662298270.git.typ22@foxmail.com> References: <849b9ddea2a18dc4b2fd05450f0c90e3e5a05421.1662298270.git.typ22@foxmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- It is no different from v2 patch. Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.87 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.87 listed in list.dnswl.org] 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: julien@lepiller.eu, tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- It is no different from v2 patch. Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.87 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.87 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- It is no different from v2 patch. gnu/bootloader/grub.scm | 73 ++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 4f18c9b518..7283257354 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -374,44 +374,57 @@ (define* (grub-configuration-file config entries (let ((label (menu-entry-label entry)) (linux (menu-entry-linux entry)) (device (menu-entry-device entry)) - (device-mount-point (menu-entry-device-mount-point entry))) - (if linux - (let ((arguments (menu-entry-linux-arguments entry)) - (linux (normalize-file linux - device-mount-point - store-directory-prefix)) - (initrd (normalize-file (menu-entry-initrd entry) - device-mount-point - store-directory-prefix))) - ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. - ;; Use the right file names for LINUX and INITRD in case - ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a - ;; separate partition. - - ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and - ;; initrd paths, to allow booting from a Btrfs subvolume. - #~(format port "menuentry ~s { + (device-mount-point (menu-entry-device-mount-point entry)) + (multiboot-kernel (menu-entry-multiboot-kernel entry)) + (chain-loader (menu-entry-chain-loader entry))) + (cond + (linux + (let ((arguments (menu-entry-linux-arguments entry)) + (linux (normalize-file linux + device-mount-point + store-directory-prefix)) + (initrd (normalize-file (menu-entry-initrd entry) + device-mount-point + store-directory-prefix))) + ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. + ;; Use the right file names for LINUX and INITRD in case + ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a + ;; separate partition. + + ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and + ;; initrd paths, to allow booting from a Btrfs subvolume. + #~(format port "menuentry ~s { ~a linux ~a ~a initrd ~a }~%" - #$label - #$(grub-root-search device linux) - #$linux (string-join (list #$@arguments)) - #$initrd)) - (let ((kernel (menu-entry-multiboot-kernel entry)) - (arguments (menu-entry-multiboot-arguments entry)) - (modules (menu-entry-multiboot-modules entry)) - (root-index 1)) ; XXX EFI will need root-index 2 - #~(format port " + #$label + #$(grub-root-search device linux) + #$linux (string-join (list #$@arguments)) + #$initrd))) + (multiboot-kernel + (let ((kernel (menu-entry-multiboot-kernel entry)) + (arguments (menu-entry-multiboot-arguments entry)) + (modules (menu-entry-multiboot-modules entry)) + (root-index 1)) ; XXX EFI will need root-index 2 + #~(format port " menuentry ~s { multiboot ~a root=device:hd0s~a~a~a +}~%" + #$label + #$kernel + #$root-index (string-join (list #$@arguments) " " 'prefix) + (string-join (map string-join '#$modules) + "\n module " 'prefix)))) + (chain-loader + #~(format port " +menuentry ~s { + ~a + chainloader ~a }~%" #$label - #$kernel - #$root-index (string-join (list #$@arguments) " " 'prefix) - (string-join (map string-join '#$modules) - "\n module " 'prefix)))))) + #$(grub-root-search device chain-loader) + #$chain-loader))))) (define (crypto-devices) (define (crypto-device->cryptomount dev) -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 10:13:26 2022 Received: (at 57496) by debbugs.gnu.org; 4 Sep 2022 14:13:26 +0000 Received: from localhost ([127.0.0.1]:45359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUqNJ-0002AJ-H8 for submit@debbugs.gnu.org; Sun, 04 Sep 2022 10:13:26 -0400 Received: from out162-62-57-64.mail.qq.com ([162.62.57.64]:36331) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUqNF-0002A0-Vm for 57496@debbugs.gnu.org; Sun, 04 Sep 2022 10:13:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662300791; bh=+hv/+969LXAcQQ5jo+zvptqiwt6JiG5YCxy5zn3y0LY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=wEZYSlo/Y60x1hmGpfHOvscMbzv71UrqqlPTdU550EUFSTug5XTtEaMAP8uNiA/W+ t21xclcp3OUifKTXaylNQMVukWjXTubdMToL+YSLe53YT7JEl67j+rk5nLhyzDRcKT ldMtEL9NBxV1QGM+BOw9WlNTETgY8X+PEgW9na6g= Received: from localhost.localdomain ([240e:398:28a4:3121:5ae1:85dd:ab7b:103f]) by newxmesmtplogicsvrsza7.qq.com (NewEsmtp) with SMTP id 2AE98672; Sun, 04 Sep 2022 22:10:46 +0800 X-QQ-mid: xmsmtpt1662300662t6jskf6yh Message-ID: X-QQ-XMAILINFO: OLnGMPzD2sDVHQYTkUhd4dmoQHxhEg7CBxGKgzj+fEHsWRaW9IuUvw5PxsrjrN MoGc4eukysMzsSxEUq4A6ijPRXtHJuAM/9qVdIE/2AQG1Z3Px7DuKz8nLdvDkUrPGCcr482Scdzo zH6TPbiPwFSgH16euJ4cz3/s7YPFr4VMkezccZODsYTKa4u46dSy6Y2gqaQzQL1PXlcRqOKEB26s sdJ3/8njOXpWv7LS0QxMSzOnTyu8fvm6AbYzYbEo/q+4OfwAYMxy5NagbvU7CThR6HChzsoUZGxm ljzoATApQBZbvARi+KVivUy1Hm8YR1+ayhEoFQDCpsQhCFjKuO7bvlL8C8QgEaM5e/clzzpUV+b7 dL3Q4+bIoRTCxLhkrAfDIwMfCow9Bc+kaEmvmEIM/jNmPXayHLvqezLAV8OkGW3VxAKKlssGCCfJ NY+xIos1+Oj6R0v/RWIZJaitvPvIvgG2wBbhmvAj4j6bSGjAU8XaSawY2iQO81ZEaaNtJ2EU4akl XzUvyPLiWZ2CeznaR30kvWdGLRbsrcOKcXw8dK2/4XJOsL+HID5iIK8iRfmFmeTXvXht6CCkaFrW eh1Tlp8/ofbP9Z3nDGR0TNZR4tNZmevV+2XdhjF2N7RVogb62/klEdny7A9cuYj/zotdyZhW2yJX rQ10yO7BTOwamCHT0eIDbYUuqhUkuCr+DHmREPaZ1gMhZ65cLC9ZHcpHDbqtNI7rbvtwLKkZyG6K cnj9d1GlNvgbmUXkZlqHFHApeHTzIz/Z+ij+bpLmAUPxqjgbik0Dsiwk69esbUbdR8JLgS+3t/gF TB0ynrBbjm3VidIx6BoA5CKjCupMb87LXi1FV1y3pKUVeYG8q9Rg1PSWzSU5Fyc0t8cZPSNpx093 OLWqkupEr5o3pR4pz40yo00IkOt2W69jTpdO3E7htIeV/WLBCA7cGlgqcJmhJc6B8zEe5m0uZIPQ FagDL/FqXs5977omdKDQ== From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH v3 3/3] gnu: bootloader: Add a friendly error message of menu-entry. Date: Sun, 4 Sep 2022 22:04:31 +0800 X-OQ-MSGID: <35555a74cdf7ec6038b2f37aa1831edcace04c21.1662298270.git.typ22@foxmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <849b9ddea2a18dc4b2fd05450f0c90e3e5a05421.1662298270.git.typ22@foxmail.com> References: <849b9ddea2a18dc4b2fd05450f0c90e3e5a05421.1662298270.git.typ22@foxmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm (report-menu-entry-error): New procedure. (menu-entry->sexp): Modify the pattern and add `else' to call `report-menu-entry-error'. Co-Authored-By: Julien Lepiller --- The error message like so: Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.64 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.64 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: julien@lepiller.eu, tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm (report-menu-entry-error): New procedure. (menu-entry->sexp): Modify the pattern and add `else' to call `report-menu-entry-error'. Co-Authored-By: Julien Lepiller --- The error message like so: Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.64 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.64 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader.scm (report-menu-entry-error): New procedure. (menu-entry->sexp): Modify the pattern and add `else' to call `report-menu-entry-error'. Co-Authored-By: Julien Lepiller --- The error message like so: guix system: error: invalid menu-entry: #< label: "test" device: # device-mount-point: #f linux: #f linux-arguments: () initrd: #f multiboot-kernel: #f multiboot-arguments: () multiboot-modules: () chain-loader: #f> hint: Please chose only one of: 1. direct boot by specifying fields `linux', `linux-arguments' and `linux-modules', 2. multiboot by specifying fields `multiboot-kernel', `multiboot-arguments' and `multiboot-modules', 3. chain-loader by specifying field `chain-loader'. The code of `report-menu-entry-error' is quoted from Julien Lepiller. Thanks the help from Julien Lepiller. gnu/bootloader.scm | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 9e8b545d10..d4fe460570 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -34,6 +34,8 @@ (define-module (gnu bootloader) #:use-module (guix diagnostics) #:use-module (guix i18n) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module (ice-9 match) #:export (menu-entry menu-entry? @@ -110,6 +112,23 @@ (define-record-type* (chain-loader menu-entry-chain-loader (default #f))) ; string, path of efi file +(define (report-menu-entry-error menu-entry) + (raise + (condition + (&message + (message + (format #f (G_ "invalid menu-entry: ~a") menu-entry))) + (&fix-hint + (hint + (G_ "Please chose only one of: +@enumerate +@item direct boot by specifying fields @code{linux}, +@code{linux-arguments} and @code{linux-modules}, +@item multiboot by specifying fields @code{multiboot-kernel}, +@code{multiboot-arguments} and @code{multiboot-modules}, +@item chain-loader by specifying field @code{chain-loader}. +@end enumerate")))))) + (define (menu-entry->sexp entry) "Return ENTRY serialized as an sexp." (define (device->sexp device) @@ -119,9 +138,21 @@ (define (menu-entry->sexp entry) ((? file-system-label? label) `(label ,(file-system-label->string label))) (_ device))) + (define (set-field? field) + "If the field is the default value, return #f." + (and field ; not default value #f + (not (null? field)))) ; not default value '() (match entry + ;; Modify the pattern to achieve more strict matching and prevent + ;; wrong matching, which ensures the output of error information + ;; when menu-entry is wrong. + + ;; The linux-arguments is optional and the test code for boot-parameters + ;; does not set it, so don't check it here. (($ label device mount-point - (? identity linux) linux-arguments initrd + (? set-field? linux) + linux-arguments + (? set-field? initrd) #f () () #f) `(menu-entry (version 0) (label ,label) @@ -131,8 +162,10 @@ (define (menu-entry->sexp entry) (linux-arguments ,linux-arguments) (initrd ,initrd))) (($ label device mount-point #f () #f - (? identity multiboot-kernel) multiboot-arguments - multiboot-modules #f) + (? set-field? multiboot-kernel) + (? set-field? multiboot-arguments) + (? set-field? multiboot-modules) + #f) `(menu-entry (version 0) (label ,label) (device ,(device->sexp device)) @@ -141,12 +174,13 @@ (define (menu-entry->sexp entry) (multiboot-arguments ,multiboot-arguments) (multiboot-modules ,multiboot-modules))) (($ label device mount-point #f () #f #f () () - (? identity chain-loader)) + (? set-field? chain-loader)) `(menu-entry (version 0) (label ,label) (device ,(device->sexp device)) (device-mount-point ,mount-point) - (chain-loader ,chain-loader))))) + (chain-loader ,chain-loader))) + (else (report-menu-entry-error entry)))) (define (sexp->menu-entry sexp) "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 11:38:08 2022 Received: (at 57496) by debbugs.gnu.org; 4 Sep 2022 15:38:08 +0000 Received: from localhost ([127.0.0.1]:45456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUrhI-0004JX-Cc for submit@debbugs.gnu.org; Sun, 04 Sep 2022 11:38:08 -0400 Received: from lepiller.eu ([89.234.186.109]:53566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUrhF-0004JM-7i for 57496@debbugs.gnu.org; Sun, 04 Sep 2022 11:38:07 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id d9ca9fc7; Sun, 4 Sep 2022 15:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=+rloTzOI2HIs nsky4H/WkrT96fNI5HSmPY8uG0DQOvA=; b=IfW33XPoDp2qwByllUY520IBeHI+ ECL4CcoA7Dr88pKTO/sHmQggu5ePVlPRS5n4054znt2DSEkiEp8EKCyHJc+35DUf diwBmsdp+TWAW9am1etYZF0Q2SycgH1p1fNquKMQdT0VXFsv1HbQcLYBGAAqgWvj DzdYk+tzP+PiAYkxwP+06OiKu3q5NzIIpVbw+0xL+0wTNtc5rKv4iVfetddu8bgQ GLk1K3clJjPsoDbXI2sEQMZvkuTuTvWtLIgVap8++3hqIJXoKC1WVh4dGddbZsJw VcXxjn7RKY0FHfcQy2rBofpVM4ihRa1i/U2b/626tMEoeePfXTdnouTDEg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id e0eb83a0 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sun, 4 Sep 2022 15:38:01 +0000 (UTC) Date: Sun, 4 Sep 2022 17:37:55 +0200 From: Julien Lepiller To: typ22@foxmail.com Subject: Re: [PATCH v3 3/3] gnu: bootloader: Add a friendly error message of menu-entry. Message-ID: <20220904173755.5be9efa0@sybil.lepiller.eu> In-Reply-To: References: <849b9ddea2a18dc4b2fd05450f0c90e3e5a05421.1662298270.git.typ22@foxmail.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57496 Cc: 57496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi tiantian, I think the first two patches are good now, so let me focus on this one :) Le Sun, 4 Sep 2022 22:04:31 +0800, typ22@foxmail.com a =C3=A9crit : > From: tiantian >=20 > + (define (set-field? field) > + "If the field is the default value, return #f." > + (and field ; not default value #f > + (not (null? field)))) ; not default value '() I don't think this set-field? is necessary. In the following, I don't think you need the null? case at all because I think all the lists may be empty without triggering an error. You don't necessarily want to load modules or have arguments on the linux command line. In any case, it should be called field-set? instead :) > (match entry > + ;; Modify the pattern to achieve more strict matching and prevent > + ;; wrong matching, which ensures the output of error information > + ;; when menu-entry is wrong. > + > + ;; The linux-arguments is optional and the test code for > boot-parameters > + ;; does not set it, so don't check it here. > (($ label device mount-point > - (? identity linux) linux-arguments initrd > + (? set-field? linux) > + linux-arguments > + (? set-field? initrd) The could still be identity > #f () () #f) > `(menu-entry (version 0) > (label ,label) > @@ -131,8 +162,10 @@ (define (menu-entry->sexp entry) > (linux-arguments ,linux-arguments) > (initrd ,initrd))) > (($ label device mount-point #f () #f > - (? identity multiboot-kernel) > multiboot-arguments > - multiboot-modules #f) > + (? set-field? multiboot-kernel) > + (? set-field? multiboot-arguments) > + (? set-field? multiboot-modules) Some users might want to not use any modules or arguments I think, so these fields should not be mandatory. For multiboot-kernel, identity is enough. > + #f) > `(menu-entry (version 0) > (label ,label) > (device ,(device->sexp device)) > @@ -141,12 +174,13 @@ (define (menu-entry->sexp entry) > (multiboot-arguments ,multiboot-arguments) > (multiboot-modules ,multiboot-modules))) > (($ label device mount-point #f () #f #f () () > - (? identity chain-loader)) > + (? set-field? chain-loader)) Same here, identity is fine. > `(menu-entry (version 0) > (label ,label) > (device ,(device->sexp device)) > (device-mount-point ,mount-point) > - (chain-loader ,chain-loader))))) > + (chain-loader ,chain-loader))) > + (else (report-menu-entry-error entry)))) Since this is a match, it is more common to use: (_ (report-menu-entry-error entry)) Also, it feels weird to patch the code you modified in a previous patch of the same series. If you're not happy with the code you wrote in a previous patch, you need to change it in the previous patch, not in a new one :) > =20 > (define (sexp->menu-entry sexp) > "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a > From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 13:17:08 2022 Received: (at 57496) by debbugs.gnu.org; 4 Sep 2022 17:17:08 +0000 Received: from localhost ([127.0.0.1]:45593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUtF6-0006vL-1z for submit@debbugs.gnu.org; Sun, 04 Sep 2022 13:17:08 -0400 Received: from out162-62-57-137.mail.qq.com ([162.62.57.137]:37121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUtF1-0006ui-If for 57496@debbugs.gnu.org; Sun, 04 Sep 2022 13:17:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662311813; bh=IopPz9JzKGz/Nw3bPeE+VRY0TwCZW/hrLqURuEQtK0c=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=UjYvDX/73QJGgHqSjSl2YW6Fq+IrgkyuqUAE+a7Rtg2/6u26LWQMvdWNBfbm3CEVF zmJpf679Tqz/OG1i05MAgAvxtDQ9L8JR3ySq5mTFo6PQhhlHUHFjhpj8fdXKjNEl/9 kkmxjSbosqTBvzdYK7vh7TaTS20th2i/cm14504Y= Received: from guix-pc ([240e:398:28a4:3121:5ae1:85dd:ab7b:103f]) by newxmesmtplogicsvrszc8.qq.com (NewEsmtp) with SMTP id 43418C8E; Mon, 05 Sep 2022 01:16:52 +0800 X-QQ-mid: xmsmtpt1662311812t566gmmoc Message-ID: X-QQ-XMAILINFO: MDcj7PhX4q4YPJFs3EPf5J6Zy9kOs2n9GRcqpVbuHkB90UH9l2zVasNYs233D6 IK+rVHrDomIRoFeKeRlk9T7cX+TXV01XEabKzOmBbCrn6Sq2VSNRcK2zNs6GHv/gOK/CzNB27MS2 U41FhFjOR9q7cYwEe4Sx/+RhADwyr8N5nlh/cWU8kVuc2X6Ow/swckeoiLHG19YH5R+3Is+2D0LD kBu9eVQ+tm/mHlufUKRkx7yIka6aO4T04Z9J65CrONMz+JX2eUy481Feu09VBtwQYT4OeCihDqNt M9xp5+QwHfKIBRMsz2Qgxnb+gzTqc1PZBKj8w+38lUbS4+3HpnfKnTpogYWzVAo223RnH9HIa8g8 kUOKqjQJZWuIvHQX6+x9XH2cY5KlerKDCDO/s65eq1Upij7IBrlaWURRXW1DHm4fM9ztilmvMBDA ySgl2VzBIw17onVHCJtiQaA7xtOFBauBBbJJh/CjflRiTG0jC6DKAnKKDjKsgJsLQearLKMfwYYb NJOwHQuhtF+oGUaHCf74z3svZTryfZO6Xv3olXCjBW6Y/oFV2MaYp2thAOs1J2Bdjag+lLSTzYVe eRx6nnIGen27qOVGgC0GVq5Ic6c7mGZvW42p3+nEElDeSWaGspYi2KmCq6iZ44SU0F9k9g4ADNdL lEU6UrbN79T+hXuD2KWYvQ1HOjlEjPScxwdCVBTqTjiDDMnVepyeSdk2K0Pa72pSHJUkhyRJ8KsF cryyHNnS9lfeApbShs/RNdMXvWx3e1OV5pW2Nm4dZWcCN8qyoAJ8xnMuv+a+PzwZzVegf1944LXL hbU8U0sHu9Stc94VESeqzVwGyo6cPkFXcnLGh3kZ1d5FdjHuoX+xa3GreZVznBV+35w2mpJwoZiV I0c6fOBFmH1yqiunqtLWwHHcOTFT8nJfNv18wEZnFK3EqnsVfYKpIWwU7XCZcUsbf0my+ccdEQSF CTZbP7uHZlSEOsbyowm4XU+6eUYRjk7eXW5w5we1TDIFiieY8m2g== References: <849b9ddea2a18dc4b2fd05450f0c90e3e5a05421.1662298270.git.typ22@foxmail.com> <20220904173755.5be9efa0@sybil.lepiller.eu> User-agent: mu4e 1.8.9; emacs 28.1 From: tiantian To: Julien Lepiller Subject: Re: [PATCH v3 3/3] gnu: bootloader: Add a friendly error message of menu-entry. Date: Mon, 05 Sep 2022 00:15:12 +0800 In-reply-to: <20220904173755.5be9efa0@sybil.lepiller.eu> Message-ID: <7x7d2jt5z0.fsf@foxmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Julien Lepiller writes: > Hi tiantian, > > I think the first two patches are good now, so let me focus on this one > :) > > Le Sun, 4 Sep 2022 22:04:31 +0800, > typ22@foxmail.com a écrit : > >> From: tiantian >> >> + (def [...] Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.137 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.137 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: 57496@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Julien Lepiller writes: > Hi tiantian, > > I think the first two patches are good now, so let me focus on this one > :) > > Le Sun, 4 Sep 2022 22:04:31 +0800, > typ22@foxmail.com a écrit : > >> From: tiantian >> >> + (def [...] Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.137 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.137 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Julien Lepiller writes: > Hi tiantian, > > I think the first two patches are good now, so let me focus on this one > :) > > Le Sun, 4 Sep 2022 22:04:31 +0800, > typ22@foxmail.com a =C3=A9crit : > >> From: tiantian >>=20 >> + (define (set-field? field) >> + "If the field is the default value, return #f." >> + (and field ; not default value #f >> + (not (null? field)))) ; not default value '() > > I don't think this set-field? is necessary. In the following, I don't > think you need the null? case at all because I think all the lists may > be empty without triggering an error. You don't necessarily want to > load modules or have arguments on the linux command line. > > In any case, it should be called field-set? instead :) > My English is not good. To be honest, I tried set-value?, value-set?, default-value?, not-default-value?, field-set? and set-field?. Finally, I select the 'set-field?'. But it seems that I didn't choose well. But it doesn't matter. The procedure is no longer needed. >> (match entry >> + ;; Modify the pattern to achieve more strict matching and prevent >> + ;; wrong matching, which ensures the output of error information >> + ;; when menu-entry is wrong. >> + >> + ;; The linux-arguments is optional and the test code for >> boot-parameters >> + ;; does not set it, so don't check it here. >> (($ label device mount-point >> - (? identity linux) linux-arguments initrd >> + (? set-field? linux) >> + linux-arguments >> + (? set-field? initrd) > > The could still be identity > >> #f () () #f) >> `(menu-entry (version 0) >> (label ,label) >> @@ -131,8 +162,10 @@ (define (menu-entry->sexp entry) >> (linux-arguments ,linux-arguments) >> (initrd ,initrd))) >> (($ label device mount-point #f () #f >> - (? identity multiboot-kernel) >> multiboot-arguments >> - multiboot-modules #f) >> + (? set-field? multiboot-kernel) >> + (? set-field? multiboot-arguments) >> + (? set-field? multiboot-modules) > > Some users might want to not use any modules or arguments I think, so > these fields should not be mandatory. For multiboot-kernel, identity is > enough. > >> + #f) >> `(menu-entry (version 0) >> (label ,label) >> (device ,(device->sexp device)) >> @@ -141,12 +174,13 @@ (define (menu-entry->sexp entry) >> (multiboot-arguments ,multiboot-arguments) >> (multiboot-modules ,multiboot-modules))) >> (($ label device mount-point #f () #f #f () () >> - (? identity chain-loader)) >> + (? set-field? chain-loader)) > > Same here, identity is fine. > I don't know multiboot very well, so I don't know if multiboot-arguments and multiboot-modules are necessary. Then I check them. It turns out that they are not necessary. I will not check them. I will change to use identify. Honestly, It's much easier for me to use only `identify'. :) >> `(menu-entry (version 0) >> (label ,label) >> (device ,(device->sexp device)) >> (device-mount-point ,mount-point) >> - (chain-loader ,chain-loader))))) >> + (chain-loader ,chain-loader))) >> + (else (report-menu-entry-error entry)))) > > Since this is a match, it is more common to use: > > (_ (report-menu-entry-error entry)) > Thank you for reminding me. I will correct it. > Also, it feels weird to patch the code you modified in a previous patch > of the same series. If you're not happy with the code you wrote in a > previous patch, you need to change it in the previous patch, not in a > new one :) > As I understood earlier, these changes about matching are related to the error reporting information, so I put these modifications in this submission. My knowledge of contribution is still too little. I will pay attention to it later. Thank you for reminding me. Thanks, tiantian From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 13:26:50 2022 Received: (at 57496) by debbugs.gnu.org; 4 Sep 2022 17:26:50 +0000 Received: from localhost ([127.0.0.1]:45602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUtOT-00079O-Lk for submit@debbugs.gnu.org; Sun, 04 Sep 2022 13:26:50 -0400 Received: from out162-62-57-87.mail.qq.com ([162.62.57.87]:44441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUtOQ-000797-17 for 57496@debbugs.gnu.org; Sun, 04 Sep 2022 13:26:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662312397; bh=Q9UgzfBzvnlqxDUpKL0g9usuB3muksaRoIJHLqKKqho=; h=From:To:Cc:Subject:Date; b=lPvzro+/oDbynFPBFpC4aEml797dTjmrUvZZziBG70x55l5xDFsk+WCZGOT2m9lst AeQBKP1MK+XwWd4p170fy+OoHlVTYF7zMnkTYvwN/oyF3wIN2wJqP2A9R4Bd02QXhP vLgSvDhAwsQgzdW1C5Wr7w6wSawopTnLWURggj9s= Received: from localhost.localdomain ([240e:398:28a4:3121:5ae1:85dd:ab7b:103f]) by newxmesmtplogicsvrsza31.qq.com (NewEsmtp) with SMTP id 6A38201E; Mon, 05 Sep 2022 01:26:35 +0800 X-QQ-mid: xmsmtpt1662312395tkjfpur49 Message-ID: X-QQ-XMAILINFO: N7h1OCCDntujfjVLzS6KDocet6VOKMUeFQEfNg0jZD48UBySY4DMVEbLn2MWED 1f3Nr3vySs2GKPFVooV8/HryMXQO3J0Lq/qXWJCwPHcI/hoRnWgYH3pNPsEHl5loBWuzxrdPMuI3 Mu8jhxZgtzAN6YtrUNkNHZ73037eKm5UyZ20sh82kSLlvRXB7DqqY2DBHPc1y9Psy6uU0pikQyjr 9Wx89CBbjnkriAgqLZVcj8eaCaoxymfn8xK+94OnOpWXVfUCaDSLr9T30ff90pH5XH9TanQ1Hl89 czZuzfkHZ0WWOPKqkMIuZ0eXB5AlE1uNQlQSq+NB1Rru9taCMrVQ6ZKVr2fOxskUhu2r+0vbeLD1 /5qsCS2wZohTv/C1pof4CtXxSgw5mQHSfv7DSnyFPZNagESENWCLxWtikTw6d98O4kb3189TJqJg GgknX8xgOrYmgGukmmsytiAlA/1+UGJZE9ENgstF+0dHATkggeMUAM61lXtcUCdHvSYnkAQM3LKd 2MwMCf+bQRXCe22KEVk72LtIrK40w1+ox72MBcqA+2cz5oNlWdEQb4LbEkq+t3RDvLrNbHZHQ4kv zBkpJKtbhb01nMthi7036hwALPh8u89/wAUxIX8x+/N6xQgpEBDewbpzD510XXD8fdG7JuaQNPZI 7Cp39mH/gGNWh0pbENaT3ZaGNd0d9+5iwyzdNHF6WXp6/zdcfHG9fw7+TlqlYOA/nHjL6FR7uAwN y/60xVotIz1hqGCk4jM2BnCN45/75Tn1YD4/srJDaA2oxGdsRYCfk2IEW1mKpddieRyLxT/fkeeq O9I0x3IeDMBnc8ERPunB2Lob1ozw4H+VmGZr6hyKblSPjr2xe/96DC7zXhX94ux5NIeOkyuJzE14 zHTetdQiEhY6Z4lSEaA9Z1IehhOrtrj7vH4JAoMqO/u4JFLaORwb+l2DnKyXpsunLXnpVWDuqgWr 1vEJmiQB+8w9hm4L0zCg== From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH v4 1/3] gnu: bootloader: Extend `' for chain-loader. Date: Mon, 5 Sep 2022 01:25:38 +0800 X-OQ-MSGID: <09eabac17314272dcb5a8d2dbbbcfb55a05ecea2.1662308919.git.typ22@foxmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. Co-Authored-By: Julien Lepiller --- v2: Correct the document and specify all fields of in the pattern of menu-entry->sexp. Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.87 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.87 listed in list.dnswl.org] 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: julien@lepiller.eu, tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. Co-Authored-By: Julien Lepiller --- v2: Correct the document and specify all fields of in the pattern of menu-entry->sexp. Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.87 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.87 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader.scm ()[chain-loader]: New field. (menu-entry->sexp, sexp->menu-entry): Support chain-loader. * doc/guix.texi (Bootloader Configuration): Document it. Co-Authored-By: Julien Lepiller --- v2: Correct the document and specify all fields of in the pattern of menu-entry->sexp. Now still judge linux, multiboot-kernel and chain-loader. Because if don't judge, the menu-entry that all of linux, linux-multiboot and chainloader are #f will match the first one. Then produce Error message: guix system: error: #: invalid G-expression input This error message does not help. v3: correct the document and delete an extra blank line. v4: Add check for initrd in menu-entry->sexp, which is a change moved from the third patch of v3. all: The documents are mainly corrected by Julien Lepiller. Thank you here. doc/guix.texi | 18 ++++++++++++++++++ gnu/bootloader.scm | 33 +++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 957b9a668e..cc64a7ed70 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37536,6 +37536,24 @@ Bootloader Configuration @dots{})) @end lisp +@item @code{chain-loader} (default: @code{#f}) +A string that can be accepted by @code{grub}'s @code{chainloader} +directive. This has no effect if either @code{linux} or +@code{multiboot-kernel} fields are specified. The following is an +example of chainloading a different GNU/Linux system. + +@lisp +(bootloader + (bootloader-configuration + ;; @dots{} + (menu-entries + (list + (menu-entry + (label "GNU/Linux") + (device (uuid "1C31-A17C" 'fat)) + (chain-loader "/EFI/GNULinux/grubx64.efi")))))) +@end lisp + @end table @end deftp diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 77c05e8946..9fe6b65212 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -46,6 +46,7 @@ (define-module (gnu bootloader) menu-entry-multiboot-kernel menu-entry-multiboot-arguments menu-entry-multiboot-modules + menu-entry-chain-loader menu-entry->sexp sexp->menu-entry @@ -104,8 +105,10 @@ (define-record-type* (multiboot-arguments menu-entry-multiboot-arguments (default '())) ; list of string-valued gexps (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 (define (menu-entry->sexp entry) "Return ENTRY serialized as an sexp." @@ -117,8 +120,9 @@ (define (menu-entry->sexp entry) `(label ,(file-system-label->string label))) (_ device))) (match entry - (($ label device mount-point linux linux-arguments initrd #f - ()) + (($ label device mount-point + (? identity linux) linux-arguments (? identity initrd) + #f () () #f) `(menu-entry (version 0) (label ,label) (device ,(device->sexp device)) @@ -127,14 +131,22 @@ (define (menu-entry->sexp entry) (linux-arguments ,linux-arguments) (initrd ,initrd))) (($ label device mount-point #f () #f - multiboot-kernel multiboot-arguments multiboot-modules) + (? identity multiboot-kernel) multiboot-arguments + multiboot-modules #f) `(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))))) (define (sexp->menu-entry sexp) "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a @@ -171,7 +183,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) _ ...) + (menu-entry + (label label) + (device (sexp->device device)) + (device-mount-point mount-point) + (chain-loader chain-loader))))) ;;; base-commit: 6beadc82df204f315d06ea35f2e232bb32f8e440 -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 13:27:47 2022 Received: (at 57496) by debbugs.gnu.org; 4 Sep 2022 17:27:47 +0000 Received: from localhost ([127.0.0.1]:45606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUtPP-0007Ax-6X for submit@debbugs.gnu.org; Sun, 04 Sep 2022 13:27:47 -0400 Received: from out162-62-57-64.mail.qq.com ([162.62.57.64]:39021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUtPN-0007Ag-25 for 57496@debbugs.gnu.org; Sun, 04 Sep 2022 13:27:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662312455; bh=K2KEaGF1Z/wq2RfdW16B7Tvop2xEYaIG+A5AOK+vmwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ef2LnPLnywuTMa07Uj87e3TSSER96E3oSjoTGtrBH4M7wmviim9+eiQyfBGTp5H9a rvS0kZ8946ryexqRE/sntQtLxPfboRLeg6igyxLy1cDYv6Y7KnCPpJ4oHyAHgn39Ib 4qxQARHsJmb1IJ//+GGu3dIL+PyzRxA6g7gFr8zg= Received: from localhost.localdomain ([240e:398:28a4:3121:5ae1:85dd:ab7b:103f]) by newxmesmtplogicsvrsza31.qq.com (NewEsmtp) with SMTP id 6A38201E; Mon, 05 Sep 2022 01:26:35 +0800 X-QQ-mid: xmsmtpt1662312397tnp5mmfky Message-ID: X-QQ-XMAILINFO: OXimaFo5SPf+NIPIPZcNdpymtPUPrBm8pz/q01R7jkuqWj0QG9TOM3Ro6R4boY NyAGSt3HJmTb41lkbFMzn8oyu0lr2FKDbQU3lzFD14tiRi2DBYgIxRPkmH0yhdHAE/bOrWQ6arX9 WmVlnC7Bgly6Qs+GmzXxD9d19PuurwSfKtSu/2Fhx+ogecrRdMb0Z8Ca4iitghcy/1Xbdncq5dGY b2EEkpxhabDYCdo4G/pA6hiREjnSH+a03WtQp9jzBhSzL+TtZTethHNX2DExs91/5H13tNSwh1bQ 7PmN1d86CoKMK+LExIDfWhYH7XnXq9ppI8DCdZXXBXneLmLNSdadfFp+K/SKPkd7YevkdfODFv24 kDCOML1gPTqCvRcdio7v4xwRdufujvzukESRdYeZ4/gcxfZDbh9NFMMa10OkfDTBCial+WTpf24B jg4+llRRvS/VbC8Vfjo5lCNFoH3ceXZX73lzhwmOSywsUtdgluu3lcrCMWKW7fezE74lOF4nLyU4 Ful3KRo9e+N1qUrV4xyHLiqPcVmTNy279gcj6i5i2M1j0YWS49EYqSDZYZwzJcD7fHiV+V+xIZKv pGcYerxsc0ThimttrYwd2wKLSMnYhmEx+cXkh9E7/u+uB8aknWsvD/A8Sxk33q51adkKHy7vKxKE Qj222vVvcE9g60QzpmDhgqisB9jeoyMjt+WUf2kt+HWt/nlbIUAdDR4NK6s/+Far8A+SM/hldO/k tdDQguqAN7+b8t6JylwzfY1a5kpxvcmDOt8XrtHjTKxV6Tu0dWthS7RQyBwh8AS3N5SxhtIwR+V9 n75u1xhpkTDT0mswTSLXu6gWKjnfNIYtCLG3pT3a7DID6cKLoqv8nk79mNal8derNb1B0MUhIbPd khorm5Jp7qibr6ji7xII1agQBg1QVPmLKJHgcWrC13fuWkqWk+jKFyEE0XbE/1yWz3aICVroaDY4 GobcxDHzXhV24rFzTVQd9rmuyydDIzdGJPmkt4IwoBe1y0lvuzqQ== From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH v4 2/3] gnu: bootloader: grub: Add support for chain-loader. Date: Mon, 5 Sep 2022 01:25:40 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.37.2 In-Reply-To: <09eabac17314272dcb5a8d2dbbbcfb55a05ecea2.1662308919.git.typ22@foxmail.com> References: <09eabac17314272dcb5a8d2dbbbcfb55a05ecea2.1662308919.git.typ22@foxmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- It is no different from v3 patch. Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.64 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.64 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: julien@lepiller.eu, tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- It is no different from v3 patch. Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.64 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.64 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader/grub.scm (grub-configuration-file): Add support for chain-loader. --- It is no different from v3 patch. gnu/bootloader/grub.scm | 73 ++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 4f18c9b518..7283257354 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -374,44 +374,57 @@ (define* (grub-configuration-file config entries (let ((label (menu-entry-label entry)) (linux (menu-entry-linux entry)) (device (menu-entry-device entry)) - (device-mount-point (menu-entry-device-mount-point entry))) - (if linux - (let ((arguments (menu-entry-linux-arguments entry)) - (linux (normalize-file linux - device-mount-point - store-directory-prefix)) - (initrd (normalize-file (menu-entry-initrd entry) - device-mount-point - store-directory-prefix))) - ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. - ;; Use the right file names for LINUX and INITRD in case - ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a - ;; separate partition. - - ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and - ;; initrd paths, to allow booting from a Btrfs subvolume. - #~(format port "menuentry ~s { + (device-mount-point (menu-entry-device-mount-point entry)) + (multiboot-kernel (menu-entry-multiboot-kernel entry)) + (chain-loader (menu-entry-chain-loader entry))) + (cond + (linux + (let ((arguments (menu-entry-linux-arguments entry)) + (linux (normalize-file linux + device-mount-point + store-directory-prefix)) + (initrd (normalize-file (menu-entry-initrd entry) + device-mount-point + store-directory-prefix))) + ;; Here DEVICE is the store and DEVICE-MOUNT-POINT is its mount point. + ;; Use the right file names for LINUX and INITRD in case + ;; DEVICE-MOUNT-POINT is not "/", meaning that the store is on a + ;; separate partition. + + ;; When BTRFS-SUBVOLUME-FILE-NAME is defined, prepend it the linux and + ;; initrd paths, to allow booting from a Btrfs subvolume. + #~(format port "menuentry ~s { ~a linux ~a ~a initrd ~a }~%" - #$label - #$(grub-root-search device linux) - #$linux (string-join (list #$@arguments)) - #$initrd)) - (let ((kernel (menu-entry-multiboot-kernel entry)) - (arguments (menu-entry-multiboot-arguments entry)) - (modules (menu-entry-multiboot-modules entry)) - (root-index 1)) ; XXX EFI will need root-index 2 - #~(format port " + #$label + #$(grub-root-search device linux) + #$linux (string-join (list #$@arguments)) + #$initrd))) + (multiboot-kernel + (let ((kernel (menu-entry-multiboot-kernel entry)) + (arguments (menu-entry-multiboot-arguments entry)) + (modules (menu-entry-multiboot-modules entry)) + (root-index 1)) ; XXX EFI will need root-index 2 + #~(format port " menuentry ~s { multiboot ~a root=device:hd0s~a~a~a +}~%" + #$label + #$kernel + #$root-index (string-join (list #$@arguments) " " 'prefix) + (string-join (map string-join '#$modules) + "\n module " 'prefix)))) + (chain-loader + #~(format port " +menuentry ~s { + ~a + chainloader ~a }~%" #$label - #$kernel - #$root-index (string-join (list #$@arguments) " " 'prefix) - (string-join (map string-join '#$modules) - "\n module " 'prefix)))))) + #$(grub-root-search device chain-loader) + #$chain-loader))))) (define (crypto-devices) (define (crypto-device->cryptomount dev) -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 13:29:28 2022 Received: (at 57496) by debbugs.gnu.org; 4 Sep 2022 17:29:28 +0000 Received: from localhost ([127.0.0.1]:45614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUtR2-0007Dm-28 for submit@debbugs.gnu.org; Sun, 04 Sep 2022 13:29:28 -0400 Received: from out162-62-57-210.mail.qq.com ([162.62.57.210]:56531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUtQz-0007DX-Es for 57496@debbugs.gnu.org; Sun, 04 Sep 2022 13:29:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1662312557; bh=y5FL3/YpA00By7lLx1rsn4VGNNfjdzZGgiu+KWPet1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=emjDoKk5LKmj8dJZV3adXWe4zEpKOsoPSk3DHTJa6LmqIj+jXpMArGvb4ENlmNn3T gPia3YNSRHz7Iv5fSrmTgstqewNXCKGdXc27s/3mtUly9A6Mxd8TC/1fZAaVXMXqea UtW9laWBg+iwu4jF1N8t3pk1GnDjAJlHzb2WtyAs= Received: from localhost.localdomain ([240e:398:28a4:3121:5ae1:85dd:ab7b:103f]) by newxmesmtplogicsvrsza31.qq.com (NewEsmtp) with SMTP id 6A38201E; Mon, 05 Sep 2022 01:26:35 +0800 X-QQ-mid: xmsmtpt1662312455tsdo5nq6d Message-ID: X-QQ-XMAILINFO: NJ/+omVLhVgatXKdPWgEwqJ4mDHOpu4Vu0jAZkdoSlqPkCnDg5VAsIrqlZpMyK TKGdQ2DhDJxs9a3bPzZ+t/rWU19rNNmwbh1+r0zpJOQOl/Wp7jJF1KuSlIouGKwDGD83IYzxnlac xtVqQOHTeY0seiB6fn/i3ctxup13qKyG4x9kIeSOenbJz3qDXuImJMIebDRAeZRIscT5ArhcNdO0 StLx8blmynN0Emk+rkWU23UhbZJx535uySDYDb4BCe5lWIPpM8psB9QLaCyXxx+xWRlD9FupvPwB MGEpE9EMLY3kvM0d+S46RjXHAmR99bNh4QTHrfoKnR/Zo1u7bPNgZ47T1BK+RZTTTkPJyDVkFDWU uzkS26d4CoQfMlRnyY6tRTmGz4kW13k7O3l4nrWo4ESX2GA480iZi7wOBUDntsejRErxZWadzotp 5vSUP2E07fcohWdwhbFTTwR+gFt2SNhbdsx3z80osZLPKqWiBu3v0QFHKvFyFF9fvZSBTiEppWm7 sZO4Yw3EdGR+VIgDSvaq1FPjHWpjPLzsk1C/LATAhWnx4ri/gDZa6pjJgmb+1gpi+8Muqx142b5j RwAJFibKl9wsRM+A14gMi5EKyKPLVaj01ky1ttGCGRyXGnJQM60SU8xW4nLehn4oMIsDJAN2/5pl n7yVgSPA9EkkfiO5sYRKUMDQ/LTsSx8clR4LLLbtCdSxMQ8KsnP6YqRrJzGxG13hTTGVqi/Y7ZTp ZrVx87zSynMvOr2FkXt+rpy5LaS1Qa1GK9vIOmD0nWOGk/ToccT30ptzkjMJBP5a7+qISASk5uN9 2asDHv0GZVc3PHlEBtDngTDktQejfeGXM/vlPCkP6j4JMSep6HesiZ26I9a7kmZRkVhdTW30oRU+ sx+FBpBV9W9sVrFBE9cOWBNEI1bAr8bMpbk2tGZ+BORjPCmKv/UXgYTQf4GROdm6HU/Egb0DK1Zo aJ+d4y7/x4wzYVe9Gvtm0ECpUoEqU4jsK5VMHZzVsfyK8e6oGyvCpW1idC2RkA From: typ22@foxmail.com To: 57496@debbugs.gnu.org Subject: [PATCH v4 3/3] gnu: bootloader: Add a friendly error message of menu-entry. Date: Mon, 5 Sep 2022 01:25:42 +0800 X-OQ-MSGID: <7741d6aa61a1dc699ec7dbbe36065e65fc2d473e.1662308919.git.typ22@foxmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <09eabac17314272dcb5a8d2dbbbcfb55a05ecea2.1662308919.git.typ22@foxmail.com> References: <09eabac17314272dcb5a8d2dbbbcfb55a05ecea2.1662308919.git.typ22@foxmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.8 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm (report-menu-entry-error): New procedure. (menu-entry->sexp): Add a call to `report-menu-entry-error'. Co-Authored-By: Julien Lepiller --- v3: The error message like so: Content analysis details: (3.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.210 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.210 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 57496 Cc: julien@lepiller.eu, tiantian X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: tiantian * gnu/bootloader.scm (report-menu-entry-error): New procedure. (menu-entry->sexp): Add a call to `report-menu-entry-error'. Co-Authored-By: Julien Lepiller --- v3: The error message like so: Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.210 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.210 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (typ22[at]foxmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (typ22[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS -0.0 T_SCC_BODY_TEXT_LINE No description available. 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager From: tiantian * gnu/bootloader.scm (report-menu-entry-error): New procedure. (menu-entry->sexp): Add a call to `report-menu-entry-error'. Co-Authored-By: Julien Lepiller --- v3: The error message like so: guix system: error: invalid menu-entry: #< label: "test" device: # device-mount-point: #f linux: #f linux-arguments: () initrd: #f multiboot-kernel: #f multiboot-arguments: () multiboot-modules: () chain-loader: #f> hint: Please chose only one of: 1. direct boot by specifying fields `linux', `linux-arguments' and `linux-modules', 2. multiboot by specifying fields `multiboot-kernel', `multiboot-arguments' and `multiboot-modules', 3. chain-loader by specifying field `chain-loader'. The code of `report-menu-entry-error' is quoted from Julien Lepiller. Thanks the help from Julien Lepiller. v4: The checks of the lists are cancelled and the check of initrd is moved to the first patch. gnu/bootloader.scm | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 9fe6b65212..da65b9d5d5 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -34,6 +34,8 @@ (define-module (gnu bootloader) #:use-module (guix diagnostics) #:use-module (guix i18n) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module (ice-9 match) #:export (menu-entry menu-entry? @@ -110,6 +112,23 @@ (define-record-type* (chain-loader menu-entry-chain-loader (default #f))) ; string, path of efi file +(define (report-menu-entry-error menu-entry) + (raise + (condition + (&message + (message + (format #f (G_ "invalid menu-entry: ~a") menu-entry))) + (&fix-hint + (hint + (G_ "Please chose only one of: +@enumerate +@item direct boot by specifying fields @code{linux}, +@code{linux-arguments} and @code{linux-modules}, +@item multiboot by specifying fields @code{multiboot-kernel}, +@code{multiboot-arguments} and @code{multiboot-modules}, +@item chain-loader by specifying field @code{chain-loader}. +@end enumerate")))))) + (define (menu-entry->sexp entry) "Return ENTRY serialized as an sexp." (define (device->sexp device) @@ -146,7 +165,8 @@ (define (menu-entry->sexp entry) (label ,label) (device ,(device->sexp device)) (device-mount-point ,mount-point) - (chain-loader ,chain-loader))))) + (chain-loader ,chain-loader))) + (_ (report-menu-entry-error entry)))) (define (sexp->menu-entry sexp) "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a -- 2.37.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 08 16:33:16 2022 Received: (at 57496-done) by debbugs.gnu.org; 8 Sep 2022 20:33:16 +0000 Received: from localhost ([127.0.0.1]:60230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWOD5-0005jS-PG for submit@debbugs.gnu.org; Thu, 08 Sep 2022 16:33:15 -0400 Received: from lepiller.eu ([89.234.186.109]:53834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWOD2-0005jI-Rf for 57496-done@debbugs.gnu.org; Thu, 08 Sep 2022 16:33:15 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id bbe1e3d3; Thu, 8 Sep 2022 20:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=jW+Fa9kper5g lFgboRL0urulWEz1WFfT3Ve9pK2BL/I=; b=mkyad+d6xiZHpKFrP8jlyBeop/vd UzPpF8AnBfO93+IJIYr/ObjrbgGIa8XChaaoJI0yD8KnPmO863Zslsf2MvB8DoNu wZUTSmg2QhheP6fkXnzaoiFUzB8PtNOI3sU+ed0eyf++mUyGyF6xFFlPVE7LWhit MEo6dSOr2an0Pt/AJXKRBnpZY0bmB4KibeAkL3jOTYu/OZwKU1koX2a/ByhYsb51 EjTCgdDjjG4+FWWipC/aLl1j9FCwIX6FFcJX6lrIcfE+G+97jCoQovMNxC8hFwsh tuhZr/iZzpX5CKj7K7/acJSrLR0cDjGKo4GcxuTUXALPWhAqEWvNahuzvg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 166cf1f4 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 8 Sep 2022 20:33:10 +0000 (UTC) Date: Thu, 8 Sep 2022 22:33:06 +0200 From: Julien Lepiller To: typ22@foxmail.com Subject: Re: [PATCH v4 3/3] gnu: bootloader: Add a friendly error message of menu-entry. Message-ID: <20220908223306.28567f0a@sybil.lepiller.eu> In-Reply-To: References: <09eabac17314272dcb5a8d2dbbbcfb55a05ecea2.1662308919.git.typ22@foxmail.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57496-done Cc: 57496-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Pushed to master as 52d780ea2b0714d035a84e350b516ca2e2c19af1 to 32da9bbc91d365f514ae41528587905b21c41825, thanks! From unknown Sun Jul 13 03:50:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 07 Oct 2022 11:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator