Commit graph

900 commits

Author SHA1 Message Date
Ludovic Courtès 6a060ff27f
store-copy: 'populate-store' can optionally deduplicate files.
Until now deduplication was performed as an additional pass after
copying files, which involve re-traversing all the files that had just
been copied.

* guix/store/deduplication.scm (copy-file/deduplicate): New procedure.
* tests/store-deduplication.scm ("copy-file/deduplicate"): New test.
* guix/build/store-copy.scm (populate-store): Add #:deduplicate?
parameter and honor it.
* tests/gexp.scm ("gexp->derivation, store copy"): Pass #:deduplicate? #f
to 'populate-store'.
* gnu/build/image.scm (initialize-root-partition): Pass #:deduplicate?
to 'populate-store'.  Pass #:deduplicate? #f to 'register-closure'.
* gnu/build/vm.scm (root-partition-initializer): Likewise.
* gnu/build/install.scm (populate-single-profile-directory): Pass
 #:deduplicate? #f to 'populate-store'.
* gnu/build/linux-initrd.scm (build-initrd): Likewise.
* guix/scripts/pack.scm (self-contained-tarball)[import-module?]: New
procedure.
[build]: Pass it as an argument to 'source-module-closure'.
* guix/scripts/pack.scm (squashfs-image)[build]: Wrap in
'with-extensions'.
* gnu/system/linux-initrd.scm (expression->initrd)[import-module?]: New
procedure.
[builder]: Pass it to 'source-module-closure'.
* gnu/system/install.scm (cow-store-service-type)[import-module?]: New
procedure.  Pass it to 'source-module-closure'.
2020-12-15 17:32:10 +01:00
Mathieu Othacehe 8361817bf6
install: Discover local substitute servers.
* gnu/installer/substitutes.scm: New file.
* gnu/installer/newt/substitutes.scm: New file.
* gnu/local.mk (INSTALLER_MODULES): Add them.
* po/guix/POTFILES.in: Add gnu/installer/newt/substitutes.scm.
* gnu/installer/proxy.scm (with-silent-shepherd): Move to ...
* gnu/installer/utils.scm: ... here.
* gnu/installer/record.scm (<installer>)[substitutes-page]: New field.
* gnu/installer/newt.scm (substitutes-page): New procedure,
(newt-installer): register it.
* gnu/installer.scm (installer-steps): Add "substitutes-page" step.
* gnu/system/install.scm (%installation-services): Add avahi-service-type and
enable substitute server discover in guix-service-type.
[<name-service-switch>]: Set it to %mdns-host-lookup-nss.
2020-12-11 21:37:07 +01:00
Tobias Geerinckx-Rice 10defc57bf
linux-initrd: Add bcachefs support.
* gnu/system/linux-initrd.scm (file-system-packages): Add
bcachefs-tools/static.
(file-system-type-modules): Add an entry for the "bcachefs" type and
module.
2020-12-06 16:11:43 +01:00
Danny Milosavljevic 005609c171
images: novena: Make boot settings and RTC accessible.
* gnu/system/images/novena.scm (novena-barebones-os)[initrd-modules]: Add
i2c-dev.
2020-12-05 11:19:17 +01:00
Mathieu Othacehe 83de7ee662
image: Fix ISO image production.
This is a follow-up of 41f27bf870.

* gnu/system/image.scm (operating-system-for-image): Force "volatile-root?" to
true when producing ISO images.
2020-12-04 14:06:49 +01:00
Danny Milosavljevic 295aa49ec9
images: novena: Replace agetty-service by term-auto.
* gnu/system/images/novena.scm (novena-barebones-os)[kernel-arguments]: New
field.
[services]: Remove field.
2020-12-03 12:24:36 +01:00
Danny Milosavljevic 9cf531f577
images: Add novena-image-type, novena-barebones-raw-image, novena-barebones-os.
* gnu/system/images/novena.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
2020-12-03 12:11:00 +01:00
Mikhail Tsykalov a9a2fdaabc
mapped-devices: Add 'lvm-device-mapping'.
* gnu/system/mapped-devices.scm (lvm-device-mapping, open-lvm-device,
close-lvm-device): New variables.

* gnu/tests/install.scm (%lvm-separate-home-os,
%lvm-separate-home-os-source, %lvm-separate-home-installation-script,
%test-lvm-separate-home-os): New variables.

