From b97b423e3f61c80d5877dadc95b3f316cd61788f Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 5 Oct 2020 10:58:55 +0200 Subject: bootloader: Fix u-boot installation. This is a follow-up of f19cf27c2b9ff92e2c0fd931ef7fde39c376adaa. The bootloader installation must be done on the final disk-image, hence using "disk-image-installer" instead of "installer" callback. * gnu/bootloader/u-boot.scm: Turn all installer callbacks into disk-image-installer callbacks. * gnu/build/bootloader.scm (write-file-on-device): Open the output file with 'no-truncate and 'no-create options. * gnu/system/image.scm (with-imported-modules*): Add (gnu build bootloader) module. --- gnu/build/bootloader.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'gnu/build') diff --git a/gnu/build/bootloader.scm b/gnu/build/bootloader.scm index 498022f6db..5ec839f902 100644 --- a/gnu/build/bootloader.scm +++ b/gnu/build/bootloader.scm @@ -22,6 +22,8 @@ #:use-module (guix utils) #:use-module (ice-9 binary-ports) #:use-module (ice-9 format) + #:use-module (rnrs io ports) + #:use-module (rnrs io simple) #:export (write-file-on-device install-efi-loader)) @@ -35,11 +37,14 @@ (call-with-input-file file (lambda (input) (let ((bv (get-bytevector-n input size))) - (call-with-output-file device - (lambda (output) - (seek output offset SEEK_SET) - (put-bytevector output bv)) - #:binary #t))))) + (call-with-port + (open-file-output-port device + (file-options no-truncate no-create) + (buffer-mode block) + (native-transcoder)) + (lambda (output) + (seek output offset SEEK_SET) + (put-bytevector output bv))))))) ;;; -- cgit v1.2.3