unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Carlos Sánchez de La Lama" <csanchezdll@gmail.com>
Cc: 24346@debbugs.gnu.org
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	[thread overview]
Message-ID: <87oa3dptkj.fsf@gnu.org> (raw)
In-Reply-To: <7th99ilgcb.fsf@gmail.com> ("Carlos Sánchez de La Lama"'s message of "Wed, 14 Sep 2016 16:13:24 +0200")

Hi Carlos!

csanchezdll@gmail.com (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 24346-done@debbugs.gnu.org.  :-)

Thanks a lot for addressing this bug!

Ludo’.

  reply	other threads:[~2016-09-24  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7tlgyw11k3.fsf@kdpof.com>
2016-09-14 14:13 ` bug#24346: [PATCH] Generate grub.cfg with correct paths when store is not in root partition Carlos Sánchez de La Lama
2016-09-24  8:53   ` Ludovic Courtès [this message]
2016-09-26 11:08     ` Carlos Sánchez de La Lama
2016-09-26 15:53       ` Ludovic Courtès
2016-08-31 21:17 bug#24346: GuixSD: grub.cfg does not support separate /gnu partition Ludovic Courtès
2016-09-13 11:23 ` bug#24346: [PATCH] Generate grub.cfg with correct paths when store is not in root partition Carlos Sánchez de La Lama

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=87oa3dptkj.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=24346@debbugs.gnu.org \
    --cc=csanchezdll@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).