Commit graph

863 commits

Author SHA1 Message Date
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
Oleg Pykhalov
03914b9d8c
examples: Add password for Alice's brother.
* gnu/system/examples/desktop.tmpl (users)[bob]: Add password.
2020-07-29 07:50:23 +03:00
Mathieu Othacehe
675e56221e
file-systems: Add NTFS support.
* gnu/system/uuid.scm (%ntfs-endianness): New macro,
(ntfs-uuid->string): new procedure,
(%ntfs-endianness): new variable,
(string->ntfs-uuid): new exported procedure,
(%uuid-parsers): add NTFS support,
(%uuid-printers): add NTFS support.
* gnu/build/file-systems.scm (%ntfs-endianness): New macro,
(ntfs-superblock?, read-ntfs-superblock, ntfs-superblock-uuid,
check-ntfs-file-system): new procedure,
(%partition-uuid-readers): add NTFS support,
(check-file-system): add NTFS support.
2020-07-26 18:35:10 +02:00
Ludovic Courtès
d51bfe242f
Use 'formatted-message' instead of '&message' where appropriate.
* gnu.scm (%try-use-modules): Use 'formatted-message' instead of
'&message'.
* gnu/machine/digital-ocean.scm (maybe-raise-unsupported-configuration-error):
Likewise.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Likewise.
(machine-check-building-for-appropriate-system): Likewise.
(deploy-managed-host): Likewise.
(maybe-raise-unsupported-configuration-error): Likewise.
* gnu/packages.scm (search-patch): Likewise.
* gnu/services.scm (%service-with-default-value): Likewise.
(files->etc-directory): Likewise.
(fold-services): Likewise.
* gnu/system.scm (locale-name->definition*): Likewise.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Likewise.
(check-luks-device): Likewise.
* guix/channels.scm (latest-channel-instance): Likewise.
* guix/cve.scm (json->cve-items): Likewise.
* guix/git-authenticate.scm (commit-signing-key): Likewise.
(commit-authorized-keys): Likewise.
(authenticate-commit): Likewise.
(verify-introductory-commit): Likewise.
* guix/remote.scm (remote-pipe-for-gexp): Likewise.
* guix/scripts/graph.scm (assert-package): Likewise.
* guix/scripts/offload.scm (private-key-from-file*): Likewise.
* guix/ssh.scm (authenticate-server*): Likewise.
(open-ssh-session): Likewise.
(remote-inferior): Likewise.
* guix/ui.scm (matching-generations): Likewise.
* guix/upstream.scm (package-update): Likewise.
* tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"):
Catch 'formatted-message?'.
("authenticate-channel, wrong first commit signer"): Likewise.
* tests/lint.scm ("patches: not found"): Adjust message string.
* tests/packages.scm ("patch not found yields a run-time error"): Catch
'formatted-message?'.
* guix/lint.scm (check-patch-file-names): Handle 'formatted-message?'.
(check-derivation): Ditto.
2020-07-25 19:11:37 +02:00
Ludovic Courtès
7a0bf3d533
file-systems: Convey hint via '&fix-hint'.
* gnu/system/file-systems.scm (btrfs-store-subvolume-file-name): Use
'&fix-hint' for the hint.
2020-07-25 19:11:36 +02:00
Ludovic Courtès
f9a8dd053c
utils: Move '&fix-hint' to (guix diagnostics).
* guix/utils.scm (&fix-hint): Move to...
* guix/diagnostics.scm (&fix-hint): ... here.
* gnu.scm: Adjust imports accordingly.
* gnu/system/mapped-devices.scm: Likewise.
* guix/channels.scm: Likewise.
* guix/profiles.scm: Likewise.
* guix/scripts/system/reconfigure.scm: Likewise.
* guix/ssh.scm: Likewise.
2020-07-25 19:11:36 +02:00
Marius Bakke
1abf205d11
Revert "vm: Use virtio network driver."
This allows users to specify network interface settings with 'guix system vm'
without having to create a new NIC.  Fixes <https://bugs.gnu.org/42252>.
Reported by Christopher Lemmer Webber <cwebber@dustycloud.org>.

