guix-commits
[Top][All Lists]
Advanced

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

40/42: system: hurd: Add hurd-grub-configuration-file.


From: guix-commits
Subject: 40/42: system: hurd: Add hurd-grub-configuration-file.
Date: Sat, 25 Apr 2020 13:45:11 -0400 (EDT)

janneke pushed a commit to branch wip-hurd-vm
in repository guix.

commit ab5d2b420929c2ca8672c87933a2db1c27702e5f
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Sat Apr 25 14:45:54 2020 +0200

    system: hurd: Add hurd-grub-configuration-file.
    
    * gnu/system/hurd.scm (hurd-grub-configuration-file): New exported 
procedure.
    (cross-hurd-image): Use it.
---
 gnu/system/hurd.scm | 59 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 23 deletions(-)

diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 2645ce8..9319958 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -55,6 +55,7 @@
   #:use-module (gnu system shadow)
   #:use-module (gnu system vm)
   #:export (cross-hurd-image
+            hurd-grub-configuration-file
             %base-packages/hurd
             %base-services/hurd
             %hurd-default-operating-system))
@@ -100,6 +101,40 @@
                                    "--disable-deduplication"
                                    "--max-jobs=1"))))))
 
+(define* (hurd-grub-configuration-file config entries
+                                       #:key
+                                       (system (%current-system))
+                                       (old-entries '()))
+  (pk "hurd-grub-configuration-file")
+  (let ((hurd (if (equal? system (%current-system))
+                  hurd
+                  (with-parameters ((%current-target-system system))
+                    hurd)))
+        (mach (with-parameters ((%current-system "i686-linux"))
+                gnumach))
+        (libc (if (equal? system (%current-system))
+                  glibc
+                  (cross-libc system))))
+    (computed-file "grub.cfg"
+                   #~(call-with-output-file #$output
+                       (lambda (port)
+                         (format port "
+set timeout=2
+search.file ~a/boot/gnumach
+
+menuentry \"GNU\" {
+  multiboot ~a/boot/gnumach root=device:hd0s1
+  module ~a/hurd/ext2fs.static ext2fs \\
+    --multiboot-command-line='${kernel-command-line}' \\
+    --host-priv-port='${host-port}' \\
+    --device-master-port='${device-port}' \\
+    --exec-server-task='${exec-task}' -T typed '${root}' \\
+    '$(task-create)' '$(task-resume)'
+  module ~a/lib/ld.so.1 exec ~a/hurd/exec '$(exec-task=task-create)'
+}\n"
+                                 #+mach #+mach #+hurd
+                                 #+libc #+hurd))))))
+
 (define %hurd-default-operating-system
   (operating-system
     (host-name "guixygnu")
@@ -186,29 +221,7 @@
                                                            
%bootstrap-glibc))))))
 
   (define grub.cfg
-    (let ((hurd (cross-built hurd))
-          (mach (with-parameters ((%current-system "i686-linux"))
-                  gnumach))
-          (libc (cross-libc "i586-pc-gnu")))
-      (computed-file "grub.cfg"
-                     #~(call-with-output-file #$output
-                         (lambda (port)
-                           (format port "
-set timeout=2
-search.file ~a/boot/gnumach
-
-menuentry \"GNU\" {
-  multiboot ~a/boot/gnumach root=device:hd0s1
-  module ~a/hurd/ext2fs.static ext2fs \\
-    --multiboot-command-line='${kernel-command-line}' \\
-    --host-priv-port='${host-port}' \\
-    --device-master-port='${device-port}' \\
-    --exec-server-task='${exec-task}' -T typed '${root}' \\
-    '$(task-create)' '$(task-resume)'
-  module ~a/lib/ld.so.1 exec ~a/hurd/exec '$(exec-task=task-create)'
-}\n"
-                                   #+mach #+mach #+hurd
-                                   #+libc #+hurd))))))
+    (hurd-grub-configuration-file #f '() #:system "i586-pc-gnu"))
 
   (define fstab
     (plain-file "fstab"



reply via email to

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