diff options
Diffstat (limited to 'gnu/build/linux-boot.scm')
-rw-r--r-- | gnu/build/linux-boot.scm | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index fbc683c798..a58232c815 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -339,24 +339,21 @@ bailing out.~%root contents: ~s~%" (scandir "/")) (define* (boot-system #:key (linux-modules '()) qemu-guest-networking? - guile-modules-in-chroot? volatile-root? + pre-mount (mounts '())) "This procedure is meant to be called from an initrd. Boot a system by first loading LINUX-MODULES (a list of absolute file names of '.ko' files), then setting up QEMU guest networking if QEMU-GUEST-NETWORKING? is true, -mounting the file systems specified in MOUNTS, and finally booting into the -new root if any. The initrd supports kernel command-line options '--load', -'--root', and '--repl'. +calling PRE-MOUNT, mounting the file systems specified in MOUNTS, and finally +booting into the new root if any. The initrd supports kernel command-line +options '--load', '--root', and '--repl'. Mount the root file system, specified by the '--root' command-line argument, if any. MOUNTS must be a list suitable for 'mount-file-system'. -When GUILE-MODULES-IN-CHROOT? is true, make core Guile modules available in -the new root. - When VOLATILE-ROOT? is true, the root file system is writable but any changes to it are lost." (define root-mount-point? @@ -407,23 +404,15 @@ to it are lost." (mkdir "/root/dev") (make-essential-device-nodes #:root "/root")) + (when (procedure? pre-mount) + ;; Do whatever actions are needed before mounting--e.g., installing + ;; device mappings. + (pre-mount)) + ;; Mount the specified file systems. (for-each mount-file-system (remove root-mount-point? mounts)) - (when guile-modules-in-chroot? - ;; Copy the directories that contain .scm and .go files so that the - ;; child process in the chroot can load modules (we would bind-mount - ;; them but for some reason that fails with EINVAL -- XXX). - (mkdir-p "/root/share") - (mkdir-p "/root/lib") - (mount "none" "/root/share" "tmpfs") - (mount "none" "/root/lib" "tmpfs") - (copy-recursively "/share" "/root/share" - #:log (%make-void-port "w")) - (copy-recursively "/lib" "/root/lib" - #:log (%make-void-port "w"))) - (if to-load (begin (switch-root "/root") |