This reverts commit 5379392731.
2020-07-11 23:36:31 +02:00
Jan (janneke) Nieuwenhuizen
4b9eecd322
image: Do not set journal_model=WAL for the Hurd.
This fixes <https://bugs.gnu.org/42151>.

* gnu/system/images/hurd.scm (hurd-initialize-root-partition): Use #:wal-mode #f
in call to ...
* gnu/build/image.scm (initialize-root-partition): ... this, add #:wal-mode?
parameter, pass it to ...
(register-closure): ... this, add #:wal-mode? parameter, pass it to ...
* guix/store/database.scm (with-database): ... this, add #:wal-mode?
parameter, pass it to ...
(call-with-database): ... this, add #:wal-mode? parameter; when
set to #f, do not set journal_model=WAL.
2020-07-11 16:34:01 +02:00
Jan (janneke) Nieuwenhuizen
5164d7fd26
system: hurd: Oops, have 'initrd' default to #f.
* gnu/system/hurd.scm (%hurd-default-operating-system)[initrd]: Oops, set to #f.
2020-06-30 18:26:47 +02:00
Mathieu Othacehe
f27bec107e
system: image: Fix disk-image name.
This is a follow-up of 5980ec8ada.

* gnu/system/image.scm (system-disk-image): When using the image name, convert
it to string first.
2020-06-26 10:05:58 +02:00
Mathieu Othacehe
5980ec8ada
system: image: Use the image name as the disk-image derivation name.
* gnu/system/image.scm (system-disk-image): Use the image name as disk-image
derivation name, if defined. Otherwise use the generic "disk-image" name.
2020-06-26 09:38:16 +02:00
Jan (janneke) Nieuwenhuizen
2463a78d17
image: hurd: Initialize root partition for the Hurd.
This is a follow-up to commit b904b59ce5.

* gnu/system/image.scm (hurd-initialize-root-partition): Move to ...
* gnu/system/images/hurd.scm (hurd-initialize-root-partition): ... here.
(hurd-disk-image): Use it.
2020-06-25 22:52:12 +02:00
Jan (janneke) Nieuwenhuizen
fd932862ac
image: hurd: Create hurd-compatible ext2 file-system.
This is a follow-up to commit b904b59ce5.

* gnu/system/images/hurd.scm (hurd-disk-image): Add file-system-options to
create an ext2 file-system that is compatible with the Hurd.
2020-06-25 22:52:09 +02:00
Ludovic Courtès
db170ee921
services: Add missing (ice-9 format) import.
These issues were reported by -Wformat, though they were harmless in
practice because importing (ice-9 format) changes the global 'format'
binding currently.

* gnu/services/nix.scm: Import (ice-9 format).
* gnu/services/web.scm: Likewise.
* gnu/system/mapped-devices.scm: Likewise.
2020-06-25 01:20:31 +02:00
Mathieu Othacehe
f56144e18a
system: image: Enable compression on ISO9660 images.
ISO9660 image compression was temporarily disabled to speed-up tests of the
new image API. Enable it again.

* gnu/system/image.scm (iso9660-image)[compression]: Enable it.
2020-06-24 20:50:42 +02:00
Mathieu Othacehe
b904b59ce5
image: Move hurd image definition to a dedicated file.
This moves hurd-disk-image to a dedicated file. It also defines a default
operating-system so that the image can be built standalone.

* gnu/system/images/hurd.scm: New file,
* gnu/local.mk (GNU_SYSTEM_MODULES): add it,
* gnu/system/image.scm (root-offset, root-label): Export it,
(hurd-disk-image): remove it as this is now defined in the new, Hurd dedicated
file above,
(find-image): adapt to avoid loop dependency.
2020-06-24 20:24:34 +02:00
Mathieu Othacehe
fd45ecb571
system: image: Remove fakeroot dependencies.
Since c29bb909d2, fakeroot "sed" and "coreutils"
dependencies are now explicit.

