aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-01-31 01:40:02 +0100
committerLudovic Courtès <ludo@gnu.org>2014-01-31 01:40:02 +0100
commit83b9e6a1854d4fb86f0269afac33200dce996f06 (patch)
treeaf3967810c54960faf5e2a822fc4078b09c628be
parent882f034fa88361c703f382f08e158e15ce330c1d (diff)
downloadguix-83b9e6a1854d4fb86f0269afac33200dce996f06.tar.gz
guix-83b9e6a1854d4fb86f0269afac33200dce996f06.zip
gnu: linux-initrd: Start a REPL when the root could not be mounted.
* guix/build/linux-initrd.scm (boot-system): Catch errors when mounting ROOT and call 'start-repl' upon error.
-rw-r--r--guix/build/linux-initrd.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/guix/build/linux-initrd.scm b/guix/build/linux-initrd.scm
index 039a60acf3..69cb58763f 100644
--- a/guix/build/linux-initrd.scm
+++ b/guix/build/linux-initrd.scm
@@ -217,7 +217,13 @@ the new root."
(unless (file-exists? "/root")
(mkdir "/root"))
(if root
- (mount root "/root" "ext3")
+ (catch #t
+ (lambda ()
+ (mount root "/root" "ext3"))
+ (lambda args
+ (format (current-error-port) "exception while mounting '~a': ~s~%"
+ root args)
+ (start-repl)))
(mount "none" "/root" "tmpfs"))
(mount-essential-file-systems #:root "/root")