[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#29922] [PATCH v2] linux-boot: Improve error reporting.
From: |
Ludovic Courtès |
Subject: |
[bug#29922] [PATCH v2] linux-boot: Improve error reporting. |
Date: |
Mon, 08 Jan 2018 10:05:10 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hi Danny,
Danny Milosavljevic <address@hidden> skribis:
> * 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))
The safe way (an exception could have fewer arguments that what’s above)
is to write something like:
(catch #t
(lambda ()
(primitive-load to-load))
(const #t) ;nothing
(lambda (key . args)
(print-exception (current-error-port)
(stack-ref (make-stack #t) 1)
key args)
(exit 1)))
Could you check if it works for you?
> --- 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)
That’s a good idea. Could you make it a separate commit?
Thanks,
Ludo’.
- [bug#29922] [PATCH v2] linux-boot: Improve error reporting., Danny Milosavljevic, 2018/01/01
- [bug#29922] [PATCH v2] linux-boot: Improve error reporting., Danny Milosavljevic, 2018/01/01
- [bug#29922] [PATCH v2] linux-boot: Improve error reporting.,
Ludovic Courtès <=
- [bug#29922] [PATCH v2] linux-boot: Improve error reporting., Danny Milosavljevic, 2018/01/08
- [bug#29922] [PATCH v2] linux-boot: Improve error reporting., Ludovic Courtès, 2018/01/08
- [bug#29922] [PATCH v2] linux-boot: Improve error reporting., Danny Milosavljevic, 2018/01/08
- [bug#29922] [PATCH v2] linux-boot: Improve error reporting., Ludovic Courtès, 2018/01/08
- [bug#29922] [PATCH 0/2] Make sure that marionette-operating-system fails on error., Danny Milosavljevic, 2018/01/09
- [bug#29922] [PATCH 1/2] system: Export operating-system-user-kernel-arguments., Danny Milosavljevic, 2018/01/09
- [bug#29922] [PATCH 2/2] tests: marionette-operating-system: Add initrd parameter and kernel-arguments., Danny Milosavljevic, 2018/01/09
- [bug#29922] [PATCH 0/2] Make sure that marionette-operating-system fails on error., Ludovic Courtès, 2018/01/09