Commit graph

450 commits

Author SHA1 Message Date
Josselin Poiret
4af3262d98
system: Filter out boot dependencies from swap-space.
* gnu/systems.scm (swap-services): Filter them.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-11-23 10:24:27 +01:00
Josselin Poiret
f574dbd163
system: Warn about swap-devices format change
* gnu/system.scm (warn-swap-devices-change,
%warn-swap-devices-change): Add them.
* gnu/system.scm (operating-system) [swap-devices]: Use it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-11-23 10:24:27 +01:00
Josselin Poiret
133a61ae26
system: Rework swap space support, add dependencies.
* gnu/system/file-systems.scm (swap-space): Add it.
* gnu/system.scm (operating-system)[swap-devices]: Update comment.
* gnu/services/base.scm (swap-space->shepherd-service-name,
swap-deprecated->shepherd-service-name, swap->shepherd-service-name):
Add them.
* gnu/services/base.scm (swap-service-type, swap-service): Use the new
records.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-11-23 10:24:27 +01:00
Josselin Poiret
7c4142628a
gnu: system: Improve location of some configuration warnings.
* gnu/bootloader.scm (%warn-target-field-deprecation): Remove it.
* gnu/bootloader.scm (warn-target-field-deprecation): Use
define-with-syntax-properties.
* gnu/system.scm (ensure-setuid-program-list): Ditto.  Also rename the
'location' variable to 'properties'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-11-17 23:05:58 +01:00
Mathieu Othacehe
a1eca979fb
Merge remote-tracking branch 'origin/master' into core-updates-frozen. 2021-10-12 17:46:23 +00:00
Mathieu Othacehe
2456026044
system: Introduce the os-release file.
* gnu/system.scm (os-release): New procedure.
(operating-system-etc-service): Use it.
2021-10-02 10:54:41 +00:00
Mathieu Othacehe
53a1cebc9b
system: Add guix-icons to the base packages.
* gnu/system.scm (%base-packages-artwork): New variable.
(%base-packages): Add it.
2021-10-02 10:54:41 +00:00
Tobias Geerinckx-Rice
9e0509f9af
system: Add xfsprogs to base packages.
This makes them available in the Guix System installer.

* gnu/system.scm (%base-packages-disk-utilities): Add xfsprogs.
2021-09-23 18:17:17 +02:00
Ludovic Courtès
580984f241
system: Add trailing newline to /etc/timezone.
Fixes <https://issues.guix.gnu.org/50523>.
Reported by meedstrom@teknik.io.

* gnu/system.scm (operating-system-etc-service): Add trailing newline
to "timezone" contents.
2021-09-14 11:50:59 +02:00
Ludovic Courtès
2826f488e4
system: Accept gexps in 'setuid-programs'.
Commit a7ac19851b led configs such as the
following one, which were previously valid, to be rejected:

  (operating-system
    ;; ...
    (setuid-programs (cons #~(string-append #$wireshark "/bin/dumpcap")
                           %setuid-programs)))

They are now accepted again.

Reported by wonko on #guix.

* gnu/system.scm (%ensure-setuid-program-list): Handle the case where
PROGRAM is not a file-like.
2021-08-12 12:34:13 +02:00
Ludovic Courtès
e0bd47b4fd
system: Handle 'setuid-programs' deprecation handling as a field sanitizer.
Previously, evaluating an OS configuration with a childhurd (for
instance) would produce tens of lines like:

  guix system: warning: representing setuid programs with '#<file-append #<package shadow@4.8.1 gnu/packages/admin.scm:798 7ff97f6f7640> "/bin/passwd">' is deprecated; use 'setuid-program' instead

Now, it prints this one line:

  gnu/system/hurd.scm:105:2: warning: representing setuid programs with file-like objects is deprecated; use 'setuid-program' instead

This change also means that extensions of 'setuid-program-service-type'
now have to provide a list of <setuid-program>, so it's stricter in this
sense.

* gnu/services.scm (setuid-program-file-like-deprecated): Remove.
(setuid-program-service-type)[extend]: Remove
'setuid-program-file-like-deprecated' call.  Assume CONFIG and
EXTENSIONS are already lists of <setuid-program> records.
* gnu/system.scm (<operating-system>)[setuid-programs]: Add 'sanitize'
property.  Change accessor name from '%operating-system-setuid-programs'
to 'operating-system-setuid-programs'.
(operating-system-default-essential-services)
(hurd-default-essential-services): Adjust accordingly.
(ensure-setuid-program-list): New macro.
(%ensure-setuid-program-list): New procedure, based on
'setuid-program-file-like-deprecated'.
2021-08-12 12:34:13 +02:00
Brice Waegeneire
a85ec0bf69
services: Migrate to <setuid-program>.
* gnu/services/dbus.scm (dbus-setuid-programs, polkit-setuid-programs):
  Return setuid-programs.
* gnu/services/desktop.scm (enlightenment-setuid-programs): Return
 setuid-programs.
 (%desktop-services)[mount-setuid-helpers]: Use setuid-programs.
* gnu/services/docker.scm (singularity-setuid-programs): Return
 setuid-programs.
