diff options
Diffstat (limited to 'machines')
-rw-r--r-- | machines/amd64.scm (renamed from machines/portable-bios.scm) | 41 | ||||
-rw-r--r-- | machines/thinkpad-x200.scm | 12 |
2 files changed, 23 insertions, 30 deletions
diff --git a/machines/portable-bios.scm b/machines/amd64.scm index 5364300..4730607 100644 --- a/machines/portable-bios.scm +++ b/machines/amd64.scm @@ -1,10 +1,4 @@ -(define-module (machines portable-bios) - ;; bootloader-configuration - #:use-module (gnu bootloader) - - ;; grub-bootloader - #:use-module (gnu bootloader grub) - +(define-module (machines amd64) ;; file-system ;; swap-space #:use-module (gnu system file-systems) @@ -16,15 +10,6 @@ ;; microcode-initrd #:use-module (nongnu system linux-initrd)) -;; bootloader-configuration -(define-public (bootloader-configuration* keyboard-layout*) - (let ((bootloader* grub-bootloader) - (bootloader-targets (list "/dev/sdb")) ; TODO: generalize the target - ) - (bootloader-configuration (bootloader bootloader*) - (targets bootloader-targets) - (keyboard-layout keyboard-layout*)))) - ;; string -> ;; (list record* file-system) (define-public (file-systems* host-name*) @@ -35,7 +20,8 @@ (file-system-root (file-system (type "ext4") (mount-point "/") (device root-device)))) - (list file-system-root))) + (append %base-file-systems + (list file-system-root)))) ;; (list record* package) (define-public firmware* @@ -46,7 +32,7 @@ microcode-initrd) ;; record* package -(define-public kernel* +(define-public kernel-amd64 linux) ;; string -> @@ -58,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/machines/thinkpad-x200.scm b/machines/thinkpad-x200.scm index faca5b0..3e32fc0 100644 --- a/machines/thinkpad-x200.scm +++ b/machines/thinkpad-x200.scm @@ -25,18 +25,6 @@ (targets bootloader-targets) (keyboard-layout keyboard-layout*)))) -;; string -> -;; (list record* file-system) -(define-public (file-systems* host-name*) - (let* ((root-device-string (string-append host-name* "-root")) - - (root-device (file-system-label root-device-string)) - - (file-system-root (file-system (type "ext4") - (mount-point "/") - (device root-device)))) - (list file-system-root))) - ;; (list record* package) (define-public firmware* (list linux-firmware)) |