Commit Graph

713 Commits (master)

Author SHA1 Message Date
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
Ludovic Courtès bacfec8611
linux-container: Add 'eval/container'.
* gnu/system/linux-container.scm (eval/container): New procedure.
* tests/containers.scm ("eval/container, exit status")
("eval/container, writable user mapping"): New tests.
2019-07-19 11:53:47 +02:00
Ludovic Courtès b41c7beb0b
file-systems: Use 'no-atime' for %IMMUTABLE-STORE.
* gnu/system/file-systems.scm (%immutable-store): Add 'no-atime'.
2019-07-19 11:53:47 +02:00
Tobias Geerinckx-Rice 3a8bfebed9
etc: Remove hydra.gnu.org.pub key.
* etc/substitutes/hydra.gnu.org.pub: Delete file.
* guix/self.scm (miscellaneous-files): Don't install it.
* Makefile.am (dist_pkgdata_DATA): Remove it.
* gnu/services/base.scm (%default-authorized-guix-keys): Likewise.
(hydra-key-authorization): Rename to…
(substitute-key-authorization): …this.  Adjust only call site.
2019-06-29 14:27:22 +02:00
Mathieu Othacehe fdbf4447bc
linux-initrd: Fix cross compilation.
* gnu/system/linux-initrd.scm (default-initrd-modules): Check system name
against %current-target-system first in case we are cross-compiling.
2019-06-25 21:38:42 +02:00
Arun Isaac b84c4cda04
linux-container: Remove networking service when network is shared with host.
* gnu/system/linux-container.scm (dummy-networking-service-type): New
variable.
(containerized-operating-system): If network is shared with host, replace
static-networking-service-type with dummy-networking-service-type.
2019-06-19 00:19:47 +05:30
Ludovic Courtès ed504cafa2
vm: 'system-docker-image' builds in a UTF-8 locale.
Fixes <https://bugs.gnu.org/36215>.
Reported by Björn Höfling <bjoern.hoefling@bjoernhoefling.de>.

This is a followup to 9c941364bf.

* gnu/system/vm.scm (system-docker-image)[build]: Set GUIX_LOCPATH and
call 'setlocale'.
2019-06-17 12:36:13 +02:00
Ludovic Courtès 15ec93a783
Add (gnu build locale).
* gnu/build/locale.scm: New file.
* gnu/local.mk (MODULES_NOT_COMPILED): Add it.
* gnu/installer/locale.scm (normalize-codeset): Remove.
* gnu/system/locale.scm (localedef-command): Remove.
(single-locale-directory): Use (gnu build locale).
(glibc-supported-locales)[build]: Likewise, and remove
'read-supported-locales'.
2019-06-07 21:50:18 +02:00
Arun Isaac d2928fa63f
linux-container: Check if nscd run directory exists when container is run.
* gnu/system/linux-container.scm (containerized-operating-system):
(container-script): Check for existence of the host nscd run directory in the
container script. This check should be run when the container is started, not
when the container script is created.
[network-mappings]: Delete variable.
[nscd-run-directory, nscd-mapping]: New variables.
2019-05-25 11:06:22 +05:30
Ludovic Courtès 99f47b53f7
Merge branch 'version-1.0.1' 2019-05-20 11:48:57 +02:00
Danny Milosavljevic 1d86b05618
vm: Create installation media with MBR and HFS only, no GPT.
* gnu/build/vm.scm (make-iso9660-image): Accept XORRISO,
GRUB-MKRESCUE-ENVIRONMENT.
* gnu/system/vm.scm (iso9660-image): Pass XORRISO; accept
GRUB-MKRESCUE-ENVIRONMENT.
(system-disk-image): Pass GRUB-MKRESCUE-ENVIRONMENT.
* gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch: New file.
* gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/cdrom.scm (xorriso)[source]: Add patches.
[arguments]<#:phases>[install-frontends]:
Add phase.
2019-05-18 18:35:37 +02:00
Ludovic Courtès 9c64080dce
vm-image: Remove ModemManager.
This is a followup to 36f5d78d4a.

* gnu/system/examples/vm-image.tmpl (services): Remove
MODEM-MANAGER-SERVICE-TYPE.
2019-05-16 14:42:40 +02:00
Ludovic Courtès fc0680929d
vm-image: Remove 'network-manager-applet' from system profile.
This is a followup to 05d907ac6f.