* gnu/system/linux-initrd.scm (raw-initrd): Add (srfi srfi-1) to initrd expression.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-11-26 00:05:39 +01:00
Mikhail Tsykalov 788df2ecd6
mapped-devices: Allow target to be list of strings.
* gnu/system/mapped-devices.scm (<mapped-device>): Rename constructor to
%mapped-device.
[target]: Remove field.
[targets]: New field. Adjust users.
(mapped-device-compatibility-helper, mapped-device): New macros.
(mapped-device-target): New deprecated procedure.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-11-26 00:05:39 +01:00
Mathieu Othacehe 17d9a91e6b
image: Add pinebook-pro support.
* gnu/system/images/pinebook-pro.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/ci.scm (%guix-system-images): Add pinebook-pro-barebones-raw-image.
2020-11-20 17:00:27 +01:00
Maxim Cournoyer 19d4693939
system: vm: Remove unused system-disk-image-in-vm.
* gnu/system/vm.scm (system-disk-image-in-vm): Remove.

Reported-by: Ludovic Courtès <ludo@gnu.org>
2020-11-17 15:20:03 -05:00
Maxim Cournoyer 1ec366cdfd
image: Remove conflicting user-provided EFI file system.
When the image type is "raw" or derived from it (such as "qcow2"), an ESP
partition and file system is already added by the image generator.  If a
conflicting user-provided EFI file system is provided, it causes the boot to
fail, as happens for the lightweight-desktop.tmpl and desktop.tmpl templates
under gnu/system/examples.

* gnu/system/image.scm (operating-system-for-image): Remove file systems whose
mount point is "/boot/efi".
2020-11-17 15:20:02 -05:00
Ludovic Courtès 07914def98
Merge branch 'version-1.2.0' 2020-11-12 10:47:25 +01:00
Ludovic Courtès 000e7a0abc
vm: expression->derivation-in-linux-vm: Run in a UTF-8 locale.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add calls to
'setenv' and 'setlocale'.
2020-11-10 21:49:15 +01:00
Ludovic Courtès 7a20c1676a
vm: 'system-qemu-image' forces the use of i386/BIOS GRUB.
Fixes <https://bugs.gnu.org/44511>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* gnu/system/vm.scm (system-qemu-image): Add 'bootloader' field to OS.
2020-11-10 12:20:09 +01:00
Ludovic Courtès 4e9ded6d27
image: Offload "disk-image" derivations.
This is a followup to 99efa804bd.

* gnu/system/image.scm (system-disk-image): Pass #:local-build? #f to
'computed-file'.
2020-11-08 16:58:30 +01:00
Ludovic Courtès f9926c071f
image: Offload "disk-image" derivations.
This is a followup to 99efa804bd.

* gnu/system/image.scm (system-disk-image): Pass #:local-build? #f to
'computed-file'.
2020-11-08 14:28:32 +01:00
Tobias Geerinckx-Rice e87471dc51
uuid: Add support for bcachefs.
* gnu/system/uuid.scm (string->bcachefs-uuid): New exported procedure.
(%uuid-parsers, %uuid-printers): Add the ‘bcachefs’ file system type.
2020-11-07 13:40:46 +01:00
raingloom fe1cd098d2
services: Add yggdrasil-service-type.
* gnu/services/networking.scm (yggdrasil-configuration)
(yggdrasil-configuration?, yggdrasil-configuration-package)
(yggdrasil-configuration-auto-conf, yggdrasil-configuration-log-level)
(yggdrasil-configuration-log-to): New procedures.
(yggdrasil-service-type): New variable.
* doc/guix.texi: Document it.
* gnu/system/examples/yggdrasil.tmpl: Provide example.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2020-11-05 18:45:40 +01:00
Ludovic Courtès 341f67991d
vm: system-qemu-image: Fix type error, remove more actual file systems.
* gnu/system/vm.scm (system-qemu-image)[file-systems-to-keep]: Check
whether SOURCE is a string before calling 'string-prefix?'.  Remove
UUIDs and file system labels as well.
2020-11-05 00:07:45 +01:00
Ludovic Courtès 99efa804bd
image: Allow offloading of "partition.img" and "image.iso" builds.
This builds are extremely I/O-intensive so they'd rather not run on the
head node of the build farm.

* gnu/system/image.scm (system-disk-image, system-iso9660-image): Pass
  #:local-build? #f.
