Commit Graph

517 Commits (cea25b08bfd22bda940e5ac7ea29d4fa035d8303)

Author SHA1 Message Date
Mathieu Othacehe 00e39b2ea4
system: vm: Do not add EFI partition on ARM system.
* gnu/system/vm.scm (qemu-img): Do not add EFI partition if we are targetting
  ARM.

UEFI support on u-boot is still experimental, so do not add EFI partition on
ARM for now.
2017-12-01 13:55:49 +01:00
Ludovic Courtès f00515b483
vm: Filter out file systems that refer to UUIDs or labels.
* gnu/system/vm.scm (virtualized-operating-system)[user-file-systems]:
Filter out things that refer to file system UUIDs or labels.
2017-11-30 18:14:57 +01:00
Mathieu Othacehe b8e7781122
vm: Use os-defined initrd intead of base-initrd.
* gnu/system/vm.scm (system-disk-image, system-qemu-image,
  virtualized-operating-system): Replace base-initrd by
  (operating-system-initrd os).

The system produced were always using base-initrd even if the user had
defined a custom initrd based on raw-initrd in the os declaration.
2017-11-26 13:50:37 +01:00
Tobias Geerinckx-Rice 795ec760e4
install: Fix typo.
* gnu/system/install.scm (installation-os): Fix typo in comment.
2017-11-11 05:17:59 +01:00
Hartmut Goebel d9565f7d87
install: Use overlayfs instead of unionfs.
I dediced to keep adding /tmp as tmpfs since I was not able to trigger bug
while still using unionfs, so I could not verify whether this mount is still
needed with overlayfs.  Mapping /tmp to tmpfs does not harm, so we are on the
save side.

* gnu/system/install.scm (make-cow-store): Mount /gnu/store without additional
  read-only bind-mount, since in overlayfs the "lower" level is always
  read-only. Add work-dir required by overlayfs. No need to sleep anymore
  since now using the mount syscall. [unionfs]: Remove now unused function.
  (%installation-services): Update comment.
  (installation-os)[file-systems]: Update comment.
2017-11-08 18:23:06 +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
Mathieu Othacehe b1a3079347
system: vm: Use 2^32 - 1 as hash size.
* gnu/system/vm.scm (operating-system-uuid): Use 2^32 - 1 instead of
  2^32 as hash size.

On some 32 bit system (ARM for example), 2^32 exceeds hash max
size (ULONG_MAX = 2^32 - 1).
2017-11-06 20:02:25 +01:00
Marius Bakke 2c16be569c
system: Return early in skeleton '.bashrc' when the shell is non-interactive.
* gnu/system/shadow.scm (default-skeletons)[bashrc]: Add return statement.
2017-11-01 20:29:32 +01:00
Marius Bakke 0ab59dd8b8
system: Test for interactive shell instead of `cat` in skeleton '.bashrc'.
* gnu/system/shadow.scm (default-skeletons)[bashrc]: Wrap $SSH_CLIENT test in
a conditional testing for interactive shell.
2017-11-01 20:29:32 +01:00
Ludovic Courtès 9b396c0cab
vm: Always use GRUB/i386.
Fixes <https://bugs.gnu.org/28768>.
Reported by Oleg Pykhalov <go.wigust@gmail.com>.

* gnu/system/vm.scm (virtualized-operating-system): Override the
'bootloader' field.
2017-10-19 23:21:49 +02:00
Ludovic Courtès 50fcf37c13
doc: Give an example with a FAT UUID.
* gnu/system/examples/lightweight-desktop.tmpl <file-systems>: Add a
UUID for the /boot/efi partition.
* doc/guix.texi (Using the Configuration System): Mention it.
2017-10-11 11:12:33 +02:00
Ludovic Courtès 03f66aea63
uuid: Change "fat32" to "fat".
* gnu/system/uuid.scm (%fat32-endianness): Rename to...
(%fat-endianness): ... this.
(fat32-uuid->string): Rename to...
(fat-uuid->string): ... this.
(%fat32-uuid-rx): Rename to..
(%fat-uuid-rx): ... this.
(string->fat32-uuid): Rename to...
(string->fat-uuid): ... this.
(%uuid-parsers, %uuid-printers): Add 'fat16.
2017-10-11 11:12:33 +02:00
Ludovic Courtès 9976c76aab
file-systems: Preserve UUID types when serializing.
Reported by Roel Janssen <roel@gnu.org>
at <https://lists.gnu.org/archive/html/help-guix/2017-09/msg00094.html>.

