* gnu/build/vm.scm (estimated-partition-size): New procedure.
* gnu/system/vm.scm (expression->derivation-in-linux-vm):
Change #:disk-image-size default to 'guess.
[builder]: When DISK-IMAGE-SIZE is 'guess, use
'estimated-partition-size' and compute and estimate of the image size.
(qemu-image): Likewise.
* guix/build/store-copy.scm (file-size, closure-size): New procedures.
* guix/scripts/system.scm (%default-options): Change 'image-size' to
'guess.
* doc/guix.texi (Building the Installation Image): Remove '--image-size'
flag from example.
(Invoking guix system): Document the image size estimate.
* gnu/build/vm.scm (load-in-linux-vm): Add 'format' call when
MAKE-DISK-IMAGE? is true.
(initialize-partition-table): Show the size of the partitions being
created.
* gnu/build/marionette.scm (wait-for-file): New procedure.
* gnu/tests/base.scm (run-mcron-test)[test](wait-for-file): Remove.
Pass second argument in 'wait-for-file' calls.
* gnu/tests/ssh.scm (run-ssh-test)[test](wait-for-file): Remove.
Pass second argument in 'wait-for-file' calls.
* gnu/tests/messaging.scm (run-xmpp-test)[test](guest-wait-for-file):
Remove.
Use 'wait-for-file' instead, with second argument.
Trying to boot GuixSD when an audio CD is in the drive will die with an
"input/output error" when trying to read the superblock from the cd
drive.
This patch catches and warns in this case rather than dying.
* gnu/build/file-systems.scm (ENOENT-safe): Handle EIO.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Reported by Alex Griffin <a@ajgrf.com>.
Fixes <http://bugs.gnu.org/27135>.
* gnu/build/activation.scm (add-user): When UID is zero, add 'chmod'
call.
* gnu/tests/base.scm (run-basic-test)["permissions on /root"]: New test.
Fixes a bug whereby GuixSD would create the /nonexistent directory, from
user 'nobody', even though it has 'create-home-directory?' set to #f.
* gnu/build/activation.scm (activate-users+groups): Add comment for
\#:create-home?.
(activate-user-home)[ensure-user-home]: Skip when CREATE-HOME? is #f or
SYSTEM? is #t.
* gnu/tests/base.scm (run-basic-test)["no extra home directories"]: New
tests.
Previously a named socket such as /dev/log would fail
the 'regular-file?' test and we'd end up mkdir'ing it.
* gnu/build/file-systems.scm (regular-file?): Remove.
(mount-file-system): Change (regular-file? source)
to (not (file-is-directory? source)).
* gnu/build/vm.scm (define-module): Use module (guix build syscalls).
It fixes the following warnings during guix build :
gnu/build/vm.scm:233:3: warning: possibly unbound variable `mount'
gnu/build/vm.scm:238:3: warning: possibly unbound variable `umount'
gnu/build/vm.scm:268:8: warning: possibly unbound variable `mount'
gnu/build/vm.scm:276:8: warning: possibly unbound variable `umount'
gnu/build/vm.scm:315:4: warning: possibly unbound variable `mount'
gnu/build/vm.scm:323:4: warning: possibly unbound variable `umount'
This was not possible until the previous commit because we had to be sure
that Guile core implementation of 'mount' and 'umount' was used in
initrd context.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/scripts/pack.scm (self-contained-tarball): Add #:localstatedir?
parameter and honor it.
(%options, show-help): Add '--localstatedir'.
(guix-pack): Honor it.
* gnu/build/install.scm (populate-single-profile-directory): Add
#:register? parameter and honor it.
* doc/guix.texi (Binary Installation): Use '--localstatedir' in
example.
(Invoking guix pack): Document it.
* gnu/build/linux-container.scm (container-excursion*): New procedure.
* tests/containers.scm ("container-excursion*")
("container-excursion*, same namespaces"): New tests.
This avoids problems where 'isatty?' return #t but 'ttyname' fails with
ENOTTY or such.
* gnu/build/linux-container.scm (mount-file-systems): Remove call of
'isatty?'. Directly call 'ttyname' and catch 'system-error'.
This fixes a regression introduced in
ae763b5b0b whereby home directories and
skeletons would be root-owned.
* gnu/build/activation.scm (copy-account-skeletons): Make 'directory' a
keyword parameter. Add #:uid and #:gid and honor them.
[set-owner]: New procedure.
(activate-user-home): Add call to 'getpw' and 'chown'. Pass UID and GID
to 'copy-account-skeletons'.
* gnu/tests/base.scm (run-basic-test)["skeletons in home directories"]:
Test file ownership under HOME.
Fixes <http://bugs.gnu.org/21108>.
Reported by Andy Patterson <ajpatter@uwaterloo.ca>
and Leo Famulari <leo@famulari.name>.
* gnu/build/activation.scm (activate-users+groups)[activate-user]: Pass
#:create-home? #t iff CREATE-HOME? and SYSTEM?.
(activate-user-home): New procedure.
* gnu/system/shadow.scm (account-shepherd-service): New procedure.
(account-service-type)[extensions]: Add SHEPHERD-ROOT-SERVICE-TYPE
extension.
* gnu/tests/base.scm (run-basic-test)["home"]
["skeletons in home directories"]: New tests.
* gnu/tests/install.scm (%separate-home-os, %separate-home-os-source)
(%test-separate-home-os): New variables.
Fixes <http://bugs.gnu.org/25573>.
Reported by Alex Kost <alezost@gmail.com>.
* gnu/build/file-systems.scm (seek*): New procedure.
(read-superblock): Use it instead of 'seek' and ensure it returns
OFFSET.
* gnu/build/activation.scm (make-file-writable): Move this to ...
* guix/build/utils.scm (make-file-writable): ... here. Export it.
* guix/build/gnu-build-system.scm (strip): Use it.
* gnu/build/file-systems.scm (read-superblock,
null-terminated-latin1->string): New variables.
(sub-bytevector): Move to general section.
(ext2-superblock?, read-ext2-superblock): New variables.
(ext2-superblock-uuid, ext2-superblock-volume-name): Use
sub-bytevector and null-terminated-latin1->string.
(%ext2-sblock-magic, %ext2-sblock-creator-os, %ext2-sblock-uuid,
%ext2-sblock-volume-name): Inline constants.
(luks-superblock?, read-luks-header): New variables.
(%luks-header-size, %luks-magic): Inline.
(partition-label-predicate, partition-uuid-predicate,
luks-partition-uuid-predicate): Use new functions.
* gnu/packages/cross-base.scm (cross-gcc-arguments) <#:phases>: Use
'cross-gcc-build-phases', and move body cross-toolchain.scm.
(cross-gcc): Add #:imported-modules. Add (gnu build cross-toolchain) to
#:modules.
* gnu/build/cross-toolchain.scm: New file, with code from
'cross-gcc-arguments'.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
This allows 'grub-install' to do the right thing when / or /boot is a
LUKS-encrypted partition.
Fixes <http://bugs.gnu.org/21843>.
* gnu/build/install.scm (install-grub): Add 'setenv' to set
'GRUB_ENABLE_CRYPTODISK'.
(wait-for-screen-text): New test.
* gnu/tests/base.scm (run-basic-test): Add #:initialization parameter
and honor it.
* gnu/tests/install.scm (%encrypted-root-os)[kernel-arguments]: Remove.
(%encrypted-root-installation-script): Pass '--uuid' to 'cryptsetup
luksFormat'. Remove 'sed' invocation.
(enter-luks-passphrase): New procedure.
(%test-encrypted-os)[value]: Pass #:initialization to 'run-basic-test'.
* gnu/build/marionette.scm (<marionette>)[marionette-repl]: Rename to...
[%marionette-repl]: ... this.
(marionette-repl): New macro.
(make-marionette): Wrap last 'read' call into 'delay', making the last
argument to 'marionette' a promise of a port.
(marionette-eval): Use 'force' in 'match' clause.