[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/04: guix system: Add '--skip-checks'.
From: |
Ludovic Courtès |
Subject: |
02/04: guix system: Add '--skip-checks'. |
Date: |
Thu, 15 Mar 2018 06:40:00 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 61b1dbbdcd87f6b37d6b87715a9a4da4e63485ab
Author: Ludovic Courtès <address@hidden>
Date: Thu Mar 15 10:28:22 2018 +0100
guix system: Add '--skip-checks'.
Fixes <https://bugs.gnu.org/30760>.
Reported by Tomáš Čech <address@hidden>.
* guix/scripts/system.scm (perform-action): Add #:skip-safety-checks?
and honor it.
(show-help, %options): Add --skip-checks.
(process-action): Pass #:skip-safety-checks? to 'perform-action'.
* doc/guix.texi (Invoking guix system): Document --skip-checks.
---
doc/guix.texi | 10 ++++++++++
guix/scripts/system.scm | 18 +++++++++++++++---
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index d3a7908..bcea89e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20458,6 +20458,16 @@ of the image size as a function of the size of the
system declared in
Make @var{file} a symlink to the result, and register it as a garbage
collector root.
address@hidden --skip-checks
+Skip pre-installation safety checks.
+
+By default, @command{guix system init} and @command{guix system
+reconfigure} perform safety checks: they make sure the file systems that
+appear in the @code{operating-system} declaration actually exist
+(@pxref{File Systems}), and that any Linux kernel modules that may be
+needed at boot time are listed in @code{initrd-modules} (@pxref{Initial
+RAM Disk}). Passing this option skips these tests altogether.
+
@item address@hidden
Apply @var{strategy} when an error occurs when reading @var{file}.
@var{strategy} may be one of the following:
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index acfccce..f0c4a2b 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -733,7 +733,8 @@ and TARGET arguments."
(#$installer #$bootloader #$device #$target))))))
(define* (perform-action action os
- #:key install-bootloader?
+ #:key skip-safety-checks?
+ install-bootloader?
dry-run? derivations-only?
use-substitutes? bootloader-target target
image-size file-system-type full-boot?
@@ -750,7 +751,10 @@ When DERIVATIONS-ONLY? is true, print the derivation file
name(s) without
building anything.
When GC-ROOT is a path, also make that path an indirect root of the build
-output when building a system derivation, such as a disk image."
+output when building a system derivation, such as a disk image.
+
+When SKIP-SAFETY-CHECKS? is true, skip the file system and initrd module
+static checks."
(define println
(cut format #t "~a~%" <>))
@@ -760,7 +764,8 @@ output when building a system derivation, such as a disk
image."
;; Check whether the declared file systems exist. This is better than
;; instantiating a broken configuration. Assume that we can only check if
;; running as root.
- (when (memq action '(init reconfigure))
+ (when (and (not skip-safety-checks?)
+ (memq action '(init reconfigure)))
(check-mapped-devices os)
(when (zero? (getuid))
(check-file-system-availability (operating-system-file-systems os))
@@ -933,6 +938,8 @@ Some ACTIONS support additional ARGS.\n"))
--expose=SPEC for 'vm', expose host file system according to SPEC"))
(display (G_ "
--full-boot for 'vm', make a full boot sequence"))
+ (display (G_ "
+ --skip-checks skip file system and initrd module safety checks"))
(newline)
(display (G_ "
-h, --help display this help and exit"))
@@ -974,6 +981,9 @@ Some ACTIONS support additional ARGS.\n"))
(option '("full-boot") #f #f
(lambda (opt name arg result)
(alist-cons 'full-boot? #t result)))
+ (option '("skip-checks") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'skip-safety-checks? #t result)))
(option '("share") #t #f
(lambda (opt name arg result)
@@ -1067,6 +1077,8 @@ resulting from command-line parsing."
#:derivations-only? (assoc-ref opts
'derivations-only?)
#:use-substitutes? (assoc-ref opts 'substitutes?)
+ #:skip-safety-checks?
+ (assoc-ref opts 'skip-safety-checks?)
#:file-system-type (assoc-ref opts
'file-system-type)
#:image-size (assoc-ref opts 'image-size)
#:full-boot? (assoc-ref opts 'full-boot?)