Commit Graph

175 Commits

Author SHA1 Message Date
Danny Milosavljevic b43b9acf15
build: Do not store two copies of the ISO-9660 superblock anymore.
* gnu/build/vm.scm (make-iso9660-image): Do not store two copies of the
ISO-9660 superblock anymore.
2017-09-22 04:03:52 +02:00
Ludovic Courtès 47cef4ecad
file-systems: Introduce (gnu system uuid).
* gnu/build/file-systems.scm (sub-bytevector)
(latin1->string, %fat32-endianness, fat32-uuid->string)
(%iso9660-uuid-rx, string->iso9660-uuid)
(iso9660-uuid->string, %network-byte-order)
(dce-uuid->string, %uuid-rx, string->dce-uuid)
(string->ext2-uuid, string->ext3-uuid, string->ext4-uuid)
(vhashq, %uuid-parsers, %uuid-printers, string->uuid)
(uuid->string): Move to...
* gnu/system/uuid.scm: ... here.  New file.
* gnu/system/file-systems.scm (uuid): Move to the above file.
* gnu/system/vm.scm: Adjust accordingly.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add uuid.scm.
2017-09-11 22:24:46 +02:00
Ludovic Courtès a8e1247d7d
file-systems: Add UUID type dictionaries.
* gnu/build/file-systems.scm (uuid->string): Rename to...
(dce-uuid->string): ... this.
(string->uuid): Rename to...
(string->dce-uuid): ... this.
(vhashq): New macro.
(%uuid-parsers, %uuid-printers): New variables.
(uuid->string, string->uuid): New procedures.
2017-09-11 22:24:46 +02:00
Ludovic Courtès bae28ccb69
vm: Allow partitions to be initialized with a given UUID.
* gnu/build/vm.scm (<partition>)[uuid]: New field.
(create-ext-file-system): Add #:uuid and honor it.
(create-fat-file-system): Add #:uuid.
(format-partition): Add #:uuid and honor it.
(initialize-partition): Honor the 'uuid' field of PARTITION.
2017-09-11 22:24:46 +02:00
Christopher Baines 575065bd1c
vm: Add comment about deduplication in make-iso9660-image.
* gnu/build/vm.scm (make-iso9660-image): Add comment about the use of
  #:deduplicate #f when calling register-closure.
2017-09-10 11:59:55 +01:00
Ludovic Courtès 13877c3453
marionette: 'wait-for-file' can be passed a read procedure.
* gnu/build/marionette.scm (wait-for-file): Add #:read parameter and
honor it.
* gnu/tests/base.scm (run-basic-test)["login on tty1"]: Use
'wait-for-file' instead of inline code.
2017-09-08 00:11:21 +02:00
Christopher Baines 309b8fe7e6
vm: Create /mnt in the generated ISO image in make-iso9660-image.
This is used in the installation process, as the mountpoint for the target
filesystem.

* gnu/build/vm.scm (make-iso9660-image): Create /mnt within the generated ISO
  image.
2017-09-06 08:43:44 +01:00
Christopher Baines 22bbdb5f79
vm: Add support for registering closures to make-iso9660-image.
This mimics the functionality in the root-partition-initializer used in
creating the QEMU image. This helps when trying to run guix system init from
the generated ISO image.

* gnu/build/vm.scm (make-iso9660-image): Add support for registering closures.
2017-09-06 08:43:38 +01:00
Ludovic Courtès 06b8eae3d1
marionette: Augment the set of keystrokes.
* gnu/build/marionette.scm (%qwerty-us-keystrokes): Add ', ", and `.
2017-08-28 09:56:33 +02:00
Ludovic Courtès 0a80981178
marionette: Fix typing of capital letters.
Previously we'd use "sendkey P" instead of "sendkey shift-p", which had
no effect.

