Commit graph

230 commits

Author SHA1 Message Date
Ludovic Courtès
42226063f6
vm: Disable KVM on i386.
* gnu/build/vm.scm (load-in-linux-vm): Disable KVM on i386.
2018-07-04 15:26:21 +02:00
Ludovic Courtès
88d4a9c2be
vm: 'make-iso9660-image' makes 'grub.cfg' a GC root.
* gnu/build/vm.scm (make-iso9660-image): Add call to
'register-bootcfg-root'.
2018-06-26 14:29:18 +02:00
Ludovic Courtès
718d44cc9f
vm: 'make-iso9660-image' no longer includes unreferenced store items.
Fixes <https://bugs.gnu.org/31757>.

* gnu/build/vm.scm (make-iso9660-image): Invoke 'grub-mkrescue' in
'open-pipe*'.  Use '-path-list -' instead of passing "gnu/store=…".
2018-06-26 14:27:57 +02:00
Ludovic Courtès
a7751eeb57
vm: Don't try to modify the bind-mounted store.
Previously 'guix system disk-image --file-system-type=iso9660' would
fail because 'register-closure' would try to reset timestamps/ownership
on the bind-mounted store, which fails with EPERM.

* gnu/build/vm.scm (make-iso9660-image): Pass #:reset-timestamps? to
'register-closure'.
2018-06-26 14:27:57 +02:00
Ludovic Courtès
411959bef3
linux-initrd: Module check correctly handles hyphen vs. underscore.
Fixes <https://bugs.gnu.org/31714>.
Reported by Vagrant Cascadian <vagrant@debian.org>
and Florian Pelz <pelzflorian@pelzflorian.de>.

* gnu/system/mapped-devices.scm (check-device-initrd-modules): Pass
LINUX-MODULES through 'normalize-module-name'.
* gnu/build/linux-modules.scm (normalize-module-name): Export.
2018-06-14 23:34:59 +02:00
Ludovic Courtès
ea0a06cee2
Remove 'guix-register' and its traces.
* Makefile.am (SH_TESTS): Remove tests/guix-register.sh.
* build-aux/pre-inst-env.in (GUIX_REGISTER): Remove.
* gnu/build/install.scm (directives): Remove outdated comment.
* gnu/build/vm.scm (root-partition-initializer): Update comment.
* gnu/packages/package-management.scm (guix-register): Remove.
* guix/config.scm.in (%sbindir, %guix-register-program): Remove.
* guix/scripts/system.scm (install): Adjust docstring.
* guix/self.scm (make-config.scm): Remove #:guix.  Do not generate
%sbindir and %guix-register-program.
(specification->package): Remove "guix".
* nix/guix-register/guix-register.cc: Remove.
* nix/libstore/store-api.cc (decodeValidPathInfo): Remove.
* nix/libstore/store-api.hh (decodeValidPathInfo): Remove declaration.
* nix/local.mk (sbin_PROGRAMS, guix_register_SOURCES)
(guix_register_CPPFLAGS, guix_register_LDFLAGS): Remove.
* tests/guix-register.sh: Remove.
2018-06-14 11:17:00 +02:00
Ludovic Courtès
eb9fe97495
database: Allow for deterministic database construction.
Fixes <https://bugs.gnu.org/21073>.

* guix/store/database.scm (sqlite-register): Add #:time.
(%epoch): New variable.
(register-items): Add #:registration-time.  Pass #:time to
'sqlite-register'.
* gnu/build/install.scm (register-closure): Pass #:registration-time.
2018-06-14 11:17:00 +02:00
Ludovic Courtès
078c2329c0
install: Use 'reset-timestamps' from (guix store database).
* gnu/build/install.scm (reset-timestamps): Remove.
* gnu/build/vm.scm: Use 'reset-timestamps' from (guix store database).
2018-06-14 11:17:00 +02:00
Ludovic Courtès
31a63be878
database: Add 'register-items'.
* guix/build/store-copy.scm (store-info): Export.
* guix/store/database.scm (register-items): New procedure.
(register-path): Implement in terms of 'register-items'.
* gnu/build/install.scm (register-closure): Use 'register-items' instead
of 'for-each' and 'register-path'.
2018-06-14 11:17:00 +02:00
Ludovic Courtès
c45477d2a1
install: Use (guix store database) instead of 'guix-register'.
* gnu/build/install.scm (register-closure): Add #:reset-timestamps? and
and #:schema; honor them.  Rewrite in terms of 'register-path'.
(populate-single-profile-directory): Add #:schema and honor it.  Make
/var/guix/profiles and /var/guix/gcroots.
* gnu/build/vm.scm (root-partition-initializer): Pass
 #:reset-timestamps? to 'register-closure'.