2020-11-03 23:47:14 +01:00
Mathieu Othacehe c045801117
system: image: Introduce arm32-raw image type.
* gnu/system/image.scm (arm32-disk-image, arm32-image-type): New variables.
(arm64-disk-image): Inherit from arm32-disk-image.
(arm64-image-type): Change name to 'arm64-raw.
2020-11-02 17:17:52 +01:00
Efraim Flashner 4170af491c
install: Deduplicate packages with %base-package sets.
* gnu/system.scm (%base-packages-interactive): Add nvi.
* gnu/system/install.scm (installation-os)[packages]: Remove parted,
gptfdisk, ddrescue, cryptsetup, mdadm, dosfstools, btrfs-progs,
f2fs-tools, jfstools, openssh, wireless-tools, iw,
wpa-supplicant-minimal, iproute, bash-completion, nvi. Add
%base-packages-disk-utilities.
2020-10-15 11:13:24 +03:00
Ludovic Courtès 281869e6f8
image: Use 'raise' from (srfi srfi-34).
* gnu/system/image.scm: Use (srfi srfi-34) for 'raise'.
(lookup-image-type-by-name): Remove extra newline in 'formatted-message'
string.
2020-10-14 15:22:55 +02:00
Jan (janneke) Nieuwenhuizen 1197b8b20f
installer: Add Emacs EXWM desktop environment.
Suggested by zenny via IRC.

* gnu/installer/services.scm (%system-services): Add emacs, emacs-exwm,
emacs-desktop-environment.
* etc/release-manifest.scm (%system-packages): Likewise.
* gnu/system/examples/lightweight-desktop.tmpl: Likewise.
* gnu/tests/install.scm (installation-target-desktop-os-for-gui-tests)
[packages]: Likewise
* gnu/installer/newt/services.scm (run-desktop-environments-cbt-page): Make
one entry taller.
2020-10-13 21:17:40 +02:00
Florian Pelz 34d436a408
Revert "Revert "install: Pass "modprobe.blacklist=radeon".""
This reverts commit 73ddcab607.
Blacklisting has become necessary again on my AMD machines, else
the installer screen stays black.
2020-10-11 06:57:17 +00:00
Jan (janneke) Nieuwenhuizen d56d79b176
system: hurd: Add diffutils, patch, gawk, tar, gzip, bzip2, xz, and lzip.
* gnu/system/hurd.scm (%base-packages/hurd): Add diffutils, patch, gawk, tar, gzip,
bzip2, xz, and lzip.
2020-10-09 23:25:34 +02:00
Jan (janneke) Nieuwenhuizen 1103f87805
system: hurd: Include 'guile-3.0-latest' in '%base-packages/hurd'.
* gnu/system/hurd.scm (%base-packages/hurd): Change GUILE-3.0 to
GUILE-3.0-LATEST.
2020-10-09 23:25:33 +02:00
Jan (janneke) Nieuwenhuizen 16f8ea064c
system: hurd: Add PAM support with shadow and sudo.
* gnu/system.scm (hurd-default-essential-services): Add
setuid-program-service-type.
* gnu/system/hurd.scm (%base-packages/hurd): Add shadow, sudo.
(%setuid-programs/hurd): New variable.
(%hurd-default-operating-system)[setuid-program]: Use it.
[pam-services, sudoers-file]: Remove overrides; enabling regular defaults.
* gnu/system/examples/bare-hurd.tmpl (%hurd-os)[users]: New field.
[services]: Do not disable PAM in SSH.
2020-10-09 23:25:33 +02:00
Mathieu Othacehe 8a4f1eef98
images: Add pine64-barebones-raw-image.
* gnu/system/images/pine64.scm (pine64-barebones-raw-image): New variable.
* gnu/ci.scm (%guix-system-images): Add it.
2020-10-06 09:51:43 +02:00
Mathieu Othacehe 599954c137
images: Add pine64 support.
* gnu/system/images/pine64.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/system/image.scm (arm64-disk-image, arm64-image-type): New variables.
2020-10-05 11:16:47 +02:00
Mathieu Othacehe b97b423e3f
bootloader: Fix u-boot installation.
This is a follow-up of f19cf27c2b. The
bootloader installation must be done on the final disk-image, hence using
"disk-image-installer" instead of "installer" callback.

