summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-20 21:56:20 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-20 23:37:11 +0200
commiteb7ccb1afaaa5db3a6c4fdec0a9f22919d100952 (patch)
tree6950f4750d95c2d2d78e90da9f2125144c56bc53
parent9bea3b42b49434bccd9acd296569d2a874eddb6e (diff)
downloadpatches-eb7ccb1afaaa5db3a6c4fdec0a9f22919d100952.tar
patches-eb7ccb1afaaa5db3a6c4fdec0a9f22919d100952.tar.gz
linux-initrd: Display a backtrace when the initial program fails.
* guix/build/linux-initrd.scm (boot-system): Add pre-unwind handler in 'catch' form around 'primitive-load', and call 'format' and 'display-backtrace' from there.
-rw-r--r--guix/build/linux-initrd.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/guix/build/linux-initrd.scm b/guix/build/linux-initrd.scm
index 9093e72695..8db9f02caf 100644
--- a/guix/build/linux-initrd.scm
+++ b/guix/build/linux-initrd.scm
@@ -483,9 +483,11 @@ to it are lost."
(lambda ()
(primitive-load to-load))
(lambda args
+ (start-repl))
+ (lambda args
(format (current-error-port) "'~a' raised an exception: ~s~%"
to-load args)
- (start-repl)))
+ (display-backtrace (make-stack #t) (current-error-port))))
(format (current-error-port)
"boot program '~a' terminated, rebooting~%"
to-load)