* gnu/build/marionette.scm (character->keystroke): New procedure.
(string->keystroke-commands): Use it.
2017-08-28 09:56:33 +02:00
Ludovic Courtès 8bd5231485
marionette: 'wait-for-file' really raises an error when a file is missing.
* gnu/build/marionette.scm (wait-for-file): Arrange to call 'error' on
the host, not in the guest.
2017-08-28 09:56:33 +02:00
Danny Milosavljevic 9833bcfc08
build: Allow mounting of entire disks.
* gnu/build/file-systems.scm (disk-partitions): Also return entire drives.
2017-08-05 18:49:33 +02:00
Ludovic Courtès 49962b15a1
activation: Make sure /etc exists.
Fixes <http://bugs.gnu.org/27146>.
Reported by ng0 <ng0@pragmatique.xyz>.

* gnu/build/activation.scm (activate-etc): Add call to 'mkdir-p'.
2017-08-03 00:35:59 +02:00
Ludovic Courtès 8d033e3e16
vm: 'iso9660-image' produces a single-file output.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add
  #:single-file-output? and pass it to 'load-in-linux-vm'.
(iso9660-image): Pass #:single-file-output? to
'expression->derivation-in-linux-vm'.
* gnu/build/vm.scm (load-in-linux-vm): Add #:single-file-output? and
honor it.
2017-07-18 21:41:35 +02:00
Tobias Geerinckx-Rice 21ffcd65c5
vm: Increase disk size overhead estimate.
* gnu/build/vm.scm (estimated-partition-size): Add 25% to the graph size.
2017-07-18 17:14:38 +02:00
Tobias Geerinckx-Rice 0862b95433
build, vm: Use a less common label.
* gnu/build/vm.scm (initialize-hard-disk): Use "GuixSD_image" as label.
* gnu/system/install.scm (installation-os): Likewise.
* gnu/system/vm.scm (system-disk-image): Likewise.
2017-07-17 20:20:24 +02:00
Danny Milosavljevic 911a53a53f
build: Make ISO-9660 image bootable from USB flash drive.
* gnu/build/vm.scm (make-iso9660-image): Make image bootable from USB flash
drive.
2017-07-12 16:15:30 +02:00
Danny Milosavljevic 651de2bdb5
build, vm: Use "GuixSD" or "GUIXSD" as volume label.
* gnu/build/vm.scm (initialize-hard-disk): Use "GuixSD" as label.
* gnu/system/install.scm (installation-os): Use "GuixSD" as label.
* gnu/system/vm.scm (system-disk-image): Use "GuixSD" or "GUIXSD" as volume
label.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-07-10 15:35:43 +02:00
Danny Milosavljevic 08c1f2d21c
build: Add (gnu build file-systems) import.
* gnu/build/vm.scm: Add (gnu build file-systems) import.
2017-07-03 16:33:46 +02:00
Danny Milosavljevic 4f80be730e
build: Clarify error message when make-iso9660-image fails.
* gnu/build/vm.scm (make-iso9660-image): Clarify error message.
2017-07-03 15:13:09 +02:00
Danny Milosavljevic 1feb3076cb
build: Allow specifying volume-uuid with make-iso9660-image.
* gnu/build/file-systems.scm (iso9660-uuid->string): Export.
* gnu/build/vm.scm (make-iso9660-image): Add volume-uuid.
2017-07-03 15:07:25 +02:00
Danny Milosavljevic be1033a334
build: Add iso9660 system image generator.
* build-aux/hydra/gnu-system.scm (qemu-jobs): Add 'iso9660-image .
* gnu/build/vm.scm (make-iso9660-image): New variable.  Export it.
* gnu/system/vm.scm (iso9660-image): New variable.  Use make-iso9660-image.
(system-disk-image): Use iso9660-image.
2017-07-03 10:07:59 +02:00
Ludovic Courtès 1b0f266e40
gnu: Switch guile-cairo and dependents to Guile 2.2 again.
Fixes <https://bugs.gnu.org/27551>.
Reported by Leo Famulari <leo@famulari.name>.

This reinstates the following commits:

  e3ddb1e83 * gnu: guile-cairo: Switch to Guile 2.2.
  ae5c6ef39 * gnu: guile-gnome: Update to 2.16.5.
  0fd8013fc * gnu: guile-rsvg: Update to commit 05c6a2fd.
  66b9183c4 * gnu: guile-lib: Switch to Guile 2.2.

and adds the following changes:

