Commit graph

296 commits

Author SHA1 Message Date
Pkill -9
b12f8720f5
system: Fix missing space in boot labels for kernels that are inferior packages
* gnu/system.scm (kernel->boot-label): Add a missing space between
the kernel's package name and package version for inferior packages.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-12-26 18:40:49 +01:00
Pkill -9
bdc61ff97d
system: 'kernel->boot-label' now accepts inferior packages.
* gnu/system.scm (kernel->boot-label): Get package name and version
using the functions for inferior packages if the kernel is an
inferior package. Return "GNU" if the kernel is not a package.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-12-21 18:07:28 +01:00
Ludovic Courtès
d422cbb3d6
linux-initrd: 'expression->initrd' returns the complete file name.
Previously 'expression->initrd' would return the directory that contains
the 'initrd' file; now it returns the complete file name for that file.

* gnu/system/linux-initrd.scm (expression->initrd)[builder]: Change
output file name to "initrd.cpio.gz".  Tail-call 'file-append' to return
the complete file name.
* gnu/system.scm (operating-system-initrd-file): Remove 'file-append'
call.
* gnu/build/linux-initrd.scm (write-cpio-archive): Check whether OUTPUT
already has the ".gz" suffix; rename if before invoking GZIP if it does,
and otherwise after.
* gnu/system/vm.scm (expression->derivation-in-linux-vm)[builder]: Do
not append "/initrd" to #$initrd.
2018-11-21 23:26:59 +01:00
Ludovic Courtès
9782c82217
system: De-monadify 'operating-system-bootcfg'.
* gnu/system.scm (operating-system-bootcfg): Remove 'mlet*' and
'lower-object' call.
* gnu/system/vm.scm (system-disk-image)
(system-qemu-image/shared-store): Adjust accordingly.
* guix/scripts/system.scm (perform-action): Add 'lower-object' call for
BOOTCFG.
2018-11-18 23:37:45 +01:00
Ludovic Courtès
5ece56dc73
system: Please Emacs.
* gnu/system.scm (operating-system-bootcfg): Remove opening parenthesis
at the beginning of the line in the docstring to placate Emacs.
2018-11-18 23:37:44 +01:00
Ludovic Courtès
35b4468127
system: De-monadify 'operating-system-boot-parameters'.
* gnu/system.scm (operating-system-boot-parameters): Turn to direct
style instead of monadic.
(operating-system-bootcfg): Adjust accordingly.
(operating-system-boot-parameters-file): Likewise.
2018-11-18 23:37:44 +01:00
Ludovic Courtès
e34ae75dc1
linux-initrd: Return file-like objects instead of monadic values.
This is an incompatible change visible to users via the 'initrd' field
of 'operating-system'.  However, assuming the user's 'initrd' value
tail-calls to 'raw-initrd' or 'base-initrd', the switch to non-monadic
style is invisible.

* gnu/system/linux-initrd.scm (expression->initrd): Use 'computed-file'
instead of 'gexp->derivation'.
(raw-initrd, base-initrd): Adjust docstring to mention non-monadic
return.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Adjust
accordingly.
* gnu/system.scm (operating-system-directory-base-entries)
(operating-system-initrd-file)
(operating-system-boot-parameters): Adjust accordingly.
* doc/guix.texi (operating-system Reference)
(Initial RAM Disk): Update.
2018-11-18 23:37:44 +01:00
Ludovic Courtès
a7ef45d9de
system: Simplify kernel argument handling.
* gnu/system.scm (bootable-kernel-arguments): Remove 'kernel-arguments'
parameter and return only the base list of kernel arguments.  Rename
'system.drv' to 'system'.
(operating-system-kernel-arguments): Adjust accordingly and remove
'system.drv' parameter.
(read-boot-parameters-file): Adjust accordingly.  Remove 'if params'
since dominating code assumed PARAMS is always true.
(operating-system-boot-parameters): Remove 'system.drv' parameter; add
 #:system-kernel-arguments? instead and honor it.
