From 641f9a2a1f3a1ad0b4c3003a2efc5c7975286cc1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 21 May 2014 23:31:46 +0200 Subject: vm: Modularize build-side code. * guix/build/install.scm (install-grub): Call 'error' if 'system*' returns non-zero. * guix/build/vm.scm (initialize-partition-table): Make 'partition-size' a positional parameter. Call 'error' when 'system*' returns non-zero'. (format-partition, initialize-root-partition): New procedures. (initialize-hard-disk): Use them. --- guix/build/install.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'guix/build/install.scm') diff --git a/guix/build/install.scm b/guix/build/install.scm index f61c16f13a..663a87b4b5 100644 --- a/guix/build/install.scm +++ b/guix/build/install.scm @@ -37,7 +37,7 @@ (define* (install-grub grub.cfg device mount-point) "Install GRUB with GRUB.CFG on DEVICE, which is assumed to be mounted on -MOUNT-POINT. Return #t on success." +MOUNT-POINT." (let* ((target (string-append mount-point "/boot/grub/grub.cfg")) (pivot (string-append target ".new"))) (mkdir-p (dirname target)) @@ -47,9 +47,11 @@ MOUNT-POINT. Return #t on success." (copy-file grub.cfg pivot) (rename-file pivot target) - (zero? (system* "grub-install" "--no-floppy" - "--boot-directory" (string-append mount-point "/boot") - device)))) + (unless (zero? (system* "grub-install" "--no-floppy" + "--boot-directory" + (string-append mount-point "/boot") + device)) + (error "failed to install GRUB")))) (define (evaluate-populate-directive directive target) "Evaluate DIRECTIVE, an sexp describing a file or directory to create under -- cgit v1.2.3