* gnu/system/image.scm (system-disk-image): Remove "sed" and "coreutils" from
inputs.
2020-06-23 09:51:20 +02:00
Mathieu Othacehe
7f75a7ec08
system: image: Remove "image-root" when building raw disk-images.
The "image-root" derivation output is used as a temporary directory that is
passed to mke2fs and mkdosfs later on. By merging the creation of this
directory and the production of partition images, we can get rid of the
derivation.

As mke2fs and mkdosfs are not able to override file permissions, call those
commands with fakeroot. This way, all the image files will be owned by root,
even if image generation is done in an unprivilegded context.

* gnu/system/image.scm (system-disk-image): Merge "image-root" and
"iso9660-image" derivations so that we spare an extra derivation. Also add
"fakeroot" and its runtime dependencies to the inputs.
* gnu/build/image.scm (make-ext-image, make-vfat-image): Make sure that mke2fs
and mkdosfs are respectively called by fakeroot.
2020-06-22 17:49:19 +02:00
Mathieu Othacehe
1cb9effc3e
system: image: Remove "image-root" derivation when building ISO.
The "image-root" derivation output is used as a temporary directory that is
passed to GNU Xorriso later on. By merging the creation of this directory and
the production of an ISO image, we can get rid of the derivation.

* gnu/system/image.scm (system-iso9660-image): Merge "image-root" and
"iso9660-image" derivations so that we spare an extra derivation.
2020-06-22 17:07:22 +02:00
Maxim Cournoyer
04a4af6dd4
uuid: Prevent a loop on invalid arguments.
* gnu/system/uuid.scm (uuid=?): Use type predicates in the fallback case to
prevent looping on invalid arguments.
2020-06-18 23:24:37 -04:00
Jan (janneke) Nieuwenhuizen
f817a0c095
system: hurd: Add "/bin/sh" and "/usr/bin/env".
* gnu/system/hurd.scm (%base-services/hurd): Add extra-special-files "/bin/sh"
and "/usr/bin/env".
2020-06-18 09:38:53 +02:00
Mathieu Othacehe
c9f6e2e5bd
system: image: Make sure target is set.
* gnu/system/image.scm (system-image): Move "with-parameters" call so that it
encapsulates "operating-system-bootcfg".
2020-06-14 18:03:08 +02:00
Mathieu Othacehe
39b63d06e1
system: image: Remove left-over.
* gnu/system/image.scm: Remove a left-over since maybe-with-target procedure
was removed.
2020-06-14 17:57:30 +02:00
Mathieu Othacehe
4a04d49c2e
image: Remove 'maybe-with-target'.
* gnu/system/image.scm (maybe-with-target): Remove,
(system-image): adapt accordingly.
2020-06-13 16:58:57 +02:00
Mathieu Othacehe
f292d4719d
image: Add 'target' support.
* gnu/image.scm (<image>)[target]: New field,
(image-target): new public method.
* gnu/system/image.scm (hurd-disk-image): Set "i586-pc-gnu" as image 'target'
field,
(maybe-with-target): new procedure,
(system-image): honor image 'target' field using the above procedure.
2020-06-13 15:20:52 +02:00
Jan (janneke) Nieuwenhuizen
7ca533c723
image: Make 'find-image' non-monadic.
* gnu/system/image.scm (find-image): Make non-monadic.  Add 'target'
parameter.
* gnu/tests/install.scm (run-install): Update caller,
passing (%current-target-system).
* guix/scripts/system.scm (perform-action): Likewise.
2020-06-13 15:03:55 +02:00
Jan (janneke) Nieuwenhuizen
60fdd9e389
system: hurd: Remove 'cross-hurd-image' hack.
The initial

    guix build -f gnu/system/hurd.scm

hack has been superseded by regular guix system (cross) build.