(operating-system-bootcfg): Adjust accordingly.
(operating-system-boot-parameters-file): Likewise.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Remove
'os-drv' variable.  Adjust call to 'operating-system-kernel-arguments'.
2018-11-18 23:37:44 +01:00
Ludovic Courtès
46c296dcc4
bootloader: De-monadify configuration file generators.
* gnu/bootloader/extlinux.scm: Remove unneeded imports.
(extlinux-configuration-file): Use 'computed-file' instead of
'gexp->derivation'.
* gnu/bootloader/grub.scm (svg->png): Likewise.
(grub-background-image, eye-candy): Adjust accordingly, return
non-monadically.
(grub-configuration-file): Likewise, and use 'computed-file' instead of
'gexp->derivation'.
* gnu/bootloader/u-boot.scm: Remove unneeded imports.
* gnu/system.scm: Add 'lower-object' call.
2018-11-18 23:37:44 +01:00
Ludovic Courtès
a56c4eb8f4
services: shepherd: Add workaround for 0.5.0 in containers.
* gnu/services/shepherd.scm (%containerized-shepherd-service): New service.
* gnu/system.scm (essential-services): Use it when CONTAINER? is true.
2018-09-26 23:40:36 +02:00
Ludovic Courtès
68a58775e0
system: Mapped devices needed for boot do not yield Shepherd services.
Fixes <https://bugs.gnu.org/31889>.
Reported by Taylan Kammer <taylanbayirli@gmail.com>.

* gnu/system.scm (non-boot-file-system-service)[mapped-devices-for-boot]:
New variable.
Remove dependencies of FS that are members of MAPPED-DEVICES-FOR-BOOT.
(mapped-device-user): Rename to...
(mapped-device-users): ... this.  Use 'filter' instead of 'find'.
(operating-system-user-mapped-devices)
(operating-system-boot-mapped-devices): Use 'any
file-system-needed-for-boot?' instead of looking at the first user.
* tests/system.scm ("non-boot-file-system-service"): New test.
2018-06-21 23:54:15 +02:00
Ludovic Courtès
378daa8cb6
services: boot: Take gexps instead of monadic gexps.
* gnu/services.scm (compute-boot-script): Rename 'mexps' to 'gexps' and
remove 'mlet' form.
(boot-service-type): Update comment.
(cleanup-gexp): Remove 'with-monad' and 'return'.
(activation-script): Rewrite in non-monadic style: use 'scheme-file'
instead of 'gexp->file'.
(gexps->activation-gexp): Remove 'mlet', return a gexp.
* gnu/services/shepherd.scm (shepherd-boot-gexp): Remove 'with-monad'
and 'return'.
* gnu/system.scm (operating-system-boot-script): Remove outdated comment.
* gnu/tests/base.scm (%cleanup-os): For 'dirty-service', remove
'with-monad' and 'return'.
2018-06-20 23:47:08 +02:00
Ludovic Courtès
661c237b4d
services: boot: Reverse the order of boot expressions.
* gnu/services.scm (compute-boot-script): Reverse MEXPS.
* gnu/system.scm (essential-services): Reverse order of
%SHEPHERD-ROOT-SERVICE, %ACTIVATION-SERVICE, and CLEANUP-SERVICE-TYPE.
2018-06-20 10:05:18 +02:00
Ludovic Courtès
a854525a34
system: Have /run/setuid-programs first in $PATH.
Fixes <https://bugs.gnu.org/31814>.
Reported by Clément Lassieur <clement@lassieur.org>.

* gnu/system.scm (operating-system-etc-service)["profile"]: Arrange so
that /run/setuid-programs comes first in $PATH.
2018-06-18 23:19:51 +02:00
Ludovic Courtès
8d09bfe218
system: Move ~/.config/guix/current first in PATH and INFOPATH.
Fixes <https://bugs.gnu.org/31770>.
Reported by iyzsong@member.fsf.org (宋文武).

