summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--machines/amd64.scm19
-rw-r--r--systems/mcdowell.scm7
2 files changed, 23 insertions, 3 deletions
diff --git a/machines/amd64.scm b/machines/amd64.scm
index 6532ef9..4730607 100644
--- a/machines/amd64.scm
+++ b/machines/amd64.scm
@@ -44,3 +44,22 @@
(swap-space* (swap-space (target target*))))
(list swap-space*)))
+
+;;;???????????????????????????????????????????????????????????????????
+
+(define-public (bootloader-device-path host-name)
+ (let*
+ ((close-pipe (@ (ice-9 popen) close-pipe))
+ (open-input-pipe (@ (ice-9 popen) open-input-pipe))
+ (read-line (@ (ice-9 rdelim) read-line))
+ (command-chain (string-append "findmnt -o SOURCE,LABEL "
+ "| grep "
+ host-name
+ " "
+ "| head -n 1 "
+ "| awk '{print $1}' "
+ "| sed 's/[0-9]*$//' "))
+ (port (open-input-pipe command-chain))
+ (output (read-line port)))
+ (close-pipe port)
+ output))
diff --git a/systems/mcdowell.scm b/systems/mcdowell.scm
index feb088e..0d20837 100644
--- a/systems/mcdowell.scm
+++ b/systems/mcdowell.scm
@@ -11,8 +11,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(define bootloader-target-mcdowell
- "/dev/sdb")
+(define (bootloader-target-mcdowell)
+ (use-modules (machines amd64))
+ (bootloader-device-path host-name*))
(define (desktop-services-mcdowell)
(use-modules (suweren system))
@@ -41,7 +42,7 @@
((@ (gnu bootloader) bootloader-configuration)
(bootloader (grub-mkrescue-bootloader-mcdowell))
(keyboard-layout keyboard-layout-mcdowell)
- (targets (list bootloader-target-mcdowell))))
+ (targets (list (bootloader-target-mcdowell)))))
(define services-mcdowell
(append (desktop-services-mcdowell)