From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= Subject: [PATCH] system: grub: Introduce foreign-menu-entry. Date: Wed, 3 Aug 2016 08:42:49 +0200 Message-ID: <20160803064249.7433-1-sleep_walker@gnu.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUptL-0001lU-9b for guix-devel@gnu.org; Wed, 03 Aug 2016 02:43:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUptG-0000YJ-82 for guix-devel@gnu.org; Wed, 03 Aug 2016 02:42:58 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * 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 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 + ;;; ;;; 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)) + (($ 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