unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22802: guix system init installs grub.cfg gcroot to host
@ 2016-02-25  3:56 Jookia
  2016-03-07 12:15 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Jookia @ 2016-02-25  3:56 UTC (permalink / raw)
  To: 22802

When running 'guix system init', GRUB requires a GC root to be placed in
/var/guix. When building a VM, this GC root is placed in <disk>/var/guix/gcroots
however while building a system on another drive, the GC root is placed on the
host's /var/guix/gcroots , not only overwriting the host's grub.cfg which could
be problematic if GC is run and the host has a different grub.cfg to the system
being inited, but the system being inited lacks the grub.cfg and can run GC and
clear out its GRUB files itself.

'guix system reconfigure' once you're inside the new system fixes this issue for
the new system, but the host system may still have a broken grub.cfg and will
need reconfiguring also.

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

* bug#22802: guix system init installs grub.cfg gcroot to host
  2016-02-25  3:56 bug#22802: guix system init installs grub.cfg gcroot to host Jookia
@ 2016-03-07 12:15 ` Ludovic Courtès
  2016-03-07 23:40   ` Jookia
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2016-03-07 12:15 UTC (permalink / raw)
  To: Jookia; +Cc: 22802

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

Jookia <166291@gmail.com> skribis:

> When running 'guix system init', GRUB requires a GC root to be placed in
> /var/guix. When building a VM, this GC root is placed in <disk>/var/guix/gcroots
> however while building a system on another drive, the GC root is placed on the
> host's /var/guix/gcroots

Indeed, good catch!

I believe this is fixed with the patch below.  Can you confirm?

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 703 bytes --]

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 9f56a96..8ebeb4d 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -128,7 +128,8 @@ TARGET, and register them."
 (define (install-grub* grub.cfg device target)
   "This is a variant of 'install-grub' with error handling, lifted in
 %STORE-MONAD"
-  (let* ((gc-root      (string-append %gc-roots-directory "/grub.cfg"))
+  (let* ((gc-root      (string-append target %gc-roots-directory
+                                      "/grub.cfg"))
          (temp-gc-root (string-append gc-root ".new"))
          (delete-file  (lift1 delete-file %store-monad))
          (make-symlink (lift2 switch-symlinks %store-monad))

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

* bug#22802: guix system init installs grub.cfg gcroot to host
  2016-03-07 12:15 ` Ludovic Courtès
@ 2016-03-07 23:40   ` Jookia
  2016-03-08 10:15     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Jookia @ 2016-03-07 23:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 22802

On Mon, Mar 07, 2016 at 01:15:38PM +0100, Ludovic Courtès wrote:
> Jookia <166291@gmail.com> skribis:
> > When running 'guix system init', GRUB requires a GC root to be placed in
> > /var/guix. When building a VM, this GC root is placed in <disk>/var/guix/gcroots
> > however while building a system on another drive, the GC root is placed on the
> > host's /var/guix/gcroots
>
> Indeed, good catch!
>
> I believe this is fixed with the patch below.  Can you confirm?

I can't easily confirm since I don't have a system I can 'init' to anymore, and
I've already fixed this in my set of GRUB patches so it'd also lock me out of
Libreboot on my actual machine if I did.

> Thanks,
> Ludo’.

Sorry,
Jookia.

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

* bug#22802: guix system init installs grub.cfg gcroot to host
  2016-03-07 23:40   ` Jookia
@ 2016-03-08 10:15     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2016-03-08 10:15 UTC (permalink / raw)
  To: Jookia; +Cc: 22802-done

Jookia <166291@gmail.com> skribis:

> On Mon, Mar 07, 2016 at 01:15:38PM +0100, Ludovic Courtès wrote:
>> Jookia <166291@gmail.com> skribis:
>> > When running 'guix system init', GRUB requires a GC root to be placed in
>> > /var/guix. When building a VM, this GC root is placed in <disk>/var/guix/gcroots
>> > however while building a system on another drive, the GC root is placed on the
>> > host's /var/guix/gcroots
>>
>> Indeed, good catch!
>>
>> I believe this is fixed with the patch below.  Can you confirm?
>
> I can't easily confirm since I don't have a system I can 'init' to anymore, and
> I've already fixed this in my set of GRUB patches so it'd also lock me out of
> Libreboot on my actual machine if I did.

Sure.  After rereading it, it seemed obviously correct™ so I pushed it
as 16210486e6bb2e7b81e0208e42584b1eed826cd0.

Thanks!

Ludo’.

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

end of thread, other threads:[~2016-03-08 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-25  3:56 bug#22802: guix system init installs grub.cfg gcroot to host Jookia
2016-03-07 12:15 ` Ludovic Courtès
2016-03-07 23:40   ` Jookia
2016-03-08 10:15     ` 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).