* gnu/system.scm (operating-system-etc-service)["profile"]: Arrange so
that ~/.config/guix/current comes first in PATH and INFOPATH.
2018-06-12 15:23:34 +02:00
Ludovic Courtès
cdc5b9320f
system: Honor ~/.config/guix/current in /etc/profile.
* gnu/system.scm (operating-system-etc-service)[profile]: Add
~/.config/guix/current/share/info to INFOPATH.  Treat ~/.guix-profile
and ~/.config/guix/current in the same way.
2018-06-09 12:02:28 +02:00
Ludovic Courtès
a13c1bf4ca
Merge branch 'master' into core-updates 2018-06-01 23:41:40 +02:00
Ludovic Courtès
b1059b38b2
system: 'read-boot-parameters' provides a more meaningful warning.
'system' here was bound to Guile's 'system' procedure.

* gnu/system.scm (read-boot-parameters): Fix argument for fallback
warning.
2018-05-31 18:13:08 +02:00
Mark H Weaver
82b695b834
Merge branch 'master' into core-updates 2018-05-28 20:45:37 -04:00
Ludovic Courtès
a5acc17a3c
file-systems: Remove 'title' field and add <file-system-label>.
The 'title' field was easily overlooked and was an endless source of
confusion.  Now, the value of the 'device' field is self-contained.

* gnu/system/file-systems.scm (<file-system>): Change constructor name
to '%file-system'.
[title]: Remove.
(<file-system-label>): New record type with printer.
(report-deprecation, device-expression)
(process-file-system-declaration, file-system): New macros.
(file-system-title): New procedure.
(file-system->spec, spec->file-system): Adjust to handle
<file-system-label>.
* gnu/system.scm (bootable-kernel-arguments): Add case for
'file-system-label?'.
(read-boot-parameters): Likewise.
(mapped-device-user): Avoid 'file-system-title'.
(fs->boot-device): Remove.
(operating-system-boot-parameters): Use 'file-system-device' instead of
'fs->boot-device'.
(device->sexp): Add case for 'file-system-label?'.
* gnu/bootloader/grub.scm (grub-root-search): Add case for
'file-system-label?'.
* gnu/system/examples/bare-bones.tmpl,
gnu/system/examples/beaglebone-black.tmpl,
gnu/system/examples/lightweight-desktop.tmpl,
gnu/system/examples/vm-image.tmpl: Remove uses of 'title'.
* gnu/system/vm.scm (virtualized-operating-system): Remove uses of
'file-system-title'.
* guix/scripts/system.scm (check-file-system-availability): Likewise,
and adjust fix-it hint.
(check-initrd-modules)[file-system-/dev]: Likewise.
* gnu/build/file-systems.scm (canonicalize-device-spec): Remove 'title'
parameter.
[canonical-title]: Remove.
Match on SPEC's type rather than on CANONICAL-TITLE.
(mount-file-system): Adjust caller.
* gnu/build/linux-boot.scm (boot-system): Interpret ROOT here.
* gnu/services/base.scm (file-system->fstab-entry): Remove use of
'file-system-title'.
* doc/guix.texi (File Systems): Remove documentation of the 'title'
field.  Rewrite documentation of 'device' and document
'file-system-label'.
2018-05-28 13:24:11 +02:00
Mark H Weaver
0661758e13
Merge branch 'master' into core-updates 2018-05-21 13:22:32 -04:00
Ludovic Courtès
a48d345041
file-systems: Do not export <file-system>.
* gnu/system/file-systems.scm (<file-system>): Do not export.
* gnu/system.scm (operating-system-root-file-system): Use an accessor
instead of 'match'.
2018-05-19 00:14:52 +02:00
Mark H Weaver
a368663a56
Merge branch 'master' into core-updates 2018-04-12 15:22:57 -04:00
Leo Famulari
e453da132a
system: Provide a fall-back PATH for non-login shells started with su(1).
* gnu/system.scm (operating-system-etc-service): Provide values for
ENV_PATH and ENV_SUPATH in '/etc/login.defs'.
2018-04-11 18:45:06 -04:00
Marius Bakke
5576cfabf3
Merge branch 'master' into core-updates 2018-03-29 17:34:41 +02:00
Leo Famulari
af23710ff5
gnu: util-linux: Fix CVE-2018-7738 without grafting.
* gnu/packages/linux.scm (util-linux)[replacement]: Remove field.
(util-linux-2.31.1): New variable.
* gnu/system.scm (%base-packages): Use util-linux-2.31.1.
2018-03-20 17:14:22 -04:00
Ludovic Courtès
6c4458172d
services: file-systems: Include 'user-file-systems' service.
Previously the KNOWN-FS value used in 'essential-services' would be
incomplete: it would lack all the file systems provided by services that
extend 'file-system-service-type' (/sys/fs/cgroup,
/proc/sys/fs/binfmt_misc, etc.)  Consequently, upon shutdown,
'user-processes' would unmount these file systems before their
corresponding service had been stopped; when their corresponding (e.g.,
'file-system-/proc/sys/fs/binfmt_misc') was stopped, its 'umount' call
would fail.

