summary refs log tree commit diff
path: root/gnu/build
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-10-21 10:42:50 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-11-03 07:59:59 +0100
commita38d861e571c952f78ca588b50bdcc4adcb0c88c (patch)
tree103c5429cc5297eeb8041947ff3c2e6d0e112535 /gnu/build
parent25e811583fc1e718668147e50a0bf297b30e8017 (diff)
downloadguix-a38d861e571c952f78ca588b50bdcc4adcb0c88c.tar.gz
system: reconfigure: Use the disk-installer if provided.
Fixes: <https://issues.guix.gnu.org/44101>.

* gnu/build/bootloader.scm (write-file-on-device): Pass 'no-fail flag instead
of 'no-create. Use a latin-1 transcoder.
* guix/scripts/system/reconfigure.scm (install-bootloader-program): Add a
"disk-installer" argument and use it as a fallback.
(install-bootloader): Adapt accordingly.
* gnu/tests/reconfigure.scm (run-install-bootloader-test): Ditto.
Diffstat (limited to 'gnu/build')
-rw-r--r--gnu/build/bootloader.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/gnu/build/bootloader.scm b/gnu/build/bootloader.scm
index 5ec839f902..3916930c89 100644
--- a/gnu/build/bootloader.scm
+++ b/gnu/build/bootloader.scm
@@ -38,10 +38,13 @@
     (lambda (input)
       (let ((bv (get-bytevector-n input size)))
         (call-with-port
+         ;; Do not use "call-with-output-file" that would truncate the file.
          (open-file-output-port device
-                                (file-options no-truncate no-create)
+                                (file-options no-truncate no-fail)
                                 (buffer-mode block)
-                                (native-transcoder))
+                                ;; Use the binary-friendly ISO-8859-1
+                                ;; encoding.
+                                (make-transcoder (latin-1-codec)))
          (lambda (output)
            (seek output offset SEEK_SET)
            (put-bytevector output bv)))))))