GNU bug report logs - #40998
Guix System's initrd doesn't honor rootflags

Previous Next

Package: guix;

Reported by: maxim.cournoyer <at> gmail.com

Date: Fri, 1 May 2020 13:54:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 40998 <at> debbugs.gnu.org
Subject: bug#40998: Guix System's initrd doesn't honor rootflags
Date: Sun, 27 Feb 2022 22:03:47 +0100
Hi,

Maxim Cournoyer <maxim.cournoyer <at> 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’.




This bug report was last modified 3 years and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.