* gnu/system/file-systems.scm (file-system->spec): When DEVICE is a
UUID, serialize it in a way that preserves its type.
(spec->file-system): Adjust accordingly.
* gnu/build/file-systems.scm (canonicalize-device-spec): Add case for
when SPEC is 'uuid?'.
2017-10-11 11:12:33 +02:00
Ludovic Courtès 1c65cca574
file-systems: 'mount-file-system' now takes a <file-system> object.
* gnu/build/file-systems.scm (mount-file-system): Rename 'spec' to 'fs'
and assume it's a <file-system>.
* gnu/build/linux-boot.scm (boot-system): Assume MOUNTS is a list of
<file-system> and adjust accordingly.
* gnu/build/linux-container.scm (mount-file-systems): Remove
'file-system->spec' call.
* gnu/services/base.scm (file-system-shepherd-service): Add
'spec->file-system' call.  Add (gnu system file-systems) to 'modules'.
* gnu/system/linux-initrd.scm (raw-initrd): Use (gnu system
file-systems).  Add 'spec->file-system' call for #:mounts.
2017-10-11 11:12:33 +02:00
Christopher Baines b36e06c2b0
linux-initrd: Ensure that the guile used in the initrd is referenced.
By referencing guile from the initrd output explicitly, it will be present in
the store when this initrd is used. If the exact guile used within the initrd
isn't present in the store, then after root is switched during the boot
process, loading modules (such as (ice-9 popen)) won't work.

This fixes guix-patches bug #28399, "Fix mysql activation, and add a basic
test".

* gnu/system/linux-initrd.scm (expression->initrd)[builder]: Write out a file
  called references in to the initrd output, which includes the store path for
  guile.
2017-10-08 17:31:49 +01:00
Ludovic Courtès dd41a7f8d8
file-systems: Add a 'location' field to <file-system>.
* gnu/system/file-systems.scm (<file-system>)[location]: New field.
2017-10-05 12:09:17 +02:00
Ludovic Courtès aed1f1b049
uuid: Add 'uuid=?' and use it.
* gnu/system/uuid.scm (uuid=?): New procedure.
* tests/uuid.scm ("uuid=?"): New test.
* gnu/build/file-systems.scm (partition-uuid-predicate)
(luks-partition-uuid-predicate): Use it instead of 'bytevector=?'.
2017-10-05 12:09:17 +02:00
Christopher Baines eb152070f1
vm: Add disk-image-size to <virtual-machine>.
* gnu/system/vm.scm (<virtual-machine>): Add disk-image-size.
  (port-forwardings->qemu-options): Use disk-image-size from
  <virtual-machine>.
2017-10-04 07:16:43 +01:00
Christopher Baines 0c75a4de49
vm: Add a minimum root size.
* gnu/system/vm.scm (qemu-image): When guessing the root-size, use a lower
  bound of 20 MiB, otherwise the root file system size is sometimes 0 MiB in
  size.