This was harmless in practice, but this patch makes sure things work as
intended and file systems are unmounted in the right order.

* gnu/services/base.scm (file-system-shepherd-services): Instantiate
'user-file-systems' Shepherd service from here.
(user-unmount-service-type, user-unmount-service): Remove.
* gnu/system.scm (essential-services): Remove call to 'user-unmount-service'.
* gnu/system/install.scm (cow-store-service-type): Adjust comment.
2018-03-07 11:22:42 +01:00
Ludovic Courtès
bc499b113a
system: Add 'initrd-modules' field.
* gnu/system.scm (<operating-system>)[initrd-modules]: New field.
(operating-system-initrd-file): Pass #:linux-modules to 'make-initrd'.
* gnu/system/linux-initrd.scm (default-initrd-modules): New procedure.
(%base-initrd-modules): New macro.
(base-initrd): Add #:linux-modules and honor it.
* gnu/system/install.scm (embedded-installation-os): Use
'initrd-modules' instead of 'initrd'.
* gnu/tests/install.scm (%raid-root-os): Likewise.
* doc/guix.texi (operating-system Reference): Add 'initrd-modules'.
(Initial RAM Disk): Document it.  Adjust example to not use
 #:extra-modules.
2018-03-02 13:53:10 +01:00
Mark H Weaver
a102d359a6
Merge branch 'master' into core-updates 2018-01-23 17:01:07 -05:00
Ludovic Courtès
d466b1fc82
services: Missing services are automatically instantiated.
This simplifies OS configuration: users no longer need to be aware of
what a given service depends on.

See the discussion at
<https://lists.gnu.org/archive/html/guix-devel/2018-01/msg00114.html>.

