summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Othacehe <m.othacehe@gmail.com>2017-05-18 12:06:36 +0200
committerMathieu Othacehe <m.othacehe@gmail.com>2017-06-21 09:57:12 +0200
commitdbaef95aabfd8a90f11f513b65a8ebfe8d0b93c2 (patch)
tree448ab74f8fbd4d21f7c15cdfc88a481b487d90ce
parentcffaca959a08f7071e5ada7f1ece075823672251 (diff)
bootloader: extlinux: Add extlinux-bootloader-gpt.
* gnu/bootloader/extlinux.scm (extlinux-bootloader-gpt): New exported variable. (install-extlinux)[mbr]: New argument. (install-extlinux-mbr, install-extlinux-gpt): New variables. (extlinux-bootloader)[installer]: Use install-extlinux-mbr.
-rw-r--r--gnu/bootloader/extlinux.scm20
1 files changed, 16 insertions, 4 deletions
diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm
index 0a1263aed72..219b058e53e 100644
--- a/gnu/bootloader/extlinux.scm
+++ b/gnu/bootloader/extlinux.scm
@@ -25,7 +25,8 @@
25 #:use-module (guix monads) 25 #:use-module (guix monads)
26 #:use-module (guix records) 26 #:use-module (guix records)
27 #:use-module (guix utils) 27 #:use-module (guix utils)
28 #:export (extlinux-bootloader)) 28 #:export (extlinux-bootloader
29 extlinux-bootloader-gpt))
29 30
30(define* (extlinux-configuration-file config entries 31(define* (extlinux-configuration-file config entries
31 #:key 32 #:key
@@ -93,7 +94,7 @@ TIMEOUT ~a~%"
93 (string-append "if=" if) 94 (string-append "if=" if)
94 (string-append "of=" of))))) 95 (string-append "of=" of)))))
95 96
96(define install-extlinux 97(define (install-extlinux mbr)
97 #~(lambda (bootloader device mount-point) 98 #~(lambda (bootloader device mount-point)
98 (let ((extlinux (string-append bootloader "/sbin/extlinux")) 99 (let ((extlinux (string-append bootloader "/sbin/extlinux"))
99 (install-dir (string-append mount-point "/boot/extlinux")) 100 (install-dir (string-append mount-point "/boot/extlinux"))
@@ -103,9 +104,15 @@ TIMEOUT ~a~%"
103 (find-files syslinux-dir "\\.c32$")) 104 (find-files syslinux-dir "\\.c32$"))
104 105
105 (unless (and (zero? (system* extlinux "--install" install-dir)) 106 (unless (and (zero? (system* extlinux "--install" install-dir))
106 (#$dd 440 1 (string-append syslinux-dir "/mbr.bin") device)) 107 (#$dd 440 1 (string-append syslinux-dir "/" #$mbr) device))
107 (error "failed to install SYSLINUX"))))) 108 (error "failed to install SYSLINUX")))))
108 109
110(define install-extlinux-mbr
111 (install-extlinux "mbr.bin"))
112
113(define install-extlinux-gpt
114 (install-extlinux "gptmbr.bin"))
115
109 116
110 117
111;;; 118;;;
@@ -116,6 +123,11 @@ TIMEOUT ~a~%"
116 (bootloader 123 (bootloader
117 (name 'extlinux) 124 (name 'extlinux)
118 (package syslinux) 125 (package syslinux)
119 (installer install-extlinux) 126 (installer install-extlinux-mbr)
120 (configuration-file "/boot/extlinux/extlinux.conf") 127 (configuration-file "/boot/extlinux/extlinux.conf")
121 (configuration-file-generator extlinux-configuration-file))) 128 (configuration-file-generator extlinux-configuration-file)))
129
130(define extlinux-bootloader-gpt
131 (bootloader
132 (inherit extlinux-bootloader)
133 (installer install-extlinux-gpt)))