GNU bug report logs - #21224
guix system init --no-grub doesn't work

Previous Next

Package: guix;

Reported by: Mark H Weaver <mhw <at> netris.org>

Date: Sun, 9 Aug 2015 17:19:02 UTC

Severity: normal

Merged with 21068

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21224 in the body.
You can then email your comments to 21224 AT debbugs.gnu.org in the normal way.

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#21224; Package guix. (Sun, 09 Aug 2015 17:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mark H Weaver <mhw <at> netris.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 09 Aug 2015 17:19:02 GMT) Full text and rfc822 format available.

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

From: Mark H Weaver <mhw <at> netris.org>
To: bug-guix <at> gnu.org
Subject: guix system init --no-grub doesn't work
Date: Sun, 09 Aug 2015 13:17:30 -0400
I'm in the early stages of adding GuixSD for the Lemote Yeeloong, and so
for now would like to avoid getting grub working on the Yeeloong.  So,
I tried running "guix system init config.scm /target --no-grub", and
this is what happens:

  /gnu/store/...-system

  initializing operating system under '/target'...
  guix system: error: build failed: path `/gnu/store/...-grub.cfg' is not valid

In the 'install' procedure in (guix scripts system), I tried changing:

  (maybe-copy grub.cfg)

to:

  (mwhen grub?
    (maybe-copy grub.cfg))

and then the command works, but almost nothing gets copied to /target.
In retrospect, this makes sense: as the comment says, the installer
works by copying the *closure* of grub.cfg.  However, it fails when
--no-grub is passed, apparently because grub.cfg was not built.

      Mark




Information forwarded to bug-guix <at> gnu.org:
bug#21224; Package guix. (Mon, 10 Aug 2015 14:45:02 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 21224 <at> debbugs.gnu.org
Subject: Re: bug#21224: guix system init --no-grub doesn't work
Date: Mon, 10 Aug 2015 17:44:27 +0300
Mark H Weaver (2015-08-09 20:17 +0300) wrote:

> I'm in the early stages of adding GuixSD for the Lemote Yeeloong, and so
> for now would like to avoid getting grub working on the Yeeloong.  So,
> I tried running "guix system init config.scm /target --no-grub", and
> this is what happens:
>
>   /gnu/store/...-system
>
>   initializing operating system under '/target'...
>   guix system: error: build failed: path `/gnu/store/...-grub.cfg' is not valid
>
> In the 'install' procedure in (guix scripts system), I tried changing:
>
>   (maybe-copy grub.cfg)
>
> to:
>
>   (mwhen grub?
>     (maybe-copy grub.cfg))
>
> and then the command works, but almost nothing gets copied to /target.
> In retrospect, this makes sense: as the comment says, the installer
> works by copying the *closure* of grub.cfg.  However, it fails when
> --no-grub is passed, apparently because grub.cfg was not built.

(This message is probably not very helpful but) AFAICT this bug was
introduced by commit f245b03debfa05fa692e95769a9b7116200bf191.

-- 
Alex




Information forwarded to bug-guix <at> gnu.org:
bug#21224; Package guix. (Sun, 23 Aug 2015 18:48:02 GMT) Full text and rfc822 format available.

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

From: Mark H Weaver <mhw <at> netris.org>
To: 21224 <at> debbugs.gnu.org
Subject: Re: bug#21224: guix system init --no-grub doesn't work
Date: Sun, 23 Aug 2015 14:46:33 -0400
Mark H Weaver <mhw <at> netris.org> writes:

