guix-commits
[Top][All Lists]
Advanced

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

07/16: system: hurd: Add hurd-grub-configuration-file.


From: guix-commits
Subject: 07/16: system: hurd: Add hurd-grub-configuration-file.
Date: Tue, 5 May 2020 13:14:15 -0400 (EDT)

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

commit b1b31929336de64c1eebb3793eb6aa8f075cf514
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 | 60 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 24 deletions(-)

diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 58bfdf8..fccdc87 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -32,7 +32,8 @@
   #:use-module (gnu packages hurd)
   #:use-module (gnu packages less)
   #:use-module (gnu system vm)
-  #:export (cross-hurd-image))
+  #:export (cross-hurd-image
+            hurd-grub-configuration-file))
 
 ;;; Commentary:
 ;;;
@@ -56,6 +57,39 @@
         guile-3.0 guile-colorized guile-readline
         net-base inetutils less which))
 
+(define* (hurd-grub-configuration-file config entries
+                                       #:key
+                                       (system (%current-target-system))
+                                       (old-entries '()))
+  (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* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach))
   "Return a cross-built GNU/Hurd image."
 
@@ -75,29 +109,7 @@
                           (packages->manifest %base-packages/hurd)))
 
   (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]