From b0dd47a8d0c39dabf6d23aa24bf6a4ae650bd006 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 28 Jan 2014 23:38:19 +0100 Subject: gnu: qemu-initrd: Adjust to allow booting with a non-empty /root. * gnu/packages/linux-initrd.scm (qemu-initrd): Use 'mkdir-p' instead of 'mkdir' for /root/xchg and /root/{share,lib}. When TO-LOAD is a symlink, resolve it. (gnu-system-initrd): Fix typo in message. --- gnu/packages/linux-initrd.scm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/linux-initrd.scm b/gnu/packages/linux-initrd.scm index 0134e89da8..5495e16e30 100644 --- a/gnu/packages/linux-initrd.scm +++ b/gnu/packages/linux-initrd.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -280,7 +280,7 @@ the Linux kernel.") (mount "none" "/root" "tmpfs")) (mount-essential-file-systems #:root "/root") - (mkdir "/root/xchg") + (mkdir-p "/root/xchg") (mkdir-p "/root/nix/store") (unless (file-exists? "/root/dev") @@ -294,8 +294,8 @@ the Linux kernel.") ;; 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 "/root/share") - (mkdir "/root/lib") + (mkdir-p "/root/share") + (mkdir-p "/root/lib") (mount "none" "/root/share" "tmpfs") (mount "none" "/root/lib" "tmpfs") (copy-recursively "/share" "/root/share" @@ -305,9 +305,17 @@ the Linux kernel.") (if to-load - (begin + (letrec ((resolve + (lambda (file) + ;; If FILE is a symlink to an absolute file name, + ;; resolve it as if we were under /root. + (let ((st (lstat file))) + (if (eq? 'symlink (stat:type st)) + (let ((target (readlink file))) + (resolve (string-append "/root" target))) + file))))) (format #t "loading boot file '~a'...\n" to-load) - (compile-file (string-append "/root/" to-load) + (compile-file (resolve (string-append "/root/" to-load)) #:output-file "/root/loader.go" #:opts %auto-compilation-options) (match (primitive-fork) @@ -392,7 +400,7 @@ the Linux kernel.") (sleep 2) (reboot)) (begin - (display "no init file passed via '--exec'\n") + (display "no init file passed via '--load'\n") (display "entering a warm and cozy REPL\n") ((@ (system repl repl) start-repl)))))) #:name "qemu-system-initrd" -- cgit v1.2.3 lass='msg-avail'>...Ludovic Courtès 2020-03-05hydra: Remove uses of _IOLBF....Ludovic Courtès 2019-12-01ci: Make sure the Guix checkout is the one providing Cuirass proc....Clément Lassieur 2019-01-06hydra: Compute jobs in an inferior....Ludovic Courtès 2019-01-06hydra: evaluate: Add the checkout to the store....Ludovic Courtès 2019-01-06hydra: Move job definitions to (gnu ci)....Ludovic Courtès 2018-12-29hydra: Use short timeouts for the QEMU jobs and system tests....Ludovic Courtès 2018-12-09hydra: Increase image sizes for USB image and Flash image....Danny Milosavljevic 2018-09-14hydra: Remove useless 'parameterize'....Clément Lassieur 2018-09-13hydra: Add support for manifests....Clément Lassieur 2018-06-15hydra: Make sure we add an absolute file name to the load path....Ludovic Courtès 2018-06-10hydra: guix-modular: Build the full Guix....Ludovic Courtès 2018-05-12hydra: Switch back to "-" instead of "@" in package job names....Ludovic Courtès 2018-04-09hydra: Fix uses of 'eval-when'....Ludovic Courtès 2018-04-08hydra: guix-modular: Honor the 'systems' argument....Ludovic Courtès 2018-04-08hydra: guix-modular: Explicitly build for the latest 2.2....Ludovic Courtès 2018-04-08hydra: Clear '%load-compiled-path' for gnu-system.scm....Ludovic Courtès 2018-04-08hydra: 'guix-modular' jobs use the new 'build-self'....Ludovic Courtès 2018-04-08cuirass: Add job specs for the modular Guix....Ludovic Courtès 2018-02-01Merge branch 'master' into core-updatesMarius Bakke 2018-01-29hydra: Fix up arm qemu job....Danny Milosavljevic 2018-01-29hydra: Only build the "flash image" on arm....Danny Milosavljevic 2018-01-29hydra: Work around import problem....Danny Milosavljevic 2018-01-29hydra: Add (gnu bootloader) import....Danny Milosavljevic 2018-01-29hydra: Add arm image builder....Danny Milosavljevic 2018-01-21hydra: Make the list of target systems a parameter....Ludovic Courtès 2017-12-29hydra: Do not cross-build from non-Intel platforms....Ludovic Courtès 2017-12-13hydra: Pre-load the compiler....Ludovic Courtès 2017-12-13hydra: Invalidate derivation caches after each architecture evaluation....Ludovic Courtès 2017-11-21hydra: Add jobs for the modular Guix....Ludovic Courtès 2017-11-21hydra: 'evaluate' passes an alist to the entry point....Ludovic Courtès 2017-11-07hydra: Add jobs for all of '%final-inputs'....Ludovic Courtès 2017-11-07hydra: Build hidden packages....Ludovic Courtès 2017-11-07hydra: Factorize package list creation....Ludovic Courtès 2017-09-28cuirass: Add 'cuirass-jobs.scm' target to compute the Cuirass jobs....Jan Nieuwenhuizen 2017-09-27cuirass: Support subset with list of package[@version]....Jan Nieuwenhuizen 2017-09-27cuirass: Add gnu-system build spec....Jan Nieuwenhuizen 2017-07-25hydra: Add 'guix.SYSTEM' jobs....Ludovic Courtès 2017-07-25hydra: Simplify 'tarball' job....Ludovic Courtès 2017-07-03build: Add iso9660 system image generator....Danny Milosavljevic 2017-06-15hydra: Don't build non-substitutable packages....Ludovic Courtès