From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: maxim.cournoyer@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 01 May 2020 13:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 40998@debbugs.gnu.org X-Debbugs-Original-To: bug-guix Received: via spool by submit@debbugs.gnu.org id=B.158834119730675 (code B ref -1); Fri, 01 May 2020 13:54:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 May 2020 13:53:17 +0000 Received: from localhost ([127.0.0.1]:48478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUW6P-0007yh-DC for submit@debbugs.gnu.org; Fri, 01 May 2020 09:53:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:40234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUW6N-0007yV-5A for submit@debbugs.gnu.org; Fri, 01 May 2020 09:53:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59854) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUW6M-0004rs-LN for bug-guix@gnu.org; Fri, 01 May 2020 09:53:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUW6M-0006nm-3i for bug-guix@gnu.org; Fri, 01 May 2020 09:53:14 -0400 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:43249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUW6L-0006nc-Np for bug-guix@gnu.org; Fri, 01 May 2020 09:53:13 -0400 Received: by mail-qk1-x731.google.com with SMTP id i136so5142770qke.10 for ; Fri, 01 May 2020 06:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=SaO1ROAwK+3O/oKgs67+yZ3H6D7b8A9NWErGSCbQXcY=; b=fgmJav1ydGFIr51K2exVCocTzVRQTOKd1wD56xHWHovI+mgYRRTqPIQddlS0G3Z8v1 PrDVZLpS/rU/guZTehT8kC2gHrDLkaDUTBErelLxE4lpPzxGDGFyQdozoYRIoub5+mN1 aEntDE9hikAA6zvtqvtLqEOi4gfuwCaAowVKDr62tNaCnEj+q4qKOuZK+4HzLe80tolu C0MfAZZOhnboHnjpUZfloxbDTvc6wdU2hztGQrqITlTj4DXo9WgWWpWfkndjv8IyRwXd msWnL2VSDQlvct0p1ol6IhUMGkgpaRt+2xtD2rl2SL4waGStdqqRNV/RnS4k1qWZeWqe 54bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=SaO1ROAwK+3O/oKgs67+yZ3H6D7b8A9NWErGSCbQXcY=; b=IZ84IxFJpwS4eomFhdIOiGr0rVOto2jbJyJ1dEeysvAUM3jfPRya6nSLLFvl+33Y5V 9/Ey9KlGLwiEBRsZK+atm0H//NbwOR5WxzHXZ3JCYH2mbxFGFA2HqhrQFsgoI9sNLFHm 39Aeu/T2ycS6K9ArhcNG3PQFdx/jPGsYd3HA6+b4qXTpD/A/IP76mxOB8Jti4v3OLLnY f5Pp8dIUN/GhVccJKQMQMy9Uz/RXtNWHM/99Jg0YW9KHQ+KzlOJw91jHTWT0axmPoGs0 ELUUD+jZMfehwwO1f0Ekm5A+yjcERFE6sfyXkIplh+rjo+bCkh6E5JQqDR7H2IW2kkMK M+WQ== X-Gm-Message-State: AGi0Pua6k8hBiGP8nFgauJhNi6mAICS4cpFKRt3ERxSBJoeF0qdq24m+ jFjXxQHHBr05+EvWLjKSQpsiUkWU X-Google-Smtp-Source: APiQypIzsmtc2NASuO/8rrMTQrxX3fyJBXGjCjz1exGYu9VCEnXgW48MOkC4EgBz6W5COXn6MpE6gA== X-Received: by 2002:a37:5c46:: with SMTP id q67mr3676133qkb.210.1588341192629; Fri, 01 May 2020 06:53:12 -0700 (PDT) Received: from hurd (dsl-153-87.b2b2c.ca. [66.158.153.87]) by smtp.gmail.com with ESMTPSA id u11sm2701733qtj.10.2020.05.01.06.53.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2020 06:53:12 -0700 (PDT) From: maxim.cournoyer@gmail.com X-Google-Original-From: maxim@hurd.i-did-not-set--mail-host-address--so-tickle-me Date: Fri, 01 May 2020 09:53:11 -0400 Message-ID: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x731.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::731 X-Spam-Score: 2.7 (++) 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: Which means users cannot pass a 'rootflags=degraded' command line option to the kernel line in GRUB to attempt booting a system whose RAID array is degraded. rootflags is standard across distributions, and is what users expect. Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] 2.0 PDS_TONAME_EQ_TOLOCAL_SHORT Short body with To: name matches everything in local email 2.0 SPOOFED_FREEMAIL No description available. 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: -0.3 (/) Which means users cannot pass a 'rootflags=degraded' command line option to the kernel line in GRUB to attempt booting a system whose RAID array is degraded. rootflags is standard across distributions, and is what users expect. Such support was added in earlier version of the patches proposed here: https://issues.guix.gnu.org/37305#0 but is later simplified out. Maxim From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 1/3] initrd: Rename the '--root' initrd option to just 'root'. References: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 18 Feb 2022 15:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 40998@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.16451984167942 (code B ref 40998); Fri, 18 Feb 2022 15:34:02 +0000 Received: (at 40998) by debbugs.gnu.org; 18 Feb 2022 15:33:36 +0000 Received: from localhost ([127.0.0.1]:56226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL5GJ-000242-HL for submit@debbugs.gnu.org; Fri, 18 Feb 2022 10:33:36 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:45623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL5GI-00023n-3L for 40998@debbugs.gnu.org; Fri, 18 Feb 2022 10:33:34 -0500 Received: by mail-qv1-f49.google.com with SMTP id c14so15370323qvl.12 for <40998@debbugs.gnu.org>; Fri, 18 Feb 2022 07:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nxoMe9CKrZQVeDXHj7Flr5en22PY7mQ90Kfdv9QLTDg=; b=Sn9NfWJivb5bzxdbgT7Z5zDe0WPR2PIHbGn9irlKZb0vxKwdEL42wZd+h1pewt6w/j KT/vDVrSrTu0Hwq1Fbb6mMa4PrsUBHck2b2hnK1tZG16PZVnGEIAKgmt2n07Fp6iUiX9 YX8sgsDDm1vxjZUiCzD09/yl64TQ1sk06doWHf+Na3tYJ+CBkQ1wWEQPiyhtMsf5FxN5 lJkm1WB4EUSAp+Z5VQiKFlkBHbipTU7Qm39r4AzszuuxZ7nxNfdBtJszVgjn+q9D8VVh 3ZddiqOC9yttVxj6mIh2J/rFrF0BPrwKujRED4OYVrGFcJmAkWoo05izsQx08M4kbWQq iQMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nxoMe9CKrZQVeDXHj7Flr5en22PY7mQ90Kfdv9QLTDg=; b=PczgydR4ByDex+ltxtG6CYcvQJg5mYH+9h5IPhx/1H1JFKuyxI6wvXY4bL19MN27yo hvslUIXGpesB6gpaNefr7jX6/vF/G13nkjjHknuQzjc2qwqAzCtYKXwWPKp2E5+O0JCs v4g8YW3eXUTy46B3ZbwqEPbCi0imcWH6ER6nXX+Xsv+fE6qxYtbgwEGbE/oYxfFZap+3 rNybzujl2znHqk5L3t8uF94vItYe5DkH9T96dlDgk5h4yqK4TP2og9g6lzwySMtrSFZD wd7UReytW7Tf+nKp9s3I+67JtN/ZVsYzz4Cs6gAlqEEa4jbUK7cJr1WXsiqKv0n9PnxZ v48Q== X-Gm-Message-State: AOAM533kMnAM1bLlCOxk9JGU+pSeAD1HIQ8n8BnP8irOndK2r9AQzTsb SjsHPdgdBWtpYOg5PNbC4mvfYBGDpCo= X-Google-Smtp-Source: ABdhPJycEr14orumG7Y27ReKO17Ci6IZpsQ46n2+8Y9HaHS2HGvIISnW09M0+ueMR/LFwjksk4paiw== X-Received: by 2002:a05:6214:1183:b0:42c:1a57:2ee5 with SMTP id t3-20020a056214118300b0042c1a572ee5mr6194190qvv.59.1645198407851; Fri, 18 Feb 2022 07:33:27 -0800 (PST) Received: from localhost.localdomain (dsl-149-79.b2b2c.ca. [66.158.149.79]) by smtp.gmail.com with ESMTPSA id y21sm3726781qtn.62.2022.02.18.07.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 07:33:27 -0800 (PST) From: Maxim Cournoyer Date: Fri, 18 Feb 2022 10:33:21 -0500 Message-Id: <20220218153323.29393-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) This is to make it less surprising, given the common convention sets forth by the kernel Linux command-line parameters. * gnu/build/linux-boot.scm (boot-system): Rename the '--root' option to 'root'. Adjust doc. * gnu/installer/parted.scm (installer-root-partition-path): Use 'root' instead of '--root'. * gnu/system.scm (bootable-kernel-arguments): Likewise. (operating-system-boot-parameters): Adjust doc. (operating-system-boot-parameters-file): Likewise. * gnu/system/linux-initrd.scm (base-initrd): Likewise. * doc/guix.texi: Adjust doc. --- doc/guix.texi | 6 +++--- gnu/build/linux-boot.scm | 20 ++++++++++---------- gnu/installer/parted.scm | 2 +- gnu/system.scm | 8 ++++---- gnu/system/linux-initrd.scm | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a4145af7fd..ba613ea31f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34909,7 +34909,7 @@ Guix uses this option to yield control to a boot program that runs the service activation programs and then spawns the GNU@tie{}Shepherd, the initialization system. -@item --root=@var{root} +@item root=@var{root} Mount @var{root} as the root file system. @var{root} can be a device name like @code{/dev/sda1}, a file system label, or a file system UUID. When unspecified, the device name from the root file system of the @@ -34967,7 +34967,7 @@ here is how to use it and customize it further. [#:helper-packages '()] [#:qemu-networking? #f] [#:volatile-root? #f] Return a derivation that builds a raw initrd. @var{file-systems} is a list of file systems to be mounted by the initrd, possibly in addition to -the root file system specified on the kernel command line via @option{--root}. +the root file system specified on the kernel command line via @option{root}. @var{linux-modules} is a list of kernel modules to be loaded at boot time. @var{mapped-devices} is a list of device mappings to realize before @var{file-systems} are mounted (@pxref{Mapped Devices}). @@ -34997,7 +34997,7 @@ to it are lost. Return as a file-like object a generic initrd, with kernel modules taken from @var{linux}. @var{file-systems} is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified -on the kernel command line via @option{--root}. @var{mapped-devices} is a list of device +on the kernel command line via @option{root}. @var{mapped-devices} is a list of device mappings to realize before @var{file-systems} are mounted. When true, @var{keyboard-layout} is a @code{} record denoting diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 0ae316849e..d36601d824 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -499,12 +499,12 @@ (define* (boot-system #:key KEYMAP-FILE is true), then setting up QEMU guest networking if QEMU-GUEST-NETWORKING? is true, calling PRE-MOUNT, mounting the file systems specified in MOUNTS, and finally booting into the new root if any. The initrd -supports kernel command-line options '--load', '--root', and '--repl'. It -also honors a subset of the documented Linux kernel command-line parameters -such as 'fsck.mode', 'resume' and 'rootdelay'. +supports kernel command-line options '--load' and '--repl'. It also honors a +subset of the Linux kernel command-line parameters such as 'fsck.mode', +'resume', 'root' and 'rootdelay'. -Mount the root file system, specified by the '--root' command-line argument, -if any. +Mount the root file system, specified by the 'root' command-line argument, if +any. MOUNTS must be a list of objects. @@ -517,9 +517,9 @@ (define (root-mount-point? fs) (string=? (file-system-mount-point fs) "/")) (define (device-string->file-system-device device-string) - ;; The "--root=SPEC" kernel command-line option always provides a - ;; string, but the string can represent a device, an nfs-root, a UUID, or a - ;; label. So check for all four. + ;; The "root=SPEC" kernel command-line option always provides a string, + ;; but the string can represent a device, an nfs-root, a UUID, or a label. + ;; So check for all four. (cond ((string-prefix? "/" device-string) device-string) ((string-contains device-string ":/") device-string) ; nfs-root ((uuid device-string) => identity) @@ -533,9 +533,9 @@ (define (device-string->file-system-device device-string) (mount-essential-file-systems) (let* ((args (linux-command-line)) (to-load (find-long-option "--load" args)) - ;; If present, ‘--root’ on the kernel command line takes precedence + ;; If present, ‘root’ on the kernel command line takes precedence ;; over the ‘device’ field of the root record. - (root-device (and=> (find-long-option "--root" args) + (root-device (and=> (find-long-option "root" args) device-string->file-system-device)) (root-fs (or (find root-mount-point? mounts) ;; Fall back to fictitious defaults. diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index e33ef5f8fd..94ef9b42bc 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -348,7 +348,7 @@ (define (remove-logical-devices) (define (installer-root-partition-path) "Return the root partition path, or #f if it could not be detected." (let* ((cmdline (linux-command-line)) - (root (find-long-option "--root" cmdline))) + (root (find-long-option "root" cmdline))) (and root (or (and (access? root F_OK) root) (find-partition-by-label root) diff --git a/gnu/system.scm b/gnu/system.scm index cc925de16f..f14186a64f 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -187,9 +187,9 @@ (define-module (gnu system) (define (bootable-kernel-arguments system root-device) "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVICE." - (list (string-append "--root=" + (list (string-append "root=" ;; Note: Always use the DCE format because that's what - ;; (gnu build linux-boot) expects for the '--root' + ;; (gnu build linux-boot) expects for the 'root' ;; kernel command-line option. (file-system-device->string root-device #:uuid-type 'dce)) @@ -1441,7 +1441,7 @@ (define* (operating-system-boot-parameters os root-device #:key system-kernel-arguments?) "Return a monadic record that describes the boot parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments -such as '--root' and '--load' to ." +such as 'root' and '--load' to ." (let* ((initrd (and (not (operating-system-hurd os)) (operating-system-initrd-file os))) (store (operating-system-store-file-system os)) @@ -1487,7 +1487,7 @@ (define* (operating-system-boot-parameters-file os "Return a file that describes the boot parameters of OS. The primary use of this file is the reconstruction of GRUB menu entries for old configurations. -When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments such as '--root' +When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments such as 'root' and '--load' to the returned file (since the returned file is then usually stored into the content-addressed \"system\" directory, it's usually not a good idea to give it because the content hash would change by the content hash diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 329cd38cd6..4c4c78e444 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -181,7 +181,7 @@ (define* (raw-initrd file-systems "Return as a file-like object a raw initrd, with kernel modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified -on the kernel command line via '--root'. LINUX-MODULES is a list of kernel +on the kernel command line via 'root'. LINUX-MODULES is a list of kernel modules to be loaded at boot time. MAPPED-DEVICES is a list of device mappings to realize before FILE-SYSTEMS are mounted. HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include @@ -375,7 +375,7 @@ (define* (base-initrd file-systems "Return as a file-like object a generic initrd, with kernel modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified -on the kernel command line via '--root'. MAPPED-DEVICES is a list of device +on the kernel command line via 'root'. MAPPED-DEVICES is a list of device mappings to realize before FILE-SYSTEMS are mounted. When true, KEYBOARD-LAYOUT is a record denoting the desired -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 2/3] initrd: Honor rootfstype and rootflags command-line parameters. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 18 Feb 2022 15:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 40998@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.16451984207965 (code B ref 40998); Fri, 18 Feb 2022 15:34:02 +0000 Received: (at 40998) by debbugs.gnu.org; 18 Feb 2022 15:33:40 +0000 Received: from localhost ([127.0.0.1]:56230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL5GO-00024O-3M for submit@debbugs.gnu.org; Fri, 18 Feb 2022 10:33:40 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:36750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL5GK-00023r-AQ for 40998@debbugs.gnu.org; Fri, 18 Feb 2022 10:33:36 -0500 Received: by mail-qv1-f49.google.com with SMTP id o5so15417232qvm.3 for <40998@debbugs.gnu.org>; Fri, 18 Feb 2022 07:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PMmQAm1rSCzEw/n2G196BjEQkvg4TTbf2nGcfwN3tu4=; b=RT1oVzpKxF8tRh+IoaaEHjrcUolo1HkfVSNLRZ2jgLfB1C+Oy3X4tqt29M3UiPWGB1 TVJk7gBpo3l0US84+ciokIPqEg6RlEG9D4IcMCfIPXIZA1A+uZHhZ/CigwxjvFJFate3 Iub4US54TFxD+PSyL8iYLxhcaJPVexg6aqUJ0KQ3Y4w4eSTn+SRfGNF16GbJrPa/SuoB ke9Q65y5j7BLfswAlur3LmelHLIIRKjznbmLd7fK6JmzoO8moDaSKUURN1Ndey+/T4Az 7yUvgxBIj2fX0+4bA92wiaLzc1AcRvw2NvOB5+fi8hk9WpfZTjyJAtV2Yv1rg63YRBVU X0HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PMmQAm1rSCzEw/n2G196BjEQkvg4TTbf2nGcfwN3tu4=; b=LRsqXVbirsEsb1PQUZWZ6bRDdf/D0p93JR8OXeigFXUcLJRU+M/EQ6OJiSanPSeGPJ s/uTWYCbt3/FeXQvFf3Mw8JHkqhhcB3xzF4KsHmx0afU/Nm/vXjfzftupxaTw7CWJPml hz7t1GHACzci4HtLFV2kmGMhrZvbSB2wHQ8yU8o4TIDAzdGeXadbWvHe7eOfUtweEKet WkttVlNWe8jB2Trn59R3Zu+zpJMLfEgEKn486PLMs+HDpngg9neC6FzCRfiVrVsbXHaZ 8svI7kXJl/zPmstv9R6vYk4DWVOBs7buGGQ0hkYtBBvuZBa0NB3TAWdL1AF1jDmazoUz YRYg== X-Gm-Message-State: AOAM533XE6Dr/f4bnh9eV95fa5kEfePv0Zc9MpVOKgTTIXi3vTrwTGKd X14bEgVgkT2jjwWpuULNEoTxIWfyH9A= X-Google-Smtp-Source: ABdhPJz8SG1R11/7MFRAcChiko+Hf14QmbvaLqBP/Eudh96W8g11UM3sogU23OTd1SBLGDZOIiwF7Q== X-Received: by 2002:ac8:5853:0:b0:2d6:8a16:753c with SMTP id h19-20020ac85853000000b002d68a16753cmr7235945qth.401.1645198410499; Fri, 18 Feb 2022 07:33:30 -0800 (PST) Received: from localhost.localdomain (dsl-149-79.b2b2c.ca. [66.158.149.79]) by smtp.gmail.com with ESMTPSA id y21sm3726781qtn.62.2022.02.18.07.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 07:33:29 -0800 (PST) From: Maxim Cournoyer Date: Fri, 18 Feb 2022 10:33:22 -0500 Message-Id: <20220218153323.29393-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220218153323.29393-1-maxim.cournoyer@gmail.com> References: <20220218153323.29393-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) * gnu/build/linux-boot.scm (boot-system): Honor rootfstype and rootflags arguments. Update doc. Error out in case there is insufficient information with regard to the root file system. Restore the behavior of inferring the root device from the root file system from the operating system in case the root argument is not provided. * doc/guix.texi (Initial RAM Disk): Document the new command-line parameters. --- doc/guix.texi | 10 +++++++ gnu/build/linux-boot.scm | 59 +++++++++++++++++++++++++--------------- 2 files changed, 47 insertions(+), 22 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ba613ea31f..cbfd9f68f2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34915,6 +34915,16 @@ name like @code{/dev/sda1}, a file system label, or a file system UUID. When unspecified, the device name from the root file system of the operating system declaration is used. +@item rootfstype=@var{type} +Set the type of the root file system. It overrides the @code{type} +field of the root file system specified via the @code{operating-system} +declaration, if any. + +@item rootflags=@var{options} +Set the mount @emph{options} of the root file system. It overrides the +@code{options} field of the root file system specified via the +@code{operating-system} declaration, if any. + @item fsck.mode=@var{mode} Whether to check the @var{root} file system for errors before mounting it. @var{mode} is one of @code{skip} (never check), @code{force} (always diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index d36601d824..b1573fe757 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -499,9 +499,9 @@ (define* (boot-system #:key KEYMAP-FILE is true), then setting up QEMU guest networking if QEMU-GUEST-NETWORKING? is true, calling PRE-MOUNT, mounting the file systems specified in MOUNTS, and finally booting into the new root if any. The initrd -supports kernel command-line options '--load' and '--repl'. It also honors a -subset of the Linux kernel command-line parameters such as 'fsck.mode', -'resume', 'root' and 'rootdelay'. +supports the kernel command-line options '--load' and '--repl'. It +also honors a subset of the Linux kernel command-line parameters such as +'fsck.mode', 'resume', 'rootdelay', rootflags and rootfstype. Mount the root file system, specified by the 'root' command-line argument, if any. @@ -533,17 +533,32 @@ (define (device-string->file-system-device device-string) (mount-essential-file-systems) (let* ((args (linux-command-line)) (to-load (find-long-option "--load" args)) - ;; If present, ‘root’ on the kernel command line takes precedence - ;; over the ‘device’ field of the root record. (root-device (and=> (find-long-option "root" args) device-string->file-system-device)) - (root-fs (or (find root-mount-point? mounts) - ;; Fall back to fictitious defaults. - (file-system (device (or root-device "/dev/root")) - (mount-point "/") - (type "ext4")))) + (rootfstype (find-long-option "rootfstype" args)) + (rootflags (find-long-option "rootflags" args)) + (root-fs* (find root-mount-point? mounts)) (fsck.mode (find-long-option "fsck.mode" args))) + (unless (or root-fs* (and root-device rootfstype)) + (error "no root file system or 'root' and 'rootfstype' parameters")) + + ;; If present, ‘root’ on the kernel command line takes precedence over + ;; the ‘device’ field of the root record; likewise for + ;; the 'rootfstype' and 'rootflags' arguments. + (define root-fs + (if root-fs* + (file-system + (inherit root-fs*) + (device (or root-device (file-system-device root-fs*))) + (type (or rootfstype (file-system-type root-fs*))) + (options (or rootflags (file-system-options root-fs*)))) + (file-system + (device root-device) + (mount-point "/") + (type rootfstype) + (options rootflags)))) + (define (check? fs) (match fsck.mode ("skip" #f) @@ -615,18 +630,18 @@ (define (repair fs) (setenv "EXT2FS_NO_MTAB_OK" "1") - (if root-device - (mount-root-file-system (canonicalize-device-spec root-device) - (file-system-type root-fs) - #:volatile-root? volatile-root? - #:flags (mount-flags->bit-mask - (file-system-flags root-fs)) - #:options (file-system-options root-fs) - #:check? (check? root-fs) - #:skip-check-if-clean? - (skip-check-if-clean? root-fs) - #:repair (repair root-fs)) - (mount "none" "/root" "tmpfs")) + ;; Mount the root file system. + (mount-root-file-system (canonicalize-device-spec + (file-system-device root-fs)) + (file-system-type root-fs) + #:volatile-root? volatile-root? + #:flags (mount-flags->bit-mask + (file-system-flags root-fs)) + #:options (file-system-options root-fs) + #:check? (check? root-fs) + #:skip-check-if-clean? + (skip-check-if-clean? root-fs) + #:repair (repair root-fs)) ;; Mount the specified non-root file systems. (for-each (lambda (fs) -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 3/3] initrd: Print its command-line parameters. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 18 Feb 2022 15:34:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 40998@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.16451984207971 (code B ref 40998); Fri, 18 Feb 2022 15:34:03 +0000 Received: (at 40998) by debbugs.gnu.org; 18 Feb 2022 15:33:40 +0000 Received: from localhost ([127.0.0.1]:56232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL5GO-00024Q-Fu for submit@debbugs.gnu.org; Fri, 18 Feb 2022 10:33:40 -0500 Received: from mail-qv1-f46.google.com ([209.85.219.46]:47063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL5GL-00023t-QJ for 40998@debbugs.gnu.org; Fri, 18 Feb 2022 10:33:38 -0500 Received: by mail-qv1-f46.google.com with SMTP id n6so15371876qvk.13 for <40998@debbugs.gnu.org>; Fri, 18 Feb 2022 07:33:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TPZH7E+Ext006dASSBeBKOY7+vw3kp6MyOznOc6+/VU=; b=I5OHPK8z4fRIWKLBYsfC8/Gvpu2I4bMVcuZfWjMuNvpHq1cEtM1sczzCvXr286siWj daOyaCLr556iZfxV/w1pKI6WfuBXCtcu+z0sKmdV1+tXUSrj+gtfC0trvfaVhESWeht1 E/W4kgocgrpuBoIlIhjt/a/qfh8aVjA+ScecG249NOVlAYYRPuXnsDoqNjDlVOKrXZ1P ZIMtfNdstHqJZP43CZXQ4fBk3a3asdlmBdzAzD5tHu46sFVk+3xwpGDtqratk+88ss71 0Y0WeLyhlYovFeDsGCEDhXK5Yf2kn+Y+PjA4eAOqzVTiqQX4R0AcWLSlhS96ZQoN0HtC 5Mvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TPZH7E+Ext006dASSBeBKOY7+vw3kp6MyOznOc6+/VU=; b=6UCNmwo4N+SHNJQ4fdDR91z9HzdGQwvYYE4sP+1ixTwa1KS5QydFjKI4GXGdln8Mt4 ngMVO3s2qirXZwCo6m1tMSMGND4Jps0vlkf7wBktrLeR/x+Q13pB6LdJnVLgALf3J7+b 2PPApYk5/LAiu6uiyFrSfoVMCSbx6ROuUCOVzXzs/GdHMZ5ZnzLROp25ufQp91BhCd5M tFTSLrZqLX5BkwKc25uwHupQ4lAeZDUhwFe0n/L4/Aem0QvWexIcACqZUgi5zO4rOnQ2 Ldg+m3yO9KD6n6uJu3ncsDL1/L2UeugARGtIVwUs1ywouN62WhMl+NMEt8efqHTJbdM+ NPag== X-Gm-Message-State: AOAM530i+5hYeu5KwlZVd3p5JfErngcJwKXXPcpT0oTXkXcxjlW/soB/ 1ibUct6xmRJzo5EW2cr14Jp78IR3f98= X-Google-Smtp-Source: ABdhPJxdEmlht8ud6oVcIJGOzFtw7OAnBOE4taKmEpB3C6nY4YMj5wP6WNj31kj0KfXHXPCbDNBWIw== X-Received: by 2002:ac8:5c45:0:b0:2dd:baf7:d4fb with SMTP id j5-20020ac85c45000000b002ddbaf7d4fbmr1639685qtj.323.1645198412094; Fri, 18 Feb 2022 07:33:32 -0800 (PST) Received: from localhost.localdomain (dsl-149-79.b2b2c.ca. [66.158.149.79]) by smtp.gmail.com with ESMTPSA id y21sm3726781qtn.62.2022.02.18.07.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 07:33:31 -0800 (PST) From: Maxim Cournoyer Date: Fri, 18 Feb 2022 10:33:23 -0500 Message-Id: <20220218153323.29393-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220218153323.29393-1-maxim.cournoyer@gmail.com> References: <20220218153323.29393-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) * gnu/build/linux-boot.scm (boot-system): Print command-line parameters to standard output. --- gnu/build/linux-boot.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index b1573fe757..45be05d705 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -540,6 +540,8 @@ (define (device-string->file-system-device device-string) (root-fs* (find root-mount-point? mounts)) (fsck.mode (find-long-option "fsck.mode" args))) + (format #t "initrd command-line parameters: ~a~%" args) + (unless (or root-fs* (and root-device rootfstype)) (error "no root file system or 'root' and 'rootfstype' parameters")) -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 18 10:33:53 2022 Received: (at control) by debbugs.gnu.org; 18 Feb 2022 15:33:54 +0000 Received: from localhost ([127.0.0.1]:56235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL5Gb-00024x-P9 for submit@debbugs.gnu.org; Fri, 18 Feb 2022 10:33:53 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:44573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nL5Ga-00024i-JR for control@debbugs.gnu.org; Fri, 18 Feb 2022 10:33:52 -0500 Received: by mail-qv1-f43.google.com with SMTP id p7so15370637qvk.11 for ; Fri, 18 Feb 2022 07:33:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:from:subject; bh=3u9U8CrXRjYvmpZNZbsVMq0tPS+XZg7W5of0941ur3E=; b=la2Z0xz3bO77861bBNLv4tZfjfsqkjheSoHROy1pQ6Y0AJ60ufuparWuX+KndHiGDR 7uTLuIlq0X1fWSA8PS4Q2m7Mim5yBF7r4eeUPsa+PREWebaBafCOuBZoOuQPNy/mdL0/ uS5tuixpKrDF66dQZNJHUGFD3XvjQrocMHBEdmAOWUWJX4ERS5tn/kOLUK3n5s+Aj4B4 2+enFGlBDXxKVjPzoq5I/1XasMHbtb420AZ8Nv0mtUgsgYn++mZ7fttLsz4Bi8T7Dhu6 jtgAU+PBCBsD5uRYCQAiU8WumHsJdUNff4ghUEG3JlZBTi4nBFQj5NlkQx3MtzM+ZFfA bBaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:from:subject; bh=3u9U8CrXRjYvmpZNZbsVMq0tPS+XZg7W5of0941ur3E=; b=FupX6JXRe3VAlpIIlt2+WrDrH6uPP7CmZf0+uIDktpoymkt8zt++RCKcxZqGmiHbnX 38hgwit2Y8kW3ipiJ/lDHLA9t12w7K1LY7cgYxL3gLDlYjFkyJoHyyTaYM3vQH+CtvTH 8WabS3evXYnshdBXCudXAZ5dBvYy6o7leTLh8IWB2vyfQ1qg7gCNJ00h5UjDo8yZoXsI I+zeN3YYvRbh7cuubIuGf5X7j9OWU3hIA4CVDF5XVlbLjJUYnyWWYqU49yghHQnMsioy v1rnaNOgb5ZsWDdYvgR2SX52EGwJIdrhT+aa/1C5X6NhEhfFN6s9Zb9MC4HBe54KPs4t v45g== X-Gm-Message-State: AOAM532iJWy0Zcx7Bv6b0Lat/f/AIjdpGGmJQwMh0WR5rhQuf1ReNN7M fK30z+2yVWVzS05avo9BivWpeBSryvQ= X-Google-Smtp-Source: ABdhPJyz07IyymOTTKEWbjRJ6VAAyD/BhlmPVA8o9EBHmH1Qt9wGsobg5d5CRhTgJqrY+J97spDqjw== X-Received: by 2002:a0c:c601:0:b0:42c:dee7:486b with SMTP id v1-20020a0cc601000000b0042cdee7486bmr6329368qvi.97.1645198426945; Fri, 18 Feb 2022 07:33:46 -0800 (PST) Received: from hurd (dsl-149-79.b2b2c.ca. [66.158.149.79]) by smtp.gmail.com with ESMTPSA id f4sm22587840qko.72.2022.02.18.07.33.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 07:33:46 -0800 (PST) Date: Fri, 18 Feb 2022 10:33:45 -0500 Message-Id: <8735kgchpi.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #40998 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control 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 (-) tags 40998 + patch quit From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH v2 1/4] system: Add a version field to the record. References: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 19 Feb 2022 07:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 40998@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164525413720878 (code B ref 40998); Sat, 19 Feb 2022 07:03:02 +0000 Received: (at 40998) by debbugs.gnu.org; 19 Feb 2022 07:02:17 +0000 Received: from localhost ([127.0.0.1]:56785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJkz-0005QT-2a for submit@debbugs.gnu.org; Sat, 19 Feb 2022 02:02:17 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:42859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJkx-0005Q7-A2 for 40998@debbugs.gnu.org; Sat, 19 Feb 2022 02:02:11 -0500 Received: by mail-qv1-f50.google.com with SMTP id e22so19234111qvf.9 for <40998@debbugs.gnu.org>; Fri, 18 Feb 2022 23:02:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7LFLXG1oTSZ8uxSyGwC+LifVPyD3WlhhBDZEX6nM5T0=; b=ZkkKBi4oIO2665oFPD2wDOm4pgZ3gNDg7fSxYmn9n5noqXTa8HqtmC8ZySUVMyWZpJ u/3tGOVJLigX7oZUzeUQGVe7bHUutUFl8DeDASn3hS3bJUB+vVAAObslfkD1a2Nxbnsr bWTqJd5DDsey4Gz38dBkrybYrIsew3m5VFZ+62zPRcQ5L76ft1OLOjyTQKTLSjKV8KvT WSdUqkuSkTrsd0qEuLxJIP27ZLVjZWzHpEOAY5QTW53KFo++nXoGuv7pQOQ2uUyxfdry v8HzSr4jh8OMmTX5kD6L4rW3SMCvLYBOltPEd4xaXi5qmaKnQGCpY1C2Q2L9HrTWN+Jd M5eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7LFLXG1oTSZ8uxSyGwC+LifVPyD3WlhhBDZEX6nM5T0=; b=hcR7byaVtTD7pmNs2J+Gv8uKa9sgq7MZYLBCzXIhHdybk29+D57oXrjk7lG3laTG7z Cq0LuZwA/1Qq+p+9YNeq4WdD3T48Luz4Rl9QHWp6wNayw7DGE7GgbUAYZeDHgf2/65yU vNgB9rc7eosmFdSI7XJs8nIgPpCUVk+uJ+Gt5N6tm0qZgCWntX2zACFiFGPRk1VwD5h7 wO8g4NIj7GuT5qAcQA2DjnUe7FfOGTlbk/0yxlGf51nunNfsC/4KIm2CIvKDO3fQJ4zJ wSabRQJjCbSLwHIhCyUPHlXdvPZjijWHGMNdEVUx5e2F+2XSDcZkYuVzlyQwvpuQd/GM wxwQ== X-Gm-Message-State: AOAM5314PDsvwwL+RfEVYsumuxS1LcrKNIflLtm0rde1Ip7MaS80/787 3M74vrPuTMs22Rm8ffJ4OPpFGoRPU6I= X-Google-Smtp-Source: ABdhPJzVqXCDn2/Lmj0wTIMhZDwCLZMuSHJDStXzO160AI0nLxeuMGPSs+GB2R/DQrdBe1/CjAU97w== X-Received: by 2002:a05:6214:262d:b0:430:c99:8d6f with SMTP id gv13-20020a056214262d00b004300c998d6fmr8479602qvb.41.1645254125515; Fri, 18 Feb 2022 23:02:05 -0800 (PST) Received: from localhost.localdomain (dsl-149-79.b2b2c.ca. [66.158.149.79]) by smtp.gmail.com with ESMTPSA id g16sm4121024qka.11.2022.02.18.23.02.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 23:02:05 -0800 (PST) From: Maxim Cournoyer Date: Sat, 19 Feb 2022 02:01:52 -0500 Message-Id: <20220219070155.1924-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) This version field exposes the (already present) version information of a boot parameters file. * gnu/system.scm (%boot-parameters-version): New variable. ()[version]: New field. (read-boot-parameters): Use it. (operating-system-boot-parameters-file): Likewise. * tests/boot-parameters.scm (test-read-boot-parameters): Use %boot-parameters-version as the default version value in the template. --- gnu/system.scm | 18 ++++++++++++++---- tests/boot-parameters.scm | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index cc925de16f..c29a44111b 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -9,7 +9,7 @@ ;;; Copyright © 2020 Danny Milosavljevic ;;; Copyright © 2020, 2021 Brice Waegeneire ;;; Copyright © 2020 Florian Pelz -;;; Copyright © 2020 Maxim Cournoyer +;;; Copyright © 2020, 2022 Maxim Cournoyer ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2021 Maxime Devos @@ -161,6 +161,8 @@ (define-module (gnu system) 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 @@ -295,6 +297,8 @@ (define (operating-system-kernel-arguments os root-device) ;;; Boot parameters ;;; +(define %boot-parameters-version 0) + (define-record-type* boot-parameters make-boot-parameters boot-parameters? (label boot-parameters-label) @@ -322,7 +326,9 @@ (define-record-type* (kernel boot-parameters-kernel) (kernel-arguments boot-parameters-kernel-arguments) (initrd boot-parameters-initrd) - (multiboot-modules boot-parameters-multiboot-modules)) + (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 @@ -359,12 +365,16 @@ (define uuid-sexp->uuid (warning (G_ "unrecognized uuid ~a at '~a'~%") x (port-filename port)) #f))) + (define (version? n) + (and (exact-integer? n) (not (negative? n)))) + (match (read port) - (('boot-parameters ('version 0) + (('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)) @@ -1500,7 +1510,7 @@ (define* (operating-system-boot-parameters-file os system-kernel-arguments?))) (scheme-file "parameters" #~(boot-parameters - (version 0) + (version #$(boot-parameters-version params)) (label #$(boot-parameters-label params)) (root-device #$(device->sexp diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm index b2799d0596..d4b680df2e 100644 --- a/tests/boot-parameters.scm +++ b/tests/boot-parameters.scm @@ -101,7 +101,7 @@ (define (quote-uuid uuid) ;; Call read-boot-parameters with the desired string as input. (define* (test-read-boot-parameters #:key - (version 0) + (version %boot-parameters-version) (bootloader-name 'grub) (bootloader-menu-entries '()) (label %default-label) -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH v2 2/4] initrd: Use non-hyphenated kernel command-line parameter names. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 19 Feb 2022 07:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 40998@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164525413920901 (code B ref 40998); Sat, 19 Feb 2022 07:03:02 +0000 Received: (at 40998) by debbugs.gnu.org; 19 Feb 2022 07:02:19 +0000 Received: from localhost ([127.0.0.1]:56788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJl3-0005Qh-Dw for submit@debbugs.gnu.org; Sat, 19 Feb 2022 02:02:19 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:33504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJl1-0005QD-Jc for 40998@debbugs.gnu.org; Sat, 19 Feb 2022 02:02:16 -0500 Received: by mail-qk1-f179.google.com with SMTP id o10so10290645qkg.0 for <40998@debbugs.gnu.org>; Fri, 18 Feb 2022 23:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hSUaQYq8oMWzdOs6PPW+/p28+ne7KflWY2wuaOrTw+A=; b=c/lvJHwL5KzNe1Liny6YiVFRrFaBrWX3gkU8N5Dj7beOwlu3vptiDqGrRv2F1gthAc 3FjbixqN/d7HQGqa+TW8xVATxsm18w6CcgNXUaigw7bg56NaezdH3GFzX4GJwBopPJdt Ad7Usz2q+EuNcastKy0ETZG+3JGu1SOObTK21nbn7Z89oSNLJy772LnSWTJcey/Zbe51 Jhn61L+v/NmIzyMQI1G/gk5sdIJ9mz13ZRl93OixtyLda6PuysQMY5ZCnNtFUQmhah9U 149jMsJhtHLeKTU7xbR3UmFUmfi7PMVYlNVvNAPGjXY8P1jXtrVHExCVp/VUFr6r3i3E KpUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hSUaQYq8oMWzdOs6PPW+/p28+ne7KflWY2wuaOrTw+A=; b=RBYbQDERuUDnAaUJAj4BlH/pHYJf0sTUHdW2CNtNLLiGjHiUp4/Hxif3BVE57cmDQO Rdw3APLI3NmQegWUPNFx4QEDv69S28c64PGogNjjqorTQ7W1jZEo/oEdFk69G6cra1w0 iAfl//69qahTAZ+pWXTkIdFvHOZxhFwuVfqExgkdpYHfvXofPS234E/6m8so87W0PHiC tAivdPaTovzobINPKQ2v36X/cw6B8J+zk21zne0kMyJW1qI9wRWi5dk3LN51wUphW1r9 Vk8OoXG1nBLZpiKvLrOYy1jf4iAIe0Hj0n+eKGj1VM87yQ3sw+VPaLBFGyu0SUsK50e2 vFWQ== X-Gm-Message-State: AOAM533uEi31fVXVu+DQmwHVxkMXLl0JtJ8JaA4k3Ao8LSZ/at6VOMgo yT/pKRl0/t9jA8nCdVpB0i+XhKjqD2Y= X-Google-Smtp-Source: ABdhPJyWglsc6KFQ5AMlePXZ6Udmity56Fctt7MT1MtTVX6duCnsgSND+yPb9dKi3lVIlKaT1ERvVQ== X-Received: by 2002:a37:b905:0:b0:4f5:4d72:e517 with SMTP id j5-20020a37b905000000b004f54d72e517mr6905076qkf.534.1645254129485; Fri, 18 Feb 2022 23:02:09 -0800 (PST) Received: from localhost.localdomain (dsl-149-79.b2b2c.ca. [66.158.149.79]) by smtp.gmail.com with ESMTPSA id g16sm4121024qka.11.2022.02.18.23.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 23:02:09 -0800 (PST) From: Maxim Cournoyer Date: Sat, 19 Feb 2022 02:01:53 -0500 Message-Id: <20220219070155.1924-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220219070155.1924-1-maxim.cournoyer@gmail.com> References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) This is to make it less surprising, given the common convention sets forth by the kernel Linux command-line parameters. * gnu/build/linux-boot.scm (boot-system): Rename '--load', '--repl', '--root' and '--system' to 'gnu.load', 'gnu.repl', 'root' and 'gnu.system', respectively. Adjust doc. (find-long-option): Adjust doc. * gnu/installer/parted.scm (installer-root-partition-path): Adjust accordingly. * gnu/system.scm (bootable-kernel-arguments): Add a VERSION argument and update doc. Use VERSION to conditionally return old style vs new style initrd arguments. (%boot-parameters-version): Increment to 1. (operating-system-boot-parameters): Adjust doc. (operating-system-boot-parameters-file): Likewise. * gnu/system/linux-initrd.scm (raw-initrd, base-initrd): Likewise. * doc/guix.texi: Adjust doc. * gnu/build/activation.scm (boot-time-system): Adjust accordingly. * gnu/build/hurd-boot.scm (boot-hurd-system): Likewise. * gnu/packages/commencement.scm (%final-inputs-riscv64): Adjust comment. --- doc/guix.texi | 12 +++++----- gnu/build/activation.scm | 4 ++-- gnu/build/hurd-boot.scm | 12 +++++----- gnu/build/linux-boot.scm | 30 +++++++++++------------ gnu/installer/parted.scm | 2 +- gnu/machine/ssh.scm | 5 ++-- gnu/packages/commencement.scm | 4 ++-- gnu/system.scm | 45 ++++++++++++++++++++++------------- gnu/system/linux-initrd.scm | 4 ++-- 9 files changed, 66 insertions(+), 52 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a4145af7fd..d3f9216563 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34901,7 +34901,7 @@ honors several options passed on the Linux kernel command line @code{-append} option of QEMU), notably: @table @code -@item --load=@var{boot} +@item gnu.load=@var{boot} Tell the initial RAM disk to load @var{boot}, a file containing a Scheme program, once it has mounted the root file system. @@ -34909,7 +34909,7 @@ Guix uses this option to yield control to a boot program that runs the service activation programs and then spawns the GNU@tie{}Shepherd, the initialization system. -@item --root=@var{root} +@item root=@var{root} Mount @var{root} as the root file system. @var{root} can be a device name like @code{/dev/sda1}, a file system label, or a file system UUID. When unspecified, the device name from the root file system of the @@ -34934,7 +34934,7 @@ or @code{preen} to repair problems considered safe to repair automatically. @code{preen} is the default if this option is not present or if @var{level} is not one of the above. -@item --system=@var{system} +@item gnu.system=@var{system} Have @file{/run/booted-system} and @file{/run/current-system} point to @var{system}. @@ -34946,7 +34946,7 @@ Instruct the initial RAM disk as well as the @command{modprobe} command must be a comma-separated list of module names---e.g., @code{usbkbd,9pnet}. -@item --repl +@item gnu.repl Start a read-eval-print loop (REPL) from the initial RAM disk before it tries to load kernel modules and to mount the root file system. Our marketing team calls it @dfn{boot-to-Guile}. The Schemer in you will @@ -34967,7 +34967,7 @@ here is how to use it and customize it further. [#:helper-packages '()] [#:qemu-networking? #f] [#:volatile-root? #f] Return a derivation that builds a raw initrd. @var{file-systems} is a list of file systems to be mounted by the initrd, possibly in addition to -the root file system specified on the kernel command line via @option{--root}. +the root file system specified on the kernel command line via @option{root}. @var{linux-modules} is a list of kernel modules to be loaded at boot time. @var{mapped-devices} is a list of device mappings to realize before @var{file-systems} are mounted (@pxref{Mapped Devices}). @@ -34997,7 +34997,7 @@ to it are lost. Return as a file-like object a generic initrd, with kernel modules taken from @var{linux}. @var{file-systems} is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified -on the kernel command line via @option{--root}. @var{mapped-devices} is a list of device +on the kernel command line via @option{root}. @var{mapped-devices} is a list of device mappings to realize before @var{file-systems} are mounted. When true, @var{keyboard-layout} is a @code{} record denoting diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 9f6126023c..10c9045740 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -389,8 +389,8 @@ (define %current-system "/run/current-system") (define (boot-time-system) - "Return the '--system' argument passed on the kernel command line." - (find-long-option "--system" (if (string-contains %host-type "linux-gnu") + "Return the 'gnu.system' argument passed on the kernel command line." + (find-long-option "gnu.system" (if (string-contains %host-type "linux-gnu") (linux-command-line) (command-line)))) diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index ac36bd17d4..ad3c50d61e 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm @@ -254,7 +254,7 @@ (define* (boot-hurd-system #:key (on-error 'debug)) "This procedure is meant to be called from an early RC script. Install the relevant passive translators on the first boot. Then, run system -activation by using the kernel command-line options '--system' and '--load'; +activation by using the kernel command-line options 'gnu.system' and 'gnu.load'; starting the Shepherd. XXX TODO: see linux-boot.scm:boot-system. @@ -265,14 +265,14 @@ (define* (boot-hurd-system #:key (on-error 'debug)) " (display "Welcome, this is GNU's early boot Guile.\n") - (display "Use '--repl' for an initrd REPL.\n\n") + (display "Use 'gnu.repl' for an initrd REPL.\n\n") (call-with-error-handling (lambda () (let* ((args (command-line)) - (system (find-long-option "--system" args)) - (to-load (find-long-option "--load" args))) + (system (find-long-option "gnu.system" args)) + (to-load (find-long-option "gnu.load" args))) (format #t "Setting-up essential translators...\n") (setenv "PATH" (string-append system "/profile/bin")) @@ -286,7 +286,7 @@ (define* (boot-hurd-system #:key (on-error 'debug)) (unless (zero? (system* "/hurd/mach-defpager")) (format #t "FAILED...Good luck!\n")) - (cond ((member "--repl" args) + (cond ((member "gnu.repl" args) (format #t "Starting repl...\n") (start-repl)) (to-load @@ -298,7 +298,7 @@ (define* (boot-hurd-system #:key (on-error 'debug)) (sleep 2) (reboot)) (else - (display "no boot file passed via '--load'\n") + (display "no boot file passed via 'gnu.load'\n") (display "entering a warm and cozy REPL\n") (start-repl))))) #:on-error on-error)) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 0ae316849e..179fb12a2b 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -93,7 +93,7 @@ (define (linux-command-line) get-string-all))) (define (find-long-option option arguments) - "Find OPTION among ARGUMENTS, where OPTION is something like \"--load\". + "Find OPTION among ARGUMENTS, where OPTION is something like \"gnu.load\". Return the value associated with OPTION, or #f on failure." (let ((opt (string-append option "="))) (and=> (find (cut string-prefix? opt <>) @@ -499,12 +499,12 @@ (define* (boot-system #:key KEYMAP-FILE is true), then setting up QEMU guest networking if QEMU-GUEST-NETWORKING? is true, calling PRE-MOUNT, mounting the file systems specified in MOUNTS, and finally booting into the new root if any. The initrd -supports kernel command-line options '--load', '--root', and '--repl'. It -also honors a subset of the documented Linux kernel command-line parameters -such as 'fsck.mode', 'resume' and 'rootdelay'. +supports kernel command-line parameters 'gnu.load' and 'gnu.repl'. It also +honors a subset of the Linux kernel command-line parameters such as +'fsck.mode', 'resume', 'root' and 'rootdelay'. -Mount the root file system, specified by the '--root' command-line argument, -if any. +Mount the root file system, specified by the 'root' command-line argument, if +any. MOUNTS must be a list of objects. @@ -517,25 +517,25 @@ (define (root-mount-point? fs) (string=? (file-system-mount-point fs) "/")) (define (device-string->file-system-device device-string) - ;; The "--root=SPEC" kernel command-line option always provides a - ;; string, but the string can represent a device, an nfs-root, a UUID, or a - ;; label. So check for all four. + ;; The "root=SPEC" kernel command-line option always provides a string, + ;; but the string can represent a device, an nfs-root, a UUID, or a label. + ;; So check for all four. (cond ((string-prefix? "/" device-string) device-string) ((string-contains device-string ":/") device-string) ; nfs-root ((uuid device-string) => identity) (else (file-system-label device-string)))) (display "Welcome, this is GNU's early boot Guile.\n") - (display "Use '--repl' for an initrd REPL.\n\n") + (display "Use 'gnu.repl' for an initrd REPL.\n\n") (call-with-error-handling (lambda () (mount-essential-file-systems) (let* ((args (linux-command-line)) - (to-load (find-long-option "--load" args)) - ;; If present, ‘--root’ on the kernel command line takes precedence + (to-load (find-long-option "gnu.load" args)) + ;; If present, ‘root’ on the kernel command line takes precedence ;; over the ‘device’ field of the root record. - (root-device (and=> (find-long-option "--root" args) + (root-device (and=> (find-long-option "root" args) device-string->file-system-device)) (root-fs (or (find root-mount-point? mounts) ;; Fall back to fictitious defaults. @@ -564,7 +564,7 @@ (define (repair fs) (_ 'preen)) (file-system-repair fs)))) - (when (member "--repl" args) + (when (member "gnu.repl" args) (start-repl)) (display "loading kernel modules...\n") @@ -652,7 +652,7 @@ (define (repair fs) (sleep 2) (reboot)) (begin - (display "no boot file passed via '--load'\n") + (display "no boot file passed via 'gnu.load'\n") (display "entering a warm and cozy REPL\n") (start-repl))))) #:on-error on-error)) diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index e33ef5f8fd..94ef9b42bc 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -348,7 +348,7 @@ (define (remove-logical-devices) (define (installer-root-partition-path) "Return the root partition path, or #f if it could not be detected." (let* ((cmdline (linux-command-line)) - (root (find-long-option "--root" cmdline))) + (root (find-long-option "root" cmdline))) (and root (or (and (access? root F_OK) root) (find-partition-by-label root) diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index 0dc8933c82..550c989c34 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -422,7 +422,8 @@ (define (read-file path) (let* ((params (call-with-input-string serialized-params read-boot-parameters)) (root (boot-parameters-root-device params)) - (label (boot-parameters-label params))) + (label (boot-parameters-label params)) + (version (boot-parameters-version params))) (boot-parameters (inherit params) (label @@ -433,7 +434,7 @@ (define (read-file path) "~Y-~m-~d ~H:~M")) ")")) (kernel-arguments - (append (bootable-kernel-arguments system-path root) + (append (bootable-kernel-arguments system-path root version) (boot-parameters-kernel-arguments params)))))))) generations)))) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index cdc9c1d621..9b495d8d84 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3740,10 +3740,10 @@ (define-public %final-inputs (define-public %final-inputs-riscv64 ;; This is similar to the added (list gcc "lib") elsewhere in this file, but ;; due to how (%current-system) is re-defined when performing builds with the - ;; '--system' flag, %final-inputs is too early in the evaulation pipeline to + ;; 'gnu.system' flag, %final-inputs is too early in the evaulation pipeline to ;; correctly identify the system for which a derivation will be built. Thus, ;; since (%current-system) is re-determined by (guix build-system gnu) after - ;; loading %final-inputs but before taking into account the '--system' flag, + ;; loading %final-inputs but before taking into account the 'gnu.system' flag, ;; the test for (target-riscv64?) needs to be in (guix build-system gnu), ;; with %final-inputs-riscv64 already available at the same time that ;; %final-inputs is available. diff --git a/gnu/system.scm b/gnu/system.scm index c29a44111b..97669daa1b 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -187,16 +187,23 @@ (define-module (gnu system) ;;; ;;; Code: -(define (bootable-kernel-arguments system root-device) - "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVICE." - (list (string-append "--root=" +(define* (bootable-kernel-arguments system root-device version) + "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVICE. +VERSION is the target version of the boot-parameters record." + ;; If the version is newer than 0, we use the new style initrd parameter + ;; names, otherwise we use the legacy ones. This is to maintain backward + ;; compatibility when producing bootloader configurations for older + ;; generations. + (define version>0? (> version 0)) + (list (string-append (if version>0? "root=" "--root=") ;; Note: Always use the DCE format because that's what - ;; (gnu build linux-boot) expects for the '--root' + ;; (gnu build linux-boot) expects for the 'root' ;; kernel command-line option. (file-system-device->string root-device #:uuid-type 'dce)) - #~(string-append "--system=" #$system) - #~(string-append "--load=" #$system "/boot"))) + #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system) + #~(string-append (if #$version>0? "gnu.load=" "--load=") + #$system "/boot"))) ;; System-wide configuration. ;; TODO: Add per-field docstrings/stexi. @@ -286,10 +293,12 @@ (define-record-type* operating-system source-properties->location)) (innate))) -(define (operating-system-kernel-arguments os root-device) - "Return all the kernel arguments, including the ones not specified -directly by the user." - (append (bootable-kernel-arguments os root-device) +(define* (operating-system-kernel-arguments + os root-device #:key (version %boot-parameters-version)) + "Return all the kernel arguments, including the ones not specified directly +by the user. VERSION should match that of the target record +object that will contain the kernel parameters." + (append (bootable-kernel-arguments os root-device version) (operating-system-user-kernel-arguments os))) @@ -297,7 +306,10 @@ (define (operating-system-kernel-arguments os root-device) ;;; Boot parameters ;;; -(define %boot-parameters-version 0) +;;; 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'. +(define %boot-parameters-version 1) (define-record-type* boot-parameters make-boot-parameters boot-parameters? @@ -476,10 +488,11 @@ (define (read-boot-parameters-file system) 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))) + (root (boot-parameters-root-device params)) + (version (boot-parameters-version params))) (boot-parameters (inherit params) - (kernel-arguments (append (bootable-kernel-arguments system root) + (kernel-arguments (append (bootable-kernel-arguments system root version) (boot-parameters-kernel-arguments params)))))) (define (boot-parameters->menu-entry conf) @@ -1451,7 +1464,7 @@ (define* (operating-system-boot-parameters os root-device #:key system-kernel-arguments?) "Return a monadic record that describes the boot parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments -such as '--root' and '--load' to ." +such as 'root' and 'gnu.load' to ." (let* ((initrd (and (not (operating-system-hurd os)) (operating-system-initrd-file os))) (store (operating-system-store-file-system os)) @@ -1497,8 +1510,8 @@ (define* (operating-system-boot-parameters-file os "Return a file that describes the boot parameters of OS. The primary use of this file is the reconstruction of GRUB menu entries for old configurations. -When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments such as '--root' -and '--load' to the returned file (since the returned file is then usually +When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments such as 'root' +and 'gnu.load' to the returned file (since the returned file is then usually stored into the content-addressed \"system\" directory, it's usually not a good idea to give it because the content hash would change by the content hash being stored into the \"parameters\" file)." diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 329cd38cd6..4c4c78e444 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -181,7 +181,7 @@ (define* (raw-initrd file-systems "Return as a file-like object a raw initrd, with kernel modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified -on the kernel command line via '--root'. LINUX-MODULES is a list of kernel +on the kernel command line via 'root'. LINUX-MODULES is a list of kernel modules to be loaded at boot time. MAPPED-DEVICES is a list of device mappings to realize before FILE-SYSTEMS are mounted. HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include @@ -375,7 +375,7 @@ (define* (base-initrd file-systems "Return as a file-like object a generic initrd, with kernel modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified -on the kernel command line via '--root'. MAPPED-DEVICES is a list of device +on the kernel command line via 'root'. MAPPED-DEVICES is a list of device mappings to realize before FILE-SYSTEMS are mounted. When true, KEYBOARD-LAYOUT is a record denoting the desired -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH v2 3/4] initrd: Honor rootfstype and rootflags command-line parameters. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 19 Feb 2022 07:03:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 40998@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164525414120913 (code B ref 40998); Sat, 19 Feb 2022 07:03:03 +0000 Received: (at 40998) by debbugs.gnu.org; 19 Feb 2022 07:02:21 +0000 Received: from localhost ([127.0.0.1]:56792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJl7-0005RE-5W for submit@debbugs.gnu.org; Sat, 19 Feb 2022 02:02:21 -0500 Received: from mail-qv1-f51.google.com ([209.85.219.51]:35424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJl3-0005QR-MW for 40998@debbugs.gnu.org; Sat, 19 Feb 2022 02:02:18 -0500 Received: by mail-qv1-f51.google.com with SMTP id d7so19258212qvk.2 for <40998@debbugs.gnu.org>; Fri, 18 Feb 2022 23:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=205DMcXOBl+dQmS2V+Wu9jm5drCExIC2TL+igSObGYA=; b=WfYSj/EAVr7Ts6t5YEdCuSHzTZstra1AiYoffntbiorjcNxuDgtIER2NcriaZmiSdN DbA//cSU+yyHBb87EpvLE9GGm0vhJkvMEnJu+oithnFAjGfKMFa8BchcpUc2Ux8Ov8u5 +qbeXfpMlf8V+ukgHFjudO/whndQeKQ+ivGhR2YEjywj0r+Jqtvv1VU0cNBwGLimb+ts 3MDbqxnWXMUx2v6NxaBW8644BJViraEwQ8iQCQ7FMZ2DIRsykRJ/Km1VblyokrYFgXQ4 GU6BTkGNLKD/lB9jh6qmgSMJauduzCXKuAatanJ3DatWq9sjcXPmVJwk25B2hC6T5SBS olLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=205DMcXOBl+dQmS2V+Wu9jm5drCExIC2TL+igSObGYA=; b=37rRR3U/vjw6sBhpkoT0lXAHeHnEeqecYLC66qZX3BPSJ/Cu7vl02aD+cHRViXHJqW yBtJm0x2uXuLJ4OrAx16M1YlVa63ndDD2EEBMmE1Nav2YogA0ijX05fcVcqNyzW3YrXQ 6c/WFYTubzidBjr3iLjkEusX77f1u7F4vtI7/btQEWs/jSJ9lTf07F8ISCelx8wRO1Jt DcLgfHh7z7idKMxFmgt2rgtOOu5zOAMpUKOBuY4RBV8YF0tsvp56NzLsrF2N5Nvub4Rp FEL4DTMAJznyfIt/MqI1pz2++2EShLU+hzwcZhdbn9jm0aGc1QHsk5Fbj2sD+LUO2bBS 8djg== X-Gm-Message-State: AOAM5324fMoqTG2JLN5N1v4IQTRM4+GYp/x1fqdEfhQ92OyhtbIZ3WY4 Wd/CMUU5q98WVU0dBVl3VLS0wgha4DY= X-Google-Smtp-Source: ABdhPJz0eUUNXwGAqitRXYlg/TbbZVJaczyFJoWjfL7RUbx6cFjB9PBkpuYj70zb0LU1QLewJ1DtXQ== X-Received: by 2002:a0c:eb0a:0:b0:42c:5084:622 with SMTP id j10-20020a0ceb0a000000b0042c50840622mr8281517qvp.127.1645254131924; Fri, 18 Feb 2022 23:02:11 -0800 (PST) Received: from localhost.localdomain (dsl-149-79.b2b2c.ca. [66.158.149.79]) by smtp.gmail.com with ESMTPSA id g16sm4121024qka.11.2022.02.18.23.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 23:02:11 -0800 (PST) From: Maxim Cournoyer Date: Sat, 19 Feb 2022 02:01:54 -0500 Message-Id: <20220219070155.1924-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220219070155.1924-1-maxim.cournoyer@gmail.com> References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) * gnu/build/linux-boot.scm (boot-system): Honor rootfstype and rootflags arguments. Update doc. Error out in case there is insufficient information with regard to the root file system. Restore the behavior of inferring the root device from the root file system from the operating system in case the root argument is not provided. * doc/guix.texi (Initial RAM Disk): Document the new command-line parameters. --- doc/guix.texi | 10 ++++++++ gnu/build/linux-boot.scm | 55 ++++++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index d3f9216563..ec1e49630f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34915,6 +34915,16 @@ name like @code{/dev/sda1}, a file system label, or a file system UUID. When unspecified, the device name from the root file system of the operating system declaration is used. +@item rootfstype=@var{type} +Set the type of the root file system. It overrides the @code{type} +field of the root file system specified via the @code{operating-system} +declaration, if any. + +@item rootflags=@var{options} +Set the mount @emph{options} of the root file system. It overrides the +@code{options} field of the root file system specified via the +@code{operating-system} declaration, if any. + @item fsck.mode=@var{mode} Whether to check the @var{root} file system for errors before mounting it. @var{mode} is one of @code{skip} (never check), @code{force} (always diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 179fb12a2b..2f8b114806 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -499,9 +499,9 @@ (define* (boot-system #:key KEYMAP-FILE is true), then setting up QEMU guest networking if QEMU-GUEST-NETWORKING? is true, calling PRE-MOUNT, mounting the file systems specified in MOUNTS, and finally booting into the new root if any. The initrd -supports kernel command-line parameters 'gnu.load' and 'gnu.repl'. It also +supports the kernel command-line options 'gnu.load' and 'gnu.repl'. It also honors a subset of the Linux kernel command-line parameters such as -'fsck.mode', 'resume', 'root' and 'rootdelay'. +'fsck.mode', 'resume', 'rootdelay', rootflags and rootfstype. Mount the root file system, specified by the 'root' command-line argument, if any. @@ -537,13 +537,30 @@ (define (device-string->file-system-device device-string) ;; over the ‘device’ field of the root record. (root-device (and=> (find-long-option "root" args) device-string->file-system-device)) - (root-fs (or (find root-mount-point? mounts) - ;; Fall back to fictitious defaults. - (file-system (device (or root-device "/dev/root")) - (mount-point "/") - (type "ext4")))) + (rootfstype (find-long-option "rootfstype" args)) + (rootflags (find-long-option "rootflags" args)) + (root-fs* (find root-mount-point? mounts)) (fsck.mode (find-long-option "fsck.mode" args))) + (unless (or root-fs* (and root-device rootfstype)) + (error "no root file system or 'root' and 'rootfstype' parameters")) + + ;; If present, ‘root’ on the kernel command line takes precedence over + ;; the ‘device’ field of the root record; likewise for + ;; the 'rootfstype' and 'rootflags' arguments. + (define root-fs + (if root-fs* + (file-system + (inherit root-fs*) + (device (or root-device (file-system-device root-fs*))) + (type (or rootfstype (file-system-type root-fs*))) + (options (or rootflags (file-system-options root-fs*)))) + (file-system + (device root-device) + (mount-point "/") + (type rootfstype) + (options rootflags)))) + (define (check? fs) (match fsck.mode ("skip" #f) @@ -615,18 +632,18 @@ (define (repair fs) (setenv "EXT2FS_NO_MTAB_OK" "1") - (if root-device - (mount-root-file-system (canonicalize-device-spec root-device) - (file-system-type root-fs) - #:volatile-root? volatile-root? - #:flags (mount-flags->bit-mask - (file-system-flags root-fs)) - #:options (file-system-options root-fs) - #:check? (check? root-fs) - #:skip-check-if-clean? - (skip-check-if-clean? root-fs) - #:repair (repair root-fs)) - (mount "none" "/root" "tmpfs")) + ;; Mount the root file system. + (mount-root-file-system (canonicalize-device-spec + (file-system-device root-fs)) + (file-system-type root-fs) + #:volatile-root? volatile-root? + #:flags (mount-flags->bit-mask + (file-system-flags root-fs)) + #:options (file-system-options root-fs) + #:check? (check? root-fs) + #:skip-check-if-clean? + (skip-check-if-clean? root-fs) + #:repair (repair root-fs)) ;; Mount the specified non-root file systems. (for-each (lambda (fs) -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH v2 4/4] initrd: Print its command-line parameters. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 19 Feb 2022 07:03:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 40998@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164525414120920 (code B ref 40998); Sat, 19 Feb 2022 07:03:03 +0000 Received: (at 40998) by debbugs.gnu.org; 19 Feb 2022 07:02:21 +0000 Received: from localhost ([127.0.0.1]:56794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJl7-0005RG-IF for submit@debbugs.gnu.org; Sat, 19 Feb 2022 02:02:21 -0500 Received: from mail-qv1-f45.google.com ([209.85.219.45]:46693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLJl4-0005QU-CJ for 40998@debbugs.gnu.org; Sat, 19 Feb 2022 02:02:18 -0500 Received: by mail-qv1-f45.google.com with SMTP id n6so19231800qvk.13 for <40998@debbugs.gnu.org>; Fri, 18 Feb 2022 23:02:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tH7kF/wu4nuDyRiL8T9Rj1u7riI0A5t0EtsZlPob9CY=; b=NeO/wkdEud0f/O2ndSncZYt6IYBKQ3d/fMYQYkUFXLuzQ2TlHvVtnsZUNGeiZX6/GT diCfdw6GOYvNsd13bPPQM39Ep25OBA0N5KjWKoZb9PfD8EXIdsAVYjHMkHqcnXRlesrz LhO3KHdOsdlXirVkUptgKrJhdKb+uxi+7U6UmnD6tsJVwYRKsJ8zT3l9fttw/BBfbN9O Kx0PcmQ+gDnfaLMkHYwJ+88DvvJw7LUsDIB4e+gkBmbEPW/FPZQRLEods9AQAd4WRwDt m6Tqk9htc1RYDdFjmHQ1U4i23S0YTlOJ6FEShxDVf3qkCJj6ed27uFCe03jyhpPYm2I+ YYOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tH7kF/wu4nuDyRiL8T9Rj1u7riI0A5t0EtsZlPob9CY=; b=ltGg2uP7XiU6X7ILd8eZGkQF4+0ET5E3o4r0pG5hepNGvqG8o7w0ULB9ZCOHtcS0WG mMHjIKi0wKcTzh7piz1fblEJSrZYdkePFe2g/HuPYtJByCI1tiXYFL4tZ+3jJJqJ6fMj 0ufsccFZdGaP1TNXy+5Nj/jHTZcWGiHDXK4SqylS6nybmPKEl/E20GigQjjS0ysUtcHt 3SXgxo2U4hKUJHRS4kbp9nKaHVSUfdq23Q6NRXlc4kvdBD5VO3rjgh+kBfxFp4zAXQw/ Y53s+eHrzS3Uk4NrNKjsvLYBWCNylCkOFEwLzQj/XQJEO7g/g/8xNTPsqlRxXH8jgNYy zNSg== X-Gm-Message-State: AOAM533cQfBnmVfRNWP15AsFS+hYFl+dLLNR5uzZTrJ7EQNX4RjEh6yp GwBedmRxT4hP2Ii9Ad/P9OFXcnqmg/w= X-Google-Smtp-Source: ABdhPJwnit04uVlO/UfQmTXjSxNNsMRKjy+u5bhW4kJzE3brLdSmUzhdLtjf6e4XnChPZJDx03nBoQ== X-Received: by 2002:a0c:906e:0:b0:42c:a71e:aaa1 with SMTP id o101-20020a0c906e000000b0042ca71eaaa1mr8689789qvo.44.1645254132755; Fri, 18 Feb 2022 23:02:12 -0800 (PST) Received: from localhost.localdomain (dsl-149-79.b2b2c.ca. [66.158.149.79]) by smtp.gmail.com with ESMTPSA id g16sm4121024qka.11.2022.02.18.23.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 23:02:12 -0800 (PST) From: Maxim Cournoyer Date: Sat, 19 Feb 2022 02:01:55 -0500 Message-Id: <20220219070155.1924-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220219070155.1924-1-maxim.cournoyer@gmail.com> References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) * gnu/build/linux-boot.scm (boot-system): Print command-line parameters to standard output. --- gnu/build/linux-boot.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 2f8b114806..30442ec8f8 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -542,6 +542,8 @@ (define (device-string->file-system-device device-string) (root-fs* (find root-mount-point? mounts)) (fsck.mode (find-long-option "fsck.mode" args))) + (format #t "initrd command-line parameters: ~a~%" args) + (unless (or root-fs* (and root-device rootfstype)) (error "no root file system or 'root' and 'rootfstype' parameters")) -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 27 Feb 2022 20:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164599527428013 (code B ref 40998); Sun, 27 Feb 2022 20:55:02 +0000 Received: (at 40998) by debbugs.gnu.org; 27 Feb 2022 20:54:34 +0000 Received: from localhost ([127.0.0.1]:59284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOQYs-0007Hl-6k for submit@debbugs.gnu.org; Sun, 27 Feb 2022 15:54:34 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:55052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOQYq-0007HW-Cn for 40998@debbugs.gnu.org; Sun, 27 Feb 2022 15:54:32 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B19CA399; Sun, 27 Feb 2022 21:54:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b0d1yWo710_w; Sun, 27 Feb 2022 21:54:25 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id B0FF022F; Sun, 27 Feb 2022 21:54:24 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20220219070155.1924-1-maxim.cournoyer@gmail.com> Date: Sun, 27 Feb 2022 21:54:24 +0100 In-Reply-To: <20220219070155.1924-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Sat, 19 Feb 2022 02:01:52 -0500") Message-ID: <87lexwuj27.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: B19CA399 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) 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: -0.0 (/) Hi! Maxim Cournoyer skribis: > This version field exposes the (already present) version information of a= boot > parameters file. > > * gnu/system.scm (%boot-parameters-version): New variable. > ()[version]: New field. > (read-boot-parameters): Use it. > (operating-system-boot-parameters-file): Likewise. > * tests/boot-parameters.scm (test-read-boot-parameters): Use > %boot-parameters-version as the default version value in the template. [...] > (define-record-type* > boot-parameters make-boot-parameters boot-parameters? > (label boot-parameters-label) > @@ -322,7 +326,9 @@ (define-record-type* > (kernel boot-parameters-kernel) > (kernel-arguments boot-parameters-kernel-arguments) > (initrd boot-parameters-initrd) > - (multiboot-modules boot-parameters-multiboot-modules)) > + (multiboot-modules boot-parameters-multiboot-modules) > + (version boot-parameters-version ;positive integer > + (default %boot-parameters-version))) [...] > (match (read port) > - (('boot-parameters ('version 0) > + (('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)) There=E2=80=99s no need to have a =E2=80=98version=E2=80=99 field in live <= boot-parameters> records: have the =E2=80=98version=E2=80=99 field in the serialized format = (the sexp) and make sure the deserializer correctly converts to the internal representation. Here, I think you can bump the version number in the serialized form, and have =E2=80=98read-boot-parameters=E2=80=99 automatically augment =E2= =80=98kernel-arguments=E2=80=99 when VERSION is 0 with =E2=80=9C--root=3DXYZ=E2=80=9D. (It might be that you can even do that without bumping the version number. Bumping is clearer but the downside is that an older Guix will abort when attempting to read =E2=80=98parameters=E2=80=99. This could hap= pen if you roll back to an earlier generation and try to run =E2=80=98guix system reconfigure=E2=80=99 or similar from there.) Also, you could write the =E2=80=98match=E2=80=99 pattern like this: ('boot-parameters ('version (and version (or 0 1))) ('label label) =E2=80=A6) I hope that makes sense! Ludo=E2=80=99. From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 27 Feb 2022 21:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164599583628897 (code B ref 40998); Sun, 27 Feb 2022 21:04:02 +0000 Received: (at 40998) by debbugs.gnu.org; 27 Feb 2022 21:03:56 +0000 Received: from localhost ([127.0.0.1]:59288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOQhw-0007W1-9v for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:03:56 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:55154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOQhv-0007Vo-38 for 40998@debbugs.gnu.org; Sun, 27 Feb 2022 16:03:55 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 0CC54399; Sun, 27 Feb 2022 22:03:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id meyeWeM3lcF7; Sun, 27 Feb 2022 22:03:47 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6C7E322F; Sun, 27 Feb 2022 22:03:47 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> <20220219070155.1924-2-maxim.cournoyer@gmail.com> Date: Sun, 27 Feb 2022 22:03:47 +0100 In-Reply-To: <20220219070155.1924-2-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Sat, 19 Feb 2022 02:01:53 -0500") Message-ID: <87bkysuimk.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 0CC54399 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) 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: -0.0 (/) Hi, Maxim Cournoyer skribis: > -(define (bootable-kernel-arguments system root-device) > - "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DE= VICE." > - (list (string-append "--root=3D" > +(define* (bootable-kernel-arguments system root-device version) > + "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DE= VICE. > +VERSION is the target version of the boot-parameters record." > + ;; If the version is newer than 0, we use the new style initrd paramet= er > + ;; names, otherwise we use the legacy ones. This is to maintain backw= ard > + ;; compatibility when producing bootloader configurations for older > + ;; generations. > + (define version>0? (> version 0)) > + (list (string-append (if version>0? "root=3D" "--root=3D") > ;; Note: Always use the DCE format because that's= what > - ;; (gnu build linux-boot) expects for the '--root' > + ;; (gnu build linux-boot) expects for the 'root' > ;; kernel command-line option. > (file-system-device->string root-device > #:uuid-type 'dce)) > - #~(string-append "--system=3D" #$system) > - #~(string-append "--load=3D" #$system "/boot"))) > + #~(string-append (if #$version>0? "gnu.system=3D" "--system=3D")= #$system) > + #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D") > + #$system "/boot"))) This is the logic I was suggesting to move to =E2=80=98read-boot-parameters= =E2=80=99. To do that, =E2=80=98read-boot-parameters=E2=80=99 would have to fill the =E2=80=98kernel-arguments=E2=80=99 field of such that it = already contains --system/gnu.system and --load/gnu.load. And then =E2=80=98read-boot-parameters-file=E2=80=99 would become: (call-with-input-file (string-append system "/parameters") read-boot-parameters) without the post-processing step it=E2=80=99s currently doing. (And the version number doesn=E2=80=99t need to flow beyond =E2=80=98read-boot-parameters=E2=80=99.) WDYT? Ludo=E2=80=99. From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 27 Feb 2022 21:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164599600329160 (code B ref 40998); Sun, 27 Feb 2022 21:07:02 +0000 Received: (at 40998) by debbugs.gnu.org; 27 Feb 2022 21:06:43 +0000 Received: from localhost ([127.0.0.1]:59292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOQkc-0007aF-OV for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:06:42 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:55216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOQkb-0007a0-4j for 40998@debbugs.gnu.org; Sun, 27 Feb 2022 16:06:41 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 9FEC5399; Sun, 27 Feb 2022 22:06:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YOX1Q0KoyFnB; Sun, 27 Feb 2022 22:06:35 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id F06D4147; Sun, 27 Feb 2022 22:06:34 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> <20220219070155.1924-3-maxim.cournoyer@gmail.com> Date: Sun, 27 Feb 2022 22:06:34 +0100 In-Reply-To: <20220219070155.1924-3-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Sat, 19 Feb 2022 02:01:54 -0500") Message-ID: <875yp0uihx.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 9FEC5399 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) 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: -0.0 (/) Maxim Cournoyer skribis: > * gnu/build/linux-boot.scm (boot-system): Honor rootfstype and rootflags > arguments. Update doc. Error out in case there is insufficient informat= ion > with regard to the root file system. > Restore the behavior of inferring the root device from the root file syst= em > from the operating system in case the root argument is not provided. > * doc/guix.texi (Initial RAM Disk): Document the new command-line paramet= ers. Very nice! [...] > - (if root-device > - (mount-root-file-system (canonicalize-device-spec root-devic= e) > - (file-system-type root-fs) > - #:volatile-root? volatile-root? > - #:flags (mount-flags->bit-mask > - (file-system-flags root-fs)) > - #:options (file-system-options root-= fs) > - #:check? (check? root-fs) > - #:skip-check-if-clean? > - (skip-check-if-clean? root-fs) > - #:repair (repair root-fs)) > - (mount "none" "/root" "tmpfs")) > + ;; Mount the root file system. > + (mount-root-file-system (canonicalize-device-spec I think the =E2=80=98if=E2=80=99 had (has?) a justification but I=E2=80=99m= not sure what that was. It=E2=80=99s likely nobody will notice if we remove it anyway. :-) Ludo=E2=80=99. From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 27 Feb 2022 21:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164599611229341 (code B ref 40998); Sun, 27 Feb 2022 21:09:01 +0000 Received: (at 40998) by debbugs.gnu.org; 27 Feb 2022 21:08:32 +0000 Received: from localhost ([127.0.0.1]:59296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOQmO-0007dA-3l for submit@debbugs.gnu.org; Sun, 27 Feb 2022 16:08:32 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:55320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOQmM-0007cw-B9 for 40998@debbugs.gnu.org; Sun, 27 Feb 2022 16:08:30 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E45C8399; Sun, 27 Feb 2022 22:08:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RKAdAZyV-bsu; Sun, 27 Feb 2022 22:08:23 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6CBDB147; Sun, 27 Feb 2022 22:08:23 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> <20220219070155.1924-4-maxim.cournoyer@gmail.com> Date: Sun, 27 Feb 2022 22:08:23 +0100 In-Reply-To: <20220219070155.1924-4-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Sat, 19 Feb 2022 02:01:55 -0500") Message-ID: <87wnhgt3ug.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: E45C8399 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) 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: -0.0 (/) Maxim Cournoyer skribis: > * gnu/build/linux-boot.scm (boot-system): Print command-line parameters to > standard output. > --- > gnu/build/linux-boot.scm | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm > index 2f8b114806..30442ec8f8 100644 > --- a/gnu/build/linux-boot.scm > +++ b/gnu/build/linux-boot.scm > @@ -542,6 +542,8 @@ (define (device-string->file-system-device device-str= ing) > (root-fs* (find root-mount-point? mounts)) > (fsck.mode (find-long-option "fsck.mode" args))) >=20=20 > + (format #t "initrd command-line parameters: ~a~%" args) I=E2=80=99d happily avoid being too talkative by default, but maybe we could honor a =E2=80=98gnu.verbosity=E2=80=99 parameter to get different levels o= f early-boot logging? :-) Anyway, it=E2=80=99s a nice patch series. Thanks, Ludo=E2=80=99. From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH v2 4/4] initrd: Print its command-line parameters. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 03:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Maxim Cournoyer , 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.16460199301602 (code B ref 40998); Mon, 28 Feb 2022 03:46:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 03:45:30 +0000 Received: from localhost ([127.0.0.1]:59754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOWyX-0000Pm-LP for submit@debbugs.gnu.org; Sun, 27 Feb 2022 22:45:29 -0500 Received: from tobias.gr ([80.241.217.52]:47568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOWyU-0000Pc-Qk for 40998@debbugs.gnu.org; Sun, 27 Feb 2022 22:45:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=Y89JDEUT3Q2A0 NawB1/aalffTzB0RGHB4onnYuwJT3w=; h=references:in-reply-to:subject:to: from:date; d=tobias.gr; b=Oz6tok0suQeFL2AGirqf6CtUl3iZ/p9UdjrFR/dXoUyT Zq9p9lcDOCvHRWsoGYBbnVwNlhddrnebxcV1ex1aYlnrYHRpVMRoPRX2/KExuG6mP2gY+N yi/OM34uAtiHff/PjXww+AJwBXXvyF7tNbCApwC8qu4277FHGjTpedGWsQHE7WxcJtwLfE m+w262AeGMWuq9crtouUVc8h4dgbHSZOd9hC6PsapBMmNyemX2L0zp4sbx2LpQziKX6jcb KyckwDD3ngSvIUgiJ+9XTQ1CoAWVXb5h2+tVjuN7cy6zJXf0aE0JD9Ut51jrAam8Yu4hN0 bUXD0cmeCs0dWtZPmg== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id b3fb26cd (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 28 Feb 2022 03:45:21 +0000 (UTC) Date: Mon, 28 Feb 2022 03:45:23 +0000 From: Tobias Geerinckx-Rice In-Reply-To: <20220219070155.1924-4-maxim.cournoyer@gmail.com> References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> <20220219070155.1924-4-maxim.cournoyer@gmail.com> Message-ID: <27E100DE-7344-4F7B-8F32-44FE6AF27D2B@tobias.gr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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 (-) On 19 February 2022 07:01:55 UTC, Maxim Cournoyer wrote: >* gnu/build/linux-boot=2Escm (boot-system): Print command-line parameters= to >standard output=2E >--- > gnu/build/linux-boot=2Escm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/gnu/build/linux-boot=2Escm b/gnu/build/linux-boot=2Escm >index 2f8b114806=2E=2E30442ec8f8 100644 >--- a/gnu/build/linux-boot=2Escm >+++ b/gnu/build/linux-boot=2Escm >@@ -542,6 +542,8 @@ (define (device-string->file-system-device device-str= ing) > (root-fs* (find root-mount-point? mounts)) > (fsck=2Emode (find-long-option "fsck=2Emode" args))) >=20 >+ (format #t "initrd command-line parameters: ~a~%" args) >+ > (unless (or root-fs* (and root-device rootfstype)) > (error "no root file system or 'root' and 'rootfstype' paramet= ers")) >=20 I suggest dropping this patch=2E The kernel already does this=2E It's ju= st noise=2E I've installed the others here=2E Thanks! Kind regards, T G-R Sent on the go=2E Excuse or enjoy my brevity=2E From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH v2 4/4] initrd: Print its command-line parameters. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 15:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Tobias Geerinckx-Rice Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164606369314166 (code B ref 40998); Mon, 28 Feb 2022 15:55:01 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 15:54:53 +0000 Received: from localhost ([127.0.0.1]:34591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOiMO-0003gQ-M6 for submit@debbugs.gnu.org; Mon, 28 Feb 2022 10:54:52 -0500 Received: from mail-qv1-f51.google.com ([209.85.219.51]:34537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOiML-0003g9-Uv for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 10:54:51 -0500 Received: by mail-qv1-f51.google.com with SMTP id ba20so13221872qvb.1 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 07:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Lxdmi9n+7UdKDdpcq8gIuz/6g+IRvseFpxXBQYDIJR4=; b=oRAXMbeWTHzlyNYumCi2ULZnnfCbzrJ2T+JKldwTB+1p43SQD+rDft4F2/gjSujTk2 AvV1NQyfsjPYl/KBNp05DPIjDPEH4BLcCEiwYaqwmUXv3Sct4f6GX+NDf4VzU39y3cwv /B4t6l5gDQMYJurpOYWMvelr7WkxvbR6nnNMrm6DHRgxuGQGx5k5g2ZMp3w0uzQLr2W/ DlSsBh1N6PwYNJ3ieI2ctNG22KWItX8n7uABmpRpzmjdeHfe8JNLhDs0PP7DscHe7nyA A/oO9lVSxse963oyHNh2DqyZDMhuXuAVQwyUPbT4iLVINwl4wrGMRCvbgsV+kogqWpq4 +dPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Lxdmi9n+7UdKDdpcq8gIuz/6g+IRvseFpxXBQYDIJR4=; b=YTntczWQK1sxRfZ9+n4Uz7gX8Vvqn8Ci5A5htMfhOR4pD+l2z48TLatv3OUCADkVwO 872epdI93YGPl+2yJclNqmWElj0tIHs8R4HKBnyHkuP+NxQ5bO15UkxoqpKDN98p3R3H Yz5M8KnKIE7e4jFWOSutwebZJPi4i/7bG/+33inqil4b1+WOTKcjCMJpmHiLPXIY1wn+ yo8FMBeqBir6ET4yMN6pS6oZ3qBpZOOq2bXcKzoBEr4QoVZ6LSVwBcisBI2BLoDyE/zq zNi2dscPMjzvoafgTE5Hcj9FLF7okBKjBKRuf7bQdJhH2UC4s1jOFmkpv8wtTJ6DYyyj REgQ== X-Gm-Message-State: AOAM533dP9x24VusQIOUxS5TXsGtktGy/F8Iry1gGmdhRtSshz3k6X8o ltn6f+tFbTs+MJPweDnZnW/4I8F7G/g= X-Google-Smtp-Source: ABdhPJyDIICsy2/Rgd5qmCBl1hFUpNNKublpPtu2RzXws5Yqlk6RmuffbG1FSwG656Dy29d2NyagIQ== X-Received: by 2002:a05:6214:5290:b0:432:d8a3:c9a0 with SMTP id kj16-20020a056214529000b00432d8a3c9a0mr9633951qvb.69.1646063684095; Mon, 28 Feb 2022 07:54:44 -0800 (PST) Received: from hurd (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id a3-20020a05620a124300b00648c9a37984sm5015029qkl.58.2022.02.28.07.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 07:54:43 -0800 (PST) From: Maxim Cournoyer References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> <20220219070155.1924-4-maxim.cournoyer@gmail.com> <27E100DE-7344-4F7B-8F32-44FE6AF27D2B@tobias.gr> Date: Mon, 28 Feb 2022 10:54:42 -0500 In-Reply-To: <27E100DE-7344-4F7B-8F32-44FE6AF27D2B@tobias.gr> (Tobias Geerinckx-Rice's message of "Mon, 28 Feb 2022 03:45:23 +0000") Message-ID: <87k0dft29p.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) 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, Tobias Geerinckx-Rice writes: > On 19 February 2022 07:01:55 UTC, Maxim Cournoyer wrote: >>* gnu/build/linux-boot.scm (boot-system): Print command-line parameters to >>standard output. >>--- >> gnu/build/linux-boot.scm | 2 ++ >> 1 file changed, 2 insertions(+) >> >>diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm >>index 2f8b114806..30442ec8f8 100644 >>--- a/gnu/build/linux-boot.scm >>+++ b/gnu/build/linux-boot.scm >>@@ -542,6 +542,8 @@ (define (device-string->file-system-device device-string) >> (root-fs* (find root-mount-point? mounts)) >> (fsck.mode (find-long-option "fsck.mode" args))) >> >>+ (format #t "initrd command-line parameters: ~a~%" args) >>+ >> (unless (or root-fs* (and root-device rootfstype)) >> (error "no root file system or 'root' and 'rootfstype' parameters")) >> > > I suggest dropping this patch. The kernel already does this. It's just noise. I thought about adding it after attempting to debug initrd/kernel problems as can be seen here: https://elephly.net/paste/1645124517.html (this is the Berlin boot log copied from a serial console). Not that the initrd printing it itself would have helped here, as it appears to be truncated from when Linux took over the initrd script, if I understand correctly. Anyway, I agree it's probably redundant and useless in all but more desperate debugging cases :-), so I don't mind to drop it. Thanks, Maxim From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 20:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164607857615400 (code B ref 40998); Mon, 28 Feb 2022 20:03:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 20:02:56 +0000 Received: from localhost ([127.0.0.1]:34847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOmES-00040K-0Q for submit@debbugs.gnu.org; Mon, 28 Feb 2022 15:02:56 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:36732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOmEQ-000407-F2 for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 15:02:54 -0500 Received: by mail-qv1-f50.google.com with SMTP id w7so14487242qvr.3 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 12:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=ajFrTYLisSdNNxrytyHgyEVt8xQSUsJQcg40We5D53k=; b=AIuyl4Iw9NUhN7HSTjKHJPSvcGLGLOExRdeQ1hCqYcWhsrCKWX/iTBxYySlg0fCmM/ PihpBtJCNqRjNRarw3cVARGOocHmQUcTj4cOrIuxxfZH92cv85w/Mzkp1fcaj+DnUr3A Owir1zCTWdCJY/5DeTfCiZTWDSBpArGG/qu6H+jzW7hpHkY0la21aRmCSuxI2Kgl4Sor 9ZPBLqnwPdRDfVC2C9C+bqhkfQV6w/pifkUe41dR7rAmdaj7KcVS1BWLJJag+fyjxDa1 40s6lr6iRAEIqlrV1epRNzQkH2eUViZr+REcpYZFpBA7Kj3Dko3S7tctsL18QJjxmodX dYNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=ajFrTYLisSdNNxrytyHgyEVt8xQSUsJQcg40We5D53k=; b=AlBdY4FJMiiosGkcDS4Tlh/sNDwTcd352DEI77mmH/NJ6GeckmnBGLwdrO33OKNp7d T8Crzqt9B1LfunNHETCmRi4wpcnn6qQU3EJzSeH+2wFIx9DyuJ9eRqYpscWeMSMPgRXG vnbVr0b/++MYhurXxsX/A+ysp0f06OdxYecx2QSc37r0NCwB6Cxpb3OlAN+K7eog1ohp pSAkr+HidGI+ih3jL5dT/W74sVRNJd2zLiLFdEObG54HQTWVZkl9xYwEsghHoyQ/XaQt ApfgimUznwfD04t6z3PdwA3TNmQvE4rZTTrPEnLAH+J1H6fBQAJWlFzMzI3abbGUbjXW dt6g== X-Gm-Message-State: AOAM5327AQePmUNGGvgtHsqgV5lV7aA4JgA+xILEb6ldrod+BmWHX1EI hTIzQy1gG9ZsXh480wBI3qZLIo2Z+3g= X-Google-Smtp-Source: ABdhPJxM7+Cfi4m8tgAFM+nOBkKKv2mUr+5f2vbOuQMX+Ip0FfRwiTqdAEcGK9dMtJCy4/vJ8YKn7A== X-Received: by 2002:a05:622a:1704:b0:2de:625:5e41 with SMTP id h4-20020a05622a170400b002de06255e41mr17723187qtk.452.1646078568644; Mon, 28 Feb 2022 12:02:48 -0800 (PST) Received: from hurd (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id x19-20020ae9e913000000b00648e98be8casm5447777qkf.13.2022.02.28.12.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:02:48 -0800 (PST) From: Maxim Cournoyer References: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20220219070155.1924-1-maxim.cournoyer@gmail.com> <87lexwuj27.fsf_-_@gnu.org> Date: Mon, 28 Feb 2022 15:02:47 -0500 In-Reply-To: <87lexwuj27.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sun, 27 Feb 2022 21:54:24 +0100") Message-ID: <87bkyqu5co.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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 Ludovic! Ludovic Court=C3=A8s writes: > Hi! > > Maxim Cournoyer skribis: > >> This version field exposes the (already present) version information of = a boot >> parameters file. >> >> * gnu/system.scm (%boot-parameters-version): New variable. >> ()[version]: New field. >> (read-boot-parameters): Use it. >> (operating-system-boot-parameters-file): Likewise. >> * tests/boot-parameters.scm (test-read-boot-parameters): Use >> %boot-parameters-version as the default version value in the template. > > [...] > >> (define-record-type* >> boot-parameters make-boot-parameters boot-parameters? >> (label boot-parameters-label) >> @@ -322,7 +326,9 @@ (define-record-type* >> (kernel boot-parameters-kernel) >> (kernel-arguments boot-parameters-kernel-arguments) >> (initrd boot-parameters-initrd) >> - (multiboot-modules boot-parameters-multiboot-modules)) >> + (multiboot-modules boot-parameters-multiboot-modules) >> + (version boot-parameters-version ;positive integer >> + (default %boot-parameters-version))) > > [...] > >> (match (read port) >> - (('boot-parameters ('version 0) >> + (('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)) > > There=E2=80=99s no need to have a =E2=80=98version=E2=80=99 field in live= > records: have the =E2=80=98version=E2=80=99 field in the serialized forma= t (the sexp) > and make sure the deserializer correctly converts to the internal > representation. > > Here, I think you can bump the version number in the serialized form, > and have =E2=80=98read-boot-parameters=E2=80=99 automatically augment =E2= =80=98kernel-arguments=E2=80=99 > when VERSION is 0 with =E2=80=9C--root=3DXYZ=E2=80=9D. I initially went that route, as this was the idea you'd given me initially. However, 'read-boot-parameters' deals with serializing the parameters file only; to add 'root', 'gnu.load' and 'gnu.system', the operating-system object as well as the root device are needed. The reason 'gnu.load' and 'gnu.system' aren't written to the parameters file to start with is because they would cause the system directory to no longer be content-addressable; this is explained in the docstring of 'operating-system-boot-parameters-file': When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments such as 'ro= ot' and 'gnu.load' to the returned file (since the returned file is then us= ually stored into the content-addressed "system" directory, it's usually not a good idea to give it because the content hash would change by the conte= nt hash being stored into the "parameters" file). So, unless we were to pack 'read-boot-parameters' with unrelated duties and a 'system-kernel-arguments?' argument, it seems unavoidable to expose the 'version' metadata. > (It might be that you can even do that without bumping the version > number. Bumping is clearer but the downside is that an older Guix will > abort when attempting to read =E2=80=98parameters=E2=80=99. This could h= appen if you > roll back to an earlier generation and try to run =E2=80=98guix system > reconfigure=E2=80=99 or similar from there.) > > Also, you could write the =E2=80=98match=E2=80=99 pattern like this: > > ('boot-parameters ('version (and version (or 0 1))) > ('label label) =E2=80=A6) I think this patch's current form is preferable, as it means future boot-parameters version bumps won't break older Guices (when reconfiguring), as long as the version is an exact, non-negative integer (e.g. when going from 1 to 2). Let me know what you think! Thank you, Maxim From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 20:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164608032418204 (code B ref 40998); Mon, 28 Feb 2022 20:33:01 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 20:32:04 +0000 Received: from localhost ([127.0.0.1]:34861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOmge-0004jY-A6 for submit@debbugs.gnu.org; Mon, 28 Feb 2022 15:32:04 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:36753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOmgc-0004j2-NJ for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 15:32:03 -0500 Received: by mail-qv1-f41.google.com with SMTP id w7so14625383qvr.3 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 12:32:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=kaX8DLNhZ3UV0kl5ZUnQEMwDUduLfp2WmWITywk+ykQ=; b=iXyk0cGQ+V1pRdkbYTQ2aMaynkLtQFQYxYKpK+GceaAe+xv+nbST2rnbXqBR+FM1Bv kSp4cT7nwoca1WAAPMfkDFbAZMB6y0oWOslaidNNN+cZvOhdqnhaHixKZ0pzygvDt28V YahkAoHydSedcZW2ducZE6XX91M23p+D4XhgDdCQj0mlg25PpawkzoD3wc0FxSzdRF7S 93PAP6KVfOqkhJL9A89RXX694cDTn+3X1JquQnDppdUKJiWHiG4tV4GobrdB8t6S6TKR RyZmnrfiVcQyL+RX7VabPicbJdd7FbVjOeCiZjM2jgT7bNheuDautXd93Tyv/IgWy6Mh EQ3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=kaX8DLNhZ3UV0kl5ZUnQEMwDUduLfp2WmWITywk+ykQ=; b=W9U6oOUG9O6clKOSy1rACgz8u2tj4FE+t0F1inLcY2vd6+0QkhdZKgkWjVF6nQRX9G Djr7zHB2BuD70bQ69SemE28irI0aRMNTuc6s3xFOWd67T7FJkGN90Xyqkjsotyv2R+n7 qP0cVx75fCEt7D9f1ZNd78UM9jzlc0NBwPGByji+EH2Tem5I7Vc1aquhpiVspVBfE7qg SWvsGud5jl+bPzmDHk/oI7h5DOP2iDUyVEEJ8oVorwaDYmlv1TsOxyWfFXf0rboOAWaU xgCmM0xAwq4vnPARfcIJ6oSD8iqtlc8j5GoHcDkzZAhZoz0IoFlPKZMvVZUC6sZ5RVhu qr0w== X-Gm-Message-State: AOAM530yF1aAXJiTzWPGFV+HMH8My41/26DnNlcQoHTG0Q/XT1NsaExd j//2L+agXO5JvlohJu1VCCiz8vTe2ts= X-Google-Smtp-Source: ABdhPJwBRU1CeNYT8lTShLP3IVJByOi2EGCXFDUaQ1WDZtmq5Ah68UxnBH3xj2OVcjBvEHItF7wIkw== X-Received: by 2002:a05:622a:588:b0:2de:9242:8788 with SMTP id c8-20020a05622a058800b002de92428788mr17927732qtb.76.1646080316944; Mon, 28 Feb 2022 12:31:56 -0800 (PST) Received: from hurd (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id h188-20020a376cc5000000b0064957b23a9csm5501800qkc.118.2022.02.28.12.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:31:56 -0800 (PST) From: Maxim Cournoyer References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> <20220219070155.1924-2-maxim.cournoyer@gmail.com> <87bkysuimk.fsf_-_@gnu.org> Date: Mon, 28 Feb 2022 15:31:55 -0500 In-Reply-To: <87bkysuimk.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sun, 27 Feb 2022 22:03:47 +0100") Message-ID: <875yoyu404.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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 Ludovic, Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer skribis: > >> -(define (bootable-kernel-arguments system root-device) >> - "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-D= EVICE." >> - (list (string-append "--root=3D" >> +(define* (bootable-kernel-arguments system root-device version) >> + "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-D= EVICE. >> +VERSION is the target version of the boot-parameters record." >> + ;; If the version is newer than 0, we use the new style initrd parame= ter >> + ;; names, otherwise we use the legacy ones. This is to maintain back= ward >> + ;; compatibility when producing bootloader configurations for older >> + ;; generations. >> + (define version>0? (> version 0)) >> + (list (string-append (if version>0? "root=3D" "--root=3D") >> ;; Note: Always use the DCE format because that'= s what >> - ;; (gnu build linux-boot) expects for the '--roo= t' >> + ;; (gnu build linux-boot) expects for the 'root' >> ;; kernel command-line option. >> (file-system-device->string root-device >> #:uuid-type 'dce)) >> - #~(string-append "--system=3D" #$system) >> - #~(string-append "--load=3D" #$system "/boot"))) >> + #~(string-append (if #$version>0? "gnu.system=3D" "--system=3D"= ) #$system) >> + #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D") >> + #$system "/boot"))) > > This is the logic I was suggesting to move to =E2=80=98read-boot-paramete= rs=E2=80=99. > > To do that, =E2=80=98read-boot-parameters=E2=80=99 would have to fill the > =E2=80=98kernel-arguments=E2=80=99 field of such that i= t already > contains --system/gnu.system and --load/gnu.load. As mentioned in my previous reply, that'd only be possible if we no longer cared about having the produced system directory content-addressable, if I understood that comment in the docstring referred earlier correctly. Thanks, Maxim From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 20:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164608062418673 (code B ref 40998); Mon, 28 Feb 2022 20:38:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 20:37:04 +0000 Received: from localhost ([127.0.0.1]:34866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOmlT-0004r7-UX for submit@debbugs.gnu.org; Mon, 28 Feb 2022 15:37:04 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:38669) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOmlR-0004qc-Ns for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 15:37:02 -0500 Received: by mail-qv1-f49.google.com with SMTP id d3so14636161qvb.5 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 12:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=e3SVYKiUqm2HHQ7r5nAi11d9PDOwlUrxUnxBWWnijjU=; b=dBjCI/G0AjcOac02ZyLRKYzzAoQZK9ABffgHq23AcxcoNtnElsa6WwBKys8OglfxGM 7jjXJF3t3GXh8TmVVLcgP0m3U1YUKexvvcH2h/cIwk8RSk6GgmSd7J1dssyagl87VRTW xmUPd+FmhNJGESbMD8lEg+fkPDaWt49Dfhg/DR6T3xJkKMMjE+2aE4R31cMrPy/UExoM 4jIPq7m08DwYpbM2Bp5xcj2Wh8LVsF8u5RB71rBZPSjsbJOFldcPAZCe8Kle+18Z60Aj Ce4INn8fu1eiWrgaZ4GVwk2Ys4jJ0DyHl8GhEamIS5FNoS75AJAQUmEbFn0qzoBVA26L CYew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=e3SVYKiUqm2HHQ7r5nAi11d9PDOwlUrxUnxBWWnijjU=; b=WK6JXhjZdkxgzH2Fihb4C+bvph3Y9rQGcylsemUPoAkNoO5rU5gdbjT2wv7xe8Yryg xrQMxP1n2p9H3Hf+YKGuK2gRI141ArbP98lhmWqrVfhP0z+DcT2fWxpuiNhNSYo/VdH2 embCiw0ikYOOcnPJWVm3BTTa6ZOl91aXymcBOIWPcSq+JrFWAJ4k3NuMFIeQfAf03kVi pHzVIy5ofczn+dWGZIq2Hoy8nkcdVeJISIfCQtZ8epAn+DXoS20Cmu8mS5jEPHYlelNT JwfVGrku4wNhGJWhkyWtWBnVOqGXgticYAshxjcwI5gayxXZlHG3ZfYSO1qXuwS9OD21 gVLw== X-Gm-Message-State: AOAM530LNloCk4x8+JC4H5dOstoLeEVRr6uTeGpIoA0ZCDG9PF56f+FV Eqxpx6Fhh33a5ybj1CWXVM7B1Y9xwRo= X-Google-Smtp-Source: ABdhPJwbz94y8GLzvKsxLE5zzTtgR6PWg6EjIPUmNDC/DkwDoNTEE9jSiyNL7zy/UI061YgzqbkFTQ== X-Received: by 2002:ac8:57d4:0:b0:2de:6f5c:4214 with SMTP id w20-20020ac857d4000000b002de6f5c4214mr17741131qta.200.1646080616043; Mon, 28 Feb 2022 12:36:56 -0800 (PST) Received: from hurd (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id y16-20020a05622a121000b002deaa0af9e2sm7473253qtx.49.2022.02.28.12.36.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:36:55 -0800 (PST) From: Maxim Cournoyer References: <20220219070155.1924-1-maxim.cournoyer@gmail.com> <20220219070155.1924-4-maxim.cournoyer@gmail.com> <87wnhgt3ug.fsf_-_@gnu.org> Date: Mon, 28 Feb 2022 15:36:54 -0500 In-Reply-To: <87wnhgt3ug.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sun, 27 Feb 2022 22:08:23 +0100") Message-ID: <87v8wysp7d.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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 again, Ludovic Court=C3=A8s writes: > Maxim Cournoyer skribis: > >> * gnu/build/linux-boot.scm (boot-system): Print command-line parameters = to >> standard output. >> --- >> gnu/build/linux-boot.scm | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm >> index 2f8b114806..30442ec8f8 100644 >> --- a/gnu/build/linux-boot.scm >> +++ b/gnu/build/linux-boot.scm >> @@ -542,6 +542,8 @@ (define (device-string->file-system-device device-st= ring) >> (root-fs* (find root-mount-point? mounts)) >> (fsck.mode (find-long-option "fsck.mode" args))) >>=20=20 >> + (format #t "initrd command-line parameters: ~a~%" args) > > I=E2=80=99d happily avoid being too talkative by default, but maybe we co= uld > honor a =E2=80=98gnu.verbosity=E2=80=99 parameter to get different levels= of early-boot > logging? :-) Eh, I've dropped it for now; I attribute my perceived need for it due to the odd berlin boot output as seen from the serial console [0], which was missing it (it appears to be truncated). Thank you! Maxim [0] https://elephly.net/paste/1645131411.html From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 21:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164608293122365 (code B ref 40998); Mon, 28 Feb 2022 21:16:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 21:15:31 +0000 Received: from localhost ([127.0.0.1]:34882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOnMh-0005of-BL for submit@debbugs.gnu.org; Mon, 28 Feb 2022 16:15:31 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:45540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOnMc-0005oO-Uh for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 16:15:30 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 45F8B2E6; Mon, 28 Feb 2022 22:15:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ugZ3dgvGmYTK; Mon, 28 Feb 2022 22:15:17 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 599F5BD; Mon, 28 Feb 2022 22:15:17 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20220219070155.1924-1-maxim.cournoyer@gmail.com> <87lexwuj27.fsf_-_@gnu.org> <87bkyqu5co.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 =?UTF-8?Q?Vent=C3=B4se?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 28 Feb 2022 22:15:17 +0100 In-Reply-To: <87bkyqu5co.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 28 Feb 2022 15:02:47 -0500") Message-ID: <87fso2bsm2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 45F8B2E6 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) 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: -0.0 (/) Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >> There=E2=80=99s no need to have a =E2=80=98version=E2=80=99 field in liv= e >> records: have the =E2=80=98version=E2=80=99 field in the serialized form= at (the sexp) >> and make sure the deserializer correctly converts to the internal >> representation. >> >> Here, I think you can bump the version number in the serialized form, >> and have =E2=80=98read-boot-parameters=E2=80=99 automatically augment = =E2=80=98kernel-arguments=E2=80=99 >> when VERSION is 0 with =E2=80=9C--root=3DXYZ=E2=80=9D. > > I initially went that route, as this was the idea you'd given me > initially. However, 'read-boot-parameters' deals with serializing the > parameters file only; to add 'root', 'gnu.load' and 'gnu.system', the > operating-system object as well as the root device are needed. already has =E2=80=98root-device=E2=80=99, so that=E2=80= =99s fine. But you=E2=80=99re right that the system itself is a problem because that= =E2=80=99s self-referential=E2=80=94it=E2=80=99s the thing the =E2=80=9Cparameters=E2= =80=9D file is in. Hmm! We could add a substitution mechanism where a literal =E2=80=9C$SYSTEM=E2= =80=9D (say) in the =E2=80=98kernel-arguments=E2=80=99 of would be substi= tuted by the actual system store file name by =E2=80=98read-boot-parameters=E2=80=99, bu= t maybe that=E2=80=99s overkill. So long story short: keeping the =E2=80=98version=E2=80=99 field in sounds reasonable after all. :-) > The reason 'gnu.load' and 'gnu.system' aren't written to the > parameters file to start with is because they would cause the system > directory to no longer be content-addressable; this is explained in > the docstring of 'operating-system-boot-parameters-file': > > When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments such as '= root' > and 'gnu.load' to the returned file (since the returned file is then = usually > stored into the content-addressed "system" directory, it's usually no= t a > good idea to give it because the content hash would change by the con= tent hash > being stored into the "parameters" file). This comment originates in 40fad1c24ce60076e26f6dc8096e4716d31d90c3. I find it a bit misleading because nothing=E2=80=99s =E2=80=9Ccontent-address= ed=E2=80=9D, but I guess it refers to the same problem: that this is self-referential. (There=E2=80=99s only one use of #:system-kernel-arguments? #t. We can rem= ove that keyword parameter from =E2=80=98operating-system-boot-parameters-file= =E2=80=99 since it=E2=80=99s not used there.) >> Also, you could write the =E2=80=98match=E2=80=99 pattern like this: >> >> ('boot-parameters ('version (and version (or 0 1))) >> ('label label) =E2=80=A6) > > I think this patch's current form is preferable, as it means future > boot-parameters version bumps won't break older Guices (when > reconfiguring), as long as the version is an exact, non-negative integer > (e.g. when going from 1 to 2). That=E2=80=99s what we want to avoid: bumping the version number means that= the new format is not backwards-compatible, and that older Guix versions won=E2=80=99t be able to read it. That=E2=80=99s why I think =E2=80=98read= -boot-parameters=E2=80=99 needs to be explicit about the version(s) it expects. (A more complete example of this pattern is =E2=80=98sexp->manifest=E2=80=99.) Breaking backwards compatibility should be avoided when possible, but it=E2=80=99s not always possible. In =E2=80=98read-boot-parameters=E2=80= =99, =E2=80=98bootloader-name=E2=80=99, =E2=80=98bootloader-menu-entries=E2=80=99, =E2=80=98kernel=E2=80=99, etc. a= re handled somewhat weirdly to preserve backwards-compatibility; doing this allowed us to not bump the file format version. Thanks! Ludo=E2=80=99. From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: Guix System's initrd doesn't honor rootflags Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 21:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164608474925197 (code B ref 40998); Mon, 28 Feb 2022 21:46:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 21:45:49 +0000 Received: from localhost ([127.0.0.1]:34909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOnq0-0006YL-Oi for submit@debbugs.gnu.org; Mon, 28 Feb 2022 16:45:49 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:44698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOnpz-0006Y9-Qr for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 16:45:48 -0500 Received: by mail-qv1-f47.google.com with SMTP id jr3so594782qvb.11 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 13:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=xPX8bNvLR1OvxYztuvQiv5wblDpJj3KAVGCbu0iBRoc=; b=IRXZHILfUs8VHlkUIvqQVx4GZE/xzYMDmz04LL18rSAEChufaEazkh7XZBV/Cm4a67 gaTiLwQCY1EWEAr99kBpjMJ2Ofnvh+2LQh2oT/WkmOM+VJpQ5CEtZ859gg7IqD1CFZqQ tKSku2dgrqP4NkfL668CXiE1VKSH47uHoI1htO2+vBtH4vTtJThgXA4UTCWAcup6JrHk RnGF6L8k0910Z5jKOxVnFZOE/GQ6hj7gL1sceGzGSG31Ew37a2/bpf142CAxsj/6q3pZ 033ebqvDFUfRYDNFJ29Q6po2fAHVlT29aMGUiHqZZcoVz5ENcIqYBxTgCEVRBh7sWqfr XxVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=xPX8bNvLR1OvxYztuvQiv5wblDpJj3KAVGCbu0iBRoc=; b=2P1w2NH5kxdXAcOwhfERkKQOjabdb42jTFWXaVC4ROToJDgYBVMPkKVRrBXHEtaJOW aGuELwcRyqnCrip7ZaOlLrABOEawIOpptYYwn7inYWNOuWZBU4vrdz4HYz1CwcypbjuX ipYikgTyCQrVKibhmiHu/QnTlK00/0eTes2BtFOkpq2zQOTPgvGgnHtWy9Xtebq4hzfN 7U2cedhpVLsSctCUGaOFNdu43GJcucdE/pAi6AsZ1e/3X1qtFc9ZiCo+npfrU0pHz+bp veDLRLATLeuB2hmjQT4p0Cz/RfVUOjTDkrFPzTeYxFFUCdeRFPKm4SpUVyDXK0nCTExr cQPg== X-Gm-Message-State: AOAM532IDXKvVqMP1kxnUsaVpOUMbvqJFap0sKYH2fH4LeEMM1dE48Xp C3GsDkhwxBiChHYYgeoOzEfTgxrkaHE= X-Google-Smtp-Source: ABdhPJwkXeUeamvo8rczofZ9A4XbMQrgDP0WVLNX+Af78l9laOzgaTJaqJcI8hJ2bw6hQEOkDYl8Dg== X-Received: by 2002:a05:622a:1652:b0:2df:f380:aca0 with SMTP id y18-20020a05622a165200b002dff380aca0mr11195336qtj.195.1646084741908; Mon, 28 Feb 2022 13:45:41 -0800 (PST) Received: from hurd (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id w13-20020a05622a190d00b002dd2600afc2sm7896761qtc.62.2022.02.28.13.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 13:45:41 -0800 (PST) From: Maxim Cournoyer References: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <20220219070155.1924-1-maxim.cournoyer@gmail.com> <87lexwuj27.fsf_-_@gnu.org> <87bkyqu5co.fsf@gmail.com> <87fso2bsm2.fsf@gnu.org> Date: Mon, 28 Feb 2022 16:45:40 -0500 In-Reply-To: <87fso2bsm2.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 28 Feb 2022 22:15:17 +0100") Message-ID: <87mtiasm0r.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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 Ludovic, Ludovic Court=C3=A8s writes: > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: > > [...] > >>> There=E2=80=99s no need to have a =E2=80=98version=E2=80=99 field in li= ve >>> records: have the =E2=80=98version=E2=80=99 field in the serialized for= mat (the sexp) >>> and make sure the deserializer correctly converts to the internal >>> representation. >>> >>> Here, I think you can bump the version number in the serialized form, >>> and have =E2=80=98read-boot-parameters=E2=80=99 automatically augment = =E2=80=98kernel-arguments=E2=80=99 >>> when VERSION is 0 with =E2=80=9C--root=3DXYZ=E2=80=9D. >> >> I initially went that route, as this was the idea you'd given me >> initially. However, 'read-boot-parameters' deals with serializing the >> parameters file only; to add 'root', 'gnu.load' and 'gnu.system', the >> operating-system object as well as the root device are needed. > > already has =E2=80=98root-device=E2=80=99, so that=E2= =80=99s fine. > > But you=E2=80=99re right that the system itself is a problem because that= =E2=80=99s > self-referential=E2=80=94it=E2=80=99s the thing the =E2=80=9Cparameters= =E2=80=9D file is in. Hmm! > > We could add a substitution mechanism where a literal =E2=80=9C$SYSTEM=E2= =80=9D (say) in > the =E2=80=98kernel-arguments=E2=80=99 of would be subs= tituted by the > actual system store file name by =E2=80=98read-boot-parameters=E2=80=99, = but maybe > that=E2=80=99s overkill. > > So long story short: keeping the =E2=80=98version=E2=80=99 field in > sounds reasonable after all. :-) OK, good, thanks for having confirmed that. >> The reason 'gnu.load' and 'gnu.system' aren't written to the >> parameters file to start with is because they would cause the system >> directory to no longer be content-addressable; this is explained in >> the docstring of 'operating-system-boot-parameters-file': >> >> When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments such as = 'root' >> and 'gnu.load' to the returned file (since the returned file is then= usually >> stored into the content-addressed "system" directory, it's usually n= ot a >> good idea to give it because the content hash would change by the co= ntent hash >> being stored into the "parameters" file). > > This comment originates in 40fad1c24ce60076e26f6dc8096e4716d31d90c3. I > find it a bit misleading because nothing=E2=80=99s =E2=80=9Ccontent-addre= ssed=E2=80=9D, but I > guess it refers to the same problem: that this is self-referential. > > (There=E2=80=99s only one use of #:system-kernel-arguments? #t. We can r= emove > that keyword parameter from =E2=80=98operating-system-boot-parameters-fil= e=E2=80=99 > since it=E2=80=99s not used there.) OK, I'll address this confusing comment and extraneous argument in a separate commit. >>> Also, you could write the =E2=80=98match=E2=80=99 pattern like this: >>> >>> ('boot-parameters ('version (and version (or 0 1))) >>> ('label label) =E2=80=A6) >> >> I think this patch's current form is preferable, as it means future >> boot-parameters version bumps won't break older Guices (when >> reconfiguring), as long as the version is an exact, non-negative integer >> (e.g. when going from 1 to 2). > > That=E2=80=99s what we want to avoid: bumping the version number means th= at the > new format is not backwards-compatible, and that older Guix versions > won=E2=80=99t be able to read it. That=E2=80=99s why I think =E2=80=98re= ad-boot-parameters=E2=80=99 > needs to be explicit about the version(s) it expects. (A more complete > example of this pattern is =E2=80=98sexp->manifest=E2=80=99.) > > Breaking backwards compatibility should be avoided when possible, but > it=E2=80=99s not always possible. In =E2=80=98read-boot-parameters=E2=80= =99, =E2=80=98bootloader-name=E2=80=99, > =E2=80=98bootloader-menu-entries=E2=80=99, =E2=80=98kernel=E2=80=99, etc.= are handled somewhat weirdly > to preserve backwards-compatibility; doing this allowed us to not bump > the file format version. Thanks for explaining! I initially thought the choice to break backward compatibility could be left to the implementer of a new version, but now I see this wouldn't work or be brittle. I've modified the first commit like so: --8<---------------cut here---------------start------------->8--- modified gnu/system.scm @@ -365,8 +365,10 @@ (define uuid-sexp->uuid (warning (G_ "unrecognized uuid ~a at '~a'~%") x (port-filename por= t)) #f))) =20 + ;; New versions are not backward-compatible, so only accept past and cur= rent + ;; versions, not future ones. (define (version? n) - (and (exact-integer? n) (not (negative? n)))) + (member n (iota (1+ %boot-parameters-version)))) =20 (match (read port) (('boot-parameters ('version (? version? version)) --8<---------------cut here---------------end--------------->8--- So that there's only one thing to update when we'll bump the version again in the future (%boot-parameters-version). I'll be sending a v3 shortly, thanks again! Maxim From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 1/4] system: Add a version field to the record. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 22:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 40998@debbugs.gnu.org Cc: ludo@gnu.org, me@tobias.gr, Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164608868931484 (code B ref 40998); Mon, 28 Feb 2022 22:52:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 22:51:29 +0000 Received: from localhost ([127.0.0.1]:34941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOorV-0008Be-2H for submit@debbugs.gnu.org; Mon, 28 Feb 2022 17:51:29 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:43987) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOorP-0008BJ-Iy for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 17:51:23 -0500 Received: by mail-qv1-f52.google.com with SMTP id c14so10356905qvk.10 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 14:51:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pgBgeKIJ80GUPqRsUuOcijxTXOHyh+Y5TGaICnL0Pwg=; b=Ta0SujBGF43hj4vE9j1EYhCXlIEE0DSnvr9HHhlgmq1OqUuSkfvrNl6jgMaR8YWbtj LgLAZrb/kILUnJDui1KQYVzLZhJeFItGn6Ps40gO2f0ToJIJczztwKIe1vfKFw6FXWA5 GSgrZ+DzmCTDhof9rNohlsMg6nxTBjDdnjxpgcfXS9aLFWiJR3vJ/uM2QYWoKAgiVxEc TSnNOKeb5mGJ00h1y2bpEYjtQ661UzaeAldeKXI+c1wMjbjBVplHD9Nf0RyLrj+lSjYf Hgmtx7yJSKOtd2BGzm2I+RSEss2jIopqCyhBgcXmgQO1bDDlsHHeSIyhMq4x3oEdAiB6 AWFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pgBgeKIJ80GUPqRsUuOcijxTXOHyh+Y5TGaICnL0Pwg=; b=u/I3X2Q2sMm7GUeBJua1ZLwWYw9FBffuawPqECAJKcyg2IZNwdifByWY9CFYkhySAl lg1tTtPnG/EloUgEwnLDydJNKPKEIj8yUtvhk6qi3st8JTVH50vw8B99v10bYhT/wEQr bxhtR6afAl+7KbHoOWMI9gjlHdlFCGQg+sKUNzJcBuTXoD50ACgJ4PKbj+mieHrhgQes fTBkXA4ZIfB9bMEu1+C70wBsB/SYJdL+KQWv9m62OjYKVYiuO9IHDGfmM5Om6AbIeplB sR6rFQq0xxCj9UXfp4sKDYmDyPeuOWzArf99i7i4VTQ8pogqlWH0EZ3wE4Uf89bHLvlA YWCQ== X-Gm-Message-State: AOAM5320NreVEAaiWW6YtMcG9ViTvs12N1mFzhQ9rOO4W0Rs5CKyXq2E P9iZdOIZSsvSj/lxMuEzmH7hjD8RxLiroA== X-Google-Smtp-Source: ABdhPJxBG7UUn21zTUtPn5GNkyZMKeBxbS6FXaapms6vvztzWRJ5MptCoWU6u676v+JAHx/QLXSNfA== X-Received: by 2002:ac8:5d49:0:b0:2df:f50f:f4eb with SMTP id g9-20020ac85d49000000b002dff50ff4ebmr9880594qtx.202.1646088673833; Mon, 28 Feb 2022 14:51:13 -0800 (PST) Received: from localhost.localdomain (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id b17-20020ae9eb11000000b0064917bda713sm5562714qkg.85.2022.02.28.14.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 14:51:13 -0800 (PST) From: Maxim Cournoyer Date: Mon, 28 Feb 2022 17:50:43 -0500 Message-Id: <20220228225047.11105-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) This version field exposes the (already present) version information of a boot parameters file. * gnu/system.scm (%boot-parameters-version): New variable. ()[version]: New field. (read-boot-parameters): Use it. (operating-system-boot-parameters-file): Likewise. * tests/boot-parameters.scm (test-read-boot-parameters): Use %boot-parameters-version as the default version value in the template. --- gnu/system.scm | 20 ++++++++++++++++---- tests/boot-parameters.scm | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index cc925de16f..9ae158dea6 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -9,7 +9,7 @@ ;;; Copyright © 2020 Danny Milosavljevic ;;; Copyright © 2020, 2021 Brice Waegeneire ;;; Copyright © 2020 Florian Pelz -;;; Copyright © 2020 Maxim Cournoyer +;;; Copyright © 2020, 2022 Maxim Cournoyer ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2021 Maxime Devos @@ -161,6 +161,8 @@ (define-module (gnu system) 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 @@ -295,6 +297,8 @@ (define (operating-system-kernel-arguments os root-device) ;;; Boot parameters ;;; +(define %boot-parameters-version 0) + (define-record-type* boot-parameters make-boot-parameters boot-parameters? (label boot-parameters-label) @@ -322,7 +326,9 @@ (define-record-type* (kernel boot-parameters-kernel) (kernel-arguments boot-parameters-kernel-arguments) (initrd boot-parameters-initrd) - (multiboot-modules boot-parameters-multiboot-modules)) + (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 @@ -359,12 +365,18 @@ (define uuid-sexp->uuid (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 0) + (('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)) @@ -1500,7 +1512,7 @@ (define* (operating-system-boot-parameters-file os system-kernel-arguments?))) (scheme-file "parameters" #~(boot-parameters - (version 0) + (version #$(boot-parameters-version params)) (label #$(boot-parameters-label params)) (root-device #$(device->sexp diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm index b2799d0596..d4b680df2e 100644 --- a/tests/boot-parameters.scm +++ b/tests/boot-parameters.scm @@ -101,7 +101,7 @@ (define (quote-uuid uuid) ;; Call read-boot-parameters with the desired string as input. (define* (test-read-boot-parameters #:key - (version 0) + (version %boot-parameters-version) (bootloader-name 'grub) (bootloader-menu-entries '()) (label %default-label) -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 2/4] system: Streamline operating-system-boot-parameters-file a bit. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 22:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 40998@debbugs.gnu.org Cc: ludo@gnu.org, me@tobias.gr, Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164608869131497 (code B ref 40998); Mon, 28 Feb 2022 22:52:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 22:51:31 +0000 Received: from localhost ([127.0.0.1]:34944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOora-0008Bx-MV for submit@debbugs.gnu.org; Mon, 28 Feb 2022 17:51:30 -0500 Received: from mail-qk1-f174.google.com ([209.85.222.174]:45581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOorZ-0008Bc-E3 for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 17:51:29 -0500 Received: by mail-qk1-f174.google.com with SMTP id b13so11591504qkj.12 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 14:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AGmL0W514zYf6GQCHP20wQp9hvVfxiBtZg8Drf3qLMU=; b=R06sTgciEXbgzI/A98tJf2/xEKZHoh25rqAj4KzjaMft2QWjiJ6rl5W3yr2GW4pNj7 Mq4nwuZTsLtGJ68Jc29lmK7fFGRbqqkeGs+uvrnfXxESdUeee3hUv3FzWtTqXJvWFUne R7KvdD66cqUxecAxnb7mD1HpeO+pqdvBX0cdJNmce9wJIfghMcGTeWqWWoghRD2q4rgh 0Dr/51RZOOFERmMgwWaSsMOPN2rglLurjqvgr9M25uwUduRcMtR7S9oTehlKBS4XwsPA RBlVcxbud6RetbyCbEQsU1MckBGIAyYcA6PMM62DIB7HhijQISr7I9nQ00QNU+RJotdR 8FJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AGmL0W514zYf6GQCHP20wQp9hvVfxiBtZg8Drf3qLMU=; b=xDkDqXT2aMwwNMvcLoXu4PyWZ9liNS1TdaevFcCxOdErTIHR6AYlgg8ucZhqZRn0ay umFYnLzs8QttAZtm7oqr3SgcJl+JPhb1tEnWR8+atg2MFjyTS5l0+JwMW8sCtmAyNjoC ZF+QfLVFs4aQyMSEcuKIfcq/BaJLP0n7Dtc6wwcnWUciDUGjiBGLxTUcxDJ4KttJaXaA t7AXRFaXXqMNFo0XYdPYkaOXPjl8a38kDb8soET69uhlV/gB8ooPdLbL/ribIXQq7pVc vlP8so1OrimoBJ6WH3nVWr86w5MRYlaUM5Yd0JbLGLevmZd/pZAK/PjOAGIUz49QV5Z8 RhwA== X-Gm-Message-State: AOAM530EMIpNb3KHMMNsshYJGnHrEsw3wDflKqnDo0ayiNVkkjorqW7J uAaXCQhyaqaJwhOUyHKUYUcott/aHKU28g== X-Google-Smtp-Source: ABdhPJyQ1CkJmeoJGFUH8st6B4CtdECgXUz4JaMFKdKIeYI1UxyzPlQsx7ovQTV5+1w/5Ji/Y+mCxA== X-Received: by 2002:a37:5d4:0:b0:508:18c2:30c1 with SMTP id 203-20020a3705d4000000b0050818c230c1mr12334446qkf.376.1646088683687; Mon, 28 Feb 2022 14:51:23 -0800 (PST) Received: from localhost.localdomain (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id b17-20020ae9eb11000000b0064917bda713sm5562714qkg.85.2022.02.28.14.51.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 14:51:23 -0800 (PST) From: Maxim Cournoyer Date: Mon, 28 Feb 2022 17:50:44 -0500 Message-Id: <20220228225047.11105-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220228225047.11105-1-maxim.cournoyer@gmail.com> References: <20220228225047.11105-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) * gnu/system.scm (operating-system-boot-parameters-file) [SYSTEM-KERNEL-ARGUMENTS?]: Remove unused argument (it had no callers) and adjust doc, moving the self-referential tip to... * gnu/system.scm (operating-system-boot-parameters): ... here, reworded for clarity. Suggested-by: Ludovic Courtès --- gnu/system.scm | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index 9ae158dea6..c6c46343cc 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1453,7 +1453,10 @@ (define* (operating-system-boot-parameters os root-device #:key system-kernel-arguments?) "Return a monadic record that describes the boot parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments -such as '--root' and '--load' to ." +such as '--root' and '--load' to . The +SYSTEM-KERNEL-ARGUMENTS? should only be used in necessity, as the '--load' and +'--system' values are self-referential (they refer to the system), thus +susceptible to introduce a cyclic dependency." (let* ((initrd (and (not (operating-system-hurd os)) (operating-system-initrd-file os))) (store (operating-system-store-file-system os)) @@ -1494,22 +1497,13 @@ (define (device->sexp device) (_ device))) -(define* (operating-system-boot-parameters-file os - #:key system-kernel-arguments?) - "Return a file that describes the boot parameters of OS. The primary use of -this file is the reconstruction of GRUB menu entries for old configurations. - -When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments such as '--root' -and '--load' to the returned file (since the returned file is then usually -stored into the content-addressed \"system\" directory, it's usually not a -good idea to give it because the content hash would change by the content hash -being stored into the \"parameters\" file)." +(define* (operating-system-boot-parameters-file os) + "Return a file that describes the boot parameters of OS. The primary use +of this file is the reconstruction of GRUB menu entries for old +configurations." (let* ((root (operating-system-root-file-system os)) (device (file-system-device root)) - (params (operating-system-boot-parameters - os device - #:system-kernel-arguments? - system-kernel-arguments?))) + (params (operating-system-boot-parameters os device))) (scheme-file "parameters" #~(boot-parameters (version #$(boot-parameters-version params)) -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 3/4] initrd: Use non-hyphenated kernel command-line parameter names. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 22:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 40998@debbugs.gnu.org Cc: ludo@gnu.org, me@tobias.gr, Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164608872431579 (code B ref 40998); Mon, 28 Feb 2022 22:53:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 22:52:04 +0000 Received: from localhost ([127.0.0.1]:34949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOos7-0008D7-2H for submit@debbugs.gnu.org; Mon, 28 Feb 2022 17:52:04 -0500 Received: from mail-qk1-f181.google.com ([209.85.222.181]:43910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOos4-0008CX-NN for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 17:52:01 -0500 Received: by mail-qk1-f181.google.com with SMTP id z66so11620047qke.10 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 14:52:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zdp2njO2feEE5z2pRwi5YnVwFDdnp2G8LogpdbsN6v4=; b=VDjtrQzlqeQ6OmwW3BR9A3ii3WdmgSswUbjN4QGkAOP3akYsO9SVRQhPE9t3Y7m05Y qo7JJtdK0z7R/F0NUktIW1pabQx7hD7AlTd9fusj422E39o7qstXoN3b1kmnn8Noub16 sJJdEq9MXbc12YLuU/wkXMo+2sAsyTBk1qv+FlAsYMV+E4JbopWpQHkPPn9hQ8dI1G0t H3Bkg7dLmK94hnpEyvBni5vbiMzrU3hjCLdaHHsK40pA0phUEuvNPB7muI0vQ/peO5h5 opED0be3WboEzY2TOTTQ4dYQ64JUsaXBz6yYKP3h9hbemjqYECv0vUbEmQXwIV6f/vVt AdzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zdp2njO2feEE5z2pRwi5YnVwFDdnp2G8LogpdbsN6v4=; b=fXJBzv6sxzZbP6LUffiwF/v1E10m58yhFSH9VjISBszn3QBQluNfY9mWvz32n7VnJg iurHhXVhZ8wZwhuz5nPEwl0J2K6KWKWCcqvWi8o2JVJWBRGxjUxLEsgJhPjuZ2jPeJVT ZfkqdjJBxObV+IErMzq4n+b38gr6pJIvgGnMy+FteW8baJLwP+GXYwaEkETUnDqAwfDn nbWZufnRZyg71tGkvegTbqu0dlq5jtSeEWgkEWfiJKWopQV3XHUuXwG4UEkhl36LoeLF MnUtyw6OfjyBAZOWbpRYcIFH+80xufyMFAd8o19akGyz08OqBd84XQcNzGH3cUBVP0Ya FCng== X-Gm-Message-State: AOAM532P/QJzjz82fBPZ3v/yvDVvy4WlkZHnQoIX40lojT3pUZ1l5El6 r3sUvidlCEV30tt2q3QOurFmixH9gAWpIg== X-Google-Smtp-Source: ABdhPJx221KLxpByyHKfOD75kCx6kbmK1vfIp43OP3gIQ7wW00g4W7Vg0izAfoN0/3pY9RArJlAeQA== X-Received: by 2002:a37:747:0:b0:60d:d709:2e20 with SMTP id 68-20020a370747000000b0060dd7092e20mr12246914qkh.579.1646088714704; Mon, 28 Feb 2022 14:51:54 -0800 (PST) Received: from localhost.localdomain (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id b17-20020ae9eb11000000b0064917bda713sm5562714qkg.85.2022.02.28.14.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 14:51:54 -0800 (PST) From: Maxim Cournoyer Date: Mon, 28 Feb 2022 17:50:45 -0500 Message-Id: <20220228225047.11105-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220228225047.11105-1-maxim.cournoyer@gmail.com> References: <20220228225047.11105-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) This is to make it less surprising, given the common convention sets forth by the kernel Linux command-line parameters. * gnu/build/linux-boot.scm (boot-system): Rename '--load', '--repl', '--root' and '--system' to 'gnu.load', 'gnu.repl', 'root' and 'gnu.system', respectively. Adjust doc. (find-long-option): Adjust doc. * gnu/installer/parted.scm (installer-root-partition-path): Adjust accordingly. * gnu/system.scm (bootable-kernel-arguments): Add a VERSION argument and update doc. Use VERSION to conditionally return old style vs new style initrd arguments. (%boot-parameters-version): Increment to 1. (operating-system-boot-parameters): Adjust doc. (operating-system-boot-parameters-file): Likewise. * gnu/system/linux-initrd.scm (raw-initrd, base-initrd): Likewise. * doc/guix.texi: Adjust doc. * gnu/build/activation.scm (boot-time-system): Adjust accordingly. * gnu/build/hurd-boot.scm (boot-hurd-system): Likewise. * gnu/packages/commencement.scm (%final-inputs-riscv64): Adjust comment. --- doc/guix.texi | 12 ++++----- gnu/build/activation.scm | 4 +-- gnu/build/hurd-boot.scm | 12 ++++----- gnu/build/linux-boot.scm | 31 ++++++++++++----------- gnu/installer/parted.scm | 2 +- gnu/machine/ssh.scm | 5 ++-- gnu/packages/commencement.scm | 4 +-- gnu/system.scm | 47 ++++++++++++++++++++++------------- gnu/system/linux-initrd.scm | 4 +-- 9 files changed, 68 insertions(+), 53 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1e8b23ad7e..ce44eb3b47 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34959,7 +34959,7 @@ honors several options passed on the Linux kernel command line @code{-append} option of QEMU), notably: @table @code -@item --load=@var{boot} +@item gnu.load=@var{boot} Tell the initial RAM disk to load @var{boot}, a file containing a Scheme program, once it has mounted the root file system. @@ -34967,7 +34967,7 @@ Guix uses this option to yield control to a boot program that runs the service activation programs and then spawns the GNU@tie{}Shepherd, the initialization system. -@item --root=@var{root} +@item root=@var{root} Mount @var{root} as the root file system. @var{root} can be a device name like @code{/dev/sda1}, a file system label, or a file system UUID. When unspecified, the device name from the root file system of the @@ -34992,7 +34992,7 @@ or @code{preen} to repair problems considered safe to repair automatically. @code{preen} is the default if this option is not present or if @var{level} is not one of the above. -@item --system=@var{system} +@item gnu.system=@var{system} Have @file{/run/booted-system} and @file{/run/current-system} point to @var{system}. @@ -35004,7 +35004,7 @@ Instruct the initial RAM disk as well as the @command{modprobe} command must be a comma-separated list of module names---e.g., @code{usbkbd,9pnet}. -@item --repl +@item gnu.repl Start a read-eval-print loop (REPL) from the initial RAM disk before it tries to load kernel modules and to mount the root file system. Our marketing team calls it @dfn{boot-to-Guile}. The Schemer in you will @@ -35025,7 +35025,7 @@ here is how to use it and customize it further. [#:helper-packages '()] [#:qemu-networking? #f] [#:volatile-root? #f] Return a derivation that builds a raw initrd. @var{file-systems} is a list of file systems to be mounted by the initrd, possibly in addition to -the root file system specified on the kernel command line via @option{--root}. +the root file system specified on the kernel command line via @option{root}. @var{linux-modules} is a list of kernel modules to be loaded at boot time. @var{mapped-devices} is a list of device mappings to realize before @var{file-systems} are mounted (@pxref{Mapped Devices}). @@ -35055,7 +35055,7 @@ to it are lost. Return as a file-like object a generic initrd, with kernel modules taken from @var{linux}. @var{file-systems} is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified -on the kernel command line via @option{--root}. @var{mapped-devices} is a list of device +on the kernel command line via @option{root}. @var{mapped-devices} is a list of device mappings to realize before @var{file-systems} are mounted. When true, @var{keyboard-layout} is a @code{} record denoting diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 9f6126023c..10c9045740 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -389,8 +389,8 @@ (define %current-system "/run/current-system") (define (boot-time-system) - "Return the '--system' argument passed on the kernel command line." - (find-long-option "--system" (if (string-contains %host-type "linux-gnu") + "Return the 'gnu.system' argument passed on the kernel command line." + (find-long-option "gnu.system" (if (string-contains %host-type "linux-gnu") (linux-command-line) (command-line)))) diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index ac36bd17d4..ad3c50d61e 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm @@ -254,7 +254,7 @@ (define* (boot-hurd-system #:key (on-error 'debug)) "This procedure is meant to be called from an early RC script. Install the relevant passive translators on the first boot. Then, run system -activation by using the kernel command-line options '--system' and '--load'; +activation by using the kernel command-line options 'gnu.system' and 'gnu.load'; starting the Shepherd. XXX TODO: see linux-boot.scm:boot-system. @@ -265,14 +265,14 @@ (define* (boot-hurd-system #:key (on-error 'debug)) " (display "Welcome, this is GNU's early boot Guile.\n") - (display "Use '--repl' for an initrd REPL.\n\n") + (display "Use 'gnu.repl' for an initrd REPL.\n\n") (call-with-error-handling (lambda () (let* ((args (command-line)) - (system (find-long-option "--system" args)) - (to-load (find-long-option "--load" args))) + (system (find-long-option "gnu.system" args)) + (to-load (find-long-option "gnu.load" args))) (format #t "Setting-up essential translators...\n") (setenv "PATH" (string-append system "/profile/bin")) @@ -286,7 +286,7 @@ (define* (boot-hurd-system #:key (on-error 'debug)) (unless (zero? (system* "/hurd/mach-defpager")) (format #t "FAILED...Good luck!\n")) - (cond ((member "--repl" args) + (cond ((member "gnu.repl" args) (format #t "Starting repl...\n") (start-repl)) (to-load @@ -298,7 +298,7 @@ (define* (boot-hurd-system #:key (on-error 'debug)) (sleep 2) (reboot)) (else - (display "no boot file passed via '--load'\n") + (display "no boot file passed via 'gnu.load'\n") (display "entering a warm and cozy REPL\n") (start-repl))))) #:on-error on-error)) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 0ae316849e..cfa1ab2fcb 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2016, 2017, 2019–2021 Tobias Geerinckx-Rice ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2019 Guillaume Le Vaillant +;;; Copyright © 2020, 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -93,7 +94,7 @@ (define (linux-command-line) get-string-all))) (define (find-long-option option arguments) - "Find OPTION among ARGUMENTS, where OPTION is something like \"--load\". + "Find OPTION among ARGUMENTS, where OPTION is something like \"gnu.load\". Return the value associated with OPTION, or #f on failure." (let ((opt (string-append option "="))) (and=> (find (cut string-prefix? opt <>) @@ -499,12 +500,12 @@ (define* (boot-system #:key KEYMAP-FILE is true), then setting up QEMU guest networking if QEMU-GUEST-NETWORKING? is true, calling PRE-MOUNT, mounting the file systems specified in MOUNTS, and finally booting into the new root if any. The initrd -supports kernel command-line options '--load', '--root', and '--repl'. It -also honors a subset of the documented Linux kernel command-line parameters -such as 'fsck.mode', 'resume' and 'rootdelay'. +supports kernel command-line parameters 'gnu.load' and 'gnu.repl'. It also +honors a subset of the Linux kernel command-line parameters such as +'fsck.mode', 'resume', 'root' and 'rootdelay'. -Mount the root file system, specified by the '--root' command-line argument, -if any. +Mount the root file system, specified by the 'root' command-line argument, if +any. MOUNTS must be a list of objects. @@ -517,25 +518,25 @@ (define (root-mount-point? fs) (string=? (file-system-mount-point fs) "/")) (define (device-string->file-system-device device-string) - ;; The "--root=SPEC" kernel command-line option always provides a - ;; string, but the string can represent a device, an nfs-root, a UUID, or a - ;; label. So check for all four. + ;; The "root=SPEC" kernel command-line option always provides a string, + ;; but the string can represent a device, an nfs-root, a UUID, or a label. + ;; So check for all four. (cond ((string-prefix? "/" device-string) device-string) ((string-contains device-string ":/") device-string) ; nfs-root ((uuid device-string) => identity) (else (file-system-label device-string)))) (display "Welcome, this is GNU's early boot Guile.\n") - (display "Use '--repl' for an initrd REPL.\n\n") + (display "Use 'gnu.repl' for an initrd REPL.\n\n") (call-with-error-handling (lambda () (mount-essential-file-systems) (let* ((args (linux-command-line)) - (to-load (find-long-option "--load" args)) - ;; If present, ‘--root’ on the kernel command line takes precedence + (to-load (find-long-option "gnu.load" args)) + ;; If present, ‘root’ on the kernel command line takes precedence ;; over the ‘device’ field of the root record. - (root-device (and=> (find-long-option "--root" args) + (root-device (and=> (find-long-option "root" args) device-string->file-system-device)) (root-fs (or (find root-mount-point? mounts) ;; Fall back to fictitious defaults. @@ -564,7 +565,7 @@ (define (repair fs) (_ 'preen)) (file-system-repair fs)))) - (when (member "--repl" args) + (when (member "gnu.repl" args) (start-repl)) (display "loading kernel modules...\n") @@ -652,7 +653,7 @@ (define (repair fs) (sleep 2) (reboot)) (begin - (display "no boot file passed via '--load'\n") + (display "no boot file passed via 'gnu.load'\n") (display "entering a warm and cozy REPL\n") (start-repl))))) #:on-error on-error)) diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index e33ef5f8fd..94ef9b42bc 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -348,7 +348,7 @@ (define (remove-logical-devices) (define (installer-root-partition-path) "Return the root partition path, or #f if it could not be detected." (let* ((cmdline (linux-command-line)) - (root (find-long-option "--root" cmdline))) + (root (find-long-option "root" cmdline))) (and root (or (and (access? root F_OK) root) (find-partition-by-label root) diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index 0dc8933c82..550c989c34 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -422,7 +422,8 @@ (define (read-file path) (let* ((params (call-with-input-string serialized-params read-boot-parameters)) (root (boot-parameters-root-device params)) - (label (boot-parameters-label params))) + (label (boot-parameters-label params)) + (version (boot-parameters-version params))) (boot-parameters (inherit params) (label @@ -433,7 +434,7 @@ (define (read-file path) "~Y-~m-~d ~H:~M")) ")")) (kernel-arguments - (append (bootable-kernel-arguments system-path root) + (append (bootable-kernel-arguments system-path root version) (boot-parameters-kernel-arguments params)))))))) generations)))) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index cdc9c1d621..9b495d8d84 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3740,10 +3740,10 @@ (define-public %final-inputs (define-public %final-inputs-riscv64 ;; This is similar to the added (list gcc "lib") elsewhere in this file, but ;; due to how (%current-system) is re-defined when performing builds with the - ;; '--system' flag, %final-inputs is too early in the evaulation pipeline to + ;; 'gnu.system' flag, %final-inputs is too early in the evaulation pipeline to ;; correctly identify the system for which a derivation will be built. Thus, ;; since (%current-system) is re-determined by (guix build-system gnu) after - ;; loading %final-inputs but before taking into account the '--system' flag, + ;; loading %final-inputs but before taking into account the 'gnu.system' flag, ;; the test for (target-riscv64?) needs to be in (guix build-system gnu), ;; with %final-inputs-riscv64 already available at the same time that ;; %final-inputs is available. diff --git a/gnu/system.scm b/gnu/system.scm index c6c46343cc..91d7e48452 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -187,16 +187,23 @@ (define-module (gnu system) ;;; ;;; Code: -(define (bootable-kernel-arguments system root-device) - "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVICE." - (list (string-append "--root=" +(define* (bootable-kernel-arguments system root-device version) + "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVICE. +VERSION is the target version of the boot-parameters record." + ;; If the version is newer than 0, we use the new style initrd parameter + ;; names, otherwise we use the legacy ones. This is to maintain backward + ;; compatibility when producing bootloader configurations for older + ;; generations. + (define version>0? (> version 0)) + (list (string-append (if version>0? "root=" "--root=") ;; Note: Always use the DCE format because that's what - ;; (gnu build linux-boot) expects for the '--root' + ;; (gnu build linux-boot) expects for the 'root' ;; kernel command-line option. (file-system-device->string root-device #:uuid-type 'dce)) - #~(string-append "--system=" #$system) - #~(string-append "--load=" #$system "/boot"))) + #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system) + #~(string-append (if #$version>0? "gnu.load=" "--load=") + #$system "/boot"))) ;; System-wide configuration. ;; TODO: Add per-field docstrings/stexi. @@ -286,10 +293,12 @@ (define-record-type* operating-system source-properties->location)) (innate))) -(define (operating-system-kernel-arguments os root-device) - "Return all the kernel arguments, including the ones not specified -directly by the user." - (append (bootable-kernel-arguments os root-device) +(define* (operating-system-kernel-arguments + os root-device #:key (version %boot-parameters-version)) + "Return all the kernel arguments, including the ones not specified directly +by the user. VERSION should match that of the target record +object that will contain the kernel parameters." + (append (bootable-kernel-arguments os root-device version) (operating-system-user-kernel-arguments os))) @@ -297,7 +306,10 @@ (define (operating-system-kernel-arguments os root-device) ;;; Boot parameters ;;; -(define %boot-parameters-version 0) +;;; 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'. +(define %boot-parameters-version 1) (define-record-type* boot-parameters make-boot-parameters boot-parameters? @@ -478,10 +490,11 @@ (define (read-boot-parameters-file system) 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))) + (root (boot-parameters-root-device params)) + (version (boot-parameters-version params))) (boot-parameters (inherit params) - (kernel-arguments (append (bootable-kernel-arguments system root) + (kernel-arguments (append (bootable-kernel-arguments system root version) (boot-parameters-kernel-arguments params)))))) (define (boot-parameters->menu-entry conf) @@ -1452,10 +1465,10 @@ (define (hurd-multiboot-modules os) (define* (operating-system-boot-parameters os root-device #:key system-kernel-arguments?) "Return a monadic record that describes the boot -parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments -such as '--root' and '--load' to . The -SYSTEM-KERNEL-ARGUMENTS? should only be used in necessity, as the '--load' and -'--system' values are self-referential (they refer to the system), thus +parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is true, add the kernel +arguments 'root', 'gnu.load' and 'gnu.system' to . The +SYSTEM-KERNEL-ARGUMENTS? should only be used in necessity, as the 'gnu.load' +and 'gnu.system' values are self-referential (they refer to the system), thus susceptible to introduce a cyclic dependency." (let* ((initrd (and (not (operating-system-hurd os)) (operating-system-initrd-file os))) diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 329cd38cd6..4c4c78e444 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -181,7 +181,7 @@ (define* (raw-initrd file-systems "Return as a file-like object a raw initrd, with kernel modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified -on the kernel command line via '--root'. LINUX-MODULES is a list of kernel +on the kernel command line via 'root'. LINUX-MODULES is a list of kernel modules to be loaded at boot time. MAPPED-DEVICES is a list of device mappings to realize before FILE-SYSTEMS are mounted. HELPER-PACKAGES is a list of packages to be copied in the initrd. It may include @@ -375,7 +375,7 @@ (define* (base-initrd file-systems "Return as a file-like object a generic initrd, with kernel modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified -on the kernel command line via '--root'. MAPPED-DEVICES is a list of device +on the kernel command line via 'root'. MAPPED-DEVICES is a list of device mappings to realize before FILE-SYSTEMS are mounted. When true, KEYBOARD-LAYOUT is a record denoting the desired -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 4/4] initrd: Honor rootfstype and rootflags command-line parameters. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Feb 2022 22:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 40998@debbugs.gnu.org Cc: ludo@gnu.org, me@tobias.gr, Maxim Cournoyer Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164608873731608 (code B ref 40998); Mon, 28 Feb 2022 22:53:02 +0000 Received: (at 40998) by debbugs.gnu.org; 28 Feb 2022 22:52:17 +0000 Received: from localhost ([127.0.0.1]:34952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOosL-0008Dj-2t for submit@debbugs.gnu.org; Mon, 28 Feb 2022 17:52:17 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:43645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOosJ-0008DX-7Y for 40998@debbugs.gnu.org; Mon, 28 Feb 2022 17:52:15 -0500 Received: by mail-qv1-f43.google.com with SMTP id c14so10360211qvk.10 for <40998@debbugs.gnu.org>; Mon, 28 Feb 2022 14:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oGwEV7PuA3bNVUKM6x8VA5DOL7o1D+uFX1eqitS6RjE=; b=iSG86jJ4cI+6S8ZP//30VfF6T8xpxqCvwRg2G8ZL/6v7ZD9qSwViBEXV4aJ5EngJia eJGc6gSo9c71EvsVVIcd6wEnJ/1UVAGMBxTrbyeSZpyWoWjo7aRjCNS5XFHfh66iCcbV /sM7cY2lNA0lERF+asIneyvsf4SN6hFgeSfLwrO1Z13HIEOtXGqDIIMUz93cSOu10VK9 Us7rpJSUX2zjw1J+IaUQn7bsxGaz0gTEIa5vxcGaaYcurkkCgGLLurxgG6MUqMq6IbQX Y6A/JbQ7QtPrXqT0dyoWa30tGzMUpSQMNFmItAQo8ZS+jwEUBec9oTXV8xnmto24jT7+ BIVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oGwEV7PuA3bNVUKM6x8VA5DOL7o1D+uFX1eqitS6RjE=; b=UzK10BLiN/fuv7YXy0d05Zn77tIIyB1LoqcIt6tPHwVtYmgh87zswitSjDu8u4LfzJ SyUeyjvNIBs6VFbgEphAR7wnQusgImLhSqt9x9waifYEDtWjNplEl3QkC3zPT+Ni303T I3RPjRA0WyKuHFhwLjDRuRxHcdRcdkMTHzYTHfpRK63xgXVmzWpUodmT8a0zmkuAyxpZ weAXfk67NDXHivF/y7Xd00Jol0B7RDZoDNLn3KqOxmiaLSlzm2fWRm+pG0xAG72nVm+f UKKFDAf7oB74yweW35ncL0lhs3/KRd93Cz+yb+xhm0yP9O+z2KflBpmEVBzv70pY069s aILg== X-Gm-Message-State: AOAM5323rLwB+AFkZweqrCl9zvEkuHGaNWW5D/ZdxUykUDrAZTnBSBvD Tgq8c2AUVUd/oYJTL8eWwuJI21CHlne83A== X-Google-Smtp-Source: ABdhPJxiN/HnJQkGC7+cLFR7d9p4mKOqWY2jYPfS2kPs1KQ3V/YlDCRLDpBFF8pXLQ0PP5rFsJIJ5w== X-Received: by 2002:ac8:4e09:0:b0:2ca:c94b:2c37 with SMTP id c9-20020ac84e09000000b002cac94b2c37mr17667534qtw.338.1646088729556; Mon, 28 Feb 2022 14:52:09 -0800 (PST) Received: from localhost.localdomain (dsl-141-227.b2b2c.ca. [66.158.141.227]) by smtp.gmail.com with ESMTPSA id b17-20020ae9eb11000000b0064917bda713sm5562714qkg.85.2022.02.28.14.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 14:52:09 -0800 (PST) From: Maxim Cournoyer Date: Mon, 28 Feb 2022 17:50:46 -0500 Message-Id: <20220228225047.11105-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220228225047.11105-1-maxim.cournoyer@gmail.com> References: <20220228225047.11105-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) 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 (-) * gnu/build/linux-boot.scm (boot-system): Honor rootfstype and rootflags arguments. Update doc. Error out in case there is insufficient information with regard to the root file system. Restore the behavior of inferring the root device from the root file system from the operating system in case the root argument is not provided. * doc/guix.texi (Initial RAM Disk): Document the new command-line parameters. --- doc/guix.texi | 10 ++++++++ gnu/build/linux-boot.scm | 55 ++++++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ce44eb3b47..dc6cb9842e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -34973,6 +34973,16 @@ name like @code{/dev/sda1}, a file system label, or a file system UUID. When unspecified, the device name from the root file system of the operating system declaration is used. +@item rootfstype=@var{type} +Set the type of the root file system. It overrides the @code{type} +field of the root file system specified via the @code{operating-system} +declaration, if any. + +@item rootflags=@var{options} +Set the mount @emph{options} of the root file system. It overrides the +@code{options} field of the root file system specified via the +@code{operating-system} declaration, if any. + @item fsck.mode=@var{mode} Whether to check the @var{root} file system for errors before mounting it. @var{mode} is one of @code{skip} (never check), @code{force} (always diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index cfa1ab2fcb..7d41537652 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -500,9 +500,9 @@ (define* (boot-system #:key KEYMAP-FILE is true), then setting up QEMU guest networking if QEMU-GUEST-NETWORKING? is true, calling PRE-MOUNT, mounting the file systems specified in MOUNTS, and finally booting into the new root if any. The initrd -supports kernel command-line parameters 'gnu.load' and 'gnu.repl'. It also +supports the kernel command-line options 'gnu.load' and 'gnu.repl'. It also honors a subset of the Linux kernel command-line parameters such as -'fsck.mode', 'resume', 'root' and 'rootdelay'. +'fsck.mode', 'resume', 'rootdelay', rootflags and rootfstype. Mount the root file system, specified by the 'root' command-line argument, if any. @@ -538,13 +538,30 @@ (define (device-string->file-system-device device-string) ;; over the ‘device’ field of the root record. (root-device (and=> (find-long-option "root" args) device-string->file-system-device)) - (root-fs (or (find root-mount-point? mounts) - ;; Fall back to fictitious defaults. - (file-system (device (or root-device "/dev/root")) - (mount-point "/") - (type "ext4")))) + (rootfstype (find-long-option "rootfstype" args)) + (rootflags (find-long-option "rootflags" args)) + (root-fs* (find root-mount-point? mounts)) (fsck.mode (find-long-option "fsck.mode" args))) + (unless (or root-fs* (and root-device rootfstype)) + (error "no root file system or 'root' and 'rootfstype' parameters")) + + ;; If present, ‘root’ on the kernel command line takes precedence over + ;; the ‘device’ field of the root record; likewise for + ;; the 'rootfstype' and 'rootflags' arguments. + (define root-fs + (if root-fs* + (file-system + (inherit root-fs*) + (device (or root-device (file-system-device root-fs*))) + (type (or rootfstype (file-system-type root-fs*))) + (options (or rootflags (file-system-options root-fs*)))) + (file-system + (device root-device) + (mount-point "/") + (type rootfstype) + (options rootflags)))) + (define (check? fs) (match fsck.mode ("skip" #f) @@ -616,18 +633,18 @@ (define (repair fs) (setenv "EXT2FS_NO_MTAB_OK" "1") - (if root-device - (mount-root-file-system (canonicalize-device-spec root-device) - (file-system-type root-fs) - #:volatile-root? volatile-root? - #:flags (mount-flags->bit-mask - (file-system-flags root-fs)) - #:options (file-system-options root-fs) - #:check? (check? root-fs) - #:skip-check-if-clean? - (skip-check-if-clean? root-fs) - #:repair (repair root-fs)) - (mount "none" "/root" "tmpfs")) + ;; Mount the root file system. + (mount-root-file-system (canonicalize-device-spec + (file-system-device root-fs)) + (file-system-type root-fs) + #:volatile-root? volatile-root? + #:flags (mount-flags->bit-mask + (file-system-flags root-fs)) + #:options (file-system-options root-fs) + #:check? (check? root-fs) + #:skip-check-if-clean? + (skip-check-if-clean? root-fs) + #:repair (repair root-fs)) ;; Mount the specified non-root file systems. (for-each (lambda (fs) -- 2.34.0 From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 1/4] system: Add a version field to the record. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 01 Mar 2022 09:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: me@tobias.gr, 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.16461262276941 (code B ref 40998); Tue, 01 Mar 2022 09:18:01 +0000 Received: (at 40998) by debbugs.gnu.org; 1 Mar 2022 09:17:07 +0000 Received: from localhost ([127.0.0.1]:35417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOyd1-0001nt-Bi for submit@debbugs.gnu.org; Tue, 01 Mar 2022 04:17:07 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:57890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOyd0-0001nN-Df for 40998@debbugs.gnu.org; Tue, 01 Mar 2022 04:17:06 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B6724504; Tue, 1 Mar 2022 10:16:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HP2_BFfKGrq0; Tue, 1 Mar 2022 10:16:59 +0100 (CET) Received: from ribbon (unknown [IPv6:2001:660:6102:320:e120:2c8f:8909:cdfe]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 9C7F82D9; Tue, 1 Mar 2022 10:16:58 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220228225047.11105-1-maxim.cournoyer@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 =?UTF-8?Q?Vent=C3=B4se?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 01 Mar 2022 10:16:57 +0100 In-Reply-To: <20220228225047.11105-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Mon, 28 Feb 2022 17:50:43 -0500") Message-ID: <877d9e822e.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: B6724504 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) 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: -0.0 (/) Hi! Maxim Cournoyer skribis: > This version field exposes the (already present) version information of a= boot > parameters file. > > * gnu/system.scm (%boot-parameters-version): New variable. > ()[version]: New field. > (read-boot-parameters): Use it. > (operating-system-boot-parameters-file): Likewise. > * tests/boot-parameters.scm (test-read-boot-parameters): Use > %boot-parameters-version as the default version value in the template. [...] > + ;; New versions are not backward-compatible, so only accept past and c= urrent > + ;; versions, not future ones. > + (define (version? n) > + (member n (iota (1+ %boot-parameters-version)))) > + > (match (read port) > - (('boot-parameters ('version 0) > + (('boot-parameters ('version (? version? version)) I still have a preference for an explicit list right here, for clarity, and so that we don=E2=80=99t unwillingly find ourselves treating any past version in the same way in the future. I think I wasn=E2=80=99t clear about it (sorry!) but I wonder if we could, instead of bumping the version, use something like: (find (cut string-prefix? "gnu.load=3D") kernel-arguments) to determine whether we=E2=80=99re dealing with an =E2=80=9Cold-style=E2=80= =9D =E2=80=9Cparameters=E2=80=9D file. If that=E2=80=99s not possible, then what this patch is doing SGTM. Thanks, Ludo=E2=80=99. From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 2/4] system: Streamline operating-system-boot-parameters-file a bit. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 01 Mar 2022 09:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: me@tobias.gr, 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.16461262496978 (code B ref 40998); Tue, 01 Mar 2022 09:18:02 +0000 Received: (at 40998) by debbugs.gnu.org; 1 Mar 2022 09:17:29 +0000 Received: from localhost ([127.0.0.1]:35420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOydN-0001oU-Kq for submit@debbugs.gnu.org; Tue, 01 Mar 2022 04:17:29 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:57918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nOydM-0001oI-5Q for 40998@debbugs.gnu.org; Tue, 01 Mar 2022 04:17:28 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B005353F; Tue, 1 Mar 2022 10:17:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4wDYKYwTkA1p; Tue, 1 Mar 2022 10:17:21 +0100 (CET) Received: from ribbon (unknown [IPv6:2001:660:6102:320:e120:2c8f:8909:cdfe]) by hera.aquilenet.fr (Postfix) with ESMTPSA id EAAEA1BD; Tue, 1 Mar 2022 10:17:20 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220228225047.11105-1-maxim.cournoyer@gmail.com> <20220228225047.11105-2-maxim.cournoyer@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 =?UTF-8?Q?Vent=C3=B4se?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 01 Mar 2022 10:17:20 +0100 In-Reply-To: <20220228225047.11105-2-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Mon, 28 Feb 2022 17:50:44 -0500") Message-ID: <8735k2821r.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: B005353F X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) 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: -0.0 (/) Maxim Cournoyer skribis: > * gnu/system.scm (operating-system-boot-parameters-file) > [SYSTEM-KERNEL-ARGUMENTS?]: Remove unused argument (it had no callers) and > adjust doc, moving the self-referential tip to... > * gnu/system.scm (operating-system-boot-parameters): ... here, reworded f= or > clarity. > > Suggested-by: Ludovic Court=C3=A8s +1! From unknown Sun Jun 15 09:00:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 1/4] system: Add a version field to the record. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 01 Mar 2022 14:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: me@tobias.gr, 40998@debbugs.gnu.org Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164614563915603 (code B ref 40998); Tue, 01 Mar 2022 14:41:01 +0000 Received: (at 40998) by debbugs.gnu.org; 1 Mar 2022 14:40:39 +0000 Received: from localhost ([127.0.0.1]:35929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP3g7-00043b-3d for submit@debbugs.gnu.org; Tue, 01 Mar 2022 09:40:39 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:46027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP3g5-00043N-OC for 40998@debbugs.gnu.org; Tue, 01 Mar 2022 09:40:38 -0500 Received: by mail-qv1-f41.google.com with SMTP id h13so16691905qvk.12 for <40998@debbugs.gnu.org>; Tue, 01 Mar 2022 06:40:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=TxRvuSs/3An62TeEtVR5LFVU0ULj9Fzef9gTl7UNVKI=; b=lW0qYIMq88BTVb2/sumXxzy68Ov4FF5L1w2yWAdlNW6JH/ozCUTJQVScA7K6YCM9sc 5RbwT5xwhmvRxgnCGnT8l8OOAEzxNsLmhd5QYsnS7wMIzN1EtUp3Y7CM6tBvs/l+A0AB Vg8ZdZfBdCkPXGlnl/snxx3App209vxylqYQ/GuTtBYOjrciixYuZELuA9VWcj87A/Q7 O7E5Hcf/lq4JBHtwusjjgwFoxwUq1qNrUg43kAVGDKVJk/YmrdQziiTDSX64aOI6yJYa qcewClNigBkqiFfE29QGv0Yr2FAGluaY2Ug16YXt5eFknHKAxrI0KoGK162tJAbCZ8NX tqgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=TxRvuSs/3An62TeEtVR5LFVU0ULj9Fzef9gTl7UNVKI=; b=TFrlddLoA9ZJCyDKk+UlK4d7pNGp3ihKYZWE/Yf5lHrN8o1vt7ODICbitpSPGaFFtC DfR4dQZ+8jc9c32nKbcKWzSmhfQz07jBd3fxNj7WfgpJZy84WjxIHrSYi8FZv4dv2arU fvCqqR4ybIWSkzXw+6Yf/HCGrgxWcvhYD8KdTYWxIAoBWwJitAOm1KfHbqEi7+ZPO+08 ncSExXJ1lVJ8V9L2+CdaC/SMz6pAFfStW8X9uBzMRuJxJ1HJk9QTBGOQvlSdmoZa6uyB RQV/BoNHq13kD0Fw4/B0FJ7hctUkdqZPXXiAqLDmoL0eSnFlr6A0hrEToJ844rv8JNCd Zhag== X-Gm-Message-State: AOAM531mU+/KIf9Mx5cK1a0pZYSj8ve5Rbx2DSDNV5/9s24htdwy98Sb MYjy0foNlRgWB62zTO9sINQoAf0AVbA= X-Google-Smtp-Source: ABdhPJxEyX/cVxBVLo5YiORHpdNNeG7XCTiEYNoA2nAG2Kj7/VRqPyw1EsdFTjdUHP4E7Zm/n1hbjA== X-Received: by 2002:a0c:be8f:0:b0:42c:5083:c6d2 with SMTP id n15-20020a0cbe8f000000b0042c5083c6d2mr17052045qvi.86.1646145632166; Tue, 01 Mar 2022 06:40:32 -0800 (PST) Received: from hurd (dsl-155-199.b2b2c.ca. [66.158.155.199]) by smtp.gmail.com with ESMTPSA id b127-20020a376785000000b00648ee0245dasm6708819qkc.69.2022.03.01.06.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:40:31 -0800 (PST) From: Maxim Cournoyer References: <20220228225047.11105-1-maxim.cournoyer@gmail.com> <877d9e822e.fsf@gnu.org> Date: Tue, 01 Mar 2022 09:40:30 -0500 In-Reply-To: <877d9e822e.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 01 Mar 2022 10:16:57 +0100") Message-ID: <87k0dd3fdt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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 Ludovic, Ludovic Court=C3=A8s writes: > Hi! > > Maxim Cournoyer skribis: > >> This version field exposes the (already present) version information of = a boot >> parameters file. >> >> * gnu/system.scm (%boot-parameters-version): New variable. >> ()[version]: New field. >> (read-boot-parameters): Use it. >> (operating-system-boot-parameters-file): Likewise. >> * tests/boot-parameters.scm (test-read-boot-parameters): Use >> %boot-parameters-version as the default version value in the template. > > [...] > >> + ;; 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 0) >> + (('boot-parameters ('version (? version? version)) > > I still have a preference for an explicit list right here, for clarity, > and so that we don=E2=80=99t unwillingly find ourselves treating any past > version in the same way in the future. OK. I prefer that we can bump %boot-parameters-version at one place and have the rest of the code base do the right thing instead of having to manually remember to adjust bits left and right. I've added a comment next to %boot-parameters-version to mention it should be incremented by 1 when bumping it. > I think I wasn=E2=80=99t clear about it (sorry!) but I wonder if we could, > instead of bumping the version, use something like: > > (find (cut string-prefix? "gnu.load=3D") kernel-arguments) > > to determine whether we=E2=80=99re dealing with an =E2=80=9Cold-style=E2= =80=9D =E2=80=9Cparameters=E2=80=9D > file. > > If that=E2=80=99s not possible, then what this patch is doing SGTM. That's not possible, because the parameters file doesn't include the gnu.load nor gnu.system parameters because of their self-referential nature, so we don't have such information to look at. I'll be looking toward pushing this series today. Thank you for the review! Maxim From unknown Sun Jun 15 09:00:41 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: maxim.cournoyer@gmail.com Subject: bug#40998: closed (Re: bug#40998: [PATCH 1/4] system: Add a version field to the record.) Message-ID: References: <874k4hle1i.fsf@gmail.com> <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> X-Gnu-PR-Message: they-closed 40998 X-Gnu-PR-Package: guix X-Gnu-PR-Keywords: patch Reply-To: 40998@debbugs.gnu.org Date: Tue, 01 Mar 2022 18:33:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1646159582-18374-1" This is a multi-part message in MIME format... ------------=_1646159582-18374-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #40998: Guix System's initrd doesn't honor rootflags which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 40998@debbugs.gnu.org. --=20 40998: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D40998 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1646159582-18374-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 40998-done) by debbugs.gnu.org; 1 Mar 2022 18:32:18 +0000 Received: from localhost ([127.0.0.1]:38189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP7II-0004l4-Cg for submit@debbugs.gnu.org; Tue, 01 Mar 2022 13:32:18 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:42875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP7IG-0004ko-7e for 40998-done@debbugs.gnu.org; Tue, 01 Mar 2022 13:32:16 -0500 Received: by mail-qt1-f180.google.com with SMTP id 11so10732634qtt.9 for <40998-done@debbugs.gnu.org>; Tue, 01 Mar 2022 10:32:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=BNnTUPCbNF6Paaz3tI8+Emijl9HiY0yF6z+U5bvmLJQ=; b=eGnZnIBaaBChT+hsjYh1CTyRefICyVaEIw76BUcwZdKXW7YBDP2g3ZmEYNvjgH9VFr HS21dngv4noEclqnIQGhzaKkeVM2bSGs75D59ywu8p0sFUng9KKdEM38Zq53ygwuqaRo vw4TdHHVO8vAZiZXOS7S/q7aU8tvTzlzhWLHEcz3OnsEB6XtIWpsCwPQxmY/4g4j/+4k 9bfd+clkzv8Q8dMi7Fg2sWwtoRaCEaASM+ZE9TaRPGa8U5J2wyjxwbx9h7iXYlUaeIkr qdcBSer/fQMTchDM12zIXk82MQbmgY4VjR/NHWW9UXDcAy7VvElsKTURzjFQ6js/kBc4 6dPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=BNnTUPCbNF6Paaz3tI8+Emijl9HiY0yF6z+U5bvmLJQ=; b=iUyti3aOJ9bRMG69NEURR2oC2lGFWDPI8wCLCunWhSM6koE/LC2H7fpodcuga9d9e8 E+FwybHJ0xn6GraoA3Ky/ukCLv9/7C7gMEXrEXZ6D5bpD6Iz2xLvWsdziLEfvCGJSNoX g1JGwz1z7AOhybSiboYVEwnqkea7DilieP+BB9j9L0hov3z4LitN0cW+DWE/IP50wY6w GpsQg4siR4m9FCa+r/dQvP0BjEWVdOfWLrtjGK+Njen2roI5gmZIHCLYkptnZ+yn/u3G oT2cILG3xOeg3Zotd+6PhUg2rvXkZ9meEwFlG/R5UWqytDHjWrZ066aRLrXKIfnGb6US sTBQ== X-Gm-Message-State: AOAM530T3jgi0kefI4/rTGvI6Yl0N5ZCtoBypEovrvngt4/Aavl/9yvs 9iJ22Gk8nFXrI+NVptUsUSjzeX/f1LQ= X-Google-Smtp-Source: ABdhPJwThc9QuKDGuIyjxeYfXRuF9ctUEh27ZcVRyoFlL6xfmBR2LiKU8X72FQJ1RvmJJb2wjG3yxA== X-Received: by 2002:a05:622a:64a:b0:2de:ac9e:fd34 with SMTP id a10-20020a05622a064a00b002deac9efd34mr19704041qtb.280.1646159530362; Tue, 01 Mar 2022 10:32:10 -0800 (PST) Received: from hurd (dsl-155-199.b2b2c.ca. [66.158.155.199]) by smtp.gmail.com with ESMTPSA id o64-20020a37be43000000b00648fd02ac00sm7072445qkf.64.2022.03.01.10.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 10:32:09 -0800 (PST) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#40998: [PATCH 1/4] system: Add a version field to the record. References: <20220228225047.11105-1-maxim.cournoyer@gmail.com> <877d9e822e.fsf@gnu.org> <87k0dd3fdt.fsf@gmail.com> Date: Tue, 01 Mar 2022 13:32:09 -0500 In-Reply-To: <87k0dd3fdt.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 01 Mar 2022 09:40:30 -0500") Message-ID: <874k4hle1i.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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: 40998-done Cc: 40998-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 (-) Hi Ludovic, Maxim Cournoyer writes: > Hi Ludovic, > > Ludovic Court=C3=A8s writes: > >> Hi! >> >> Maxim Cournoyer skribis: >> >>> This version field exposes the (already present) version information of= a boot >>> parameters file. >>> >>> * gnu/system.scm (%boot-parameters-version): New variable. >>> ()[version]: New field. >>> (read-boot-parameters): Use it. >>> (operating-system-boot-parameters-file): Likewise. >>> * tests/boot-parameters.scm (test-read-boot-parameters): Use >>> %boot-parameters-version as the default version value in the template. >> >> [...] >> >>> + ;; 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 0) >>> + (('boot-parameters ('version (? version? version)) >> >> I still have a preference for an explicit list right here, for clarity, >> and so that we don=E2=80=99t unwillingly find ourselves treating any past >> version in the same way in the future. > > OK. I prefer that we can bump %boot-parameters-version at one place and > have the rest of the code base do the right thing instead of having to > manually remember to adjust bits left and right. I've added a comment > next to %boot-parameters-version to mention it should be incremented by > 1 when bumping it. > >> I think I wasn=E2=80=99t clear about it (sorry!) but I wonder if we coul= d, >> instead of bumping the version, use something like: >> >> (find (cut string-prefix? "gnu.load=3D") kernel-arguments) >> >> to determine whether we=E2=80=99re dealing with an =E2=80=9Cold-style=E2= =80=9D =E2=80=9Cparameters=E2=80=9D >> file. >> >> If that=E2=80=99s not possible, then what this patch is doing SGTM. > > That's not possible, because the parameters file doesn't include the > gnu.load nor gnu.system parameters because of their self-referential > nature, so we don't have such information to look at. > > I'll be looking toward pushing this series today. I've now pushed it as 6d9d616113cf051d80567b584a5b0a6489ddc065. Thanks for the review! Maxim ------------=_1646159582-18374-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 May 2020 13:53:17 +0000 Received: from localhost ([127.0.0.1]:48478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUW6P-0007yh-DC for submit@debbugs.gnu.org; Fri, 01 May 2020 09:53:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:40234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUW6N-0007yV-5A for submit@debbugs.gnu.org; Fri, 01 May 2020 09:53:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59854) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUW6M-0004rs-LN for bug-guix@gnu.org; Fri, 01 May 2020 09:53:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUW6M-0006nm-3i for bug-guix@gnu.org; Fri, 01 May 2020 09:53:14 -0400 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:43249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUW6L-0006nc-Np for bug-guix@gnu.org; Fri, 01 May 2020 09:53:13 -0400 Received: by mail-qk1-x731.google.com with SMTP id i136so5142770qke.10 for ; Fri, 01 May 2020 06:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=SaO1ROAwK+3O/oKgs67+yZ3H6D7b8A9NWErGSCbQXcY=; b=fgmJav1ydGFIr51K2exVCocTzVRQTOKd1wD56xHWHovI+mgYRRTqPIQddlS0G3Z8v1 PrDVZLpS/rU/guZTehT8kC2gHrDLkaDUTBErelLxE4lpPzxGDGFyQdozoYRIoub5+mN1 aEntDE9hikAA6zvtqvtLqEOi4gfuwCaAowVKDr62tNaCnEj+q4qKOuZK+4HzLe80tolu C0MfAZZOhnboHnjpUZfloxbDTvc6wdU2hztGQrqITlTj4DXo9WgWWpWfkndjv8IyRwXd msWnL2VSDQlvct0p1ol6IhUMGkgpaRt+2xtD2rl2SL4waGStdqqRNV/RnS4k1qWZeWqe 54bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=SaO1ROAwK+3O/oKgs67+yZ3H6D7b8A9NWErGSCbQXcY=; b=IZ84IxFJpwS4eomFhdIOiGr0rVOto2jbJyJ1dEeysvAUM3jfPRya6nSLLFvl+33Y5V 9/Ey9KlGLwiEBRsZK+atm0H//NbwOR5WxzHXZ3JCYH2mbxFGFA2HqhrQFsgoI9sNLFHm 39Aeu/T2ycS6K9ArhcNG3PQFdx/jPGsYd3HA6+b4qXTpD/A/IP76mxOB8Jti4v3OLLnY f5Pp8dIUN/GhVccJKQMQMy9Uz/RXtNWHM/99Jg0YW9KHQ+KzlOJw91jHTWT0axmPoGs0 ELUUD+jZMfehwwO1f0Ekm5A+yjcERFE6sfyXkIplh+rjo+bCkh6E5JQqDR7H2IW2kkMK M+WQ== X-Gm-Message-State: AGi0Pua6k8hBiGP8nFgauJhNi6mAICS4cpFKRt3ERxSBJoeF0qdq24m+ jFjXxQHHBr05+EvWLjKSQpsiUkWU X-Google-Smtp-Source: APiQypIzsmtc2NASuO/8rrMTQrxX3fyJBXGjCjz1exGYu9VCEnXgW48MOkC4EgBz6W5COXn6MpE6gA== X-Received: by 2002:a37:5c46:: with SMTP id q67mr3676133qkb.210.1588341192629; Fri, 01 May 2020 06:53:12 -0700 (PDT) Received: from hurd (dsl-153-87.b2b2c.ca. [66.158.153.87]) by smtp.gmail.com with ESMTPSA id u11sm2701733qtj.10.2020.05.01.06.53.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2020 06:53:12 -0700 (PDT) From: maxim.cournoyer@gmail.com X-Google-Original-From: maxim@hurd.i-did-not-set--mail-host-address--so-tickle-me To: bug-guix Subject: Guix System's initrd doesn't honor rootflags Date: Fri, 01 May 2020 09:53:11 -0400 Message-ID: <87r1w3kbi0.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x731.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::731 X-Spam-Score: 2.7 (++) 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: Which means users cannot pass a 'rootflags=degraded' command line option to the kernel line in GRUB to attempt booting a system whose RAID array is degraded. rootflags is standard across distributions, and is what users expect. Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.51.188.17 listed in wl.mailspike.net] 2.0 PDS_TONAME_EQ_TOLOCAL_SHORT Short body with To: name matches everything in local email 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit 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: -0.3 (/) Which means users cannot pass a 'rootflags=degraded' command line option to the kernel line in GRUB to attempt booting a system whose RAID array is degraded. rootflags is standard across distributions, and is what users expect. Such support was added in earlier version of the patches proposed here: https://issues.guix.gnu.org/37305#0 but is later simplified out. Maxim ------------=_1646159582-18374-1--