* gnu/bootloader/grub.scm (svg->png): Add 'package->derivation' call for
GUILE-2.2.  Pass #:guile-for-build to 'gexp->derivation'.
* gnu/build/svg.scm (svg->png): Add 'em' and 'ex' to the 'let-values'
form to account for all the values returned by
'rsvg-handle-get-dimensions', which Guile 2.2 does not truncate.
2017-07-02 22:52:30 +02:00
Danny Milosavljevic 9c0a05b31e
file-systems: iso9660-uuid->string: Use "-" as separator in the result.
* gnu/build/file-systems.scm (iso9660-uuid->string): Use "-" as separator
in the result.
2017-07-02 19:27:25 +02:00
Ludovic Courtès a2278922fe
vm: Use 'fold2' from (guix combinators).
* gnu/build/vm.scm: Use (guix combinators).
(fold2): Remove.
2017-06-30 00:16:51 +02:00
Ludovic Courtès a8ac4f081a
vm: Estimate the disk size by default.
* 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.
2017-06-30 00:16:50 +02:00
Ludovic Courtès a2cf57e79e
vm: Display the disk and partition sizes.
* 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.
2017-06-30 00:16:50 +02:00
Ludovic Courtès 6efb98ed3c
vm: Fix 'load-in-linux-vm' docstring.
* gnu/build/vm.scm (load-in-linux-vm): Change default value of
  #:disk-image-size.  Update docstring to note that DISK-IMAGE-SIZE is
  in bytes.
2017-06-30 00:16:50 +02:00
Ludovic Courtès 5fa7cc5335
marionette: Factorize 'wait-for-file'.
* 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.
2017-06-12 23:34:14 +02:00
Adam Van Ymeren b53510e0d0
file-systems: Handle EIO error in 'ENOENT-safe' as well.
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>
2017-06-11 23:09:19 +02:00
Danny Milosavljevic a81cae38ca
file-systems: Provide string->ext*-uuid, string->btrfs-uuid.
* gnu/build/file-systems.scm (string->ext2-uuid, string->ext3-uuid,
string->ext4-uuid, string->btrfs-uuid): New variables.  Export them.
2017-06-10 19:22:03 +02:00
Danny Milosavljevic bb7cf4f533
file-systems: Provide string->iso9660-uuid.
* gnu/build/file-systems.scm (string->iso9660-uuid): New variable.  Export it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-06-09 12:30:56 +02:00
Danny Milosavljevic c6aee77e29
file-systems: Use creation time if modification time is unset for ISO9660.
* gnu/build/file-systems.scm (iso9660-superblock-uuid): Modify.
2017-06-07 08:34:52 +02:00
Danny Milosavljevic fb03f44bb1
file-systems: Improve error handling in the iso9660 case - fixes boot problem.
* gnu/build/file-systems.scm (read-iso9660-superblock): Modify.
2017-06-03 22:10:23 +02:00
Danny Milosavljevic 203a9455c4
file-systems: Improve error reporting.
Suggested by Chris Marusich <cmmarusich@gmail.com>.
Fixes <https://bugs.gnu.org/27143>.

* gnu/build/file-systems.scm (read-iso9660-primary-volume-descriptor):
Improve error reporting.
2017-05-31 21:13:15 +02:00
Danny Milosavljevic cdc701ea48
gnu: build: Improve comments.
* gnu/build/file-systems.scm (iso9660-superblock-volume-name):
Add clarifying comment.
2017-05-31 19:38:49 +02:00
Ludovic Courtès 41db5a7563
activation: Change permissions on /root to #o700.
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.
2017-05-30 18:08:37 +02:00
Danny Milosavljevic 3dba9b3782
gnu: build: Improve docstrings.
* gnu/build/file-systems.scm (iso9660-superblock?,
read-iso9660-superblock, iso9660-superblock-uuid): Improve docstrings.
2017-05-27 12:35:43 +02:00
Marius Bakke ecf5d53769
vm: Add UEFI loader to disk images.
* gnu/build/vm.scm (install-efi): New procedure.
(initialize-hard-disk): Generate EFI blob when ESP is present.
* gnu/system/vm.scm (qemu-image): Append 40MiB EFI System Partition.
2017-05-19 12:59:25 +02:00
Marius Bakke 4d415f0c3c
vm: Support creating FAT partitions.
* gnu/build/vm.scm (create-ext-file-system, create-fat-file-system): New procedures.
(format-partition): Use them. Error for unknown file systems.
* gnu/system/vm.scm (qemu-image): Include DOSFSTOOLS.
* gnu/system/linux-initrd.scm (base-initrd): Always add nls_is8859-1.ko.
2017-05-19 12:59:25 +02:00
Marius Bakke 01cc84dade
vm: Support arbitrary partition flags.
* gnu/build/vm.scm (<partition>): Change BOOTABLE? to FLAGS.
(initialize-partition-table): Pass each flag to parted.
(initialize-hard-disk): Locate boot partition.
* gnu/system/vm.scm (qemu-image): Adjust partition flags.
2017-05-19 12:59:25 +02:00
Ludovic Courtès 41f76ae08a
services: user-homes: Do not create home directories marked as no-create.
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.
2017-05-18 10:55:16 +02:00
Mathieu Othacehe 9121ce553d
bootloader: Adapt vm to new bootloader API.
* gnu/build/install.scm (install-boot-config): New procedure.
  (install-grub): Move to (gnu bootloader grub).
