linux-boot: Add #:on-error for initrd error handling.
Suggested by Danny Milosavljevic <dannym@scratchpost.org> in <https://bugs.gnu.org/29922>. * gnu/build/linux-boot.scm (boot-system): Add #:on-error parameter and pass it to 'call-with-error-handling'. * gnu/system/linux-initrd.scm (raw-initrd): Add #:on-error and pass it. (base-initrd): Likewise.master
parent
a60f13197e
commit
aeed74f370
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
|
@ -430,7 +430,8 @@ bailing out.~%root contents: ~s~%" (scandir "/"))
|
||||||
qemu-guest-networking?
|
qemu-guest-networking?
|
||||||
volatile-root?
|
volatile-root?
|
||||||
pre-mount
|
pre-mount
|
||||||
(mounts '()))
|
(mounts '())
|
||||||
|
(on-error 'debug))
|
||||||
"This procedure is meant to be called from an initrd. Boot a system by
|
"This procedure is meant to be called from an initrd. Boot a system by
|
||||||
first loading LINUX-MODULES (a list of module names) from
|
first loading LINUX-MODULES (a list of module names) from
|
||||||
LINUX-MODULE-DIRECTORY, then setting up QEMU guest networking if
|
LINUX-MODULE-DIRECTORY, then setting up QEMU guest networking if
|
||||||
|
@ -444,7 +445,10 @@ if any.
|
||||||
MOUNTS must be a list of <file-system> objects.
|
MOUNTS must be a list of <file-system> objects.
|
||||||
|
|
||||||
When VOLATILE-ROOT? is true, the root file system is writable but any changes
|
When VOLATILE-ROOT? is true, the root file system is writable but any changes
|
||||||
to it are lost."
|
to it are lost.
|
||||||
|
|
||||||
|
ON-ERROR is passed to 'call-with-error-handling'; it determines what happens
|
||||||
|
upon error."
|
||||||
(define (root-mount-point? fs)
|
(define (root-mount-point? fs)
|
||||||
(string=? (file-system-mount-point fs) "/"))
|
(string=? (file-system-mount-point fs) "/"))
|
||||||
|
|
||||||
|
@ -517,6 +521,7 @@ to it are lost."
|
||||||
(begin
|
(begin
|
||||||
(display "no boot file passed via '--load'\n")
|
(display "no boot file passed via '--load'\n")
|
||||||
(display "entering a warm and cozy REPL\n")
|
(display "entering a warm and cozy REPL\n")
|
||||||
(start-repl)))))))
|
(start-repl)))))
|
||||||
|
#:on-error on-error))
|
||||||
|
|
||||||
;;; linux-initrd.scm ends here
|
;;; linux-initrd.scm ends here
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
|
||||||
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
|
||||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
|
@ -155,7 +155,8 @@ MODULES and taken from LINUX."
|
||||||
(mapped-devices '())
|
(mapped-devices '())
|
||||||
(helper-packages '())
|
(helper-packages '())
|
||||||
qemu-networking?
|
qemu-networking?
|
||||||
volatile-root?)
|
volatile-root?
|
||||||
|
(on-error 'debug))
|
||||||
"Return a monadic derivation that builds a raw initrd, with kernel
|
"Return a monadic derivation that builds a raw initrd, with kernel
|
||||||
modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be
|
modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be
|
||||||
mounted by the initrd, possibly in addition to the root file system specified
|
mounted by the initrd, possibly in addition to the root file system specified
|
||||||
|
@ -167,8 +168,12 @@ e2fsck/static or other packages needed by the initrd to check root partition.
|
||||||
|
|
||||||
When QEMU-NETWORKING? is true, set up networking with the standard QEMU
|
When QEMU-NETWORKING? is true, set up networking with the standard QEMU
|
||||||
parameters.
|
parameters.
|
||||||
|
|
||||||
When VOLATILE-ROOT? is true, the root file system is writable but any changes
|
When VOLATILE-ROOT? is true, the root file system is writable but any changes
|
||||||
to it are lost."
|
to it are lost.
|
||||||
|
|
||||||
|
ON-ERROR is passed to 'call-with-error-handling'; it determines what happens
|
||||||
|
upon error."
|
||||||
(define device-mapping-commands
|
(define device-mapping-commands
|
||||||
;; List of gexps to open the mapped devices.
|
;; List of gexps to open the mapped devices.
|
||||||
(map (lambda (md)
|
(map (lambda (md)
|
||||||
|
@ -216,7 +221,8 @@ to it are lost."
|
||||||
#:linux-modules '#$linux-modules
|
#:linux-modules '#$linux-modules
|
||||||
#:linux-module-directory '#$kodir
|
#:linux-module-directory '#$kodir
|
||||||
#:qemu-guest-networking? #$qemu-networking?
|
#:qemu-guest-networking? #$qemu-networking?
|
||||||
#:volatile-root? '#$volatile-root?)))
|
#:volatile-root? '#$volatile-root?
|
||||||
|
#:on-error '#$on-error)))
|
||||||
#:name "raw-initrd"))
|
#:name "raw-initrd"))
|
||||||
|
|
||||||
(define* (file-system-packages file-systems #:key (volatile-root? #f))
|
(define* (file-system-packages file-systems #:key (volatile-root? #f))
|
||||||
|
@ -243,7 +249,8 @@ FILE-SYSTEMS."
|
||||||
qemu-networking?
|
qemu-networking?
|
||||||
volatile-root?
|
volatile-root?
|
||||||
(virtio? #t)
|
(virtio? #t)
|
||||||
(extra-modules '()))
|
(extra-modules '())
|
||||||
|
(on-error 'debug))
|
||||||
"Return a monadic derivation that builds a generic initrd, with kernel
|
"Return a monadic derivation that builds a generic initrd, with kernel
|
||||||
modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be
|
modules taken from LINUX. FILE-SYSTEMS is a list of file-systems to be
|
||||||
mounted by the initrd, possibly in addition to the root file system specified
|
mounted by the initrd, possibly in addition to the root file system specified
|
||||||
|
@ -318,6 +325,7 @@ loaded at boot time in the order in which they appear."
|
||||||
#:mapped-devices mapped-devices
|
#:mapped-devices mapped-devices
|
||||||
#:helper-packages helper-packages
|
#:helper-packages helper-packages
|
||||||
#:qemu-networking? qemu-networking?
|
#:qemu-networking? qemu-networking?
|
||||||
#:volatile-root? volatile-root?))
|
#:volatile-root? volatile-root?
|
||||||
|
#:on-error on-error))
|
||||||
|
|
||||||
;;; linux-initrd.scm ends here
|
;;; linux-initrd.scm ends here
|
||||||
|
|
Reference in New Issue