* gnu/services/xorg.scm(screen-locker-setuid-programs): Return
 setuid-programs.
* gnu/system.scm (%setuid-programs): Return setuid-programs.
* doc/guix.texi (Setuid Programs, operating-system Reference): Replace
  'list of G-expressions' with 'list of <setuid-program>'.
2021-07-29 11:32:48 -04:00
Chris Lemmer-Webber
a7ac19851b
services: setuid: More configurable setuid support.
New record <setuid-program> with fields for setting the specific user
and group, as well as specifically selecting the setuid and setgid bits,
for a program within the setuid-program-service.

* gnu/services.scm (setuid-program-file-like-deprecated): New function.
  (setuid-program-service-type): Make use of
  setuid-program->activation-gexp.  Adjust the extend property to handle
  <setuid-program>.
* gnu/build/activation.scm (activate-setuid-programs): Update to expect a
  <setuid-record> list for each program entry.
* gnu/system.scm: (operating-system-setuid-programs): Renamed to
  %operating-system-setuid-programs and replace it with new procedure.
  (operating-system-default-essential-services,
  hurd-default-essential-services): Replace
  operating-system-setuid-programs with
  %operating-system-setuid-programs.
* gnu/system/setuid.scm: New file.
* doc/guix.texi (Setuid Programs): Document <setuid-program>.

Co-authored-by: Brice Waegeneire <brice@waegenei.re>
2021-07-29 11:32:08 -04:00
Mathieu Othacehe
74168d99bb
system: Provide mg instead of zile.
Since the update to the 2.6.2 release, the closure size of zile has
increased. Switch to mg which is lighter.

* gnu/system.scm (%base-packages-interactive): Replace zile by mg.
* doc/guix.texi (Proceeding with the Installation,
Using the Configuration System): Adapt those sections.
2021-07-09 12:08:12 +02:00
Maxim Cournoyer
b7cbca221f
Merge branch 'version-1.3.0' 2021-05-11 22:42:59 -04:00
raid5atemyhomework
a3df382525
gnu: Allow services to install kernel-loadable modules.
* gnu/system.scm (operating-system-directory-base-entries): Remove code
to handle generation of "kernel" for linux-libre kernels.
(operating-system-default-essential-services): Instantiate
linux-builder-service-type.
(package-for-kernel): Move ...
* gnu/services.scm: ... to here.
(linux-builder-service-type): New variable.
(linux-builder-configuration): New type.
(linux-loadable-module-service-type): New variable.
* gnu/tests/linux-modules.scm (run-loadable-kernel-modules-test): Move
code to ...
(run-loadable-kernel-modules-test-base): ... new procedure here.
(run-loadable-kernel-modules-service-test): New procedure.
(%test-loadable-kernel-modules-service-0): New variable.
(%test-loadable-kernel-modules-service-1): New variable.
(%test-loadable-kernel-modules-service-2): New variable.
* doc/guix.texi: Document linux-loadable-module-service-type.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2021-05-11 16:13:48 +02:00
Maxim Cournoyer
7a65beff0f
system: Add wget to %base-packages-networking.
Fixes <https://issues.guix.gnu.org/43530>.

Wget is typically included with most GNU/Linux distributions.  It adds about
~3 MiB to the system size.

* gnu/system.scm (%base-packages-networking): Add the wget package.
2021-05-07 17:20:41 -04:00
Maxime Devos
95f72dcd7a
services: shepherd: Allow custom 'shepherd' package.
* gnu/services/shepherd.scm (<shepherd-configuration>): New record.
(shepherd-boot-gexp, shepherd-root-service-type): Use it.
(scm->go, shepherd-configuration-file): Allow passing custom
shepherd package.
* gnu/system.scm (operating-system-shepherd-service-names): Use the new
record.
* guix/scripts/system.scm (export-shepherd-graph): Adjust accordingly.
* doc/guix.texi (Shepherd Services). Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-01-30 15:36:57 +01:00
Ludovic Courtès
211a503522
system: Fix typo in docstring.
* gnu/system.scm (operating-system-etc-service): Fix typo.
2021-01-22 08:36:03 +01:00
Miguel Ángel Arruga Vivas
f00e68ace0
system: Allow separated /boot and encrypted root.
* gnu/bootloader/grub.scm (grub-configuration-file): New parameter
store-crypto-devices.
[crypto-devices]: New helper function.
[builder]: Use crypto-devices.
* gnu/machine/ssh.scm (roll-back-managed-host): Use
boot-parameters-store-crypto-devices to provide its contents to the
bootloader configuration generation process.
* gnu/tests/install.scm (%encrypted-root-not-boot-os,
%encrypted-root-not-boot-os): New os declaration.
(%encrypted-root-not-boot-installation-script): New script, whose contents
were initially taken from %encrypted-root-installation-script.
(%test-encrypted-root-not-boot-os): New test.
* gnu/system.scm (define-module): Export
operating-system-bootoader-crypto-devices and
boot-parameters-store-crypto-devices.
(<boot-parameters>): Add field store-crypto-devices.
(read-boot-parameters): Parse store-crypto-devices field.
[uuid-sexp->uuid]: New helper function extracted from
device-sexp->device.
(operating-system-bootloader-crypto-devices): New function.
(operating-system-bootcfg): Use
operating-system-bootloader-crypto-devices to provide its contents to
the bootloader configuration generation process.
(operating-system-boot-parameters): Add store-crypto-devices to the
generated boot-parameters.
(operating-system-boot-parameters-file): Likewise to the file with
the serialized structure.
* guix/scripts/system.scm (reinstall-bootloader): Use
boot-parameters-store-crypto-devices to provide its contents to the
bootloader configuration generation process.
* tests/boot-parameters.scm (%default-store-crypto-devices): New
variable.
(%grub-boot-parameters, test-read-boot-parameters): Use
%default-store-crypto-devices.
(tests store-crypto-devices): New tests.
2020-12-21 18:41:11 +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
Miguel Ángel Arruga Vivas
2df44e934c
system: Change comment wording.
* gnu/system.scm (<boot-parameters>)<Comment>: Substitute path with file name.
2020-11-02 18:22:33 +01:00
Miguel Ángel Arruga Vivas
582cf9257c
system: Add store-directory-prefix to boot-parameters.
Fixes <http://issues.guix.gnu.org/44196>

