guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#29922] [PATCH v2] linux-boot: Improve error reporting.


From: Danny Milosavljevic
Subject: [bug#29922] [PATCH v2] linux-boot: Improve error reporting.
Date: Mon, 1 Jan 2018 09:56:47 +0100

* gnu/build/linux-boot.scm (boot-system): Improve error reporting.
* gnu/system.scm (operating-system-user-kernel-arguments): Export.
* gnu/tests.scm (marionette-operating-system): Modify kernel-arguments.
---
 gnu/build/linux-boot.scm | 21 ++++++++++++++++++++-
 gnu/system.scm           |  1 +
 gnu/tests.scm            |  3 +++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 4dd740174..bff2eb0f4 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -507,7 +507,26 @@ to it are lost."
              (switch-root "/root")
              (format #t "loading '~a'...\n" to-load)
 
-             (primitive-load to-load)
+             (catch #t
+               (lambda ()
+                 (primitive-load to-load))
+               (lambda (key proc format-string format-args . rest)
+                 (format (current-error-port) "~a: ~a~%" proc
+                  (apply format #f format-string format-args))
+                 (force-output (current-error-port))
+                 (exit 1)
+                 (reboot))
+               (lambda _
+                 (let ((print-frames
+                        (@@ (system repl debug) print-frames))
+                       (frame->stack-vector
+                        (@@ (system repl debug) frame->stack-vector))
+                       (stack-ref
+                        (@@ (system repl debug) stack-ref)))
+                   (print-frames
+                    (frame->stack-vector
+                     (stack-ref (make-stack #t) 0))
+                    #:width 1000000))))
 
              (format (current-error-port)
                      "boot program '~a' terminated, rebooting~%"
diff --git a/gnu/system.scm b/gnu/system.scm
index df89ca06d..a4407e8ab 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -73,6 +73,7 @@
             operating-system-hosts-file
             operating-system-kernel
             operating-system-kernel-file
+            operating-system-user-kernel-arguments
             operating-system-kernel-arguments
             operating-system-initrd
             operating-system-users
diff --git a/gnu/tests.scm b/gnu/tests.scm
index 0caa922fd..dc0188f1e 100644
--- a/gnu/tests.scm
+++ b/gnu/tests.scm
@@ -172,6 +172,9 @@ marionette service in the guest is started after the 
Shepherd services listed
 in REQUIREMENTS."
   (operating-system
     (inherit os)
+    ;; Make sure that the system doesn't hang on kernel panic.
+    (kernel-arguments (cons "panic=1"
+                            (operating-system-user-kernel-arguments os)))
     (services (cons (service marionette-service-type
                              (marionette-configuration
                               (requirements requirements)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]