* gnu/services.scm (missing-target-error): New procedure.
(service-back-edges): Use it.
(instantiate-missing-services): New procedure.
* gnu/system.scm (operating-system-services): Call
'instantiate-missing-services'.
* tests/services.scm ("instantiate-missing-services")
("instantiate-missing-services, no default value"): New tests.
* gnu/services/version-control.scm (cgit-service-type)[extensions]: Add
FCGIWRAP-SERVICE-TYPE.
* gnu/tests/version-control.scm (%cgit-os): Remove NGINX-SERVICE-TYPE
and FCGIWRAP-SERVICE-TYPE instances.
* doc/guix.texi (Log Rotation): Remove 'mcron-service-type' in example.
(Miscellaneous Services): Remove 'nginx-service-type' and
'fcgiwrap-service-type' in Cgit example.
2018-01-21 00:24:03 +01:00
Leo Famulari
4adb40bffc
Merge branch 'master' into core-updates 2018-01-11 14:22:50 -08:00
Danny Milosavljevic
20abb8c408
system: Export operating-system-user-kernel-arguments.
* gnu/system.scm (operating-system-user-kernel-arguments): Export it.
2018-01-09 20:02:23 +01:00
Efraim Flashner
23de2e1d5f
Merge remote-tracking branch 'origin/master' into core-updates 2017-12-31 14:10:25 +02:00
Ludovic Courtès
206a28d84a
services: 'user-processes-service-type' can now be extended.
* gnu/services/base.scm (user-processes-shepherd-service): New
procedure, taken from former 'user-processes-service-type'.  Add
REQUIREMENTS argument; remove GRACE-DELAY argument.
(user-processes-service-type): Redefine in terms of 'service-type'.
(user-processes-service): Remove.
(file-system-service-type): Extend USER-PROCESSES-SERVICE-TYPE.
* gnu/system.scm (essential-services): Use USER-PROCESSES-SERVICE-TYPE
directly.
2017-12-22 08:56:50 +01:00
Marius Bakke
77181815ae
Merge branch 'master' into core-updates 2017-12-05 23:41:30 +01:00
Ludovic Courtès
bd7e136d29
Add semicolon in commands that set GUIX_PROFILE.
Fixes <https://bugs.gnu.org/28223>.
Reported by Rosebud Uplink <Uplink.Introversion@outlook.com>.

* doc/guix.texi (Binary Installation): Add missing semicolon after
'GUIX_PROFILE=' line.
(Invoking guix package): Likewise.
* gnu/system.scm (operating-system-etc-service)[profile]: Likewise.
* guix/build/profiles.scm (build-etc/profile): Likewise.
2017-11-20 18:43:10 +01:00
Marius Bakke
2dd12924cf
Merge branch 'master' into core-updates 2017-11-19 15:01:00 +01:00
Ludovic Courtès
a0fea77dbb
services: guix: Remove dependency on 'lsof'.
This is a followup to b8f59cdc20:
'list-runtime-roots' no longer depends on 'lsof'.

* gnu/services/base.scm (<guix-configuration>)[lsof]: Remove.
(guix-shepherd-service): Adjust accordingly.
* doc/guix.texi (Base Services): Adjust accordingly.
* gnu/system.scm (%base-packages): Remove LSOF.
2017-11-13 11:36:28 +01:00
Ludovic Courtès
5475749960
system: Do not set 'TZ'.
Fixes <https://bugs.gnu.org/29212>.
Reported by Diego Nicola Barbato <dnbarbato@posteo.de>.

* gnu/system.scm (operating-system-environment-variables): Remove "TZ".
2017-11-09 09:59:21 +01:00
Efraim Flashner
5146f22b3b
gnu: rfkill: Mark as superseded by util-linux.
* gnu/packages/linux.scm (rfkill)[properties]: New field, superseded by
util-linux.
* gnu/system.scm (%base-packages): Remove rfkill.
2017-11-02 22:43:55 +02:00
Thomas Danckaert
ce38015066
system: operating-system-etc-service: Set XCURSOR_PATH.
* gnu/system.scm (operating-system-etc-service): Set XCURSOR_PATH environment
variable so that libxcursor finds cursors in user and system profiles.
* gnu/packages/xorg.scm (libxcursor): Add a TODO for better handling of
XCURSOR_PATH in other profiles.
2017-10-10 10:22:08 +02:00
Ludovic Courtès
90d23ed9df
system: Really filter out Linux device names for the store.
This is a followup to db4e8fd5d4.
Fixes <https://bugs.gnu.org/28445>.
Reported by Mark H Weaver <mhw@netris.org>.

