unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21224: guix system init --no-grub doesn't work
@ 2015-08-09 17:17 Mark H Weaver
  2015-08-10 14:44 ` Alex Kost
  2015-08-23 18:46 ` Mark H Weaver
  0 siblings, 2 replies; 5+ messages in thread
From: Mark H Weaver @ 2015-08-09 17:17 UTC (permalink / raw)
  To: 21224

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#21224: guix system init --no-grub doesn't work
  2015-08-09 17:17 bug#21224: guix system init --no-grub doesn't work Mark H Weaver
@ 2015-08-10 14:44 ` Alex Kost
  2015-08-23 18:46 ` Mark H Weaver
  1 sibling, 0 replies; 5+ messages in thread
From: Alex Kost @ 2015-08-10 14:44 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 21224

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#21224: guix system init --no-grub doesn't work
  2015-08-09 17:17 bug#21224: guix system init --no-grub doesn't work Mark H Weaver
  2015-08-10 14:44 ` Alex Kost
@ 2015-08-23 18:46 ` Mark H Weaver
  2015-08-25 13:50   ` Ludovic Courtès
  2015-11-02 22:54   ` Ludovic Courtès
  1 sibling, 2 replies; 5+ messages in thread
From: Mark H Weaver @ 2015-08-23 18:46 UTC (permalink / raw)
  To: 21224

Mark H Weaver <mhw@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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#21224: guix system init --no-grub doesn't work
  2015-08-23 18:46 ` Mark H Weaver
@ 2015-08-25 13:50   ` Ludovic Courtès
  2015-11-02 22:54   ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2015-08-25 13:50 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 21224

Mark H Weaver <mhw@netris.org> skribis:

> Mark H Weaver <mhw@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’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#21224: guix system init --no-grub doesn't work
  2015-08-23 18:46 ` Mark H Weaver
  2015-08-25 13:50   ` Ludovic Courtès
@ 2015-11-02 22:54   ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2015-11-02 22:54 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 21068-done, 21224-done

Mark H Weaver <mhw@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’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-02 22:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-09 17:17 bug#21224: guix system init --no-grub doesn't work Mark H Weaver
2015-08-10 14:44 ` Alex Kost
2015-08-23 18:46 ` Mark H Weaver
2015-08-25 13:50   ` Ludovic Courtès
2015-11-02 22:54   ` Ludovic Courtès

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).