* gnu/system/vm.scm (not-config?): New procedure.
(guile-sqlite3&co): New variable.
(expression->derivation-in-linux-vm)[config]: New variable.
[builder]: Use 'with-extensions'.
(iso9660-image)[schema, config]: New variables.
Wrap build expression in 'with-extensions'; add 'sql-schema' call.
Remove GUIX from INPUTS.
(qemu-image)[schema, config]: New variables.
Wrap body in 'with-extensions'.
(system-docker-image)[not-config?]: Remove.
[config]: Use 'make-config.scm'.
[schema]: New variable.
[build]: Use 'with-extensions'.  Add call to 'sql-schema'.  Remove GUIX
from INPUTS.
* gnu/system/file-systems.scm (%store-prefix): Check whether
'%store-prefix' is defined.
* guix/scripts/pack.scm (self-contained-tarball)[not-config?]
[libgcrypt, schema]: New variables.
[build]: Wrap in 'with-extensions'.  Adjust imported module list to use
'make-config.scm' for (guix config).
2018-06-14 11:16:59 +02:00
Ludovic Courtès
a13c1bf4ca
Merge branch 'master' into core-updates 2018-06-01 23:41:40 +02:00
Ludovic Courtès
33d8a87104
bootloader: grub: Use 'with-extensions'.
* gnu/bootloader/grub.scm (svg->png): Use 'with-extensions'.  Remove
'add-to-load-path' calls.
* gnu/build/svg.scm: Use (rsvg) and (cairo) the normal way.  Remove
'module-autoload!' calls.
2018-06-01 15:21:28 +02:00
Ludovic Courtès
7a4e2eaab3
marionette: Add 'wait-for-tcp-port'.
* gnu/build/marionette.scm (wait-for-tcp-port): New procedure.
* gnu/tests/dict.scm (run-dicod-test)["connect inside"]: Use it instead
of the inline loop.
2018-06-01 13:50:26 +02:00
Ludovic Courtès
69a05eab35
file-systems: Always wait for devices to show up.
Previously, 'canonicalize-device-spec' would wait for devices when they
were specified as a label or UUID, but would not wait when the user
passed a "/dev" file name directly.  This could cause problems when
the /dev node takes a while to show up.

* gnu/build/file-systems.scm (canonicalize-device-spec): Add 'resolve'
call in the 'string?' case.
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
9ceeca0880
system: Remove uses of the 'title' field of <file-system>.
* gnu/system/install.scm (installation-os): Remove uses of the 'title'
field of 'file-system'; use 'file-system-label' as appropriate.
* gnu/system/vm.scm (system-disk-image, system-qemu-image): Likewise.
* gnu/tests.scm (%simple-os): Likewise.
* gnu/tests/install.scm (%minimal-os, %minimal-extlinux-os)
(%minimal-os-on-vda, %separate-home-os, %separate-store-os)
(%raid-root-os, %encrypted-root-os, %btrfs-root-os): Likewise.
* gnu/build/shepherd.scm (default-mounts)[tmpfs]: Likewise.
* tests/guix-system.sh: Likewise.
* tests/system.scm (%root-fs): Likewise.
("operating-system-boot-mapped-devices, implicit dependency"): Likewise.
2018-05-28 13:24:19 +02: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
1640f16e78
Merge branch 'master' into core-updates 2018-05-27 01:26:09 -04:00
Ludovic Courtès
98e0b1288f
vm: Pass "panic=1" to Linux.
* gnu/build/vm.scm (load-in-linux-vm): Always pass "panic=1" after '-append'.
2018-05-25 13:43:03 +02:00
Mark H Weaver
9d10a63402
Merge branch 'master' into core-updates 2018-05-24 02:34:08 -04:00
Ludovic Courtès
353df40102
vm: Print the label and UUID of partitions.
* gnu/build/vm.scm (create-ext-file-system): Print the label and UUID.
2018-05-23 10:21:02 +02:00
Marius Bakke
5576cfabf3
Merge branch 'master' into core-updates 2018-03-29 17:34:41 +02:00
Ludovic Courtès
82b71ac366
activation: Pass '-d HOME' to 'usermod'.
Fixes a bug whereby changes to user home directories in the OS config
would never be effective.

