Commit graph

756 commits

Author SHA1 Message Date
Mathieu Othacehe 77f5296236
vm: Remove obsolete procedures.
* 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.
2020-05-05 16:13:55 +02:00
Mathieu Othacehe f19cf27c2b
image: Add a new API.
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.
2020-05-05 16:13:53 +02:00
Mathieu Othacehe 78fbf2bd70
system: vm: Move operating-system-uuid.
* gnu/system/vm.scm (operating-system-uuid): Move to ...
* gnu/system.scm: ... here.
2020-05-05 16:08:32 +02:00
Danny Milosavljevic 33eab4a10d
linux-initrd: Provide fsck for F2FS.
* gnu/system/linux-initrd.scm (file-system-packages): Add F2FS fsck.
2020-05-03 23:04:59 +02:00
Danny Milosavljevic f8a0065ae3
install: Add f2fs-tools to the installation image.
* gnu/system/install.scm (installation-os)[packages]: Add f2fs-tools.
2020-05-03 20:35:50 +02:00
raingloom 27efeef306
linux-initrd: Add initial support for F2FS.
* gnu/system/linux-initrd.scm (file-system-type-modules): Add f2fs module.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2020-05-02 10:54:39 +02:00
Florian Pelz 73ddcab607
Revert "install: Pass "modprobe.blacklist=radeon"."
This reverts commit 7859191210, which is no longer
needed since uvesafb was added in 557e6820a7.
2020-05-01 08:26:07 +00:00
Jakub Kądziołka 2ef4d273d1
file-systems: mount the PID cgroup filesystem.
* gnu/system/file-systems.scm (%control-groups): Add "pids".
* gnu/services/docker.scm (docker-shepherd-service): Resolve a TODO.

This has allowed me to make a specific configuration of nsjail work.
2020-04-27 14:14:47 +02:00
Ludovic Courtès 0e5c2d5e14
services: system: Initial entries are non-monadic.
* gnu/system.scm (operating-system-directory-base-entries): Return a
regular, non-monadic value.
* gnu/services.scm (system-derivation): Adjust accordingly.
* gnu/system/linux-container.scm (container-essential-services): Likewise.
2020-04-26 22:49:49 +02:00
Marius Bakke 796b387bc2
vm: Remove unused import.
* gnu/system/vm.scm: Do not import (gnu packages make-bootstrap).
2020-04-26 11:27:06 +02:00
Florian Pelz 80dbad1814
installer: Rename uvesafb shepherd service to maybe-uvesafb.
Because the installer's uvesafb service loads uvesafb only on some machines.

This is a follow-up to commit 0ad60b2a89.

* gnu/system/install.scm (uvesafb-shepherd-service): Adjust provision and
description fields.
2020-04-20 19:24:21 +00:00
Ludovic Courtès 1e7281108b
services: account: Have 'user-processes' depend on 'user-homes'.
Until now, 'user-homes' happened to start right after 'user-processes'
and before services that depend on a home directory but the dependency
was not explicit.  This addresses it.

* gnu/system/shadow.scm (account-service-type): Extend
USER-PROCESSES-SERVICE-TYPE.
2020-04-17 23:18:32 +02:00
Ludovic Courtès b4440de133
Merge branch 'version-1.1.0' 2020-04-15 16:09:18 +02:00
Florian Pelz 0ad60b2a89
installer: Only load uvesafb kernel module when needed.
This is a follow-up to commit 557e6820a7.

* gnu/system/install.scm (uvesafb-shepherd-service): Check
that /dev/fb0 is not already present.
2020-04-14 13:05:57 +00:00
Florian Pelz 557e6820a7
installer: Load uvesafb kernel module.
Fixes <https://bugs.gnu.org/40538>.

Machines without Kernel Mode Setting (those with many old and current AMD
GPUs, SiS GPUs, …) need uvesafb to show the GUI installer.  Some may also need
a kernel parameter like nomodeset or vga=793, but we leave that for the user
to specify in GRUB.

* gnu/system/install.scm (uvesafb-shepherd-service): New procedure.
(uvesafb-service-type): New variable.
(%installation-services): Add it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-04-11 22:59:35 +02:00
Marius Bakke 5379392731
vm: Use virtio network driver.
This fixes a regression introduced in 8e53fe2b91
where 'guix system vm' would no longer be using virtio.