* gnu/machine/ssh.scm (roll-back-managed-host): Use
boot-parameters-store-directory-prefix.
* gnu/system.scm (define-module): Export
boot-parameters-store-directory-prefix.
(<boot-parameters>)[store-directory-prefix]: New field. It is used to
generate the correct paths when /gnu/store is installed on a btrfs
subvolume whose name doesn't match the final runtime path, as the
bootloader doesn't have knowledge about the final mounting points.
[boot-parameters-store-directory-prefix]: New accessor.
(read-boot-parameters): Read directory-prefix from store field.
(operating-system-boot-parameters-file): Add directory-prefix to
store field.
* guix/scripts/system.scm (reinstall-bootloader): Use
boot-parameters-store-directory-prefix.
* test/boot-parameters.scm (%default-btrfs-subvolume,
%default-store-directory-prefix): New variables.
(%grub-boot-parameters): Use %default-store-directory-prefix.
(%default-operating-system): Use %default-btrfs-subvolume.
(test-boot-parameters): Add directory-prefix.
(test optional fields): Add test for directory-prefix.
(test os store-directory-prefix): New test.
2020-11-01 02:28:38 +01:00
Miguel Ángel Arruga Vivas
eaf0963983
system: Provide locale information to the bootloader.
* gnu/machine/ssh.scm (roll-back-managed-host): Use locale information
from boot-parameters.
* gnu/system.scm (operating-system-bootcfg): Provide locale information
to the bootloader.
* guix/system/script.scm (reinstall-bootloader): Use locale information
from boot-parameters.
2020-10-18 15:33:05 +02:00
Miguel Ángel Arruga Vivas
9d449b945b
system: Add locale to boot-parameters.
* gnu/system.scm (define-module)[export]: Add boot-parameters-locale.
(<boot-parameters>)[locale]: New field.
[boot-parameters-locale]: New accessor.
(read-boot-parameters): Read locale field.
(operating-system-boot-parameters): Provide operating-system locale to
boot-parameters record.
(opeating-system-boot-parameters-file): Likewise.
* Makefile.am (SCM_TESTS): Add tests/boot-parameters.scm.
* tests/boot-parameters.scm: New test file.
2020-10-18 15:32:54 +02: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
Efraim Flashner
e6e076281e
system: Add %base-packages-disk-utilities.
* gnu/system.scm (%base-packages-disk-utilities): New variable.
2020-10-15 11:13:24 +03: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
Ludovic Courtès
275b37e84c
system: Include 'guile-3.0-latest' in '%base-packages'.
* gnu/system.scm (%base-packages-utils): Change GUILE-3.0 to
GUILE-3.0-LATEST.
2020-10-08 12:26:56 +02:00
Stefan
1c3b709edb
linux-boot: Handle nfs-root device strings.
* gnu/build/linux-boot.scm (device-string->file-system-device): Support
nfs-root "device" strings.
* gnu/build/file-systems.scm (canonicalize-device-spec): Support nfs-root
"device" strings.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Avoid
checking of NFS file systems.
* gnu/system.scm (read-boot-parameters, device-sexp->device): Support
nfs-root "device" strings.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2020-09-07 11:00:48 +02:00
Ludovic Courtès
384377632c
system: Validate sudoers file when building the system.
Suggested by pkill9 <pkill9@runbox.com>.

* gnu/system.scm (validated-sudoers-file): New procedure.
(operating-system-etc-service): Use it.
2020-08-24 23:23:57 +02:00
Ludovic Courtès
12a3d7d6f7
system: 'operating-system-with-provenance' uses the OS location info.
This allows 'guix deploy' to save the config file when it's available.