* gnu/bootloader/u-boot.scm: Turn all installer callbacks into
disk-image-installer callbacks.
* gnu/build/bootloader.scm (write-file-on-device): Open the output file with
'no-truncate and 'no-create options.
* gnu/system/image.scm (with-imported-modules*): Add (gnu build bootloader)
module.
2020-10-05 11:10:35 +02:00
Mathieu Othacehe 23ad7e92b1
system: image: Add qcow2 image type.
* gnu/system/image.scm (qcow2-image-type): New variable.
2020-10-02 14:54:26 +02:00
Jason Conroy 5627bfe45c
Instantiate nscd in each system container.
* gnu/system/linux-container.scm (%nscd-container-caches): New variable.
(containerized-operating-system): Instantiate nscd-service with smaller caches
and add it to the generated operating-system, replacing any nscd-service
specified by the caller.
* gnu/system/file-systems.scm: (%network-file-mappings): Remove "/var/run/nscd".

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2020-10-01 09:27:33 +02:00
Mathieu Othacehe 10b135cef5
system: image: Add image-type support.
* gnu/system/image.scm (image-with-os): New macro. Rename the old
"image-with-os" procedure to ...
(image-with-os*): ... this new procedure,
(system-image): adapt according,
(raw-image-type, iso-image-type, uncompressed-iso-image-type
%image-types): new variables,
(lookup-image-type-by-name): new procedure.
(find-image): remove it.
* gnu/system/images/hurd.scm (hurd-image-type): New variable,
use it to define ...
(hurd-disk-image): ... this variable, using "os->image" procedure.
* gnu/tests/install.scm (run-install): Rename
installation-disk-image-file-system-type parameter to installation-image-type,
use os->config instead of find-image to compute the image passed to system-image,
(%test-iso-image-installer) adapt accordingly,
(guided-installation-test): ditto.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2020-09-30 10:47:59 +02:00
Mathieu Othacehe 644cdc819f
images: hurd: Add hurd-barebones-qcow2-image.
* gnu/system/images/hurd.scm (hurd-barebones-qcow2-image): New variable.
2020-09-29 11:42:52 +02:00
Mathieu Othacehe f441e3e8b5
image: Add support for compressed-qcow2 format.
* gnu/build/image.scm (convert-disk-image): New procedure.
(genimage): Remove target argument.
* gnu/system/image.scm (system-disk-image): Add support for 'compressed-qcow2
image format. Call "convert-disk-image" to apply image conversions on the
final image. Add "qemu-minimal" to the build inputs.
(system-image): Also add support for 'compressed-qcow2.
2020-09-29 11:42:52 +02:00
Mathieu Othacehe 0996fcc657
system: image: Rename ISO9660 files.
* gnu/system/image.scm (system-iso9660-image): Change the default file output
name to "image.iso".
2020-09-19 14:24:59 +02:00
Mathieu Othacehe 22827396ba
install: Factorize cow-store procedure.
Move the cow-store procedure from the service declaration in (gnu system
install) to (gnu build install), so that it can be called from within a
different context than Shepherd.

* gnu/build/install.scm (mount-cow-store, unmount-cow-store): New procedures.
* gnu/system/install.scm (make-cow-store): Remove it,
(cow-store-service-type): adapt it accordingly.
2020-09-02 17:05:22 +02:00
Maxim Cournoyer 6d6e74ea98
Revert "system: image: Do not offload image files."
This reverts commit 6a9581741e, which is
obsoleted by the previous commit.
2020-09-01 00:48:59 -04:00
Julien Lepiller 036f23f053
guix: system: Add `--label' option.
* guix/scripts/system.scm (%options): Add `--label'.
(system-derivation-for-action): Take a #:label key to set volume ID.
(perform-action): Take a #:label key.
(%default-options): Add default label value.
(process-action): Pass label value from command-line to perform-action.
* gnu/system/image.scm (image-with-label): New procedure.
2020-08-31 16:12:16 +02:00
Ludovic Courtès 7eeb78157d
vm: Disable caching for writable file system mappings.
Fixes <https://bugs.gnu.org/43062>.
Reported by elaexuotee@wilsonb.com.

* gnu/system/vm.scm (mapping->file-system)[options]: Disable loose
caching when WRITABLE? is true.
2020-08-31 15:50:35 +02:00
Ludovic Courtès be1c00ae3c
system: Remove extra line from 'lightweight-desktop.tmpl'.
This is a followup to c7af968717.

* gnu/system/examples/lightweight-desktop.tmpl: Remove extra
'use-package-modules' line.
2020-08-28 23:27:53 +02:00
Maxim Cournoyer 6a9581741e
system: image: Do not offload image files.
Image files can be very large (multiple gigabytes), and the process of
generating them is primarily I/O bound. As disk access is typically faster
than network access, it makes sense build them locally.

