From 557a938633ed55c41aed8b41a0f93b6151f00943 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 6 Nov 2020 21:37:33 -0500 Subject: [PATCH 1/2] build: image: Ensure required arguments are present. * gnu/build/image.scm (initialize-root-partition): Validate arguments. [system-directory, references-graph]: Change from keyword to positional arguments. [doc]: Add space between sentences. * gnu/system/image.scm (system-iso9660-image): Adjust. --- gnu/build/image.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gnu/build/image.scm b/gnu/build/image.scm index 640a784204..053972166b 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2017 Marius Bakke ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Mathieu Othacehe +;;; Copyright © 2020 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -179,7 +180,7 @@ to call-with-database." make-device-nodes (wal-mode? #t) #:allow-other-keys) - "Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to + "Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to install the bootloader configuration. If REGISTER-CLOSURES? is true, register REFERENCES-GRAPHS in the store. If @@ -187,6 +188,20 @@ DEDUPLICATE? is true, then also deduplicate files common to CLOSURES and the rest of the store when registering the closures. SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation. Pass WAL-MODE? to register-closure." + + (define (validate-arguments) + (when bootcfg + (unless bootcfg-location + (error "Missing 'bootcfg-location' argument"))) + (when bootloader-installer + (unless bootloader-package + (error "Missing 'bootloader-package' argument"))) + (unless references-graphs + (error "Missing 'references-graphs' argument")) + (unless system-directory + (error "Missing 'system-directory' argument"))) + + (validate-arguments) (populate-root-file-system system-directory root) (populate-store references-graphs root) -- 2.28.0