* gnu/system/vm.scm (common-qemu-options): Add "-nic user,model=virtio-net-pci".
2020-04-10 20:20:11 +02:00
Ludovic Courtès 74f01059cb
vm: 'system-disk-image' honors #:substitutable? for ISO9660 images.
This is a followup to a328f66a9e.

* gnu/system/vm.scm (iso9660-image): Add #:substitutable? and pass it to
'expression->derivation-in-linux-vm'.
(system-disk-image): Pass #:substitutable? to 'iso9660-image'.
2020-04-10 16:06:23 +02:00
Ludovic Courtès 76026b5f51
vm: 'system-disk-image' honors #:substitutable? for ISO9660 images.
This is a followup to a328f66a9e.

* gnu/system/vm.scm (iso9660-image): Add #:substitutable? and pass it to
'expression->derivation-in-linux-vm'.
(system-disk-image): Pass #:substitutable? to 'iso9660-image'.
2020-04-10 16:02:51 +02:00
Ludovic Courtès a328f66a9e
vm: Allow images to be marked as non-substitutable.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add
 #:substitutable? parameter.  Pass it to 'gexp->derivation'.
(qemu-image): Add #:substitutable? and pass it to
'expression->derivation-in-linux-vm'.
(system-disk-image): Add #:substitutable? and pass it to 'qemu-image'.
2020-04-08 12:42:41 +02:00
Ludovic Courtès 2729cb406d
system: Allow for comma-separated keyboard layouts.
Reported by Florian Pelz <pelzflorian@pelzflorian.de>.

* gnu/bootloader/grub.scm (keyboard-layout-file): Replace commas with
hyphens in the first argument to 'computed-file'.
* gnu/system/keyboard.scm (keyboard-layout->console-keymap): Likewise.
* doc/guix.texi (Keyboard Layout): Add example.
2020-04-06 00:14:13 +02:00
Ludovic Courtès c7af968717
system: Add xterm to lightweight-desktop example.
That makes ratpoison more usable, for instance.

* gnu/system/examples/lightweight-desktop.tmpl (packages): Add XTERM.
2020-04-02 11:48:25 +02:00
Efraim Flashner f12bd0bedd
system: Move nanorc to XDG_CONFIG_HOME.
* gnu/system/shadow.scm (skeleton-directory): Move .nanorc to
.config/nano/nanorc.
2020-04-01 07:50:48 +03:00
Leo Famulari 49d20d51e9
Revert "system: Move nanorc to XDG_CONFIG_HOME."
This reverts commit bd71818df3.

This changed caused system reconfiguration to fail like this:

------
building /gnu/store/y1x8asbzw624ywgkpin35p1i4bqnyfy2-skel.drv...
Backtrace:
           4 (primitive-load "/gnu/store/2x7d0jsbgf2ndb5fsk0nj07rhsx?")