* gnu/system.scm (ensure-not-/dev): New procedure.
(read-boot-parameters)[ensure-not-/dev]: Remove.
(operating-system-boot-parameters): Use it.
2017-10-07 00:05:18 +02:00
Ludovic Courtès
db4e8fd5d4
system: <boot-parameters> does not use "/dev" device names.
Fixes <https://bugs.gnu.org/28445>.
Reported by Mark H Weaver and Roel Janssen.

* gnu/system.scm (read-boot-parameters)[ensure-not-/dev]: New procedure.
Use it.
2017-09-21 22:30:59 +02:00
Andy Wingo
96bc651800
gnu: system: Fix computation of boot parameters for LUKS devices.
* gnu/system.scm (read-boot-parameters): Fix store-device computation for root
devices of type "device", like the LUKS partition described in the manual.
From a patch from https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28445#23.

Signed-off-by: Andy Wingo <wingo@igalia.com>
2017-09-20 15:40:32 +02:00
Thomas Danckaert
c694520bb1
system: Create "/etc/hostname".
* gnu/system.scm (operating-system-etc-service): Add a plain-file with the
  operating-system-host-name.
2017-09-19 15:39:32 +02:00
Ludovic Courtès
c08da2ee37
system: Define 'DICPATH' in /etc/profile.
* gnu/system.scm (operating-system-etc-service) <profile>: Define
'DICPATH'.
2017-09-18 15:44:52 +02:00
Ludovic Courtès
96da5d6296
system: Add gexp compiler for <operating-system>.
* gnu/system.scm (operating-system-compiler): New procedure.
2017-09-12 23:56:33 +02:00
Ludovic Courtès
7940188ebf
system: Fix typo in 'read-boot-parameters'.
Fixes a regression introduced in
commit 075681d350.

* gnu/system.scm (read-boot-parameters): For 'root-device', use
'device-sexp->device', not 'device->sexp'.
2017-09-11 23:00:40 +02:00
Ludovic Courtès
075681d350
system: Serialize the UUID type in the "parameters" file.
* gnu/system.scm (read-boot-parameters)[device->sexp]: New procedure.
Use it for 'root-device' and 'store-device'.
(device->sexp): Serialize the UUID type in addition to its bytevector.
2017-09-11 22:24:47 +02:00
Ludovic Courtès
9b336338cd
system: Introduce a disjoint UUID type.
Conceptually a UUID is just a bytevector.  However, there's software out
there such as GRUB that relies on the string representation of different
UUID types (e.g., the string representation of DCE UUIDs differs from
that of ISO-9660 UUIDs, even if they are actually bytevectors of the
same length).  This new <uuid> record type allows us to preserve
information about the type of UUID so we can eventually convert it to a
string using the right representation.

* gnu/system/uuid.scm (<uuid>): New record type.
(bytevector->uuid): New procedure.
(uuid): Return calls to 'make-uuid'.
(uuid->string): Rewrite using 'match-lambda*' to accept a single 'uuid?'
argument.
* gnu/bootloader/grub.scm (grub-root-search): Check for 'uuid?' instead
of 'bytevector?'.
* gnu/system.scm (bootable-kernel-arguments): Check whether ROOT-DEVICE
is 'uuid?'.
(read-boot-parameters): Use 'bytevector->uuid' when the
store device is a bytevector.
(read-boot-parameters-file): Check for 'uuid?' instead of 'bytevector?'.
(device->sexp): New procedure.
(operating-system-boot-parameters-file): Use it for 'root-device' and
'store'.
(operating-system-bootcfg): Remove conditional in definition of
'root-device'.
* gnu/system/file-systems.scm (file-system->spec): Check for 'uuid?' on
DEVICE and take its bytevector.
* gnu/system/mapped-devices.scm (open-luks-device): Likewise.
* gnu/system/vm.scm (iso9660-image): Call 'uuid-bytevector' for the
 #:volume-uuid argument.
2017-09-11 22:24:46 +02:00