summaryrefslogtreecommitdiff
path: root/machines/amd64.scm
diff options
context:
space:
mode:
Diffstat (limited to 'machines/amd64.scm')
-rw-r--r--machines/amd64.scm19
1 files changed, 19 insertions, 0 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))