* gnu/system.scm (operating-system-configuration-file): New procedure.
(operating-system-with-provenance): 'config-file' defaults to the value
returned by 'operating-system-configuration-file'.
2020-07-29 00:22:01 +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
a5e2fc7376
utils: Move <location> and '&error-location' to (guix diagnostics).
* guix/utils.scm (<location>, source-properties->location)
(location->source-properties, &error-location): Move to...
* guix/diagnostics.scm: ... here.
* gnu.scm: Adjust imports accordingly.
* gnu/machine.scm: Likewise.
* gnu/system.scm: Likewise.
* gnu/tests.scm: Likewise.
* guix/inferior.scm: Likewise.
* tests/channels.scm: Likewise.
* tests/packages.scm: Likewise.
2020-07-25 19:11:36 +02:00
Ludovic Courtès
d7e9e0bbc9
system: 'operating-system-root-file-system' raises upon missing root.
* gnu/system.scm (operating-system-root-file-system): Raise when 'find'
returns #f.
2020-07-15 01:36:24 +02:00
Ludovic Courtès
9e12da319b
system: Add 'location' field to <operating-system>.
This allows error messages to include source location info.

* gnu/system.scm (<operating-system>)[location]: New field.
2020-07-15 01:36:24 +02:00
Mathieu Othacehe
395782f235
system: Do not use "hurd-target?".
Fix the following issue, that happens during CI evaluation:

In guix/gexp.scm:
    782:4 19 (_ _)