Reported by Pierre Neidhardt <ambrevar@gmail.com>.

* gnu/build/activation.scm (modify-user): Pass '-d HOME'.
2018-03-27 14:51:44 +02:00
Chris Marusich
8c9bf2946a
gnu: When building in a VM, share a temporary directory.
* gnu/build/vm.scm (load-in-linux-vm): Make a shared temporary directory
  available in the VM.
* gnu/system/vm.scm (%linux-vm-file-systems): Add a corresponding entry.
2018-03-24 03:04:10 +01:00
Chris Marusich
af81311b8c
vm: Allow control of deduplication in root-partition-initializer.
* gnu/build/vm.scm (root-partition-initializer): Add #:deduplicate?
  keyword argument.
2018-03-24 03:04:10 +01:00
Mark H Weaver
3e629738a3
gnu: cross-base: Use invoke in (gnu build cross-toolchain).
* gnu/build/cross-toolchain.scm (set-cross-path/mingw, install-strip): Use
invoke.
2018-03-23 04:41:53 -04:00
Ludovic Courtès
71e08fde28
glob: Add an extra glob pattern compilation stage.
* guix/glob.scm (compile-glob-pattern): Rename to...
(string->sglob): ... this.
(compile-sglob, string->compiled-sglob): New procedures.
(glob-match?): Replace '?, 'range, and 'set with a single clause.
* tests/glob.scm (test-compile-glob-pattern): Rename to...
(test-string->sglob): ... this.  Adjust accordingly.
(test-glob-match): Use 'string->compiled-sglob' instead of
'compile-glob-pattern'.
* gnu/build/linux-modules.scm (read-module-aliases): Use
'string->compiled-sglob' instead of 'compile-glob-pattern'.
2018-03-18 22:57:17 +01:00
Ludovic Courtès
675e81a082
linux-modules: 'load-linux-module*' honors BLACK-LIST in recursive calls.
* gnu/build/linux-modules.scm (load-linux-module*): Pass BLACK-LIST in
recursive call.
2018-03-18 22:35:27 +01:00
Ludovic Courtès
a57df67b59
linux-modules: Add 'current-kernel-directory'.
* gnu/build/linux-modules.scm (current-kernel-directory): New procedure.
(current-alias-file): Use it.
2018-03-18 22:35:03 +01:00
Danny Milosavljevic
363be0c6db
vm: Pass "-append ..." only once.
* gnu/build/vm.scm (load-in-linux-vm): Pass "-append ..." only once.
2018-03-16 22:59:28 +01:00
Ludovic Courtès
e1d0f2aa87
vm: Use 'invoke' instead of 'system*'.
* gnu/build/vm.scm (load-in-linux-vm, initialize-partition-table)
(create-ext-file-system, create-fat-file-system)
(install-efi, make-iso9660-image): Use 'invoke' instead
of (unless (zero? (system* ...)) (error ...)).
2018-03-15 23:46:15 +01:00
Danny Milosavljevic
8b2219d847
linux-modules: Add module-aliases.
* gnu/build/linux-modules.scm (module-aliases): New variable.
2018-03-03 23:40:02 +01:00
Ludovic Courtès
8661ad2743
linux-modules: Add 'device-module-aliases' and related procedures.
* gnu/build/linux-modules.scm (readlink*, stat->device-major)
(stat->device-minor): New procedures.
(%not-slash): New variable.
(read-uevent, device-module-aliases, read-module-aliases)
(current-alias-file, known-module-aliases, matching-modules): New
procedures.
2018-03-02 13:46:33 +01:00
Ludovic Courtès
3c14e7e6bb
linux-modules: Use 'load-linux-module/fd'.
This should be more efficient than loading the whole thing in user space.