2017-10-04 07:16:40 +01:00
Ludovic Courtès 8a7d81a5e2
uuid: Add a parser for FAT32 UUIDs.
* gnu/system/uuid.scm (%fat32-uuid-rx): New variable.
(string->fat32-uuid): New procedure.
(%uuid-parsers): Add it.
* tests/uuid.scm ("uuid, FAT32, format preserved"): New test.
2017-09-22 18:40:57 +02:00
Ludovic Courtès fbc31dc124
services: Move 'session-environment-service-type' to pam.scm.
* gnu/services/base.scm (environment-variables->environment-file)
(session-environment-service-type)
(session-environment-service): Move to...
* gnu/system/pam.scm: ... here.
2017-09-22 00:05:08 +02:00
Ludovic Courtès 960c40de21
doc: Use Screen and OpenSSH in the bare-bones example.
* gnu/system/examples/bare-bones.tmpl (packages): Remove TCPDUMP; add
SCREEN and OPENSSH.
* doc/guix.texi (Using the Configuration System): Adjust explanation
accordingly.
2017-09-12 23:56:34 +02:00
Ludovic Courtès 4e854b1814
install: Include the whole bare-bones OS in the image.
* gnu/system/install.scm (%installation-services): Load
"example/bare-bones.tmpl".  Add a 'gc-root-service-type' instance.
2017-09-12 23:56:33 +02:00
Ludovic Courtès 5f7fe1c57e
vm: Generate a UUID to identify the root file system.
This makes collisions less likely than when using a label to look up the
partition.  See <https://bugs.gnu.org/27735>.

* gnu/system/vm.scm (operating-system-uuid): New procedure.
(system-disk-image): Define 'root-uuid' and use it for the root file
system.  Pass it to 'iso9660-image' and 'qemu-image'.
2017-09-11 22:26:29 +02:00
Ludovic Courtès fd3b4b985d
vm: Allow users to specify a UUID for the root partition.
* gnu/system/vm.scm (qemu-image): Add #:file-system-uuid parameter; pass
it as the 'uuid' field of the root partition.
2017-09-11 22:26:24 +02:00
Ludovic Courtès ce094b4663
uuid: 'uuid' macro supports more UUID types.
* gnu/system/uuid.scm (string->uuid): Turn 'type' into an optional
argument.
(uuid): Add clauses to allow for an optional 'type' parameter.
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
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 1e8d398abc
install: Add OpenSSH to the global profile.
Suggested by Jan Nieuwenhuizen.

* gnu/system/install.scm (installation-os)[packages]: Add OPENSSH.
2017-09-10 23:34:29 +02:00
Ludovic Courtès 903ae630a0
install: Add 'passwd' to $PATH.
Suggested by Jan Nieuwenhuizen.

* gnu/system/install.scm (installation-os)[setuid-programs]: Add 'passwd'.
2017-09-10 23:34:29 +02:00
Christopher Baines b069111f7a
vm: Call iso9660-image with #:register-closures? as #t.
* gnu/system/vm.scm (system-disk-image): Call iso9660-image with
  #:register-closures? as #t.
2017-09-06 08:43:52 +01:00
Christopher Baines e375d3fab7
vm: Add support for registering closures to iso9660-image.
* gnu/system/vm.scm (iso9660-image): Add support for registering closures.
2017-09-06 08:43:48 +01:00
Christopher Baines 4138e782dc
vm: Remove redundant conditional in system-disk-image.
* gnu/system/vm.scm (system-disk-image): Remove redundant conditional for
  #:file-system-type when calling qemu-image.
2017-09-04 22:30:04 +01:00
Andy Wingo 045ebb3e58
gnu: bootloader: Deprecate "device" field in favor of "target".
* gnu/bootloader.scm (<bootloader-configuration>): Deprecate "device" field in
favor of "target" field.  This is mostly a renaming but also a generalization
to support UEFI targets being paths to a mounted partition instead of a device
name.
* gnu/system/examples/bare-bones.tmpl:
* gnu/system/examples/desktop.tmpl:
* gnu/system/examples/lightweight-desktop.tmpl:
* gnu/system/examples/vm-image.tmpl:
* gnu/system/install.scm:
* gnu/tests.scm:
* gnu/tests/install.scm:
* gnu/tests/nfs.scm:
* tests/system.scm: Adapt all invocations of bootloader-configuration.
* guix/scripts/system.scm (perform-action): Rename device argument to
bootloader-target.
(process-action): Adapt caller.
* doc/guix.texi (Proceeding with the Installation):
* doc/guix.texi (Bootloader Configuration): Update documentation.
2017-08-23 22:23:19 +02:00
Andy Wingo 2941b347b6
gnu: grub-efi-bootloader: Specialize grub-install invocation.
* gnu/bootloader/grub.scm (install-grub-efi): Fix grub-install invocation for
  EFI systems.