> I'm in the early stages of adding GuixSD for the Lemote Yeeloong, and so
> for now would like to avoid getting grub working on the Yeeloong.  So,
> I tried running "guix system init config.scm /target --no-grub", and
> this is what happens:
>
>   /gnu/store/...-system
>
>   initializing operating system under '/target'...
>   guix system: error: build failed: path `/gnu/store/...-grub.cfg' is not valid

I ran into the same problem while porting GuixSD to MIPS, before I had
GRUB working.

The problem here is that the method for copying the necessary store
items to the target directory is to copy grub.cfg and its transitive
closure, using (maybe-copy grub.cfg).

However, if --no-grub is specified, then grub.cfg is not built.

The preliminary approach I used successfully was to build and install
grub.cfg even if --no-grub is specified, although 'grub-install' is not
run in that case.  Here's the patch I used:

--8<---------------cut here---------------start------------->8---
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 45f5982..6ec1f29 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -331,8 +331,10 @@ boot directly to the kernel or to the bootloader."
                                              (if (eq? 'init action)
                                                  '()
                                                  (previous-grub-entries))))
-       (drvs   -> (if (and grub? (memq action '(init reconfigure)))
-                      (list sys grub grub.cfg)
+       (drvs   -> (if (memq action '(init reconfigure))
+                      (if grub?
+                          (list sys grub.cfg grub)
+                          (list sys grub.cfg))
                       (list sys)))
        (%         (maybe-build drvs #:dry-run? dry-run?
                                #:use-substitutes? use-substitutes?)))
--8<---------------cut here---------------end--------------->8---

      Mark




Information forwarded to bug-guix <at> gnu.org:
bug#21224; Package guix. (Tue, 25 Aug 2015 13:51:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw <at> netris.org>
Cc: 21224 <at> debbugs.gnu.org
Subject: Re: bug#21224: guix system init --no-grub doesn't work
Date: Tue, 25 Aug 2015 15:50:00 +0200
Mark H Weaver <mhw <at> netris.org> skribis:

> Mark H Weaver <mhw <at> netris.org> writes:
>
>> I'm in the early stages of adding GuixSD for the Lemote Yeeloong, and so
>> for now would like to avoid getting grub working on the Yeeloong.  So,
>> I tried running "guix system init config.scm /target --no-grub", and
>> this is what happens:
>>
>>   /gnu/store/...-system
>>
>>   initializing operating system under '/target'...
>>   guix system: error: build failed: path `/gnu/store/...-grub.cfg' is not valid
>
> I ran into the same problem while porting GuixSD to MIPS, before I had
> GRUB working.
>
> The problem here is that the method for copying the necessary store
> items to the target directory is to copy grub.cfg and its transitive
> closure, using (maybe-copy grub.cfg).

Right.

> However, if --no-grub is specified, then grub.cfg is not built.

I see.  Good catch!

> The preliminary approach I used successfully was to build and install
> grub.cfg even if --no-grub is specified, although 'grub-install' is not
> run in that case.  Here's the patch I used:
>
> diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
> index 45f5982..6ec1f29 100644
> --- a/guix/scripts/system.scm
> +++ b/guix/scripts/system.scm
> @@ -331,8 +331,10 @@ boot directly to the kernel or to the bootloader."
>                                               (if (eq? 'init action)
>                                                   '()
>                                                   (previous-grub-entries))))
> -       (drvs   -> (if (and grub? (memq action '(init reconfigure)))
> -                      (list sys grub grub.cfg)
> +       (drvs   -> (if (memq action '(init reconfigure))
> +                      (if grub?
> +                          (list sys grub.cfg grub)
> +                          (list sys grub.cfg))

Sounds like a reasonable approach.  We’d be building slightly too much
in the --no-grub case, but that’s probably acceptable.

WDYT?

Thanks,
Ludo’.




Merged 21068 21224. Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Wed, 28 Oct 2015 11:10:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#21224; Package guix. (Mon, 02 Nov 2015 22:55:06 GMT) Full text and rfc822 format available.

Message #19 received at 21224-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw <at> netris.org>
Cc: 21068-done <at> debbugs.gnu.org, 21224-done <at> debbugs.gnu.org
Subject: Re: bug#21224: guix system init --no-grub doesn't work
Date: Mon, 02 Nov 2015 23:54:23 +0100
Mark H Weaver <mhw <at> netris.org> skribis:

> I ran into the same problem while porting GuixSD to MIPS, before I had
> GRUB working.
>
> The problem here is that the method for copying the necessary store
> items to the target directory is to copy grub.cfg and its transitive
> closure, using (maybe-copy grub.cfg).
>
> However, if --no-grub is specified, then grub.cfg is not built.
>
> The preliminary approach I used successfully was to build and install
> grub.cfg even if --no-grub is specified, although 'grub-install' is not
> run in that case.  Here's the patch I used:
>
> diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
> index 45f5982..6ec1f29 100644
> --- a/guix/scripts/system.scm
> +++ b/guix/scripts/system.scm
> @@ -331,8 +331,10 @@ boot directly to the kernel or to the bootloader."
>                                               (if (eq? 'init action)
>                                                   '()
>                                                   (previous-grub-entries))))
> -       (drvs   -> (if (and grub? (memq action '(init reconfigure)))
> -                      (list sys grub grub.cfg)
> +       (drvs   -> (if (memq action '(init reconfigure))
> +                      (if grub?
> +                          (list sys grub.cfg grub)
> +                          (list sys grub.cfg))
>                        (list sys)))
>         (%         (maybe-build drvs #:dry-run? dry-run?
>                                 #:use-substitutes? use-substitutes?)))

Applied in a704361, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Dec 2015 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 205 days ago.

Previous Next


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