* gnu/system/examples/vm-image.tmpl (services): Remove
'network-manager-applet'.
2019-05-16 14:37:23 +02:00
Ludovic Courtès 247649d42e
vm: 'system-docker-image' provides an entry point.
This simplifies use of images created with 'guix system docker-image'.

* gnu/system/vm.scm (system-docker-image)[boot-program]: New variable.
[os]: Add it to the GC roots.
[build]: Pass #:entry-point to 'build-docker-image'.
* gnu/tests/docker.scm (run-docker-system-test): New procedure.
(%test-docker-system): New variable.
* doc/guix.texi (Invoking guix system): Remove GUIX_NEW_SYSTEM hack and
'--entrypoint' from the example.  Mention 'docker create', 'docker
start', and 'docker exec'.
2019-05-15 16:36:21 +02:00
Ludovic Courtès 3f9bed04f0
linux-container: Compute essential services for THIS-OPERATING-SYSTEM.
Previously, the 'essential-services' would correspond to the initial,
non-containerized OS.  Thus, all the file systems removed in
'container-essential-services' would actually still be there because the
essential services would be computed on the non-containerized OS.

This is a followup to 69cae3d335.

* gnu/system/linux-container.scm (container-essential-services): Call
'operating-system-default-essential-services' to get the baseline
services.
(containerized-operating-system): Pass THIS-OPERATING-SYSTEM, not OS, to
'container-essential-services'.
Add a dummy root file system to 'file-systems'.
(container-script)[mountable-file-system?]: New procedure.
Use it.
2019-05-15 16:36:21 +02:00
Ludovic Courtès 6edd5c546c
linux-container: Do not add %CONTAINER-FILE-SYSTEMS to Docker image OSes.
Previously, 'guix system docker-image' would end up providing an OS that
would try to mount all of %CONTAINER-FILE-SYSTEMS as well as /gnu/store,
which is bound to fail in unprivileged Docker.

This patch makes it so that 'guix system container' still gets those
file systems, but 'guix system docker-image' doesn't.

* gnu/system/linux-container.scm (containerized-operating-system): Add
 #:extra-file-systems parameter and honor it.  Do not include
 %STORE-MAPPING and SHARED-NETWORK-FILE-MAPPINGS.
(container-script): Add %STORE-MAPPING and optionally NETWORK-MAPPINGS
to MAPPINGS and pass #:extra-file-systems.
2019-05-15 16:36:21 +02:00
Maxim Cournoyer d03de6be0a
vm: Auto-detect if inputs should be registered.
The default value of the argument REGISTER-CLOSURE? of the ISO9660-IMAGE,
QEMU-IMAGE and SYSTEM-DOCKER-IMAGE procedures can be computed automatically,
since the operating-system definition is available in its context.  When the
operating-system definition does not contain the GUIX-SERVICE-TYPE, do not
register the closure in the database of Guix, as it takes time and doesn't
serve a purpose.

* gnu/system/vm.scm (has-guix-service-type): Add predicate.
(iso9660-image)[register-closures?]: Use it to compute the argument's default
value.
(qemu-image)[register-closures?]: Likewise, and update docstring.
(system-docker-image)[register-closures?]: Likewise.
(system-disk-image): Do not explicit a value for the REGISTER-CLOSURES?
argument of the ISO9660-IMAGE and QEMU-IMAGE procedure calls, so that its
default value is used instead.
* guix/scripts/system.scm (system-derivation-for-action): Do not explicit a
value for the REGISTER-CLOSURES? argument of the SYSTEM-DOCKER-IMAGE
procedure call, so that its default value is used instead.
2019-05-13 22:59:09 -04:00
Ludovic Courtès 1be065c478
locale: Add 'glibc-supported-locales'.
* gnu/system/locale.scm (glibc-supported-locales): New procedure.
2019-05-13 23:46:08 +02:00
Arun Isaac b33454ae0b
linux-container: Support container network sharing.
* gnu/system/linux-container.scm (container-essential-services): If network is
to be shared with the host, remove network configuration files from etc
service.
(containerized-operating-system): If network is to be shared with the host,
remove nscd service and map host's /var/run/nscd if it exists.
(container-script): If network is to be shared with the host, do not create
network namespace.
* guix/scripts/system.scm (system-derivation-for-action): Add
#:container-shared-network? argument.
(perform-action): Add #:container-shared-network? argument.
(show-help): Add "-N, --network" help information.
(%options): Add network option.
(process-action): Call perform-action with #container-shared-network? argument.
* doc/guix.texi (Invoking guix system): Document the "-N, --network" option.

