summaryrefslogtreecommitdiff
path: root/systems
diff options
context:
space:
mode:
Diffstat (limited to 'systems')
-rw-r--r--systems/mcdowell.scm60
1 files changed, 52 insertions, 8 deletions
diff --git a/systems/mcdowell.scm b/systems/mcdowell.scm
index ac4bd70..3fa8b21 100644
--- a/systems/mcdowell.scm
+++ b/systems/mcdowell.scm
@@ -5,6 +5,52 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define install-grub-mcdowell
+ ((@ (guix gexp) gexp)
+ (lambda (bootloader device mount-point)
+ (let ((grub (string-append bootloader "/sbin/grub-install"))
+ (install-dir (string-append mount-point "/boot")))
+ ;; Install GRUB on DEVICE which is mounted at MOUNT-POINT. If DEVICE
+ ;; is #f, then we populate the disk-image rooted at MOUNT-POINT.
+ (if device
+ (begin
+ ;; Tell 'grub-install' that there might be a LUKS-encrypted
+ ;; /boot or root partition.
+ (setenv "GRUB_ENABLE_CRYPTODISK" "y")
+
+ ;; Hide potentially confusing messages from the user, such as
+ ;; "Installing for i386-pc platform."
+ (invoke/quiet grub
+ "--no-floppy"
+ "--target=x86_64-efi"
+ "--removable"
+ "--no-nvram"
+ "--boot-directory"
+ install-dir
+ "--efi-directory"
+ "/boot/efi")
+
+ ;; (invoke/quiet grub
+ ;; "--no-floppy"
+ ;; "--target=i386-efi"
+ ;; "--removable"
+ ;; "--no-nvram"
+ ;; "--boot-directory"
+ ;; install-dir
+ ;; "--efi-directory"
+ ;; "/boot/efi")
+
+ (invoke/quiet grub "--no-floppy" "--target=i386-pc"
+ "--boot-directory" install-dir
+ device))
+ ;; When creating a disk-image, only install a font and GRUB modules.
+ (let* ((fonts (string-append install-dir "/grub/fonts")))
+ (mkdir-p fonts)
+ (copy-file (string-append bootloader "/share/grub/unicode.pf2")
+ (string-append fonts "/unicode.pf2"))
+ (copy-recursively (string-append bootloader "/lib/")
+ install-dir)))))))
+
(define (home-environments-mcdowell)
(use-modules (users id1000))
`((,uid1000-name ,(uid1000-home-environment host-name*))))
@@ -12,20 +58,18 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define bootloader-target-mcdowell
- ((@ (machines amd64) bootloader-device-path)
- host-name*))
+ ((@ (machines amd64) bootloader-device-path) host-name*))
(define (desktop-services-mcdowell)
(use-modules (suweren system))
%suweren-services)
-(define grub-mkrescue-bootloader-mcdowell
+(define grub-custom-bootloader-mcdowell
(let
- ((grub-bootloader (@ (gnu bootloader grub) grub-bootloader))
- (grub-hybrid (@ (gnu packages bootloaders) grub-hybrid)))
+ ((grub-mkrescue-bootloader (@ (gnu bootloader grub) grub-mkrescue-bootloader)))
((@ (gnu bootloader) bootloader)
- (inherit grub-bootloader)
- (package grub-hybrid))))
+ (inherit grub-mkrescue-bootloader)
+ (installer install-grub-mcdowell))))
(define keyboard-layout-mcdowell
((@ (gnu system keyboard) keyboard-layout)
@@ -41,7 +85,7 @@
(define bootloader-mcdowell
((@ (gnu bootloader) bootloader-configuration)
- (bootloader grub-mkrescue-bootloader-mcdowell)
+ (bootloader grub-custom-bootloader-mcdowell)
(keyboard-layout keyboard-layout-mcdowell)
(targets (list bootloader-target-mcdowell))))