diff options
| author | Mathieu Othacehe <m.othacehe@gmail.com> | 2017-12-01 14:09:38 +0100 |
|---|---|---|
| committer | Mathieu Othacehe <m.othacehe@gmail.com> | 2017-12-04 18:26:59 +0100 |
| commit | 4307397b5e060b54d69b7d2818654504ebde9c1d (patch) | |
| tree | 220be063b26be9ce8cfa4a94bc016cf3450f85d8 /gnu/bootloader | |
| parent | 39b27f4eae36d155faf466c59629afb5843030e6 (diff) | |
bootloader: extlinux: Stop using dd binary.
* gnu/bootloader/extlinux.scm (dd): Remove it,
(install-extlinux): replace dd call by Guile I/O procedures.
* gnu/system/vm.scm (qemu-image): Add (ice-9 binary-ports) to used-modules
list to provide "get-bytevector-n" and "put-bytevector".
* guix/scripts/system.scm (bootloader-installer-derivation): Ditto.
Diffstat (limited to 'gnu/bootloader')
| -rw-r--r-- | gnu/bootloader/extlinux.scm | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm index 0db5598fc9b..9b6e2c7f2a2 100644 --- a/gnu/bootloader/extlinux.scm +++ b/gnu/bootloader/extlinux.scm | |||
| @@ -85,14 +85,6 @@ TIMEOUT ~a~%" | |||
| 85 | ;;; Install procedures. | 85 | ;;; Install procedures. |
| 86 | ;;; | 86 | ;;; |
| 87 | 87 | ||
| 88 | (define dd | ||
| 89 | #~(lambda (bs count if of) | ||
| 90 | (zero? (system* "dd" | ||
| 91 | (string-append "bs=" (number->string bs)) | ||
| 92 | (string-append "count=" (number->string count)) | ||
| 93 | (string-append "if=" if) | ||
| 94 | (string-append "of=" of))))) | ||
| 95 | |||
| 96 | (define (install-extlinux mbr) | 88 | (define (install-extlinux mbr) |
| 97 | #~(lambda (bootloader device mount-point) | 89 | #~(lambda (bootloader device mount-point) |
| 98 | (let ((extlinux (string-append bootloader "/sbin/extlinux")) | 90 | (let ((extlinux (string-append bootloader "/sbin/extlinux")) |
| @@ -101,9 +93,15 @@ TIMEOUT ~a~%" | |||
| 101 | (for-each (lambda (file) | 93 | (for-each (lambda (file) |
| 102 | (install-file file install-dir)) | 94 | (install-file file install-dir)) |
| 103 | (find-files syslinux-dir "\\.c32$")) | 95 | (find-files syslinux-dir "\\.c32$")) |
| 104 | 96 | (unless | |
| 105 | (unless (and (zero? (system* extlinux "--install" install-dir)) | 97 | (and (zero? (system* extlinux "--install" install-dir)) |
| 106 | (#$dd 440 1 (string-append syslinux-dir "/" #$mbr) device)) | 98 | (call-with-input-file (string-append syslinux-dir "/" #$mbr) |
| 99 | (lambda (input) | ||
| 100 | (let ((bv (get-bytevector-n input 440))) | ||
| 101 | (call-with-output-file device | ||
| 102 | (lambda (output) | ||
| 103 | (put-bytevector output bv)) | ||
| 104 | #:binary #t))))) | ||
| 107 | (error "failed to install SYSLINUX"))))) | 105 | (error "failed to install SYSLINUX"))))) |
| 108 | 106 | ||
| 109 | (define install-extlinux-mbr | 107 | (define install-extlinux-mbr |
