all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] system: grub: Introduce foreign-menu-entry.
@ 2016-08-03  6:42 Tomáš Čech
  2016-08-03  8:48 ` Chris Marusich
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tomáš Čech @ 2016-08-03  6:42 UTC (permalink / raw)
  To: guix-devel

* gnu/system/grub(foreign-menu-entry): New record type.

menu-entry type is suitable for kernel and initrd from GuixSD as it is looking
for menu-entry-linux/bzImage for kernel in every case which makes pasing any
other form impossible.

foreign-menu-entry is very similar but is intended for entering other
distributions so it doesn't limit the name and allows kernel and initrd to be
placed in different device (in Grub syntax).
---
 gnu/system/grub.scm | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm
index 45b46ca..9b60dc8 100644
--- a/gnu/system/grub.scm
+++ b/gnu/system/grub.scm
@@ -54,6 +54,9 @@
             menu-entry
             menu-entry?
 
+            foreign-menu-entry
+            foreign-menu-entry?
+
             grub-configuration-file))
 
 ;;; Commentary:
@@ -116,6 +119,16 @@
                    (default '()))          ; list of string-valued gexps
   (initrd          menu-entry-initrd))     ; file name of the initrd as a gexp
 
+(define-record-type* <foreign-menu-entry>
+  foreign-menu-entry make-foreign-menu-entry
+  foreign-menu-entry?
+  (label           foreign-menu-entry-label)
+  (device          foreign-menu-entry-device (default ""))
+  (linux           foreign-menu-entry-linux)
+  (linux-arguments foreign-menu-entry-linux-arguments
+                   (default '()))                  ; list of string-valued gexps
+  (initrd          foreign-menu-entry-initrd))     ; file name of the initrd as a gexp
+
 \f
 ;;;
 ;;; Background image & themes.
@@ -264,7 +277,16 @@ corresponding to old generations of the system."
                                     #~(string-append #$linux "/"
                                                      #$linux-image-name))
                 #$linux #$linux-image-name (string-join (list #$@arguments))
-                #$initrd))))
+                #$initrd))
+     (($ <foreign-menu-entry> label device linux arguments initrd)
+      #~(format port "menuentry ~s {
+  linux ~a ~a
+  initrd ~a
+}~%"
+                #$label
+                (string-append #$device #$linux)
+                (string-join (list #$@arguments))
+                (string-append #$device #$initrd)))))
 
   (mlet %store-monad ((sugar (eye-candy config store-fs system #~port)))
     (define builder
-- 
2.9.2

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

end of thread, other threads:[~2016-08-04  6:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03  6:42 [PATCH] system: grub: Introduce foreign-menu-entry Tomáš Čech
2016-08-03  8:48 ` Chris Marusich
2016-08-03  9:05   ` Tomáš Čech
2016-08-04  6:43     ` Chris Marusich
2016-08-03 16:52 ` bug#20067: " Ludovic Courtès
2016-08-03 16:52 ` Ludovic Courtès
2016-08-04  5:38   ` bug#20067: " Chris Marusich
2016-08-04  5:38   ` Chris Marusich

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.