all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Tomáš Čech" <sleep_walker@gnu.org>
To: guix-devel@gnu.org
Subject: [PATCH] system: grub: Introduce foreign-menu-entry.
Date: Wed,  3 Aug 2016 08:42:49 +0200	[thread overview]
Message-ID: <20160803064249.7433-1-sleep_walker@gnu.org> (raw)

* 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

             reply	other threads:[~2016-08-03  6:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-03  6:42 Tomáš Čech [this message]
2016-08-03  8:48 ` [PATCH] system: grub: Introduce foreign-menu-entry 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160803064249.7433-1-sleep_walker@gnu.org \
    --to=sleep_walker@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.