Subject: bug#18082: 'guix system reconfigure' fails to install grub from standalone guix

From: [email-masked] (Ludovic Courtès)
Date: Tue, 22 Jul 2014 22:17:33 +0200

Mark H Weaver <[email-masked]> skribis:

> In guix/build/install.scm:
>   47: 1 [install-grub # "/dev/sda" "/"]
> In unknown file:
>    ?: 0 [copy-file # "//boot/grub/grub.cfg.new"]
>
> ERROR: In procedure copy-file:
> ERROR: Wrong type (expecting string): #<derivation /gnu/store/ynkp0ijahvg4x1q6bfdw34d28hhqmgb4-grub.cfg.drv => /gnu/store/6qwr8shknwlb1f1l0a7j6n3h8sg36bv7-grub.cfg b7ecf78>

Oops, should be much better with this:

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 57f4221..5737807 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -299,7 +299,8 @@ actions."
              (mlet %store-monad ((% (switch-to-system os)))
                (when grub?
                  (unless (false-if-exception
-                          (install-grub grub.cfg device "/"))
+                          (install-grub (derivation->output-path grub.cfg)
+                                        device "/"))
                    (leave (_ "failed to install GRUB on device '~a'~%")
                           device)))
                (return #t)))

Can you confirm?

>   (services
>    (let ((motd (text-file "motd" "
> This is the GNU operating system, welcome!\n\n")))
>      (list (console-font-service "tty1")
> 	   (console-font-service "tty2")
> 	   (console-font-service "tty3")
> 	   (console-font-service "tty4")
> 	   (console-font-service "tty5")
> 	   (console-font-service "tty6")
>
> 	   (mingetty-service "tty1" #:motd motd)
> 	   (mingetty-service "tty2" #:motd motd)
> 	   (mingetty-service "tty3" #:motd motd)
> 	   (mingetty-service "tty4" #:motd motd)
> 	   (mingetty-service "tty5" #:motd motd)
> 	   (mingetty-service "tty6" #:motd motd)
> 	   (static-networking-service "lo" "127.0.0.1"
> 				      #:provision '(loopback))
> 	   (syslog-service)
> 	   (guix-service #:authorize-hydra-key? #t)
> 	   (nscd-service)
> 	   (udev-service)))))

Perhaps we should make #:authorize-hydra-key? #t the default?

Thanks!

Ludo’.