* gnu/build/linux-modules.scm (load-linux-module*): Use
'load-linux-module/fd' instead of 'load-linux-module'.  Remove 'slurp'.
2018-02-28 22:47:48 +01:00
Ludovic Courtès
27a2c9c3e0
marionette: Use QEMU's "VM channel" mechanism.
* gnu/tests.scm (<marionette-configuration>)[device]: Default to
"/dev/virtio-ports/org.gnu.guix.port.0".
* gnu/tests.scm (marionette-shepherd-service): Remove (guix build
syscalls) from 'modules'.  Remove 'tcsetattr' call from 'start'.
* gnu/build/marionette.scm (make-marionette): Use "-virtserialport"
instead of "-virtconsole".
2018-02-19 22:04:11 +01:00
Christopher Baines
8db8bf921d
gnu: build: linux-boot: Remove bind-mount export.
bind-mount is not contained within this module.

* gnu/build/linux-boot.scm: Remove bind-mount export.
2018-02-06 17:19:28 +00:00
Danny Milosavljevic
015d0a8418
linux-boot: Add find-long-options.
* gnu/build/linux/boot.scm (find-long-options): New variable.
2018-02-01 00:11:10 +01:00
Tobias Geerinckx-Rice
162a137400
gnu: Consistently Write ‘file system(s)’.
It is the GNU way.

* doc/guix.texi (Build Systems, DNS Services): Write ‘file system(s)’.
* gnu/build/vm.scm (create-ext-file-system, create-fat-file-system):
Likewise.
* gnu/packages/backup.scm (dirvish, rsnapshot)[description]: Likewise.
* gnu/packages/check.scm (python-testpath)[description]: Likewise.
* gnu/packages/disk.scm (pydf)[description]: Likewise.
* gnu/packages/file-systems.scm (disorderfs)[synopsis, description]: Likewise.
(glusterfs)[description]: Likewise.
* gnu/packages/haskell.scm (ghc-directory, ghc-system-fileio-bootstrap)
(ghc-system-fileio)[synopsis]: Likewise.
(ghc-fsnotify)[description]: Likewise.
* gnu/packages/linux.scm (proot)[description]: Likewise.
(jmtpfs)[synopsis, description]: Likewise.
* gnu/packages/mate.scm (caja, caja-extensions)[description]: Likewise.
* gnu/packages/storage.scm (ceph)[description]: Likewise.
* gnu/packages/sync.scm (lsyncd)[description]: Likewise.
* gnu/packages/syncthing.scm (syncthing)[synopsis]: Likewise.
(go-github-com-zillode-notify)[description]: Likewise.
* gnu/services/nfs.scm (pipefs-service-type): Likewise.
* guix/scripts/system.scm (perform-action): Likewise.
2018-01-19 17:28:31 +01:00
Ludovic Courtès
95aa64bc48
linux-container: Work around EBADF errors upon exit.
Typically 'read-pid-file/container' would fail when starting services in
containers such as BitlBee.

* gnu/build/linux-container.scm (call-with-clean-exit): Use
'primitive-_exit' instead of 'primitive-exit'.
(container-excursion*): Close OUT.
2018-01-15 23:29:33 +01:00
Ludovic Courtès
aeed74f370
linux-boot: Add #:on-error for initrd error handling.
Suggested by Danny Milosavljevic <dannym@scratchpost.org>
in <https://bugs.gnu.org/29922>.

