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.
This commit is contained in:
parent
9bea3b42b4
commit
eb7ccb1afa
|
@ -482,10 +482,12 @@ to it are lost."
|
|||
(catch #t
|
||||
(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)
|
||||
|
|
Loading…
Reference in New Issue