From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) 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 Message-ID: <87oa3dptkj.fsf@gnu.org> References: <7tlgyw11k3.fsf@kdpof.com> <7th99ilgcb.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bniil-00030n-JN for bug-guix@gnu.org; Sat, 24 Sep 2016 04:54:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bniig-0005Xi-NF for bug-guix@gnu.org; Sat, 24 Sep 2016 04:54:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bniig-0005Xd-JV for bug-guix@gnu.org; Sat, 24 Sep 2016 04:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bniig-0005YD-Ab for bug-guix@gnu.org; Sat, 24 Sep 2016 04:54:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <7th99ilgcb.fsf@gmail.com> ("Carlos =?UTF-8?Q?S=C3=A1nchez?= de La Lama"'s message of "Wed, 14 Sep 2016 16:13:24 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Carlos =?UTF-8?Q?S=C3=A1nchez?= de La Lama Cc: 24346@debbugs.gnu.org Hi Carlos! csanchezdll@gmail.com (Carlos S=C3=A1nchez 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 =E2=80=98readlink=E2=80=99 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=3D? mount-point "/") > + file > + #~(if (string-prefix? #$mount-point #$file) > + (substring #$file (string-length #$mount-point)) > + #$file)))) I introduced a =E2=80=98file=E2=80=99 variable in the staged code, to avoid= having that (string-append =E2=80=A6) expression several times in the output. I think that=E2=80=99s it! I verified the grub.cfg that =E2=80=98guix system reconfigure=E2=80=99 gene= rates and it seems to work fine. If you can confirm that it still works for you, please say so to 24346-done@debbugs.gnu.org. :-) Thanks a lot for addressing this bug! Ludo=E2=80=99.