From: "Ludovic Courtès" <ludo@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 40998@debbugs.gnu.org
Subject: bug#40998: Guix System's initrd doesn't honor rootflags
Date: Sun, 27 Feb 2022 22:03:47 +0100 [thread overview]
Message-ID: <87bkysuimk.fsf_-_@gnu.org> (raw)
In-Reply-To: <20220219070155.1924-2-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Sat, 19 Feb 2022 02:01:53 -0500")
Hi,
Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
> -(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")))
This is the logic I was suggesting to move to ‘read-boot-parameters’.
To do that, ‘read-boot-parameters’ would have to fill the
‘kernel-arguments’ field of <boot-parameters> such that it already
contains --system/gnu.system and --load/gnu.load.
And then ‘read-boot-parameters-file’ would become:
(call-with-input-file (string-append system "/parameters")
read-boot-parameters)
without the post-processing step it’s currently doing.
(And the version number doesn’t need to flow beyond
‘read-boot-parameters’.)
WDYT?
Ludo’.
next prev parent reply other threads:[~2022-02-27 21:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-01 13:53 bug#40998: Guix System's initrd doesn't honor rootflags maxim.cournoyer
2022-02-18 15:33 ` bug#40998: [PATCH 1/3] initrd: Rename the '--root' initrd option to just 'root' Maxim Cournoyer
2022-02-18 15:33 ` bug#40998: [PATCH 2/3] initrd: Honor rootfstype and rootflags command-line parameters Maxim Cournoyer
2022-02-18 15:33 ` bug#40998: [PATCH 3/3] initrd: Print its " Maxim Cournoyer
2022-02-19 7:01 ` bug#40998: [PATCH v2 1/4] system: Add a version field to the <boot-parameters> record Maxim Cournoyer
2022-02-19 7:01 ` bug#40998: [PATCH v2 2/4] initrd: Use non-hyphenated kernel command-line parameter names Maxim Cournoyer
2022-02-27 21:03 ` Ludovic Courtès [this message]
2022-02-28 20:31 ` bug#40998: Guix System's initrd doesn't honor rootflags Maxim Cournoyer
2022-02-19 7:01 ` bug#40998: [PATCH v2 3/4] initrd: Honor rootfstype and rootflags command-line parameters Maxim Cournoyer
2022-02-27 21:06 ` bug#40998: Guix System's initrd doesn't honor rootflags Ludovic Courtès
2022-02-19 7:01 ` bug#40998: [PATCH v2 4/4] initrd: Print its command-line parameters Maxim Cournoyer
2022-02-27 21:08 ` bug#40998: Guix System's initrd doesn't honor rootflags Ludovic Courtès
2022-02-28 20:36 ` Maxim Cournoyer
2022-02-28 3:45 ` bug#40998: [PATCH v2 4/4] initrd: Print its command-line parameters Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-02-28 15:54 ` Maxim Cournoyer
2022-02-27 20:54 ` bug#40998: Guix System's initrd doesn't honor rootflags Ludovic Courtès
2022-02-28 20:02 ` Maxim Cournoyer
2022-02-28 21:15 ` Ludovic Courtès
2022-02-28 21:45 ` Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bkysuimk.fsf_-_@gnu.org \
--to=ludo@gnu.org \
--cc=40998@debbugs.gnu.org \
--cc=maxim.cournoyer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).