* gnu/system/image.scm (system-disk-image): Pass the #:local-build? #t
parameter to computed-file calls dealing with generating image files.
(system-iso9660-image): Likewise.
2020-08-26 09:35:57 -04:00
Mathieu Othacehe dac7dd1b0b
Remove "guile-zlib" extension when unused.
This is a follow-up of 755f365b02.

As (zlib) is autoloaded in (gnu build linux-modules), "guile-zlib" is needed
as an extension only when it is effectively used.

* gnu/installer.scm (installer-program): Remove "guile-zlib" from the extensions.
* gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto.
* gnu/services.scm (activation-script): Ditto.
* gnu/services/base.scm (default-serial-port): Ditto,
(agetty-shepherd-service): ditto,
(udev-service-type): ditto.
* gnu/system/image.scm (gcrypt-sqlite3&co): Ditto.
* gnu/system/shadow.scm (account-shepherd-service): Ditto.
2020-08-25 12:39:11 +02:00
Mathieu Othacehe 755f365b02
linux-libre: Support module compression.
This commit adds support for GZIP compression for linux-libre kernel
modules. The initrd modules are kept uncompressed as the initrd is already
compressed as a whole.

The linux-libre kernel also supports XZ compression, but as Guix does not have
any available bindings for now, and the compression time is far more
significant, GZIP seems to be a better option.

* gnu/build/linux-modules.scm (modinfo-section-contents): Use
'call-with-gzip-input-port' to read from a module file using '.gz' extension,
(strip-extension): new procedure,
(dot-ko): adapt to support compression,
(ensure-dot-ko): ditto,
(file-name->module-name): ditto,
(find-module-file): ditto,
(load-linux-module*): ditto,
(module-name->file-name/guess): ditto,
(module-name-lookup): ditto,
(write-module-name-database): ditto,
(write-module-alias-database): ditto,
(write-module-device-database): ditto.
* gnu/installer.scm (installer-program): Add "guile-zlib" to the extensions.
* gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto.
* gnu/services.scm (activation-script): Ditto.
* gnu/services/base.scm (default-serial-port): Ditto,
(agetty-shepherd-service): ditto,
(udev-service-type): ditto.
* gnu/system/image.scm (gcrypt-sqlite3&co): Ditto.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): Add "guile-zlib"
to the extensions and make sure that the initrd only contains
uncompressed module files.
* gnu/system/shadow.scm (account-shepherd-service): Add "guile-zlib" to the
extensions.
* guix/profiles.scm (linux-module-database): Ditto.
2020-08-25 11:53:20 +02:00
Ludovic Courtès 86c926d7f2
file-systems: Leave room for extension in serialized specs.
* gnu/system/file-systems.scm (spec->file-system): Ignore extra fields.
(file-system->spec): Add comment.
2020-08-03 17:44:38 +02:00
Mathieu Othacehe f94835a917
file-system: Add efivarfs support.
Tools such as efibootmgr rely on the deprecated /sys/firmware/efi/vars API as
well as on the new /sys/firmware/efi/efivars API. The latter needs to be
mounted.

Reported by Keyhenge here:
https://lists.gnu.org/archive/html/bug-guix/2020-04/msg00274.html

Here is the efivarfs documentation:
https://www.kernel.org/doc/Documentation/filesystems/efivarfs.txt.

* gnu/system/file-systems.scm (%efivars-file-system): New exported variable,
(%base-file-systems): add it.
* gnu/system/install.scm (%efivars-file-system): Add it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2020-07-31 13:43:36 +02:00
Mathieu Othacehe 7c27bd115b
file-system: Add mount-may-fail? option.
* gnu/system/file-systems.scm (<file-system>): Add a mount-may-fail? field.
(file-system->spec): adapt accordingly,
(spec->file-system): ditto.
* gnu/build/file-systems.scm (mount-file-system): If 'system-error is raised
and mount-may-fail? is true, ignore it. Otherwise, re-raise the exception.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2020-07-31 13:43:20 +02:00
Mathieu Othacehe 6bb07e91e1
file-systems: Add %debug-file-system.
* gnu/system/file-systems.scm (%debug-file-system): New variable,
(%base-file-systems): add it.
2020-07-31 12:58:16 +02:00