Package: guix-patches;
Reported by: Felix Lechner <felix.lechner <at> lease-up.com>
Date: Sat, 24 Feb 2024 01:09:02 UTC
Severity: normal
Tags: patch
Message #41 received at 69343 <at> debbugs.gnu.org (full text, mbox):
From: Felix Lechner <felix.lechner <at> lease-up.com> To: 69343 <at> debbugs.gnu.org Cc: Felix Lechner <felix.lechner <at> lease-up.com> Subject: [PATCH 02/12] Move <boot-parameters> record to a separate file. Date: Fri, 23 Feb 2024 17:51:35 -0800
Without it, the following commit following this one causes 'guix pull' to fail with this message: [ 0/ 50] loading... 0.0% of 25 files [ 1/ 50] loading... 4.0% of 25 files [ 2/ 50] loading... 8.0% of 25 files [ 3/ 50] loading... 12.0% of 25 files [ 4/ 50] loading... 16.0% of 25 files [ 5/ 50] loading... 20.0% of 25 files [ 6/ 50] loading... 24.0% of 25 files [ 7/ 50] loading... 28.0% of 25 files [ 8/ 50] loading... 32.0% of 25 files [ 9/ 50] loading... 36.0% of 25 files [ 10/ 50] loading... 40.0% of 25 files [ 11/ 50] loading... 44.0% of 25 files [ 12/ 50] loading... 48.0% of 25 files [ 13/ 50] loading... 52.0% of 25 files [ 14/ 50] loading... 56.0% of 25 files [ 15/ 50] loading... 60.0% of 25 files [ 16/ 50] loading... 64.0% of 25 files [ 17/ 50] loading... 68.0% of 25 files [ 18/ 50] loading... 72.0% of 25 files [ 19/ 50] loading... 76.0% of 25 files [ 20/ 50] loading... 80.0% of 25 files [ 21/ 50] loading... 84.0% of 25 files [ 22/ 50] loading... 88.0% of 25 files [ 23/ 50] loading... 92.0% of 25 files [ 24/ 50] loading... 96.0% of 25 files [ 25/ 50] loading... 100.0% of 25 files [ 25/ 50] compiling... 0.0% of 25 files [ 26/ 50] compiling... 4.0% of 25 files [ 27/ 50] compiling... 8.0% of 25 files [ 28/ 50] compiling... 12.0% of 25 files [ 29/ 50] compiling... 16.0% of 25 files [ 30/ 50] compiling... 20.0% of 25 files [ 31/ 50] compiling... 24.0% of 25 files [ 32/ 50] compiling... 28.0% of 25 files [ 33/ 50] compiling... 32.0% of 25 files [ 34/ 50] compiling... 36.0% of 25 files [ 35/ 50] compiling... 40.0% of 25 files [ 36/ 50] compiling... 44.0% of 25 files [ 37/ 50] compiling... 48.0% of 25 files [ 38/ 50] compiling... 52.0% of 25 files [ 39/ 50] compiling... 56.0% of 25 files [ 40/ 50] compiling... 60.0% of 25 files [ 41/ 50] compiling... 64.0% of 25 files [ 42/ 50] compiling... 68.0% of 25 files [ 43/ 50] compiling... 72.0% of 25 files [ 44/ 50] compiling... 76.0% of 25 files [ 45/ 50] compiling... 80.0% of 25 files [ 46/ 50] compiling... 84.0% of 25 files [ 47/ 50] compiling... 88.0% of 25 files [ 48/ 50] compiling... 92.0% of 25 files [ 49/ 50] compiling... 96.0% of 25 files [ 50/ 50] compiling... 100.0% of 25 files [ 0/ 50] loading... 0.0% of 25 files [ 1/ 50] loading... 4.0% of 25 files [ 2/ 50] loading... 8.0% of 25 files [ 3/ 50] loading... 12.0% of 25 files [ 4/ 50] loading... 16.0% of 25 files [ 5/ 50] loading... 20.0% of 25 files [ 6/ 50] loading... 24.0% of 25 files [ 7/ 50] loading... 28.0% of 25 files [ 8/ 50] loading... 32.0% of 25 files [ 9/ 50] loading... 36.0% of 25 files [ 10/ 50] loading... 40.0% of 25 files [ 11/ 50] loading... 44.0% of 25 files [ 12/ 50] loading... 48.0% of 25 files [ 13/ 50] loading... 52.0% of 25 files [ 14/ 50] loading... 56.0% of 25 files [ 15/ 50] loading... 60.0% of 25 files [ 16/ 50] loading... 64.0% of 25 files [ 17/ 50] loading... 68.0% of 25 files [ 18/ 50] loading... 72.0% of 25 files [ 19/ 50] loading... 76.0% of 25 files [ 20/ 50] loading... 80.0% of 25 files [ 21/ 50] loading... 84.0% of 25 files [ 22/ 50] loading... 88.0% of 25 files [ 23/ 50] loading... 92.0% of 25 files [ 24/ 50] loading... 96.0% of 25 files [ 25/ 50] loading... 100.0% of 25 files [ 25/ 50] compiling... 0.0% of 25 files [ 26/ 50] compiling... 4.0% of 25 files [ 27/ 50] compiling... 8.0% of 25 files [ 28/ 50] compiling... 12.0% of 25 files [ 29/ 50] compiling... 16.0% of 25 files [ 30/ 50] compiling... 20.0% of 25 files [ 31/ 50] compiling... 24.0% of 25 files [ 32/ 50] compiling... 28.0% of 25 files [ 33/ 50] compiling... 32.0% of 25 files [ 34/ 50] compiling... 36.0% of 25 files [ 35/ 50] compiling... 40.0% of 25 files [ 36/ 50] compiling... 44.0% of 25 files [ 37/ 50] compiling... 48.0% of 25 files [ 38/ 50] compiling... 52.0% of 25 files [ 39/ 50] compiling... 56.0% of 25 files [ 40/ 50] compiling... 60.0% of 25 files [ 41/ 50] compiling... 64.0% of 25 files [ 42/ 50] compiling... 68.0% of 25 files [ 43/ 50] compiling... 72.0% of 25 files [ 44/ 50] compiling... 76.0% of 25 files [ 45/ 50] compiling... 80.0% of 25 files [ 46/ 50] compiling... 84.0% of 25 files [ 47/ 50] compiling... 88.0% of 25 files [ 48/ 50] compiling... 92.0% of 25 files [ 49/ 50] compiling... 96.0% of 25 files [ 50/ 50] compiling... 100.0% of 25 files [ 0/ 50] loading... 0.0% of 25 files [ 1/ 50] loading... 4.0% of 25 files [ 2/ 50] loading... 8.0% of 25 files [ 3/ 50] loading... 12.0% of 25 files [ 4/ 50] loading... 16.0% of 25 files [ 5/ 50] loading... 20.0% of 25 files [ 6/ 50] loading... 24.0% of 25 files [ 7/ 50] loading... 28.0% of 25 files [ 8/ 50] loading... 32.0% of 25 files [ 9/ 50] loading... 36.0% of 25 files [ 10/ 50] loading... 40.0% of 25 files [ 11/ 50] loading... 44.0% of 25 files [ 12/ 50] loading... 48.0% of 25 files [ 13/ 50] loading... 52.0% of 25 files [ 14/ 50] loading... 56.0% of 25 files [ 15/ 50] loading... 60.0% of 25 files [ 16/ 50] loading... 64.0% of 25 files [ 17/ 50] loading... 68.0% of 25 files [ 18/ 50] loading... 72.0% of 25 files [ 19/ 50] loading... 76.0% of 25 files [ 20/ 50] loading... 80.0% of 25 files [ 21/ 50] loading... 84.0% of 25 files [ 22/ 50] loading... 88.0% of 25 files [ 23/ 50] loading... 92.0% of 25 files [ 24/ 50] loading... 96.0% of 25 files [ 25/ 50] loading... 100.0% of 25 files [ 25/ 50] compiling... 0.0% of 25 files [ 26/ 50] compiling... 4.0% of 25 files [ 27/ 50] compiling... 8.0% of 25 files [ 28/ 50] compiling... 12.0% of 25 files [ 29/ 50] compiling... 16.0% of 25 files [ 30/ 50] compiling... 20.0% of 25 files [ 31/ 50] compiling... 24.0% of 25 files [ 32/ 50] compiling... 28.0% of 25 files [ 33/ 50] compiling... 32.0% of 25 files [ 34/ 50] compiling... 36.0% of 25 files [ 35/ 50] compiling... 40.0% of 25 files [ 36/ 50] compiling... 44.0% of 25 files [ 37/ 50] compiling... 48.0% of 25 files [ 38/ 50] compiling... 52.0% of 25 files [ 39/ 50] compiling... 56.0% of 25 files [ 40/ 50] compiling... 60.0% of 25 files [ 41/ 50] compiling... 64.0% of 25 files [ 42/ 50] compiling... 68.0% of 25 files [ 43/ 50] compiling... 72.0% of 25 files [ 44/ 50] compiling... 76.0% of 25 files [ 45/ 50] compiling... 80.0% of 25 files [ 46/ 50] compiling... 84.0% of 25 files [ 47/ 50] compiling... 88.0% of 25 files [ 48/ 50] compiling... 92.0% of 25 files [ 49/ 50] compiling... 96.0% of 25 files [ 50/ 50] compiling... 100.0% of 25 files [ 0/ 50] loading... 0.0% of 25 files [ 1/ 50] loading... 4.0% of 25 files [ 2/ 50] loading... 8.0% of 25 files [ 3/ 50] loading... 12.0% of 25 files [ 4/ 50] loading... 16.0% of 25 files [ 5/ 50] loading... 20.0% of 25 files [ 6/ 50] loading... 24.0% of 25 files [ 7/ 50] loading... 28.0% of 25 files [ 8/ 50] loading... 32.0% of 25 files [ 9/ 50] loading... 36.0% of 25 files [ 10/ 50] loading... 40.0% of 25 files [ 11/ 50] loading... 44.0% of 25 files [ 12/ 50] loading... 48.0% of 25 files [ 13/ 50] loading... 52.0% of 25 files [ 14/ 50] loading... 56.0% of 25 files [ 15/ 50] loading... 60.0% of 25 files [ 16/ 50] loading... 64.0% of 25 files [ 17/ 50] loading... 68.0% of 25 files [ 18/ 50] loading... 72.0% of 25 files [ 19/ 50] loading... 76.0% of 25 files [ 20/ 50] loading... 80.0% of 25 files [ 21/ 50] loading... 84.0% of 25 files [ 22/ 50] loading... 88.0% of 25 files [ 23/ 50] loading... 92.0% of 25 files [ 24/ 50] loading... 96.0% of 25 files [ 25/ 50] loading... 100.0% of 25 files [ 25/ 50] compiling... 0.0% of 25 files [ 26/ 50] compiling... 4.0% of 25 files [ 27/ 50] compiling... 8.0% of 25 files [ 28/ 50] compiling... 12.0% of 25 files [ 29/ 50] compiling... 16.0% of 25 files [ 30/ 50] compiling... 20.0% of 25 files [ 31/ 50] compiling... 24.0% of 25 files [ 32/ 50] compiling... 28.0% of 25 files [ 33/ 50] compiling... 32.0% of 25 files [ 34/ 50] compiling... 36.0% of 25 files [ 35/ 50] compiling... 40.0% of 25 files [ 36/ 50] compiling... 44.0% of 25 files [ 37/ 50] compiling... 48.0% of 25 files [ 38/ 50] compiling... 52.0% of 25 files [ 39/ 50] compiling... 56.0% of 25 files [ 40/ 50] compiling... 60.0% of 25 files [ 41/ 50] compiling... 64.0% of 25 files [ 42/ 50] compiling... 68.0% of 25 files [ 43/ 50] compiling... 72.0% of 25 files [ 44/ 50] compiling... 76.0% of 25 files [ 45/ 50] compiling... 80.0% of 25 files [ 46/ 50] compiling... 84.0% of 25 files [ 47/ 50] compiling... 88.0% of 25 files [ 48/ 50] compiling... 92.0% of 25 files [ 49/ 50] compiling... 96.0% of 25 files [ 50/ 50] compiling... 100.0% of 25 files [ 0/ 50] loading... 0.0% of 25 files [ 1/ 50] loading... 4.0% of 25 files [ 2/ 50] loading... 8.0% of 25 files [ 3/ 50] loading... 12.0% of 25 files [ 4/ 50] loading... 16.0% of 25 files [ 5/ 50] loading... 20.0% of 25 files [ 6/ 50] loading... 24.0% of 25 files [ 7/ 50] loading... 28.0% of 25 files [ 8/ 50] loading... 32.0% of 25 files [ 9/ 50] loading... 36.0% of 25 files [ 10/ 50] loading... 40.0% of 25 files [ 11/ 50] loading... 44.0% of 25 files [ 12/ 50] loading... 48.0% of 25 files [ 13/ 50] loading... 52.0% of 25 files [ 14/ 50] loading... 56.0% of 25 files [ 15/ 50] loading... 60.0% of 25 files [ 16/ 50] loading... 64.0% of 25 files [ 17/ 50] loading... 68.0% of 25 files [ 18/ 50] loading... 72.0% of 25 files [ 19/ 50] loading... 76.0% of 25 files [ 20/ 50] loading... 80.0% of 25 files [ 21/ 50] loading... 84.0% of 25 files [ 22/ 50] loading... 88.0% of 25 files [ 23/ 50] loading... 92.0% of 25 files [ 24/ 50] loading... 96.0% of 25 files [ 25/ 50] loading... 100.0% of 25 files [ 25/ 50] compiling... 0.0% of 25 files [ 26/ 50] compiling... 4.0% of 25 files [ 27/ 50] compiling... 8.0% of 25 files [ 28/ 50] compiling... 12.0% of 25 files [ 29/ 50] compiling... 16.0% of 25 files [ 30/ 50] compiling... 20.0% of 25 files [ 31/ 50] compiling... 24.0% of 25 files [ 32/ 50] compiling... 28.0% of 25 files [ 33/ 50] compiling... 32.0% of 25 files [ 34/ 50] compiling... 36.0% of 25 files [ 35/ 50] compiling... 40.0% of 25 files [ 36/ 50] compiling... 44.0% of 25 files [ 37/ 50] compiling... 48.0% of 25 files [ 38/ 50] compiling... 52.0% of 25 files [ 39/ 50] compiling... 56.0% of 25 files [ 40/ 50] compiling... 60.0% of 25 files [ 41/ 50] compiling... 64.0% of 25 files [ 42/ 50] compiling... 68.0% of 25 files [ 43/ 50] compiling... 72.0% of 25 files [ 44/ 50] compiling... 76.0% of 25 files [ 45/ 50] compiling... 80.0% of 25 files [ 46/ 50] compiling... 84.0% of 25 files [ 47/ 50] compiling... 88.0% of 25 files [ 48/ 50] compiling... 92.0% of 25 files [ 49/ 50] compiling... 96.0% of 25 files [ 50/ 50] compiling... 100.0% of 25 files [ 0/ 50] loading... 0.0% of 25 files [ 1/ 50] loading... 4.0% of 25 files [ 2/ 50] loading... 8.0% of 25 files [ 3/ 50] loading... 12.0% of 25 files [ 4/ 50] loading... 16.0% of 25 files [ 5/ 50] loading... 20.0% of 25 files [ 6/ 50] loading... 24.0% of 25 files [ 7/ 50] loading... 28.0% of 25 files [ 8/ 50] loading... 32.0% of 25 files [ 9/ 50] loading... 36.0% of 25 files [ 10/ 50] loading... 40.0% of 25 files [ 11/ 50] loading... 44.0% of 25 files [ 12/ 50] loading... 48.0% of 25 files [ 13/ 50] loading... 52.0% of 25 files [ 14/ 50] loading... 56.0% of 25 files [ 15/ 50] loading... 60.0% of 25 files [ 16/ 50] loading... 64.0% of 25 files [ 17/ 50] loading... 68.0% of 25 files [ 18/ 50] loading... 72.0% of 25 files [ 19/ 50] loading... 76.0% of 25 files [ 20/ 50] loading... 80.0% of 25 files [ 21/ 50] loading... 84.0% of 25 files [ 22/ 50] loading... 88.0% of 25 files [ 23/ 50] loading... 92.0% of 25 files [ 24/ 50] loading... 96.0% of 25 files [ 25/ 50] loading... 100.0% of 25 files [ 25/ 50] compiling... 0.0% of 25 files [ 26/ 50] compiling... 4.0% of 25 files [ 27/ 50] compiling... 8.0% of 25 files [ 28/ 50] compiling... 12.0% of 25 files [ 29/ 50] compiling... 16.0% of 25 files [ 30/ 50] compiling... 20.0% of 25 files [ 31/ 50] compiling... 24.0% of 25 files [ 32/ 50] compiling... 28.0% of 25 files [ 33/ 50] compiling... 32.0% of 25 files [ 34/ 50] compiling... 36.0% of 25 files [ 35/ 50] compiling... 40.0% of 25 files [ 36/ 50] compiling... 44.0% of 25 files [ 37/ 50] compiling... 48.0% of 25 files [ 38/ 50] compiling... 52.0% of 25 files [ 39/ 50] compiling... 56.0% of 25 files [ 40/ 50] compiling... 60.0% of 25 files [ 41/ 50] compiling... 64.0% of 25 files [ 42/ 50] compiling... 68.0% of 25 files [ 43/ 50] compiling... 72.0% of 25 files [ 44/ 50] compiling... 76.0% of 25 files [ 45/ 50] compiling... 80.0% of 25 files [ 46/ 50] compiling... 84.0% of 25 files [ 47/ 50] compiling... 88.0% of 25 files [ 48/ 50] compiling... 92.0% of 25 files [ 49/ 50] compiling... 96.0% of 25 files [ 50/ 50] compiling... 100.0% of 25 files [ 0/ 50] loading... 0.0% of 25 files [ 1/ 50] loading... 4.0% of 25 filesBacktrace: In ice-9/boot-9.scm: 222:29 19 (map1 (((gnu packages nano)) ((gnu packages nvi)) ((gnu packages package-management)) ((gnu packages pciutils)) ((gnu packages texinfo)) ((gnu packages text-editors)) ((gnu # wget)) ?)) 222:29 18 (map1 (((gnu packages nvi)) ((gnu packages package-management)) ((gnu packages pciutils)) ((gnu packages texinfo)) ((gnu packages text-editors)) ((gnu packages wget)) ((gnu #)) ((?)) ?)) 222:29 17 (map1 (((gnu packages package-management)) ((gnu packages pciutils)) ((gnu packages texinfo)) ((gnu packages text-editors)) ((gnu packages wget)) ((gnu services)) ((gnu services #)) ?)) 222:29 16 (map1 (((gnu packages pciutils)) ((gnu packages texinfo)) ((gnu packages text-editors)) ((gnu packages wget)) ((gnu services)) ((gnu services shepherd)) ((gnu services base)) ((# ?)) ?)) 222:29 15 (map1 (((gnu packages texinfo)) ((gnu packages text-editors)) ((gnu packages wget)) ((gnu services)) ((gnu services shepherd)) ((gnu services base)) ((gnu bootloader)) ((gnu # #)) # ?)) 222:29 14 (map1 (((gnu packages text-editors)) ((gnu packages wget)) ((gnu services)) ((gnu services shepherd)) ((gnu services base)) ((gnu bootloader)) ((gnu system shadow)) ((gnu system #)) ?)) 222:29 13 (map1 (((gnu packages wget)) ((gnu services)) ((gnu services shepherd)) ((gnu services base)) ((gnu bootloader)) ((gnu system shadow)) ((gnu system nss)) ((gnu system locale)) ((?)) ?)) 222:17 12 (map1 (((gnu services)) ((gnu services shepherd)) ((gnu services base)) ((gnu bootloader)) ((gnu system shadow)) ((gnu system nss)) ((gnu system locale)) ((gnu system pam)) ((gnu ?)) ?)) 3327:17 11 (resolve-interface (gnu services) #:select _ #:hide _ #:prefix _ #:renamer _ #:version _) In ice-9/threads.scm: 390:8 10 (_ _) In ice-9/boot-9.scm: 3253:13 9 (_) In ice-9/threads.scm: 390:8 8 (_ _) In ice-9/boot-9.scm: 3544:20 7 (_) 2836:4 6 (save-module-excursion #<procedure 7fffdd1c7660 at ice-9/boot-9.scm:3545:21 ()>) 3564:26 5 (_) In unknown file: 4 (primitive-load-path "gnu/services" #<procedure 7fffde800600 at ice-9/boot-9.scm:3551:37 ()>) In ice-9/eval.scm: 626:19 3 (_ #<directory (gnu services) 7fffe2b5daa0>) 159:9 2 (_ #<directory (gnu services) 7fffe2b5daa0>) 213:37 1 (_ #<directory (gnu services) 7fffe2b5daa0>) In guix/modules.scm: 157:28 0 (loop ((gnu build hurd-boot) (guix build syscalls)) ((guix build utils)) #<<set> vhash: #<vhash 7fffdcb533e0 1 pairs> insert: #<procedure %insert (t-5ce36f5c768e728-57f t-5ce36f5c768e?>) guix/modules.scm:157:28: In procedure loop: ERROR: 1. &missing-dependency-error: module: (gnu build hurd-boot) search-path: ("." "/gnu/store/11i4vribdynrxkp4ppilkjp9y9jshaxq-guix-core-source" "/gnu/store/avd0dsg9rixk3djls8ikzphfjbl227za-guix-extra-source" "/gnu/store/vdi10jyhr1igrkdgnsjj09krjx1jkzkm-guix-packages-base-source" "/gnu/store/l8sdgq6cpnxyk732w23p7mhq6sial0vm-guile-gcrypt-0.4.0/share/guile/site/3.0" "/gnu/store/0i81lpfnn05pmjc5f43q4nfvd27r08f7-guile-gnutls-3.7.12/share/guile/site/3.0" "/gnu/store/rm803mxjvr9zamg1226dl9zf2275yjzg-guile-git-0.5.2/share/guile/site/3.0" "/gnu/store/bxvl7w7q66gbk7qkkhsiq30vl69jj4x7-guile-bytestructures-1.0.10/share/guile/site/3.0" "/gnu/store/q91hbi8yc2jnx0hlk6zb6vlkrw3xm0yx-guile-avahi-0.4.1/share/guile/site/3.0" "/gnu/store/p5f006jcr83jc7m731vhvjdkr2j0hnp3-guile-json-4.7.3/share/guile/site/3.0" "/gnu/store/d75xpk3qxw7na6zgbf2dw3asqhwifd6a-guile-semver-0.1.1/share/guile/site/3.0" "/gnu/store/19m9xm33jq34nb64z11q5bph85ff6gyd-guile-ssh-0.16.3/share/guile/site/3.0" "/gnu/store/r8izi6mi1mjl7s1kn20q1hxmy3jg2bxc-guile-sqlite3-0.1.3/share/guile/site/3.0" "/gnu/store/bc3zzjych6jyp4ph2af9k3w8qcs3nsn2-guile-lib-0.2.7/share/guile/site/3.0" "/gnu/store/w6gpivr3421wbzkjg6qlc95sv1srz15a-guile-zlib-0.1.0/share/guile/site/3.0" "/gnu/store/1zlqd5240mq0dwwig9bv1cg4zjf092h9-guile-lzlib-0.0.2/share/guile/site/3.0" "/gnu/store/rqd5wpa09fizcb211p78g6f2f5jb2lwg-guile-zstd-0.1.1/share/guile/site/3.0" "/gnu/store/xfd68fq6vmali9wqivg84baqp4n4maqx-guix-packages-source" "/gnu/store/a7sykpl77z61sr0dv034rpwby9bz8zwm-module-import" "/gnu/store/4gvgcfdiz67wv04ihqfa8pqwzsb0qpv5-guile-3.0.9/share/guile/3.0" "/gnu/store/4gvgcfdiz67wv04ihqfa8pqwzsb0qpv5-guile-3.0.9/share/guile/site/3.0" "/gnu/store/4gvgcfdiz67wv04ihqfa8pqwzsb0qpv5-guile-3.0.9/share/guile/site" "/gnu/store/4gvgcfdiz67wv04ihqfa8pqwzsb0qpv5-guile-3.0.9/share/guile") Change-Id: I6944ffd4c323c776005b0cef23218bffae59be23 --- gnu/machine/ssh.scm | 1 + gnu/system.scm | 224 +----------------------------- gnu/system/boot.scm | 277 ++++++++++++++++++++++++++++++++++++++ guix/scripts/system.scm | 1 + tests/boot-parameters.scm | 1 + 5 files changed, 281 insertions(+), 223 deletions(-) create mode 100644 gnu/system/boot.scm diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index b47ce7c225..0ffe71367c 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -23,6 +23,7 @@ (define-module (gnu machine ssh) #:use-module (gnu machine) #:autoload (gnu packages gnupg) (guile-gcrypt) #:use-module (gnu system) + #:use-module (gnu system boot) #:use-module (gnu system file-systems) #:use-module (gnu system uuid) #:use-module ((gnu services) #:select (sexp->system-provenance)) diff --git a/gnu/system.scm b/gnu/system.scm index aede35775e..a438137731 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -70,6 +70,7 @@ (define-module (gnu system) #:use-module (gnu services shepherd) #:use-module (gnu services base) #:use-module (gnu bootloader) + #:use-module (gnu system boot) #:use-module (gnu system shadow) #:use-module (gnu system nss) #:use-module (gnu system locale) @@ -149,25 +150,6 @@ (define-module (gnu system) hurd-default-essential-services - boot-parameters - boot-parameters? - boot-parameters-label - boot-parameters-root-device - boot-parameters-bootloader-name - boot-parameters-bootloader-menu-entries - boot-parameters-store-crypto-devices - boot-parameters-store-device - boot-parameters-store-directory-prefix - boot-parameters-store-mount-point - boot-parameters-locale - boot-parameters-kernel - boot-parameters-kernel-arguments - boot-parameters-initrd - boot-parameters-multiboot-modules - boot-parameters-version - %boot-parameters-version - read-boot-parameters - read-boot-parameters-file boot-parameters->menu-entry local-host-aliases ;deprecated @@ -327,210 +309,6 @@ (define* (operating-system-kernel-arguments ;;; Boot parameters ;;; -;;; Version 1 was introduced early 2022 to mark the departure from long option -;;; names such as '--load' to the more conventional initrd option names like -;;; 'gnu.load'. -;;; -;;; When bumping the boot-parameters version, increment it by one (1). -(define %boot-parameters-version 1) - -(define-record-type* <boot-parameters> - boot-parameters make-boot-parameters boot-parameters? - (label boot-parameters-label) - ;; Because we will use the 'store-device' to create the GRUB search command, - ;; the 'store-device' has slightly different semantics than 'root-device'. - ;; The 'store-device' can be a file system uuid, a file system label, or #f, - ;; but it cannot be a device file name such as "/dev/sda3", since GRUB would - ;; not understand that. The 'root-device', on the other hand, corresponds - ;; exactly to the device field of the <file-system> object representing the - ;; OS's root file system, so it might be a device file name like - ;; "/dev/sda3". The 'store-directory-prefix' field contains #f or the store - ;; file name inside the 'store-device' as it is seen by GRUB, e.g. it would - ;; contain "/storefs" if the store is located in that subvolume of a btrfs - ;; partition. - (root-device boot-parameters-root-device) - (bootloader-name boot-parameters-bootloader-name) - (bootloader-menu-entries ;list of <menu-entry> - boot-parameters-bootloader-menu-entries) - (store-device boot-parameters-store-device) - (store-mount-point boot-parameters-store-mount-point) - (store-directory-prefix boot-parameters-store-directory-prefix) - (store-crypto-devices boot-parameters-store-crypto-devices - (default '())) - (locale boot-parameters-locale) - (kernel boot-parameters-kernel) - (kernel-arguments boot-parameters-kernel-arguments) - (initrd boot-parameters-initrd) - (multiboot-modules boot-parameters-multiboot-modules) - (version boot-parameters-version ;positive integer - (default %boot-parameters-version))) - -(define (ensure-not-/dev device) - "If DEVICE starts with a slash, return #f. This is meant to filter out -Linux device names such as /dev/sda, and to preserve GRUB device names and -file system labels." - (if (and (string? device) (string-prefix? "/" device)) - #f - device)) - -(define (read-boot-parameters port) - "Read boot parameters from PORT and return the corresponding -<boot-parameters> object. Raise an error if the format is unrecognized." - (define device-sexp->device - (match-lambda - (('uuid (? symbol? type) (? bytevector? bv)) - (bytevector->uuid bv type)) - (('file-system-label (? string? label)) - (file-system-label label)) - ((? bytevector? bv) ;old format - (bytevector->uuid bv 'dce)) - ((? string? device) - (if (string-contains device ":/") - device ; nfs-root - ;; It used to be that we would not distinguish between labels and - ;; device names. Try to infer the right thing here. - (if (string-prefix? "/" device) - device - (file-system-label device)))))) - (define uuid-sexp->uuid - (match-lambda - (('uuid (? symbol? type) (? bytevector? bv)) - (bytevector->uuid bv type)) - (x - (warning (G_ "unrecognized uuid ~a at '~a'~%") x (port-filename port)) - #f))) - - ;; New versions are not backward-compatible, so only accept past and current - ;; versions, not future ones. - (define (version? n) - (member n (iota (1+ %boot-parameters-version)))) - - (match (read port) - (('boot-parameters ('version (? version? version)) - ('label label) ('root-device root) - ('kernel kernel) - rest ...) - (boot-parameters - (version version) - (label label) - (root-device (device-sexp->device root)) - - (bootloader-name - (match (assq 'bootloader-name rest) - ((_ args) args) - (#f 'grub))) ; for compatibility reasons. - - (bootloader-menu-entries - (match (assq 'bootloader-menu-entries rest) - ((_ entries) (map sexp->menu-entry entries)) - (#f '()))) - - ;; In the past, we would store the directory name of linux instead of - ;; the absolute file name of its image. Detect that and correct it. - (kernel (if (string=? kernel (direct-store-path kernel)) - (string-append kernel "/" - (system-linux-image-file-name)) - kernel)) - - (kernel-arguments - (match (assq 'kernel-arguments rest) - ((_ args) args) - (#f '()))) ;the old format - - (initrd - (match (assq 'initrd rest) - (('initrd ('string-append directory file)) ;the old format - (string-append directory file)) - (('initrd (? string? file)) - file) - (#f #f))) - - (multiboot-modules - (match (assq 'multiboot-modules rest) - ((_ args) args) - (#f '()))) - - (locale - (match (assq 'locale rest) - ((_ locale) locale) - (#f #f))) - - (store-device - ;; Linux device names like "/dev/sda1" are not suitable GRUB device - ;; identifiers, so we just filter them out. - (ensure-not-/dev - (match (assq 'store rest) - (('store ('device #f) _ ...) - root-device) - (('store ('device device) _ ...) - (device-sexp->device device)) - (_ ;the old format - root-device)))) - - (store-directory-prefix - (match (assq 'store rest) - (('store . store-data) - (match (assq 'directory-prefix store-data) - (('directory-prefix prefix) prefix) - ;; No directory-prefix found. - (_ #f))) - (_ - ;; No store found, old format. - #f))) - - (store-crypto-devices - (match (assq 'store rest) - (('store . store-data) - (match (assq 'crypto-devices store-data) - (('crypto-devices (devices ...)) - (map uuid-sexp->uuid devices)) - (('crypto-devices dev) - (warning (G_ "unrecognized crypto-devices ~S at '~a'~%") - dev (port-filename port)) - '()) - (_ - ;; No crypto-devices found. - '()))) - (_ - ;; No store found, old format. - '()))) - - (store-mount-point - (match (assq 'store rest) - (('store ('device _) ('mount-point mount-point) _ ...) - mount-point) - (_ ;the old format - "/"))))) - (x ;unsupported format - (raise - (make-compound-condition - (formatted-message - (G_ "unrecognized boot parameters at '~a'~%") - (port-filename port)) - (condition - (&fix-hint (hint (format #f (G_ "This probably means that this version -of Guix is older than the one that created @file{~a}. To address this, you -need to update Guix: - -@example -guix pull -@end example") - (port-filename port)))))))))) - -(define (read-boot-parameters-file system) - "Read boot parameters from SYSTEM's (system or generation) \"parameters\" -file and returns the corresponding <boot-parameters> object or #f if the -format is unrecognized. -The object has its kernel-arguments extended in order to make it bootable." - (let* ((file (string-append system "/parameters")) - (params (call-with-input-file file read-boot-parameters)) - (root (boot-parameters-root-device params)) - (version (boot-parameters-version params))) - (boot-parameters - (inherit params) - (kernel-arguments (append (bootable-kernel-arguments system root version) - (boot-parameters-kernel-arguments params)))))) - (define (boot-parameters->menu-entry conf) "Return a <menu-entry> instance given CONF, a <boot-parameters> instance." (let* ((kernel (boot-parameters-kernel conf)) diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm new file mode 100644 index 0000000000..87b0184f98 --- /dev/null +++ b/gnu/system/boot.scm @@ -0,0 +1,277 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013-2022 Ludovic Courtès <ludo <at> gnu.org> +;;; Copyright © 2015 Mark H Weaver <mhw <at> netris.org> +;;; Copyright © 2015, 2016 Alex Kost <alezost <at> gmail.com> +;;; Copyright © 2016 Chris Marusich <cmmarusich <at> gmail.com> +;;; Copyright © 2017 Mathieu Othacehe <m.othacehe <at> gmail.com> +;;; Copyright © 2019 Meiyo Peng <meiyo.peng <at> gmail.com> +;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835 <at> gmail.com> +;;; Copyright © 2020 Danny Milosavljevic <dannym <at> scratchpost.org> +;;; Copyright © 2020, 2021 Brice Waegeneire <brice <at> waegenei.re> +;;; Copyright © 2020 Florian Pelz <pelzflorian <at> pelzflorian.de> +;;; Copyright © 2020, 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> +;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <jannek <at> gnu.org> +;;; Copyright © 2020, 2022 Efraim Flashner <efraim <at> flashner.co.il> +;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be> +;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework <at> protonmail.com> +;;; Copyright © 2023 Bruno Victal <mirai <at> makinata.eu> +;;; Copyright © 2023 Felix Lechner <felix.lechner <at> lease-up.com> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu system boot) + #:use-module (guix store) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (gnu bootloader) + #:use-module (gnu system file-systems) + #:use-module (ice-9 format) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-35) + #:use-module (rnrs bytevectors) + #:export (boot-parameters + boot-parameters? + boot-parameters-label + boot-parameters-root-device + boot-parameters-bootloader-name + boot-parameters-bootloader-menu-entries + boot-parameters-store-crypto-devices + boot-parameters-store-device + boot-parameters-store-directory-prefix + boot-parameters-store-mount-point + boot-parameters-locale + boot-parameters-kernel + boot-parameters-kernel-arguments + boot-parameters-initrd + boot-parameters-multiboot-modules + boot-parameters-version + %boot-parameters-version + + read-boot-parameters + read-boot-parameters-file + + ensure-not-/dev)) + +;;; +;;; Boot parameters +;;; + +;;; Version 1 was introduced early 2022 to mark the departure from long option +;;; names such as '--load' to the more conventional initrd option names like +;;; 'gnu.load'. +;;; +;;; When bumping the boot-parameters version, increment it by one (1). +(define %boot-parameters-version 1) + +(define-record-type* <boot-parameters> + boot-parameters make-boot-parameters boot-parameters? + (label boot-parameters-label) + ;; Because we will use the 'store-device' to create the GRUB search command, + ;; the 'store-device' has slightly different semantics than 'root-device'. + ;; The 'store-device' can be a file system uuid, a file system label, or #f, + ;; but it cannot be a device file name such as "/dev/sda3", since GRUB would + ;; not understand that. The 'root-device', on the other hand, corresponds + ;; exactly to the device field of the <file-system> object representing the + ;; OS's root file system, so it might be a device file name like + ;; "/dev/sda3". The 'store-directory-prefix' field contains #f or the store + ;; file name inside the 'store-device' as it is seen by GRUB, e.g. it would + ;; contain "/storefs" if the store is located in that subvolume of a btrfs + ;; partition. + (root-device boot-parameters-root-device) + (bootloader-name boot-parameters-bootloader-name) + (bootloader-menu-entries ;list of <menu-entry> + boot-parameters-bootloader-menu-entries) + (store-device boot-parameters-store-device) + (store-mount-point boot-parameters-store-mount-point) + (store-directory-prefix boot-parameters-store-directory-prefix) + (store-crypto-devices boot-parameters-store-crypto-devices + (default '())) + (locale boot-parameters-locale) + (kernel boot-parameters-kernel) + (kernel-arguments boot-parameters-kernel-arguments) + (initrd boot-parameters-initrd) + (multiboot-modules boot-parameters-multiboot-modules) + (version boot-parameters-version ;positive integer + (default %boot-parameters-version))) + +(define (read-boot-parameters port) + "Read boot parameters from PORT and return the corresponding +<boot-parameters> object. Raise an error if the format is unrecognized." + (define device-sexp->device + (match-lambda + (('uuid (? symbol? type) (? bytevector? bv)) + (bytevector->uuid bv type)) + (('file-system-label (? string? label)) + (file-system-label label)) + ((? bytevector? bv) ;old format + (bytevector->uuid bv 'dce)) + ((? string? device) + (if (string-contains device ":/") + device ; nfs-root + ;; It used to be that we would not distinguish between labels and + ;; device names. Try to infer the right thing here. + (if (string-prefix? "/" device) + device + (file-system-label device)))))) + (define uuid-sexp->uuid + (match-lambda + (('uuid (? symbol? type) (? bytevector? bv)) + (bytevector->uuid bv type)) + (x + (warning (G_ "unrecognized uuid ~a at '~a'~%") x (port-filename port)) + #f))) + + ;; New versions are not backward-compatible, so only accept past and current + ;; versions, not future ones. + (define (version? n) + (member n (iota (1+ %boot-parameters-version)))) + + (match (read port) + (('boot-parameters ('version (? version? version)) + ('label label) ('root-device root) + ('kernel kernel) + rest ...) + (boot-parameters + (version version) + (label label) + (root-device (device-sexp->device root)) + + (bootloader-name + (match (assq 'bootloader-name rest) + ((_ args) args) + (#f 'grub))) ; for compatibility reasons. + + (bootloader-menu-entries + (match (assq 'bootloader-menu-entries rest) + ((_ entries) (map sexp->menu-entry entries)) + (#f '()))) + + ;; In the past, we would store the directory name of linux instead of + ;; the absolute file name of its image. Detect that and correct it. + (kernel (if (string=? kernel (direct-store-path kernel)) + (string-append kernel "/" + (system-linux-image-file-name)) + kernel)) + + (kernel-arguments + (match (assq 'kernel-arguments rest) + ((_ args) args) + (#f '()))) ;the old format + + (initrd + (match (assq 'initrd rest) + (('initrd ('string-append directory file)) ;the old format + (string-append directory file)) + (('initrd (? string? file)) + file) + (#f #f))) + + (multiboot-modules + (match (assq 'multiboot-modules rest) + ((_ args) args) + (#f '()))) + + (locale + (match (assq 'locale rest) + ((_ locale) locale) + (#f #f))) + + (store-device + ;; Linux device names like "/dev/sda1" are not suitable GRUB device + ;; identifiers, so we just filter them out. + (ensure-not-/dev + (match (assq 'store rest) + (('store ('device #f) _ ...) + root-device) + (('store ('device device) _ ...) + (device-sexp->device device)) + (_ ;the old format + root-device)))) + + (store-directory-prefix + (match (assq 'store rest) + (('store . store-data) + (match (assq 'directory-prefix store-data) + (('directory-prefix prefix) prefix) + ;; No directory-prefix found. + (_ #f))) + (_ + ;; No store found, old format. + #f))) + + (store-crypto-devices + (match (assq 'store rest) + (('store . store-data) + (match (assq 'crypto-devices store-data) + (('crypto-devices (devices ...)) + (map uuid-sexp->uuid devices)) + (('crypto-devices dev) + (warning (G_ "unrecognized crypto-devices ~S at '~a'~%") + dev (port-filename port)) + '()) + (_ + ;; No crypto-devices found. + '()))) + (_ + ;; No store found, old format. + '()))) + + (store-mount-point + (match (assq 'store rest) + (('store ('device _) ('mount-point mount-point) _ ...) + mount-point) + (_ ;the old format + "/"))))) + (x ;unsupported format + (raise + (make-compound-condition + (formatted-message + (G_ "unrecognized boot parameters at '~a'~%") + (port-filename port)) + (condition + (&fix-hint (hint (format #f (G_ "This probably means that this version +of Guix is older than the one that created @file{~a}. To address this, you +need to update Guix: + +@example +guix pull +@end example") + (port-filename port)))))))))) + +(define (read-boot-parameters-file system) + "Read boot parameters from SYSTEM's (system or generation) \"parameters\" +file and returns the corresponding <boot-parameters> object or #f if the +format is unrecognized. +The object has its kernel-arguments extended in order to make it bootable." + (let* ((file (string-append system "/parameters")) + (params (call-with-input-file file read-boot-parameters)) + (root (boot-parameters-root-device params)) + (version (boot-parameters-version params))) + (boot-parameters + (inherit params) + (kernel-arguments (append (bootable-kernel-arguments system root version) + (boot-parameters-kernel-arguments params)))))) + +(define (ensure-not-/dev device) + "If DEVICE starts with a slash, return #f. This is meant to filter out +Linux device names such as /dev/sda, and to preserve GRUB device names and +file system labels." + (if (and (string? device) (string-prefix? "/" device)) + #f + device)) + +;;; boot.scm ends here diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 955dfa618d..40df166fd7 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -66,6 +66,7 @@ (define-module (guix scripts system) #:use-module (gnu image) #:use-module (gnu system) #:use-module (gnu bootloader) + #:use-module (gnu system boot) #:use-module (gnu system file-systems) #:use-module (gnu system image) #:use-module (gnu system mapped-devices) diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm index 03a1d01aff..2e7976aa6c 100644 --- a/tests/boot-parameters.scm +++ b/tests/boot-parameters.scm @@ -27,6 +27,7 @@ (define-module (test-boot-parameters) #:use-module (gnu bootloader) #:use-module (gnu bootloader grub) #:use-module (gnu system) + #:use-module (gnu system boot) #:use-module (gnu system file-systems) #:use-module (gnu system uuid) #:use-module ((guix diagnostics) #:select (formatted-message?)) -- 2.41.0
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.