From 1ade872ffae08ded1b8dae2fca05fee33ac0c69f Mon Sep 17 00:00:00 2001
From: Chris Marusich
Date: Mon, 1 Aug 2016 08:57:08 -0700
Subject: [PATCH 6/9] gnu/system and gnu/system/grub: use root-fs-device, not
root-fs
---
gnu/system.scm | 3 ++-
gnu/system/grub.scm | 37 ++++++++++++++++++++-----------------
2 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/gnu/system.scm b/gnu/system.scm
index 1d1ed5e..3750094 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -740,7 +740,8 @@ OLD-ENTRIES to populate the \"old entries\" menu."
(operating-system-kernel-arguments os)))
(initrd (file-append system "/initrd"))))))
(grub-configuration-file (operating-system-bootloader os)
- store-fs entries
+ (file-system-device store-fs)
+ entries
#:old-entries old-entries)))
(define (operating-system-parameters-file os)
diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm
index c426d5f..02f8e68 100644
--- a/gnu/system/grub.scm
+++ b/gnu/system/grub.scm
@@ -26,6 +26,7 @@
#:use-module (guix download)
#:use-module (gnu artwork)
#:use-module (gnu system file-systems)
+ #:use-module (gnu build file-systems)
#:autoload (gnu packages grub) (grub)
#:autoload (gnu packages inkscape) (inkscape)
#:autoload (gnu packages imagemagick) (imagemagick)
@@ -154,12 +155,12 @@ WIDTH/HEIGHT, or #f if none was found."
(with-monad %store-monad
(return #f)))))
-(define (eye-candy config root-fs system port)
+(define (eye-candy config root-fs-device system port)
"Return in %STORE-MONAD a gexp that writes to PORT (a port-valued gexp) the
'grub.cfg' part concerned with graphics mode, background images, colors, and
-all that. ROOT-FS is a file-system object denoting the root file system where
-the store is. SYSTEM must be the target system string---e.g.,
-\"x86_64-linux\"."
+all that. ROOT-FS-DEVICE is the device parameter from a object
+denoting the root file system where the store is. SYSTEM must be the target
+system string---e.g., \"x86_64-linux\"."
(define setup-gfxterm-body
;; Intel systems need to be switched into graphics mode, whereas most
;; other modern architectures have no other mode and therefore don't need
@@ -206,7 +207,7 @@ else
set menu_color_highlight=white/blue
fi~%"
#$setup-gfxterm-body
- #$(grub-root-search root-fs font-file)
+ #$(grub-root-search root-fs-device font-file)
#$font-file
#$image
@@ -218,31 +219,32 @@ fi~%"
;;; Configuration file.
;;;
-(define (grub-root-search root-fs file)
- "Return the GRUB 'search' command to look for ROOT-FS, which contains FILE,
+(define (grub-root-search root-fs-device file)
+ "Return the GRUB 'search' command to look for ROOT-FS-DEVICE, which contains FILE,
a gexp. The result is a gexp that can be inserted in the grub.cfg-generation
code."
- (case (file-system-title root-fs)
- ;; Preferably refer to ROOT-FS by its UUID or label. This is more
- ;; efficient and less ambiguous, see <>.
+ (case (device->title root-fs-device)
+ ;; Preferably refer to ROOT-FS-DEVICE by its UUID or label. This is more
+ ;; efficient and less ambiguous.
((uuid)
(format #f "search --fs-uuid --set ~a"
- (uuid->string (file-system-device root-fs))))
+ (uuid->string root-fs-device)))
((label)
(format #f "search --label --set ~a"
- (file-system-device root-fs)))
+ root-fs-device))
(else
;; As a last resort, look for any device containing FILE.
#~(format #f "search --file --set ~a" #$file))))
-(define* (grub-configuration-file config store-fs entries
+(define* (grub-configuration-file config store-fs-device entries
#:key
(system (%current-system))
(old-entries '()))
"Return a derivation which builds the GRUB configuration file corresponding
to CONFIG, a object, and where the store is available at
-STORE-FS, a object. OLD-ENTRIES is taken to be a list of menu
-entries corresponding to old generations of the system."
+STORE-FS-DEVICE, the device parameter from a object.
+OLD-ENTRIES is taken to be a list of menu entries corresponding to old
+generations of the system."
(define all-entries
(append entries (grub-configuration-menu-entries config)))
@@ -255,11 +257,12 @@ entries corresponding to old generations of the system."
initrd ~a
}~%"
#$label
- #$(grub-root-search store-fs linux)
+ #$(grub-root-search store-fs-device linux)
#$linux (string-join (list address@hidden))
#$initrd))))
- (mlet %store-monad ((sugar (eye-candy config store-fs system #~port)))
+ (mlet %store-monad
+ ((sugar (eye-candy config store-fs-device system #~port)))
(define builder
#~(call-with-output-file #$output
(lambda (port)
--
2.9.2