Co-authored-by: Christopher Baines <mail@cbaines.net>
2019-05-14 02:54:58 +05:30
Ludovic Courtès 7059cfc823
install: Add node name in Russian.
* gnu/system/install.scm (%installation-node-names): Add "ru".
2019-05-13 10:50:27 +02:00
Ludovic Courtès 76ae10a1f4
linux-container: Improve filtering of unnecessary file systems.
* gnu/system/linux-container.scm (containerized-operating-system)[user-file-systems]:
Add trailing slash for the "/dev/" and "/sys/" prefixes.
2019-05-10 23:29:18 +02:00
Ludovic Courtès af55ca481d
system: pam: Add #:login-uid? parameter to 'unix-pam-service'.
* gnu/system/pam.scm (unix-pam-service): Add #:login-uid? parameter.  In
then 'session' field, add "pam_loginuid.so" as required when LOGIN-UID?
is true.
2019-05-09 12:11:36 +02:00
Ludovic Courtès 6c5790a2fa
uuid: 'fat-uuid->string' preserves leading zeros.
Fixes <https://bugs.gnu.org/35582>.
Reported by sirgazil <sirgazil@zoho.com>.

Previously, leading zeros would be removed, leading to an "invalid"
UUID:

  (uuid->string (uuid "00CA-050E" 'fat32))
  ⇒ "CA-50E"
  (string->uuid "CA-50E" 'fat32)
  ⇒ #f

* gnu/system/uuid.scm (fat-uuid->string): Pad digits with zeros.
* tests/uuid.scm ("uuid, FAT32, leading zeros preserved"): New test.
2019-05-07 12:18:44 +02:00
Ludovic Courtès 9c941364bf
vm: Build ISOs and VM images in a UTF-8 environment.
Fixes a bug whereby building an image containing non-ASCII file names
would fail due to improper decoding of file names.

* gnu/system/vm.scm (iso9660-image, qemu-image): Set GUIX_LOCPATH and
call 'setlocale' in the build environment.
2019-05-01 21:11:22 +02:00
Ludovic Courtès 4c13ccbf39
vm-image: Add 'label' field.
* gnu/system/examples/vm-image.tmpl (label): New field.
2019-05-01 09:33:54 +02:00
Ludovic Courtès a4ae05fb8b
vm-image: Add 'nss-certs' to the global package set.
* gnu/system/examples/vm-image.tmpl (packages): Add NSS-CERTS.
2019-04-28 22:57:06 +02:00
Ludovic Courtès 6e0521eeed
vm-image: Allow for password-less sudo.
* gnu/system/examples/vm-image.tmpl (sudoers-file): New field.
2019-04-27 15:08:18 +02:00
Ludovic Courtès ff587e0fc0
vm-image: Mention 'info guix' in the MOTD.
* gnu/system/examples/vm-image.tmpl (vm-image-motd): Mention 'info guix'.
2019-04-27 15:08:18 +02:00
Ludovic Courtès 5df29aad3b
vm-image: Add a font to the global profile.
* gnu/system/examples/vm-image.tmpl (packages): Add FONT-BITSTREAM-VERA,
for use by xfce-terminal, IceCat, etc.
2019-04-27 15:08:17 +02:00
Ludovic Courtès ea2acfe98a
doc: Update bit about SSH in the VM.
* doc/guix.texi (Running Guix in a VM): Remove mentions of 'lsh-server';
mention 'openssh-service-type' and add a cross-reference.
* gnu/system/examples/vm-image.tmpl (services): Add a commented-out line
for 'openssh-service-type'.
2019-04-27 15:08:17 +02:00
Ludovic Courtès d7b05620a9
vm-image: Remove NetworkManager & co. and add the DHCP client.
* gnu/system/examples/vm-image.tmpl (services): Remove wpa-supplicant,
cups-pk-helper, and NetworkManager.  Add DHCP-CLIENT-SERVICE-TYPE.
2019-04-26 18:24:55 +02:00
Ludovic Courtès 1ac6c33cae
vm-image: Use the actual file name of the current file.
* gnu/system/examples/vm-image.tmpl (this-file): Use 'basename' and
'current-source-location'.
2019-04-26 16:47:11 +02:00
Ludovic Courtès 538b99f31f
system: Provide a new VM image configuration.
* gnu/system/examples/vm-image.tmpl: Rewrite.
* doc/guix.texi (Running Guix in a VM): Adjust accordingly.
2019-04-26 14:19:36 +02:00
Ludovic Courtès 5be7aecd14
vm: 'system-disk-image' no longer requires the OS to define the "/" file system.
Previously 'guix system disk-image' would fail if the OS didn't define a
"/" file system, even though it actually overrides that file system.

* gnu/system/vm.scm (system-disk-image)[root-uuid]: Turn into a
procedure.
Call 'root-uuid' on a variant of OS with a "/" file system and inherit
from that.
2019-04-25 00:45:35 +02:00
Ludovic Courtès 55111549e8
install: Add node name in Castellano.
* gnu/system/install.scm (%installation-node-names): Add "es".
2019-04-25 00:45:34 +02:00
Ludovic Courtès 86b8869fff
linux-container: Remove '%containerized-shepherd-service' hack.
This hack worked around a defect in the Shepherd 0.5.0 and is no longer
needed.

* gnu/services/shepherd.scm (%containerized-shepherd-service): Remove.
* gnu/system/linux-container.scm (container-essential-services): Don't
use it.
2019-04-23 16:38:12 +02:00
Ludovic Courtès 051b279fd0
services: account: Make 'user-homes' a one-shot service.
* gnu/system/shadow.scm (account-shepherd-service): Add 'one-shot?'
field.  Return #t from 'start'.
2019-04-23 16:38:12 +02:00
Ludovic Courtès 519177ad41
install: Pass "quiet" to the kernel.
This is a followup to 5582aa8e31.

* gnu/system/install.scm (installation-os)[kernel-arguments]: Add "quiet".
2019-04-23 00:40:50 +02:00
Ludovic Courtès 7859191210
install: Pass "modprobe.blacklist=radeon".
* gnu/system/install.scm (installation-os)[kernel-arguments]: New field.
2019-04-21 00:51:18 +02:00
Ludovic Courtès 0134ebc55b
install: Provide a meaningful label.
* gnu/system/install.scm (installation-os)[label]: New field.
2019-04-15 12:24:14 +02:00
Ludovic Courtès 66ec389580
vm: Do not mount /xchg with "cache=loose".
Fixes <https://bugs.gnu.org/33639>.

* gnu/system/vm.scm (%linux-vm-file-systems): Remove "cache=loose" for /xchg.
(system-docker-image): Remove 'sync' call, now unneeded, and which was
probably insufficient.
2019-04-14 17:42:08 +02:00
Ludovic Courtès 13fd0a3087
install: Use a font with more glyphs on tty2.
* gnu/system/install.scm (%installation-services): For
'console-font-service-type', use LatGrkCyr-8x16 on tty2.
2019-04-12 17:56:23 +02:00
Ludovic Courtès c7dc604253
installer: Choosing a locale opens the translated manual on tty2.
Suggested by Florian Pelz.

* gnu/system/install.scm (%installation-node-names): New variable.
(log-to-info): Expect the chosen locale as an argument.  Compute the
language, Info file name, and node name.  Install the locale.
(documentation-shepherd-service): Add 'locale' parameter to the 'start'
action and honor it.  Set GUIX_LOCPATH and TERM as environment variables
for the process.
* gnu/installer.scm (apply-locale): Use (gnu services herd).  Call
'stop-service' and 'start-service' with the chosen locale.
2019-04-12 17:56:23 +02:00
Ludovic Courtès 126d4c12ce
install: Add standalone documentation service.
* gnu/system/install.scm (log-to-info): Add 'tty' and 'user'
parameters.  Open the tty and change UIDs/GIDs.
(documentation-shepherd-service): New procedure.
(%documentation-users, documentation-service-type): New variables.
(%installation-services): Use it instead of 'mingetty-service'.
2019-04-12 17:56:23 +02:00