all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 29922@debbugs.gnu.org
Subject: [bug#29922] [PATCH v2] linux-boot: Improve error reporting.
Date: Mon, 08 Jan 2018 10:05:10 +0100	[thread overview]
Message-ID: <87r2r0k9fd.fsf@gnu.org> (raw)
In-Reply-To: <20180101085647.22716-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Mon, 1 Jan 2018 09:56:47 +0100")

Hi Danny,

Danny Milosavljevic <dannym@scratchpost.org> 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’.

  parent reply	other threads:[~2018-01-08  9:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01  0:42 [bug#29922] [PATCH] linux-boot: Improve error reporting Danny Milosavljevic
2018-01-01  8:56 ` [bug#29922] [PATCH v2] " Danny Milosavljevic
2018-01-01 12:24   ` Danny Milosavljevic
2018-01-08  9:05   ` Ludovic Courtès [this message]
2018-01-08 11:18     ` Danny Milosavljevic
2018-01-08 14:05       ` Ludovic Courtès
2018-01-08 16:29         ` Danny Milosavljevic
2018-01-08 23:03           ` Ludovic Courtès
2018-01-09  8:45             ` [bug#29922] [PATCH 0/2] Make sure that marionette-operating-system fails on error Danny Milosavljevic
2018-01-09  8:46               ` [bug#29922] [PATCH 1/2] system: Export operating-system-user-kernel-arguments Danny Milosavljevic
2018-01-09  8:46                 ` [bug#29922] [PATCH 2/2] tests: marionette-operating-system: Add initrd parameter and kernel-arguments Danny Milosavljevic
2018-01-09 11:48               ` [bug#29922] [PATCH 0/2] Make sure that marionette-operating-system fails on error Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r2r0k9fd.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=29922@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.