In guix/store.scm:
  1907:12 18 (_ #<store-connection 256.99 7f3727b6de10>)
   1340:2 17 (map/accumulate-builds #<store-connection 256.99 7f372…> …)
In srfi/srfi-1.scm:
   586:29 16 (map1 ((#<file-append #<package hurd@0.9-1.91a516…> …) …))
   586:29 15 (map1 ((#<file-append #<<parameterized> bindings:…> …) …))
   586:29 14 (map1 ((#<file-append #<package hurd@0.9-1.91a516…> …) …))
   586:17 13 (map1 ((#<<operating-system> kernel: #<<parameter…> …) …))
In guix/store.scm:
   1299:8 12 (call-with-build-handler #<procedure build-accumulator…> …)
  2025:24 11 (run-with-store #<store-connection 256.99 7f3727b6de10> …)
In guix/gexp.scm:
   785:13 10 (_ _)
In guix/store.scm:
   1859:8  9 (_ _)
In guix/gexp.scm:
   243:18  8 (_ _)
In guix/store.scm:
  1894:38  7 (_ #<store-connection 256.99 7f3727b6de10>)
In gnu/system.scm:
  1012:19  6 (_ #<store-connection 256.99 7f3727b6de10>)
   634:11  5 (operating-system-services #<<operating-system> kernel:…>)
   611:17  4 (hurd-default-essential-services #<<operating-system> k…>)
   555:18  3 (operating-system-directory-base-entries #<<operating-s…>)
  1270:18  2 (operating-system-boot-parameters-file #<<operating-sy…> …)
  1225:35  1 (operating-system-boot-parameters #<<operating-system>…> …)
  1225:35  0 (operating-system-boot-parameters (#<<file-system> de…>) …)

gnu/system.scm:1225:35: In procedure operating-system-boot-parameters:
Wrong type to apply: #f

"hurd-target?" is returning false when it should return true in that context.

* gnu/system.scm (operating-system-boot-parameters): Check for "hurd" target
field of "os" instead of using the "hurd-target?" procedure.
2020-07-05 09:40:34 +02:00
Jan (janneke) Nieuwenhuizen
2b76179ecd
services: system-service-type: Add entries support for the Hurd.
When creating a disk-image using --save-provenance, "guix system describe"
now works.

* gnu/system.scm (operating-system-directory-base-entries): Add conditional
"hurd" parameter, make "initrd" parameter conditional.
(hurd-default-essential-services): Use them.
(operating-system-boot-parameters-file): Only add 'initrd' when set.
2020-07-03 09:06:21 +02:00
Jan (janneke) Nieuwenhuizen
12906d3e2a
system: 'read-boot-parameters' allow initrd to be missing.
* gnu/system.scm (read-boot-parameters): Allow initrd to be missing.
2020-07-03 09:00:53 +02:00
Jan (janneke) Nieuwenhuizen
aa864ebdb0
system: 'read-boot-parameters' bugfix for multiboot.
* gnu/system.scm (read-boot-parameters): Oops, only return value for
multiboot-modules instead of (key value).
2020-07-03 08:59:31 +02:00
Brice Waegeneire
f6c6970e0d
system: Add 'sg' and 'newgrp' to %SETUID-PROGRAMS.
* gnu/system.scm (%setuid-programs): Add 'sg' and 'newgrp'.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
2020-06-21 11:35:55 +08:00
Jan (janneke) Nieuwenhuizen
f25e8f76fe
hurd-boot: Use 'setxattr' instead of invoking settrans.
Note: Using `getxattr' on the Hurd instead of running showtrans does not
work (yet?).

* gnu/build/hurd-boot.scm (setup-translator): Use 'setxattr' instead of
invoking settrans.
* gnu/system.scm (hurd-multiboot-modules): Add --x-xattr-translator-records to
enable xattr-embedding of translators.
2020-06-19 10:40:53 +02:00
Jan (janneke) Nieuwenhuizen
5681ce5074
services: etc: Add '/etc/ttys' symlink for the Hurd.
Reported by Vitaliy Shatrov <D0dyBo0D0dyBo0@protonmail.com> via IRC.

* gnu/system.scm (operating-system-etc-service): For the Hurd, add '/etc/ttys'
symlink.  This fixes terminal behavior in the console by setting TERM=hurd.
2020-06-09 17:59:56 +02:00
Royce Strange
535a6be2e5
system: Fix typo that breaks grub.cfg generation.
* gnu/system.scm (boot-parameters->menu-entry): Delete quote to evalutate and
get kernel boot parameters.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2020-06-09 01:28:18 -04:00
Jan (janneke) Nieuwenhuizen
68d8c09465
gnu: services: Add %hurd-startup-service.
This decouples startup of the Hurd from the "hurd" package, moving the RC
script into SYSTEM.

* gnu/packages/hurd.scm (hurd)[inputs]: Remove hurd-rc-script.
[arguments]: Do not substitute it.  Update "runsystem.sh" to parse kernel
arguments and exec into --system=SYSTEM/rc.
(hurd-rc-script): Move to...
* gnu/services.scm (%hurd-rc-file): ...this new variable.
(hurd-rc-entry): New procedure.
(%hurd-startup-service): Use it in new variable.
* gnu/system.scm (hurd-default-essential-services): Use 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
c03e513a41
services: hurd: Populate system profile.
* gnu/system.scm (hurd-default-essential-services): Populate profile with
packages.
2020-06-08 14:26:13 +02:00
Jan (janneke) Nieuwenhuizen
f5ca79d2a2
services: Support etc-service for the Hurd.
* gnu/system.scm (operating-system-etc-service): Cater for missing nsswitch
and missing sudoers-file.  For the Hurd, add "login" and "motd".
(hurd-default-essential-services): Add operating-system-etc-service.
2020-06-08 14:12:29 +02:00
Jan (janneke) Nieuwenhuizen
c3fd2df705
system: Support activation service for the Hurd.
* gnu/build/activation.scm (boot-time-system): Use "command-line" for the
Hurd.
* gnu/system.scm (hurd-default-essential-services): Add %boot-service and
%activation-service.
2020-06-08 14:12:20 +02:00
Jan (janneke) Nieuwenhuizen
e6cd8581c1
system: Use 'hurd' package in label.
* gnu/system.scm (kernel->boot-label): Add keyword parameter 'hurd'.  If set,
use it for label.
(operating-system-default-label): Call with it with operating-system-hurd.
2020-06-08 13:51:19 +02:00
Jan (janneke) Nieuwenhuizen
912b857ede
system: Add 'multiboot-modules' field to <boot-parameters>.
* gnu/system.scm (<boot-parameters>)[multiboot-modules]: New field.
(read-boot-parameters): Initialize it.
(operating-system-multiboot-modules, hurd-multiboot-modules): New procedure.
(operating-system-boot-parameters): Cater for multiboot the Hurd and
initialize it; avoid initrd in that case.
(operating-system-kernel-file): Cater for for Gnumach (the Hurd) besides Linux.
(boot-parameters->menu-entry): Use it to support a multiboot <menu-entry>.
2020-06-08 13:51:18 +02:00
Jan (janneke) Nieuwenhuizen
2018fb2afe
system: Add 'hurd' field to <operating-system>.
* gnu/system.scm (<operating-system>)[hurd]: New field.
* doc/guix.texi (operating-system Reference): Document 'hurd'.
2020-06-08 13:51:18 +02:00
Jan (janneke) Nieuwenhuizen
45b2cb439d
system: hurd: Add hurd-default-essential-services.
* gnu/system.scm (hurd-default-essential-services): New procedure.
2020-06-08 13:51:18 +02:00
Ludovic Courtès
0c053a3973
system: 'system-linux-image-file-name' takes an optional parameter.
* gnu/system.scm (system-linux-image-file-name): Make 'target' an
optional parameter.
2020-06-06 23:28:49 +02:00
Maxim Cournoyer
e7b86a0d88
bootloader: grub: Rename the btrfs-subvolume-file-name parameter.
Following discussion in <https://issues.guix.gnu.org/37305>, it seems more
appropriate to give the parameter a more generic name that better describes
what it does.

* gnu/bootloader/grub.scm (normalize-file): Rename the
BTRFS-SUBVOLUME-FILE-NAME parameter to STORE-DIRECTORY-PREFIX, and always
assume this argument to be a string.
(eye-candy): Likewise.  Default STORE-DIRECTORY-PREFIX to "".
(grub-configuration-file): Likewise.
* gnu/system.scm (operating-system-bootcfg): Adapt.
2020-05-29 21:48:59 -04:00
Maxim Cournoyer
b460ba7992
bootloader: grub: Allow booting from a Btrfs subvolume.
* gnu/bootloader/grub.scm (strip-mount-point): Remove procedure.
(normalize-file): Add procedure.
(grub-configuration-file): New BTRFS-SUBVOLUME-FILE-NAME parameter.  When
defined, prepend its value to the kernel and initrd file names, using the
NORMALIZE-FILE procedure.  Adjust the call to EYE-CANDY to pass the
BTRFS-SUBVOLUME-FILE-NAME argument.  Normalize the KEYMAP file as well.
(eye-candy): Add a BTRFS-SUBVOLUME-FILE-NAME parameter, and use it, along with
the NORMALIZE-FILE procedure, to normalize the FONT-FILE and IMAGE nested
variables.  Adjust doc.
* gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): Adapt.
* gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise.
* gnu/system/file-systems.scm (btrfs-subvolume?)
(btrfs-store-subvolume-file-name): New procedures.
* gnu/system.scm (operating-system-bootcfg): Specify the Btrfs
subvolume file name the store resides on to the
`operating-system-bootcfg' procedure, using the new
BTRFS-SUBVOLUME-FILE-NAME argument.
* doc/guix.texi (File Systems): Add a Btrfs subsection to document the use of
subvolumes.
* gnu/tests/install.scm (%btrfs-root-on-subvolume-os)
(%btrfs-root-on-subvolume-os-source)
(%btrfs-root-on-subvolume-installation-script)
(%test-btrfs-root-on-subvolume-os): New variables.
2020-05-20 08:30:35 -04:00
Marius Bakke
87a40d7203
Merge branch 'master' into core-updates 2020-05-05 20:43:21 +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
Marius Bakke
50e6c1bf2e
Merge branch 'master' into core-updates 2020-05-02 17:31:28 +02:00
Florian Pelz
fd31731b9d
system: Blacklist usbkbd kernel module in default kernel-arguments.
This is said to avoid a race with the usbhid kernel module.
See <https://issues.guix.gnu.org/35574#18>.

* gnu/system.scm (%default-modprobe-blacklist): Blacklist it.
2020-05-01 12:27:52 +00:00
Florian Pelz
e06664da02
system: Blacklist usbmouse kernel module in default kernel-arguments.
This avoids a race with the bcm5974 kernel module.
Fixes <https://bugs.gnu.org/35574>.

* gnu/system.scm (%default-modprobe-blacklist): New variable.
(<operating-system>)[kernel-arguments]: Default to ...
(%default-kernel-arguments): ... this new variable.
* doc/guix.texi (operating-system Reference): Document the change.
2020-05-01 08:46:59 +00:00
Marius Bakke
8bf8cd9b85
Merge branch 'master' into core-updates
Conflicts:
	gnu/local.mk
	gnu/packages/backup.scm
	gnu/packages/emacs-xyz.scm
	gnu/packages/guile.scm
	gnu/packages/lisp.scm
	gnu/packages/openldap.scm
	gnu/packages/package-management.scm
	gnu/packages/web.scm
	gnu/packages/xorg.scm
2020-04-30 23:47:49 +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
Ludovic Courtès
cda751105e
system: 'operating-system-directory-base-entries' uses 'profile'.
* gnu/system.scm (operating-system-directory-base-entries): Use a
declarative profile instead of 'profile-derivation'.
2020-04-26 22:49:48 +02:00
Marius Bakke
030f6f489f
Merge branch 'master' into core-updates
Conflicts:
	etc/news.scm
	gnu/local.mk
	gnu/packages/bootloaders.scm
	gnu/packages/linphone.scm
	gnu/packages/linux.scm
	gnu/packages/tls.scm
	gnu/system.scm
2020-04-23 13:33:09 +02:00
Danny Milosavljevic
f91ad0b13d
system: Automatically adjust linux-module packages to use the
operating-system's kernel.

* gnu/system.scm (package-for-kernel): New procedure.
(operating-system-directory-base-entries): Use it.
* gnu/tests/linux-module.scm: Test it.
2020-04-22 22:59:39 +02:00
Brice Waegeneire
93664feee1
system: Split %BASE-PACKAGES in smaller parts.
* gnu/system.scm: (%base-packages-interactive, %base-packages-linux,
%base-packages-networking, %base-packages-utils): New variables.
(%base-packages): Use those new variables.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-04-22 19:23:57 +02:00
Ludovic Courtès
2e37d1583a
system: 'operating-system-boot-parameters-file' uses 'scheme-file'.
* gnu/system.scm (operating-system-boot-parameters-file): Use
'scheme-file' instead of 'gexp->file'.
(operating-system-directory-base-entries): Adjust accordingly.
2020-04-22 19:23:57 +02:00
Ludovic Courtès
71977a6c59
Revert "system: Don’t create a module database when no modules are available."
This reverts commit b2fff3b5de.

Fixes <https://bugs.gnu.org/40713>.
Reported by pkill9 <pkill9@runbox.com>.

This commit is incorrect: its effect depends on whether KERNEL's build
output is already available in the store, it breaks with non-package
kernels as reported at <https://bugs.gnu.org/40713>, and the
LINUX-MODULE-DATABASE hook is required at all times since
5c79f23863 removed the relevant bits from
the 'linux-libre' package.
2020-04-21 00:06:40 +02:00
Marius Bakke
2778302399
Merge branch 'master' into core-updates
Conflicts:
	etc/news.scm
	gnu/local.mk
	gnu/packages/check.scm
	gnu/packages/cross-base.scm
	gnu/packages/gimp.scm
	gnu/packages/java.scm
	gnu/packages/mail.scm
	gnu/packages/sdl.scm
	gnu/packages/texinfo.scm
	gnu/packages/tls.scm
	gnu/packages/version-control.scm
2020-04-08 13:00:50 +02:00
Ivan Kozlov
b2fff3b5de
system: Don’t create a module database when no modules are available.
* gnu/system.scm (operating-system-directory-base-entries): Don't create
a module database when no modules are available.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2020-04-04 21:13:26 +02:00
Marius Bakke
18af687037
Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/icu4c.scm
	gnu/packages/man.scm
	gnu/packages/python-xyz.scm
	guix/scripts/environment.scm
	guix/scripts/pack.scm
	guix/scripts/package.scm
	guix/scripts/pull.scm
	guix/store.scm
2020-03-27 00:12:15 +01:00
Brice Waegeneire
a9f2c210f3
system: Export 'operating-system-kernel-loadable-modules'.
* gnu/system.scm: Export 'operating-system-kernel-loadable-modules'.

Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com>
2020-03-23 18:52:31 +01:00
Danny Milosavljevic
5c79f23863
system: Add kernel-loadable-modules to operating-system.
* gnu/system.scm (<operating-system>): Add kernel-loadable-modules.
(operating-system-directory-base-entries): Use it.
* doc/guix.texi (operating-system Reference): Document
KERNEL-LOADABLE-MODULES.
* gnu/build/linux-modules.scm (depmod): New procedure.
(make-linux-module-directory): New procedure.  Export it.
* guix/profiles.scm (linux-module-database): New procedure.  Export it.
* gnu/tests/linux-modules.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/linux.scm (make-linux-libre*)[arguments]<#:phases>[install]:
Disable depmod.  Remove "build" and "source" symlinks.
[native-inputs]: Remove kmod.
2020-03-22 12:51:50 +01:00
Marius Bakke
c95f5f0af7
system: Switch to Guile 3.0.
* gnu/system.scm (%base-packages): Change from GUILE-2.2 to GUILE-3.0.
2020-03-20 17:23:01 +01:00
Marius Bakke
c4d769d359
Merge branch 'master' into core-updates 2020-03-18 19:41:08 +01:00
Maxim Cournoyer
f6b950319c
gnu: system: Export %sudoers-specification.
Exporting this variable allows reusing the default value of the `sudoers-file'
field when configuring it.

* gnu/system.scm (gnu): Export %sudoers-specification.
* doc/guix.texi (Invoking guix deploy): Document an example, to use with 'guix
deploy'.
2020-03-17 23:01:07 -04:00
Marius Bakke
50b99c90c8
Merge branch 'master' into core-updates 2020-03-10 20:50:02 +01:00
Brice Waegeneire
9ef37e81d6
system: Export 'operating-system' missing fields.
* gnu/system.scm: Export 'operating-system-firmware',
'operating-system-keyboard-layout',
'operating-system-name-service-switch', 'operating-system-pam-services',
'operating-system-setuid-programs', 'operating-system-skeletons',
'operating-system-sudoers-file', 'operating-system-swap-devices'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-03-08 21:21:57 +01:00
Marius Bakke
ebb7cf9e21
Merge branch 'master' into core-updates 2020-03-04 23:16:17 +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
Mathieu Othacehe
dfc8ccbf5d
system: Stop using canonical-package.
Usage of canonical-package outside of thunked fields breaks cross-compilation,
see: https://lists.gnu.org/archive/html/guix-devel/2019-12/msg00410.html.

* gnu/installer.scm (installer-program): Remove canonical-package.
* gnu/services/base.scm (<nscd-cache>): Ditto,
(%base-services): ditto.
* gnu/services/xorg.scm: Remove useless canonical-package import.
* gnu/system.scm (%base-packages): Remove canonical-package.
* gnu/system/install.scm (%installation-services): Ditto,
(installation-os): ditto.
* gnu/system/locale.scm (single-locale-directory): Ditto.
2020-02-11 13:54:45 +01:00
Simon Josefsson
58236d301c
system: Drop net-tools from %BASE-PACKAGES (replaced by iproute2).
* gnu/system.scm (%base-packages): Remove net-tools.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-01-12 00:19:09 +01:00
Marius Bakke
01bb039e7b
system: Use the udev-enabled util-linux variant.
Fixes <https://bugs.gnu.org/37931>.
Reported by Bengt Richter <bokr@bokr.com>.

* gnu/system.scm (%base-packages): Change from UTIL-LINUX to UTIL-LINUX+UDEV.
2020-01-08 20:04:12 +01:00
Ludovic Courtès
33b7cb7a59
services: Add 'provenance-service-type'.
* gnu/services.scm (object->pretty-string)
(channel->code, channel->sexp, provenance-file)
(provenance-entry): New procedures.
(provenance-service-type): New variable.
* gnu/system.scm (operating-system-with-provenance): New procedure.
* doc/guix.texi (Service Reference): Document 'provenance-service-type'.
2019-12-07 00:59:56 +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
Ricardo Wurmus
e08902d3cb
Merge branch 'master' into core-updates 2019-10-06 22:02:20 +02:00
Ludovic Courtès
1994422752
system: Add 'mount' and 'umount' to '%setuid-programs'.
Fixes <https://bugs.gnu.org/37569>.
Reported by Diego Nicola Barbato <dnbarbato@posteo.de>.

* gnu/system.scm (%setuid-programs): Add "mount" and "umount" from
util-linux.
2019-10-06 14:45:35 +02:00
Mark H Weaver
65542a8852
Merge branch 'master' into core-updates 2019-09-06 20:46:00 -04:00
Ludovic Courtès
a28cfee841
system: Add 'bootloader-menu-entries' field to <boot-parameters>.
This allows us to keep track of the extra menu entries specified in the
OS configuration.

* gnu/system.scm (<boot-parameters>)[bootloader-menu-entries]: New field.
(read-boot-parameters): Initialize it.
(operating-system-boot-parameters): Likewise.
(operating-system-boot-parameters-file): Serialize it.
* gnu/bootloader.scm (menu-entry->sexp, sexp->menu-entry): New
procedures.
2019-08-30 01:33:45 +02:00
Timothy Sample
2a80d9e552
system: Write the timezone to /etc/timezone.
* gnu/system.scm (operating-system-etc-service): Write the operating
system timezone to /etc/timezone.

Fixes <https://bugs.gnu.org/35746>.
2019-07-16 21:53:05 -04:00
Ludovic Courtès
9fcfe30d28
system: Add 'operating-system-with-gc-roots'.
* gnu/tests/install.scm (operating-system-with-gc-roots): Move to...
* gnu/system.scm (operating-system-with-gc-roots): ... here.  New
procedure.
2019-05-15 16:36:21 +02:00
Ludovic Courtès
f8885ecab6
system: Export 'operating-system-default-essential-services'.
* gnu/system.scm (essential-services): Rename to...
(operating-system-default-essential-services): ... this.
(<operating-system>)[essential-services]: Adjust accordingly.
2019-05-10 23:29:18 +02:00
Ludovic Courtès
aea1a42e00
system: Add boot file systems to /etc/fstab.
* gnu/system.scm (essential-services): Pass FSTAB-SERVICE-TYPE the list
of file systems that match 'file-system-needed-for-boot?'.
2019-04-27 00:11:52 +02:00
Ludovic Courtès
01ac0e6be1
system: Add guile-readline and guile-colorized to %BASE-PACKAGES.
This adds pretty much nothing to the system closure size.

* gnu/system.scm (%base-packages): Add GUILE-READLINE and
GUILE-COLORIZED.
2019-04-25 00:45:34 +02:00
Christopher Baines
5582aa8e31
system: Change default kernel-arguments to '("quiet").
This improves the readability of the boot process, especially when using full
disk encryption where you're required to enter the passphrase at a particular
point.

* gnu/system.scm (<operating-system>)[kernel-arguments]: Change the default to
'("quiet").
* doc/guix.texi (operating-system Reference): Document this change.
2019-04-22 22:18:00 +01:00
Ludovic Courtès
3f03a198b2
system: Add 'label' field to <operating-system>.
* gnu/system.scm (<operating-system>)[label]: New field.
(operating-system-default-label): New procedure.
(operating-system-boot-parameters): Use it instead of
'kernel->boot-label'.
* doc/guix.texi (operating-system Reference): Document it.
2019-04-15 12:24:14 +02:00
Ludovic Courtès
4ce3a32680
system: Remove "beta" from GRUB menu entries.
* gnu/system.scm (kernel->boot-label): Remove "(beta)".
2019-04-14 23:40:52 +02:00
Ludovic Courtès
d8bead6c5d
system: Define 'this-operating-system'.
* gnu/system.scm (<operating-system>): Choose 'this-operating-system' as
the 'this' identifier.
[essential-services]: Adjust accordingly.
2019-03-30 11:08:39 +01:00
Ludovic Courtès
69cae3d335
system: Add 'essential-services' field to <operating-system>.
* gnu/system.scm (<operating-system>)[essential-services]: New field.
(operating-system-directory-base-entries): Remove #:container? keyword
and keep only the not-container branch.
(essential-services): Likewise.
(operating-system-services): Likewise, and call
'operating-system-essential-services' instead of 'essential-services'.
(operating-system-activation-script): Remove #:container?.
(operating-system-boot-script): Likewise.
(operating-system-derivation): Likewise.
* gnu/system/linux-container.scm (container-essential-services): New procedure.
(containerized-operating-system): Use it and set the
'essential-services' field.
(container-script): Remove call to 'operating-system-derivation'.
* gnu/system/vm.scm (system-docker-image): Likewise.
* doc/guix.texi (operating-system Reference): Document 'essential-services'.
2019-03-25 23:37:06 +01:00