* gnu/build/linux-boot.scm (boot-system): Add #:on-error parameter and
pass it to 'call-with-error-handling'.
* gnu/system/linux-initrd.scm (raw-initrd): Add #:on-error and pass it.
(base-initrd): Likewise.
2018-01-08 23:44:07 +01:00
Leo Famulari
2ca712bdba
vm: Pass the host's /dev/urandom to the guest at /dev/hwrng.
* gnu/build/vm.scm (load-in-linux-vm): Use QEMU's virtio-rng-pci.
* gnu/system/vm.scm (common-qemu-options): Likewise.
2017-12-18 00:39:40 -05:00
Danny Milosavljevic
97817e7f18
linux-boot: Add make-static-device-nodes.
* gnu/build/linux-boot.scm (make-static-device-nodes): New variable.
(<device-node>): New variable.
(read-static-device-nodes): New variable.
(report-system-error): New variable.
(catch-system-error): New variable.
(create-device-node): New variable.
(mkdir-p*): New variable.

Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
2017-12-16 07:33:09 +01:00
Mathieu Othacehe
e224820386
bootloader: Factorize write-file-on-device.
* gnu/bootloader/extlinux.scm (install-extlinux): Factorize bootloader
writing in a new procedure write-file-on-device defined in (gnu build
bootloader).
* gnu/build/bootloader.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add new file.
* gnu/system/vm.scm (qemu-img): Adapt to import and use (gnu build bootloader)
module during derivation building.
* gnu/scripts/system.scm (bootloader-installer-derivation): Ditto.
2017-12-15 11:52:38 +01:00
Mathieu Othacehe
acf54bca22
vm: Adapt qemu command to ARM.
* gnu/build/vm.scm (load-in-linux-vm): New argument #:target-arm32.
Use it to adapt command for qemu-system-arm.  This implies to choose a
machine ("virt"), use the correct console port "ttyAMA0", disable KVM use
that is buggy on some ARM boards (Odroid XU4 for example) and use user mode
network stack instead of NIC. Gather all those options in a new variable
"arch-specific-flags".
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Pass
to load-in-linux-vm "#:target-arm32?" argument.
2017-12-15 11:44:29 +01:00
Mathieu Othacehe
7b307a21dd
vm: Use qemu drive device parameter.
* gnu/build/vm.scm (load-in-linux-vm): Use device parameter to define drive
  device.
2017-12-13 11:30:04 +01:00
Ludovic Courtès
22bf86a671
linux-boot: Remove unneeded import.
* gnu/build/linux-boot.scm: Remove unnecessary autoload of (system base
compile).
2017-12-02 23:13:21 +01:00
Ludovic Courtès
15c2ddc124
vm: ISO9660 images include /etc and other standard files.
* gnu/build/vm.scm (make-iso9660-image): Call
'populate-root-file-system' instead of a series of 'mkdir-p' calls.  Add
/etc to the arguments of xorriso.
2017-11-29 16:44:53 +01:00
Ludovic Courtès
748d4a84d1
linux-boot: Ensure /etc exists on the root file system.
Fixes a regression introduced in
c828969036 whereby /etc would no longer be
created as a result of calling 'mark-as-not-killable'.

This would affect ISO images because 'make-iso9660-image' does not
create /etc by default.  In particular, the ISO installation image as
created by the "iso-image-installer" test would fail to boot while
creating the /root/etc/mtab symlink:
<https://hydra.gnu.org/build/2352514/nixlog/9/raw>.

* gnu/build/linux-boot.scm (mount-root-file-system): Make sure /root/etc
exists.
2017-11-29 16:44:53 +01:00
Ludovic Courtès
0cb9c9d170
shepherd: Include /etc/group in service containers.
* gnu/build/shepherd.scm (default-mounts)[passwd]: Rename to...
[accounts]: ... this.  Add /etc/group.
2017-11-22 23:02:35 +01:00
Hartmut Goebel
c828969036
build: Use overlayfs instead of unionfs.
Overlayfs is part of the kernel, while unionfs needs FUSE.  This also reduces
the size of the initrd by ca. 4.3% (487K).

* gnu/build/linux-boot.scm (mount-root-file-system): Remove optional parameter
  "unionfs"; mount using overlayfs instead of unionfs; new directory layout
  requied by overlayfs; update documentation.
  [mark-as-not-killable]: Remove now unused function

* gnu/system/linux-initrd.scm (file-system-packages): Remove now unused
  packages "unionfs-fuse/static" and thus unused related 'if'.
  (linux-modules): Replace "fuse" by "overlay".
2017-11-08 18:23:05 +01:00