GNU bug report logs - #54528
STORE-DIRECTORY-PREFIX is global, per generation, to all bootloader menu entries

Previous Next

Package: guix;

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

Date: Tue, 22 Mar 2022 21:11:01 UTC

Severity: normal

To reply to this bug, email your comments to 54528 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#54528; Package guix. (Tue, 22 Mar 2022 21:11:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 22 Mar 2022 21:11:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: bug-guix <bug-guix <at> gnu.org>
Subject: STORE-DIRECTORY-PREFIX is global, per generation, to all bootloader
 menu entries
Date: Tue, 22 Mar 2022 17:10:25 -0400
Hello Guix,

Recently I noticed after reconfiguring with the following
operating system definition:

--8<---------------cut here---------------start------------->8---
(use-modules (gnu bootloader)
             (gnu bootloader grub)
             (gnu packages linux)
             (gnu system file-systems)
             (guix gexp)
             (sysadmin build-machines))

;;; XXX: Copied from berlin-nodes.scm.
(define %authorized-guix-keys
  ;; List of authorized 'guix archive' keys.
  (list (local-file "keys/guix/berlin.guixsd.org-export.pub")))

(define %btrfs-raid-uuid "64a837b7-b9dc-4b64-ba95-712ba4032c71")

(define %common-btrfs-options '(("compress-force" . "zstd")
                                ("space_cache" . "v2")
                                "degraded"))

;;; Top-level Btrfs subvolume.
(define %btrfs-pool
  (file-system
    (device (uuid %btrfs-raid-uuid))
    (mount-point "/mnt/btrfs-pool")
    (create-mount-point? #t)
    (type "btrfs")
    (options (alist->file-system-options
              (cons '("subvolid" . "5")
                    %common-btrfs-options)))))

(define (btrfs-subvolume-mount name mount-point)
  "Return a file system to mount the Btrfs subvolume NAME at MOUNT-POINT."
  (file-system
    (device (uuid %btrfs-raid-uuid))
    (mount-point mount-point)
    (create-mount-point? #t)
    (type "btrfs")
    (options (alist->file-system-options
              (cons (cons "subvol" name)
                    %common-btrfs-options)))))


(define node-129-os
  (let ((base-os (berlin-new-build-machine-os
                  129 #:authorized-guix-keys %authorized-guix-keys)))
    (operating-system
      (inherit base-os)
      (bootloader
       (bootloader-configuration
        (inherit (operating-system-bootloader base-os))
        (bootloader grub-bootloader)
        (targets (list "/dev/sdb" "/dev/sdc" "/dev/sdd"))
        (menu-entries
         (list (menu-entry
                (label "Previous system -- 5.15.19 (#91, 2022-02-18 22:25)")
                (linux "/gnu/store/8w9v4dka10cv0r5fyw9f0pc14fszbl03-linux-libre-5.15.19/bzImage")
                (linux-arguments
                 '("--root=my-root"
                   "--system=/var/guix/profiles/system-92-link"
                   "--load=/var/guix/profiles/system-92-link/boot"
                   "console=tty0"
                   "console=ttyS0,57600n8"))
                (initrd "/gnu/store/in2bcjh03kyv793v8bd3fizswyx1q0rq-raw-initrd/initrd.cpio.gz"))))))
      (file-systems (cons*
                     (btrfs-subvolume-mount "@root"       "/")
                     (btrfs-subvolume-mount "@etc"        "/etc")
                     (btrfs-subvolume-mount "@home"       "/home")
                     (btrfs-subvolume-mount "@cache"      "/var/cache")
                     (btrfs-subvolume-mount "@log"        "/var/log")
                     (btrfs-subvolume-mount "@secrets"    "/secrets")
                     (btrfs-subvolume-mount "@srv"        "/srv")
                     %btrfs-pool
                     %base-file-systems))
      (packages (cons btrfs-progs (operating-system-packages base-os)))
      ;; FIXME: fix swap field.
      )))

node-129-os
--8<---------------cut here---------------end--------------->8---

That the custom menu-entry object specified in the bootloader
configuration would also result in a grub.cfg entry where the linux and
initrd items would be prefixed with '/@root/' (the store directory
prefix), which is not desired (this entry corresponds to another,
previous system generation that didn't even use Btrfs).

The problem is that the store-directory-prefix is globally applied to
all menu entries corresponding to a specific generation (e.g., via the
boot-parameters file); it seems like it should rather be preserved per
menu-entry.

Thanks,

Maxim




Information forwarded to bug-guix <at> gnu.org:
bug#54528; Package guix. (Thu, 09 Feb 2023 20:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 54528 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Karrmann <S.Karrmann <at> web.de>
To: 54528 <at> debbugs.gnu.org
Subject: [PATCH] fix store-prefix for menu-entries
Date: Thu, 9 Feb 2023 21:05:09 +0100
[Message part 1 (text/plain, inline)]
Dear Maxim Cournoyer,

here is a patch, that fixes the global store-prefix for grub menu-entries

on commit 58a95d599ee5d0dc6419d038b7317e1b77b11519

git apply fix-store-prefix-for-menu-entry.patch

Kind regards,
--
Dr. Stefan Karrmann
[fix-btrfs-subvol-prefix-in-menu-entry.patch (text/x-diff, attachment)]

This bug report was last modified 1 year and 73 days ago.

Previous Next


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