* gnu/build/vm.scm (register-bootcfg-root): Rename register-grub.cfg-root and
  adjust accordingly.
  (initialize-hard-disk): Takes a bootloader-package, bootcfg, bootcfg-location and
  bootloader-installer procedure. Adjust accordingly.
* gnu/system/vm.scm (qemu-image): Adjust to initialize-hard-disk.
  (system-disk-image, system-qemu-image, system-qemu-image/shared-store):
  Adjust to qemu-image.
2017-05-16 14:41:01 +02:00
Danny Milosavljevic 06110559bb
gnu: build: file-systems: Add ISO-9660.
Fixes <https://bugs.gnu.org/26751>.

* gnu/build/file-systems.scm (iso9660-superblock?,
read-iso9660-primary-volume-descriptor, read-iso9660-superblock,
iso9660-superblock-uuid, iso9660-uuid->string,
iso9660-superblock-volume-name): New variables.
(%partition-label-readers): Add iso9660.
(%partition-uuid-readers): Add iso9660.
2017-05-03 00:18:33 +02:00
Mathieu Othacehe 07f812c404
vm: Reword grub.cfg to bootcfg.
* gnu/build/vm.scm (register-grub.cfg-root): Reword grub.cfg to bootcfg,
(initialize-hard-disk): ditto,
* gnu/system/vm.scm (system-disk-image): ditto,
(system-qemu-image): ditto,
(system-qemu-image/shared-store): ditto.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2017-04-15 14:42:15 +02:00
Ludovic Courtès bb5cad4eb2
file-systems: Allow for bind-mounts of named sockets.
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)).
2017-04-13 00:12:42 +02:00
Mathieu Othacehe a5e13c3be9
build: Fix compilation warnings.
* gnu/build/linux-boot.scm (define-module): Use (guix build syscalls).
* gnu/build/linux-modules.scm (define-module): Ditto.
* gnu/build/file-systems (define-module): Stop re-exporting mount, umount and
MS_* flags as this is now safe to include (guix build syscalls) instead.
(mount): Remove procedure.
(umount): Ditto.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-11 11:13:26 +02:00
Mathieu Othacehe abf0880a67
vm: Add missing module.
* 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>
2017-04-07 23:30:39 +02:00
Marius Bakke 4b7e5c1131
Merge branch 'master' into core-updates 2017-03-15 17:52:26 +01:00
Ludovic Courtès 5895ec8aa2
pack: Add '--symlink'.
* guix/scripts/pack.scm (self-contained-tarball): Add #:symlinks
parameter.
[build](symlink->directives): New procedure
(directives): New variable.
Add call to 'evaluate-populate-directive'.  Pass the directories among
DIRECTIVES to 'tar'.
(%default-options): Add 'symlinks'.
(%options, show-help): Add '--symlink'.
(guix-pack): Honor it.
* gnu/build/install.scm (evaluate-populate-directive): Export.
* doc/guix.texi (Invoking guix pack): Document it.
2017-03-14 17:57:27 +01:00