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
1 changed files with 3 additions and 1 deletions
|
@ -482,10 +482,12 @@ to it are lost."
|
||||||
(catch #t
|
(catch #t
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(primitive-load to-load))
|
(primitive-load to-load))
|
||||||
|
(lambda args
|
||||||
|
(start-repl))
|
||||||
(lambda args
|
(lambda args
|
||||||
(format (current-error-port) "'~a' raised an exception: ~s~%"
|
(format (current-error-port) "'~a' raised an exception: ~s~%"
|
||||||
to-load args)
|
to-load args)
|
||||||
(start-repl)))
|
(display-backtrace (make-stack #t) (current-error-port))))
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
"boot program '~a' terminated, rebooting~%"
|
"boot program '~a' terminated, rebooting~%"
|
||||||
to-load)
|
to-load)
|
||||||
|
|
Reference in a new issue