* gnu/system/hurd.scm (compile-manifest, cross-hurd-image): Remove.
2020-06-13 09:11:47 +02:00
Jan (janneke) Nieuwenhuizen
edbc067138
system: bare-hurd.tmpl: Add openssh-sans-x client and service.
* gnu/system/examples/bare-hurd.tmpl (%hurd-os)[packages]: Add openssh-sans-x.
[services]: Add openssh-service.  Add example usage.
2020-06-13 09:11:47 +02:00
Mathieu Othacehe
fd1e885236
system: image: Do not produce an HFS tree when building an ISO.
Use "mbr_only" mode to make sure that no HFS+ tree are generated.

* gnu/system/image.scm (system-image): Set MKRESCUE_SED_MODE to "mbr_only".
2020-06-12 17:21:18 +02:00
Royce Strange
23567138f8
system: vm: Add missing imported module.
* gnu/system/vm.scm (qemu-image): Import missing (gnu build hurd-boot) module.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2020-06-09 01:31:16 -04:00
Jan (janneke) Nieuwenhuizen
b37c544196
hurd-boot: Further cleanup of "rc".
* gnu/packages/hurd.scm (hurd-rc-script): Move implementation to ...
* gnu/build/hurd-boot.scm (boot-hurd-system): ...here, new file.
* gnu/build/linux-boot.scm (make-hurd-device-nodes): Move there likewise.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
2020-06-08 14:26:14 +02:00
Jan (janneke) Nieuwenhuizen
11e4200fee
system: hurd: Populate services.
* gnu/system/hurd.scm (%base-services/hurd): Add hurd-console-service,
hurd-getty-services, guix-service.  Also add sylog and loopback, needed for
...
* gnu/system.scm (hurd-default-essential-services): ... add
%shepherd-root-service with dependencies: %boot-service, %activation-service,
user-processes, root-file-system-service, file-system-service,
pam-root-service.
2020-06-08 14:26:14 +02:00
Jan (janneke) Nieuwenhuizen
59bcffa314
system: examples: Add bare-hurd.tmpl.
* gnu/system/hurd.scm (%hurd-def%hurd-default-operating-system-kernel,
%hurd-default-operating-system): New exported variables.
* gnu/system/examples/bare-hurd.tmpl: New file.
* Makefile.am (EXAMPLES): Add it.
* tests/guix-system.sh: Add --target=i586-pc-gnu when testing it.
2020-06-08 13:51:19 +02:00
Mathieu Othacehe
c77b92859f
image: Add Hurd support.
* gnu/system/image.scm (hurd-disk-image): New exported variable,
(root-offset, root-label): new variables,
(esp-partition, root-partition): adapt accordingly,
(find-image): add Hurd support.
2020-06-08 13:51:18 +02:00
Mathieu Othacehe
0dddaa7b01
system: bare-bones: Remove dependency to X libraries.
Use "openssh-sans-x" to prevent the inclusion of X libraries to the bare-bones
system closure.

* gnu/system/examples/bare-bones.tmpl (operating-system)[services]: Use
openssh-sans-x instead of openssh.
2020-06-08 11:03:11 +02:00
Mathieu Othacehe
ea5d9bf991
system: install: Add default libcs to gc-roots.
During the installation, it may be needed to build locales that are not
covered by glibc-utf8-locales. Make sure that the libraries required to build
locales are available.

This is a follow-up of 0eed771275.

* gnu/system/install.scm (installation-os)[services]: Add
%default-locale-libcs to gc-root-service-type.
2020-06-08 10:52:53 +02:00
Ludovic Courtès
e768e4e97f
vm: Shared-store script runs the native QEMU and Bash.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Use #+ for
QEMU and BASH.
2020-06-06 23:28:49 +02:00
Ludovic Courtès
60f759f06d
vm: <virtual-machine> compiler honors system and target.
* gnu/system/vm.scm (system-qemu-image/shared-store): Add #:system
and #:target.  Pass it down.
(system-qemu-image/shared-store-script): Likewise.
(virtual-machine-compiler): Likewise.
2020-06-06 23:28:49 +02:00