* gnu/build/image.scm (initialize-root-partition): Add bootloader-package and
bootloader-installer arguments. Run the bootloader-installer if defined.
* gnu/system/image.scm (system-disk-image): Adapt the partition initializer
call accordingly.
* gnu/build/image.scm (make-ext4-image): Rename to ...
(make-ext-image): ... it, and pass the file-system type to mke2fs,
(make-partition-image): Adapt to call "make-ext-image" if the partition
file-system is prefixed by "ext".
The --root option can now be omitted, and inferred from the root file system
declaration instead.
* gnu/build/file-systems.scm (canonicalize-device-spec): Extend to support NFS
directly, and...
* gnu/build/linux-boot.scm (boot-system): ...remove NFS special casing from
here. Remove nested definitions for root-fs-type, root-fs-flags and
root-fs-options, and bind those inside the let* instead. Make "--root" take
precedence over the device field string representation of the root file
system.
* doc/guix.texi (Initial RAM Disk): Document that "--root" can be left
unspecified.
* gnu/build/vm.scm (install-efi, make-iso9660-image): Remove those procedures
that are now implemented in (gnu build image) module,
(initialize-hard-disk): remove efi support.
* gnu/system/vm.scm (iso9660-image): Remove it,
(qemu-image): adapt it to remove ISO9660 support.
Raw disk-images and ISO9660 images are created in a Qemu virtual machine. This
is quite fragile, very slow, and almost unusable without KVM.
For all these reasons, add support for host image generation. This implies the
use new image generation mechanisms.
- Raw disk images: images of partitions are created using tools such as mke2fs
and mkdosfs depending on the partition file-system type. The partition
images are then assembled into a final image using genimage.
- ISO9660 images: the ISO root directory is populated within the store. GNU
xorriso is then called on that directory, in the exact same way as this is
done in (gnu build vm) module.
Those mechanisms are built upon the new (gnu image) module.
* gnu/image.scm: New file.
* gnu/system/image.scm: New file.
* gnu/build/image: New file.
* gnu/local.mk: Add them.
* gnu/system/vm.scm (system-disk-image): Rename to system-disk-image-in-vm.
* gnu/ci.scm (qemu-jobs): Adapt to new API.
* gnu/tests/install.scm (run-install): Ditto.
* guix/scripts/system.scm (system-derivation-for-action): Ditto.
* gnu/build/bootloader.scm (install-efi): New procedure copied from (gnu build vm).
(install-efi-loader): New exported procedure, wrapping install-efi.
* gnu/build/vm.scm (initialize-hard-disk): Adapt to use install-efi-loader.
There's no need to set the store GID as is will be done by the guix-daemon,
with the following snippet:
if (chown(chrootStoreDir.c_str(), 0, buildUser.getGID()) == -1)
throw SysError(format("cannot change ownership of ‘%1%’") % chrootStoreDir);
* gnu/build/install.scm (directives): Do not set store GID.
Changing ownership may require root permissions. As image can now be generated
without root permissions (no VM involved), ignore those exceptions.
* gnu/build/install.scm (evaluate-populate-directive): Ignore chown
exceptions.
Follow-up to 23b37c3d40.
* gnu/build/file-systems.scm (bytevector-utf16-length): New procedure.
(null-terminated-utf16->string): New procedure.
(f2fs-superblock-volume-name): Use it.
* gnu/build/linux-boot.scm (boot-system) Treat a root option with ":/" as an nfs source
and avoid to call 'canonicalize-device-spec' for it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* gnu/build/vm.scm (root-partition-initializer): Add #:make-device-nodes
parameter and use it.
* gnu/system/vm.scm (qemu-image): Add #:device-node parameter. Pass
#:make-device-nodes to 'root-partition-initializer'.
Previously, when REGISTER-CLOSURES? was false, we'd set all the files
under /dev to #o644, including /dev/null, /dev/zero, etc.
* gnu/build/vm.scm (root-partition-initializer): Call 'reset-timestamps'
separately for /dev, with #:preserve-permissions? #t.
* gnu/build/vm.scm (<partition>)[file-system-options]: New field.
(create-ext-file-system, create-fat-file-system)
(format-partition): Add #:options and honor it.
(initialize-partition): Pass #:options to 'format-partition'.
* gnu/system/vm.scm (qemu-image): Add #:file-system-options and use it
for the root partition.
* gnu/build/vm.scm (root-partition-initializer): Add #:extra-directives
parameter and pass it to 'populate-root-file-system'.
* gnu/system/vm.scm (qemu-image): Add #:extra-directives parameter and
pass it to 'root-partition-initializer'.
Fixes <https://bugs.gnu.org/34276>.
Reported by Tobias Geerinckx-Rice <me@tobias.gr>.
* gnu/system/vm.scm (expression->derivation-in-linux-vm)[loader]:
Produce '/xchg/.exit-status' file upon success.
* gnu/build/vm.scm (load-in-linux-vm): Check for 'xchg/.exit-status'
once QEMU has completed and respond accordingly.
* gnu/build/marionette.scm (%qwerty-us-keystrokes): Use shit-comma and
shift-dot for #\< and #\> because the "less" key doesn't work the same
in "US intl." layouts.
This is a followup to 2073b55e6b.
* gnu/build/cross-toolchain.scm (%gcc-include-paths): Switch back to
'C_INCLUDE_PATH' & co.
* gnu/packages/cross-base.scm (%gcc-include-paths): Likewise.
(cross-gcc-arguments): Remove 'treat-glibc-as-system-header' phase.
(cross-gcc)[native-inputs]: Reorder so that libc comes last.
[search-paths]: Add "include/c++" for 'CROSS_CPLUS_INCLUDE_PATH'.
* guix/build-system/gnu.scm (standard-cross-packages): Have "cross-gcc"
appear both for 'host and 'target.
* gnu/build/activation.scm (activate-modprobe): Check whether
/proc/sys/kernel/modprobe exists before writing to it.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://bugs.gnu.org/38800>.
Reported by Jakub Kądziołka <kuba@kadziolka.net>.
* gnu/build/activation.scm (activate-setuid-programs): Catch
'system-error' around 'make-setuid-program' calls.
* gnu/build/vm.scm (load-in-linux-vm): Move Qemu network configuration from
ARCH-SPECIFIC-FLAGS to the Qemu command line. Use the "-nic" option of Qemu
instead of "-device" and "-net".
* gnu/system/vm.scm (common-qemu-options): Do not add a '-net' command.
(virtual-machine-compiler): Use "-nic user,..." instead of "-net".
* doc/guix.texi (Installing Guix in a VM, Invoking guix system, Running Guix
in a VM): Do the same for examples.
* gnu/build/linux-boot.scm (mount-root-file-system): Add the 'flags' keyword
argument and use it when mounting the root file system.
(boot-system): Pass the root file system flags to 'mount-root-file-system'.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/build/syscalls.scm (MS_LAZYTIME): New variable.
* gnu/build/file-systems.scm (mount-flags->bit-mask): Add match rules for
'strict-atime' and 'lazy-time'.
* doc/guix.texi (File Systems): Add 'strict-atime' and 'lazy-time' to the list
of supported flags.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* gnu/build/vm.scm (load-in-linux-vm): Add target-arm64? argument and use it
to pass correct arguments to qemu.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass the new
target-arm64? argument added above. Do not add ESP partition on all ARM
targets. Do not pass grub-efi package to initialize-hard-disk on ARM targets.
Fixes <https://bugs.gnu.org/37977>.
* gnu/build/linux-boot.scm (mount-root-file-system): Add the 'options'
keyword argument and use it when mounting the root file system.
(boot-system): Pass the root file system options to
'mount-root-file-system'.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* gnu/build/file-systems.scm (mount-file-system): Clean the documentation from
the no longer existing parameters (these are now encapsulated within a
<file-system> record).