guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: berlin: Add 'copy-kernel+initrd-to-/store' service.


From: Ludovic Courtès
Subject: 01/01: berlin: Add 'copy-kernel+initrd-to-/store' service.
Date: Sat, 21 Dec 2019 18:19:14 -0500 (EST)

civodul pushed a commit to branch master
in repository maintenance.

commit 49affacdb0d798f641bac50095f48e8ed3906102
Author: Ludovic Courtès <address@hidden>
Date:   Sat Dec 21 21:04:11 2019 +0100

    berlin: Add 'copy-kernel+initrd-to-/store' service.
    
    * hydra/berlin.scm (%copy-kernel-and-initrd): New variable.
    (services): Add 'copy-kernel+initrd-to-/store' service.
---
 hydra/berlin.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/hydra/berlin.scm b/hydra/berlin.scm
index 960b1f9..afb7e36 100644
--- a/hydra/berlin.scm
+++ b/hydra/berlin.scm
@@ -68,6 +68,24 @@ Best practices:
 Happy hacking!\n"))
 
 
+(define %copy-kernel-and-initrd
+  ;; The storage device where the root file system is is invisible to GRUB.
+  ;; Thus, copy the kernel and initrd to /store, where GRUB will be able to
+  ;; find them.
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+
+        (for-each (lambda (file)
+                    (let ((target (string-append "/store/" (basename file))))
+                      (unless (file-exists? target)
+                        (format #t "copying '~a' to /store...~%" file)
+                        (copy-recursively file target
+                                          #:log (%make-void-port "w")))))
+                  (list (readlink "/run/current-system/kernel")
+                        (dirname (readlink "/run/current-system/initrd")))))))
+
+
 (operating-system
   (host-name "berlin.guixsd.org")
   (timezone "Europe/Berlin")
@@ -138,6 +156,10 @@ Happy hacking!\n"))
                    %base-packages))
 
   (services (cons*
+             (simple-service 'copy-kernel+initrd-to-/store
+                             activation-service-type
+                             %copy-kernel-and-initrd)
+
              ;; Connection to the DMZ for public access
              ;; This is a 1G port only
              (static-networking-service "eno1"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]