* gnu/system/examples/bare-bones.tmpl: Use the newer
"bootloader-configuration" syntax.
* gnu/system/examples/desktop.tmpl: Use bootloader-configuration sytax.  Also,
use the same label for the LUKS-mapped device and the root partition.  Remove
unneeded "title" field for the file-system based on LUKS; as noted in the
manual, the "title" field is ignored for mapped devices.
* gnu/system/examples/lightweight-desktop.tmpl: Use bootloader-configuration,
and use grub-efi-bootloader.
2017-08-20 11:16:42 +02:00
Danny Milosavljevic cf189709bc
vm: Use grub-hybrid's grub-mkrescue.
* gnu/system/vm.scm (system-disk-image): Use grub-hybrid's grub-mkrescue.
* gnu/bootlader/grub.scm (grub-mkrescue-bootloader): New variable.
2017-08-03 18:13:03 +02:00
Ludovic Courtès 138fe41198
system: Add 'grep --color' alias in '.bash_profile' skeleton.
* gnu/system/shadow.scm (default-skeletons)[profile]: Add 'grep' alias.
2017-07-27 14:44:28 +02:00
Ludovic Courtès a84ea2191e
system: Add a default '.guile' skeleton.
* gnu/system/shadow.scm (default-skeletons): Add ".guile".
2017-07-25 12:23:26 +02:00
Ludovic Courtès ed419fa0c5
vm: Add a <virtual-machine> type and associated gexp compiler.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Add
 #:options parameter and honor it.
(<virtual-machine>): New record type.
(virtual-machine): New macro.
(port-forwardings->qemu-options, virtual-machine-compiler): New
procedures.
2017-07-20 11:57:13 +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
Ludovic Courtès b19a49d015
locale: Demonadify the locale creation API.
* gnu/system/locale.scm (single-locale-directory): Use 'computed-file'
instead of 'gexp->derivation'.
(locale-directory): Adjust accordingly and do the same.
* gnu/system.scm (operating-system-directory-base-entries): Adjust
accordingly.
2017-07-17 23:41:36 +02:00
Ludovic Courtès 6d833b13b7
gnu: Remove glibc@2.21 and its traces.
* gnu/packages/base.scm (glibc-2.21): Remove.
* gnu/system/locale.scm (localedef-command)[maybe-version-directory]:
Remove.  Replace call with use of 'package-version'.
(single-locale-directory): Remove 'version>=' conditional.
2017-07-17 23:41:36 +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
宋文武 59132b8000
gnu: Rename (gnu packages qemu) to (gnu packages virtualization).
* gnu/packages/qemu.scm: Rename this ...
* gnu/packages/virtualization.scm: ... to this.
* gnu/local.mk (GNU_SYSTEM_MODULES),
gnu/packages/bootloaders.scm, gnu/packages/debug.scm,
gnu/packages/gnome.scm, gnu/system/vm.scm,
gnu/tests/install.scm: Adjust accordingly.
2017-07-15 19:17:37 +08:00
Ludovic Courtès 4ddb64f57d
system: Refer to native packages when appropriate.
* gnu/system/locale.scm (localedef-command): Use the native LIBC.
* gnu/system/shadow.scm (default-skeletons): Use the native GUILE-WM.
2017-07-11 22:47:08 +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 acc0f6bb58
guix system: Add file system label and uuid to iso9660-image.
* gnu/system/vm.scm (system-disk-image): Pass root-label to ...
(iso9660-image): ... here.  Add keyword arguments #:file-system-label
and #:file-system-uuid.
2017-07-07 18:04:31 +02:00
Ludovic Courtès 6d9a859038
linux-initrd: Avoid monadic style a bit.
* gnu/system/linux-initrd.scm (expression->initrd): Use 'program-file'
for 'init'.
(flat-linux-module-directory): Use 'computed-file' instead of
'gexp->derivation'.
(raw-initrd): Adjust accordingly.
2017-07-04 23:45:12 +02:00
Marius Bakke 6db571cbf0
install: Drop redundant package after c0f5eee4b2.
* gnu/system/install.scm (installation-os): Remove SHADOW.
2017-07-04 02:52: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