In ice-9/eval.scm:
    619:8  3 (_ #f)
In ice-9/boot-9.scm:
   260:13  2 (for-each #<procedure 7ffff6ad8100 at ice-9/eval.scm:3?> ?)
In guix/build/utils.scm:
   343:27  1 (_ "/gnu/store/ajrgkj1s9vdcq00drn703f4zj9dvfrsv-nanorc" ?)
In unknown file:
           0 (copy-file "/gnu/store/ajrgkj1s9vdcq00drn703f4zj9dvfrs?" ?)

ERROR: In procedure copy-file:
In procedure copy-file: No such file or directory
`/gnu/store/v1grsca743phw41lyf63dzmh9nz5jlpn-bash_profile' -> `.bash_profile'
`/gnu/store/xdsaw0mj6axj427hyi6ysrnsxi21n7d5-bashrc' -> `.bashrc'
`/gnu/store/6i0b236dyar78zc5k5hrj5dv3vr4zb9w-zprofile' -> `.zprofile'
`/gnu/store/ajrgkj1s9vdcq00drn703f4zj9dvfrsv-nanorc' -> `.config/nano/nanorc'
builder for `/gnu/store/y1x8asbzw624ywgkpin35p1i4bqnyfy2-skel.drv' failed with exit code 1
------
2020-03-30 16:02:38 -04:00
Efraim Flashner bd71818df3
system: Move nanorc to XDG_CONFIG_HOME.
* gnu/system/shadow.scm (default-skeletons): Move .nanorc to
.config/nano/nanorc.
2020-03-30 15:40:30 +03:00
Ludovic Courtès be6520e6a5
vm: Distinguish between success and failure of the guest code.
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.
2020-03-26 23:45:41 +01:00
Vagrant Cascadian 37f8c50cdc
gnu: linux-libre-arm-veyron: Deprecate package.
* gnu/packages/linux (linux-libre-arm-veyron): Mark as deprecated package.
  (kernel-config-veyron): Remove obsolete function.
* gnu/system/examples/asus-c201.tmpl: Update to use linux-libre-arm-generic.
* gnu/packages/aux-files/linux-libre/5.4-arm-veyron.conf: Delete file.
* Makefile.am (AUX_FILES): Update accordingly.
2020-03-22 20:55:37 -07:00
Jan Nieuwenhuizen ac75bd0102
gnu: system: Remove guile-wm from skeleton.
* gnu/system/shadow.scm (default-skeletons): Remove guile-wm (especially as a
dependency).
2020-03-19 12:14:19 +01:00
Ludovic Courtès 09844816c7
vm: Compute UUIDs truly deterministically.
This is a followup to 1540075c79.
The mistake had no effect on prior Guile versions but it's visible since
Guile 3.0.1 and the fix for <https://bugs.gnu.org/39634>.

* gnu/system/vm.scm (operating-system-uuid): Hash a list of
'file-system-digest' values, not the 'file-system-type' procedure.
2020-03-10 18:16:39 +01:00
Maxim Cournoyer 99e676db43
file-systems: Add a 'file-system-device->string' procedure.
* gnu/system/file-systems.scm (file-system-device->string): New procedure.
* gnu/system.scm (bootable-kernel-arguments): Use it.
* gnu/system/vm.scm (operating-system-uuid): Likewise.
* guix/scripts/system.scm (display-system-generation): Likewise.
2020-03-02 23:24:47 -05:00
Efraim Flashner c27710859c
system: linux-container: Recommend guix container.
* gnu/system/linux-container.scm (container-script)[script]: Recommend
using 'guix container' to get a shell inside the running container.
2020-01-06 12:20:21 +02:00
Tobias Geerinckx-Rice b24f561c5e
install: Add jfsutils to the installation image.
* gnu/system/install.scm (installation-os)[packages]: Add jfsutils.
2020-01-03 13:54:14 +01:00
Tobias Geerinckx-Rice c7b5cfb014
linux-initrd: Add support for JFS.
* gnu/system/linux-initrd.scm (file-system-packages): Add jfs_fsck/static.
(file-system-type-modules): Add ‘jfs’ module.
2020-01-03 13:54:13 +01:00
Tobias Geerinckx-Rice 43c4d27cdf
uuid: Add support for JFS.
* gnu/system/uuid.scm (string->jfs-uuid): New procedure.
(%uuid-parsers, %uuid-printers): Add ‘jfs’ file system type.
2020-01-03 13:54:13 +01:00
Marius Bakke 8e53fe2b91
gnu: Remove uses of deprecated Qemu network configuration.
* 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.
2019-12-18 22:36:37 +01:00
Ludovic Courtès 362bcdb1b0
system: Remove custom 'config-file service from "vm-image.tmpl".
This example is broken since commit
99c45877a9 (wrong file name passed to
'local-file'), and its functionality is superseded by the upcoming
'provenance-service-type'.

* gnu/system/examples/vm-image.tmpl (this-file): Remove.
<services>: Remove 'config-file service.
2019-12-07 00:59:56 +01:00
Ludovic Courtès 33d1c970c3
install: Pass 'local-file' literal strings for proper resolution.
This is a followup to 99c45877a9, which
introduced a regression: "guix system build gnu/system/install.scm"
would fail to find the .tmpl files.

* gnu/system/install.scm (/etc/configuration-files)[file]: Remove.
[directory]: Use 'local-file' with a literal string.
2019-12-01 23:36:52 +01:00
Mathieu Othacehe d4ddf22d54
system: vm: Support cross-compilation.
* gnu/system.scm (system-linux-image-file-name): Add support for cross-built
systems. Remove system argument that was ignored,
(operating-system-kernel-file): adapt by removing ignored os argument.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add target
argument and turn inputs into native-inputs. Pass target to qemu-command
and gexp->derivation calls.
(iso9660-image): Add target argument and pass it to
expression->derivation-in-linux-vm. Remove qemu from inputs as it
is not necessary.
(qemu-image): Add target argument, also remove qemu from inputs. Pass
target argument to expression->derivation-in-linux-vm call.
2019-12-01 16:51:40 +01:00
Mathieu Othacehe 1ee72bb55b
system: vm: Add arm64 support.
* 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.
2019-11-22 16:33:43 +01:00
Maxim Cournoyer 67ed544212
vm: Honor the VOLATILE? parameter when producing a system disk image.
* gnu/system/vm.scm (system-disk-image): Honor the VOLATILE? parameter instead
of hard coding its value to #t.

Reported-by: Jelle Licht <jlicht@fsfe.org>
2019-11-18 14:07:12 +09:00
Ludovic Courtès 625bdf09d3
file-systems: Mount /var/run/nscd read-write in containers.
Fixes <https://bugs.gnu.org/37967>.
Reported by Ivan Vilata i Balaguer <ivan@selidor.net>.

* gnu/system/file-systems.scm (%network-file-mappings): Set 'writable?'
to #true for /var/run/nscd.
2019-11-04 23:35:32 +01:00
Vagrant Cascadian 545ff7b784
gnu: Add u-boot-firefly-rk3399.
* gnu/packages/bootloaders (u-boot-firefly-rk3399): New variable.
* gnu/bootloader/u-boot (install-firefly-rk3399-u-boot): New variable.
  (u-boot-firefly-rk3399-bootloader): New variable.
* gnu/system/install (define firefly-rk3399-installation-os): New variable.
2019-10-18 15:48:18 -07:00
Vagrant Cascadian 2fce14af24
gnu: Add u-boot-rock64-rk3328.
* gnu/packages/bootloaders (u-boot-rock64-rk3328): New variable.
* gnu/bootloader/u-boot (install-rock64-rk3328-u-boot): New variable.
  (u-boot-rock64-rk3328-bootloader): New variable.
* gnu/system/install (define rock64-installation-os): New variable.
2019-10-18 13:32:25 -07:00
Caliph Nomble fa7470189e
gnu: Add u-boot-rockpro64-rk3399
* gnu/packages/bootloaders.scm (u-boot-rockpro64-rk3399): New exported
  variable.
  (u-boot-2019.10): New variable.
* gnu/bootloader/u-boot.scm (u-boot-rockpro64-rk3399-bootloader): New exported
  variable.
  (install-rockpro64-rk3399-u-boot): New variable.
* gnu/system/install.scm (rockpro64-installation-os): New exported variable.

Adjusted-by: Vagrant Cascadian <vagrant@debian.org>
Signed-off-by: Caliph Nomble <nomble@palism.com>
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
2019-10-18 13:32:09 -07:00
Ludovic Courtès 96b35998e6
linux-container: 'eval/container' correctly passes -L and -C flags.
This fixes a type error.

* gnu/system/linux-container.scm (eval/container): Use 'append-map', not
'map'.
* tests/containers.scm ("eval/container, non-empty load path"): New test.
2019-09-18 23:08:28 +02:00
Ludovic Courtès d236cd16a7
linux-container: "run-container" scripts shows the container's PID.
* gnu/build/linux-container.scm (call-with-container): Add
 #:process-spawned-hook and honor it.
* gnu/system/linux-container.scm (container-script)[script]:
Define 'explain' and pass it as #:process-spawned-hook'.
2019-09-12 23:07:43 +02:00
Ludovic Courtès da966a7a3d
linux-container: Exclude more services when sharing networking with the host.
* gnu/system/linux-container.scm (containerized-operating-system)[useless-services]:
Add more services to the list when SHARED-NETWORK? is true.
2019-09-12 23:07:42 +02:00
Ludovic Courtès 5ccec77176
file-systems: Add /var/run/nscd to '%network-file-mappings'.
This allows containers created by "guix environment -CN" or by
"guix system container -N" to talk to the host nscd.

* gnu/system/file-systems.scm (%network-file-mappings): Add
"/var/run/nscd".
* gnu/build/shepherd.scm (default-mounts)[nscd-socket]: Remove.
* gnu/system/linux-container.scm (container-script)[nscd-run-directory]
[nscd-mapping, nscd-os, nscd-specs]: Remove.
[script]: Filter out from SPECS bind-mounts where the device does not
exist.
* guix/scripts/environment.scm (launch-environment/container)
[optional-mapping->fs]: New procedure.
[mappings]: Remove %NETWORK-FILE-MAPPINGS.
[file-systems]: Add %NETWORK-FILE-MAPPINGS here, filtered through
'optional-mapping->fs'.
2019-09-12 23:07:42 +02:00
Mathieu Othacehe 328a4c5bf1
linux-initrd: Use native gzip.
* gnu/system/linux-initrd.scm (expression->initrd): Pass native gzip to
build-initrd procedure.
2019-09-04 17:56:13 +02:00
Ludovic Courtès c85ccf60bf
linux-modules: Define and use a module name database.
Fixes <https://bugs.gnu.org/34902>.
Reported by Julien Lepiller <julien@lepiller.eu>.

* gnu/build/linux-modules.scm (module-formal-name): New procedure.
(load-linux-modules-from-directory)[lookup-module]: Remove.
[module-name->file-name]: New variable.  Use it.
(module-name->file-name/guess, module-name-lookup)
(write-module-name-database): New procedures.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): Call
'write-module-name-database'.
2019-08-16 23:00:27 +02:00
Ludovic Courtès 81c3dc3224
maint: Switch to Guile-JSON 3.x.
Guile-JSON 3.x is incompatible with Guile-JSON 1.x, which we relied on
until now: it maps JSON dictionaries to alists (instead of hash tables),
and JSON arrays to vectors (instead of lists).  This commit is about
adjusting all the existing code to this new mapping.

* m4/guix.m4 (GUIX_CHECK_GUILE_JSON): New macro.
* configure.ac: Use it.
* doc/guix.texi (Requirements): Mention the Guile-JSON version.
* guix/git-download.scm (git-fetch)[guile-json]: Use GUILE-JSON-3.
* guix/import/cpan.scm (string->license): Expect vectors instead of
lists.
(module->dist-name): Use 'json-fetch' instead of 'json-fetch-alist'.
(cpan-fetch): Likewise.
* guix/import/crate.scm (crate-fetch): Likewise, and call 'vector->list'
for DEPS.
* guix/import/gem.scm (rubygems-fetch): Likewise.
* guix/import/json.scm (json-fetch-alist): Remove.
* guix/import/pypi.scm (pypi-fetch): Use 'json-fetch' instead of
'json-fetch-alist'.
(latest-source-release, latest-wheel-release): Call 'vector->list' on
RELEASES.
* guix/import/stackage.scm (stackage-lts-info-fetch): Use 'json-fetch'
instead of 'json-fetch-alist'.
(lts-package-version): Use 'vector->list'.
* guix/import/utils.scm (hash-table->alist): Remove.
(alist->package): Pass 'vector->list' on the inputs fields, and default
to the empty vector.
* guix/scripts/import/json.scm (guix-import-json): Remove call to
'hash-table->alist'.
* guix/swh.scm (define-json-reader): Expect pair? or null? instead of
hash-table?.
[extract-field]: Use 'assoc-ref' instead of 'hash-ref'.
(json->branches): Use 'map' instead of 'hash-map->list'.
(json->checksums): Likewise.
(json->directory-entries, origin-visits): Call 'vector->list' on the
result of 'json->scm'.
* tests/import-utils.scm ("alist->package with dependencies"): New test.
* gnu/installer.scm (build-compiled-file)[builder]: Use GUILE-JSON-3.
* gnu/installer.scm (installer-program)[installer-builder]: Likewise.
* gnu/installer/locale.scm (iso639->iso639-languages): Use 'assoc-ref'
instead of 'hash-ref', and pass vectors through 'vector->list'.
(iso3166->iso3166-territories): Likewise.
* gnu/system/vm.scm (system-docker-image)[build]: Use GUILE-JSON-3.
* guix/docker.scm (manifest, config): Adjust for Guile-JSON 3.
* guix/scripts/pack.scm (docker-image)[build]: Use GUILE-JSON-3.
* guix/import/github.scm (fetch-releases-or-tags): Update docstring.
(latest-released-version): Use 'assoc-ref' instead of 'hash-ref'.  Pass
the result of 'fetch-releases-or-tags' to 'vector->list'.
* guix/import/launchpad.scm (latest-released-version): Likewise.
2019-07-25 00:16:41 +02:00