file-systems: Spawn a Bournish REPL upon fsck failure.

Fixes <http://bugs.gnu.org/22588>.
Reported by Mark H Weaver <mhw@netris.org>.

* gnu/build/file-systems.scm (check-file-system): Pass
%BOURNISH-LANGUAGE as the argument to 'start-repl'.
* gnu/services.scm (activation-script): Add (guix build bournish).
* gnu/services/base.scm (file-system-shepherd-service)[imported-modules]:
Likewise.
* gnu/system/linux-container.scm (container-script): Likewise.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Likewise.
This commit is contained in:
Ludovic Courtès 2016-02-08 23:29:06 +01:00
parent f2e4805b7e
commit 6eb439070a
5 changed files with 8 additions and 2 deletions

View file

@ -18,6 +18,7 @@
(define-module (gnu build file-systems) (define-module (gnu build file-systems)
#:use-module (guix build utils) #:use-module (guix build utils)
#:use-module (guix build bournish)
#:use-module (rnrs io ports) #:use-module (rnrs io ports)
#:use-module (rnrs bytevectors) #:use-module (rnrs bytevectors)
#:use-module (ice-9 match) #:use-module (ice-9 match)
@ -352,9 +353,10 @@ (define fsck
(sleep 3) (sleep 3)
(reboot)) (reboot))
(code (code
(format (current-error-port) "'~a' exited with code ~a on ~a; spawning REPL~%" (format (current-error-port) "'~a' exited with code ~a on ~a; \
spawning Bourne-like REPL~%"
fsck code device) fsck code device)
(start-repl))))) (start-repl %bournish-language)))))
(define (mount-flags->bit-mask flags) (define (mount-flags->bit-mask flags)
"Return the number suitable for the 'flags' argument of 'mount' that "Return the number suitable for the 'flags' argument of 'mount' that

View file

@ -326,6 +326,7 @@ (define %modules
(gnu build file-systems) (gnu build file-systems)
(guix build utils) (guix build utils)
(guix build syscalls) (guix build syscalls)
(guix build bournish)
(guix elf))) (guix elf)))
(define (service-activations) (define (service-activations)

View file

@ -271,6 +271,7 @@ (define (file-system-shepherd-service file-system)
#:select (check-file-system canonicalize-device-spec)) #:select (check-file-system canonicalize-device-spec))
,@%default-modules)) ,@%default-modules))
(imported-modules `((gnu build file-systems) (imported-modules `((gnu build file-systems)
(guix build bournish)
,@%default-imported-modules)))) ,@%default-imported-modules))))
'()))) '())))

View file

@ -110,5 +110,6 @@ (define script
(guix utils) (guix utils)
(guix build utils) (guix build utils)
(guix build syscalls) (guix build syscalls)
(guix build bournish)
(gnu build file-systems) (gnu build file-systems)
(gnu build linux-container)))))) (gnu build linux-container))))))

View file

@ -104,6 +104,7 @@ (define* (expression->derivation-in-linux-vm name exp
(guix records) (guix records)
(guix build utils) (guix build utils)
(guix build syscalls) (guix build syscalls)
(guix build bournish)
(guix build store-copy))) (guix build store-copy)))
(guile-for-build (guile-for-build
(%guile-for-build)) (%guile-for-build))