[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24346: [PATCH] Generate grub.cfg with correct paths when store is no
From: |
Ludovic Courtès |
Subject: |
bug#24346: [PATCH] Generate grub.cfg with correct paths when store is not in root partition |
Date: |
Sat, 24 Sep 2016 17:53:32 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hi Carlos!
address@hidden (Carlos Sánchez de La Lama) skribis:
> Rebasing to current master (76f31f0b), as new file-append made merge
> non-trivial.
>
> * guix/scripts/system.scm (previous-grub-entries): resolve initrd
> symlink for old entries (on the host).
> * gnu/system.scm (operating-system-grub.cfg): resolve initrd symlink for
> current system (on the container).
> * gnu/system/grub.scm: strip mount-point from GRUB filenames.
I ended up pushing a slightly modified version of this patch as
0f65f54ebd76324653fd5506a7dab42ee44d9255.
Essentially, I was dissatisfied with those ‘readlink’ calls, which do
I/O and could always fail, so I changed them to use the procedures we
have that return the store file name of the initrd.
> +(define (strip-mount-point fs file)
I added a docstring here.
> + (let ((mount-point (file-system-mount-point fs)))
> + (if (string=? mount-point "/")
> + file
> + #~(if (string-prefix? #$mount-point #$file)
> + (substring #$file (string-length #$mount-point))
> + #$file))))
I introduced a ‘file’ variable in the staged code, to avoid having that
(string-append …) expression several times in the output.
I think that’s it!
I verified the grub.cfg that ‘guix system reconfigure’ generates and it
seems to work fine. If you can confirm that it still works for you,
please say so to address@hidden :-)
Thanks a lot for addressing this bug!
Ludo’.