Commit Graph

183 Commits (71ace914cf4dbbc0c99bdaf0b33c05e737d0c8f7)

Author SHA1 Message Date
Ludovic Courtès c3e59de9b1
guix system: Reinstalling the bootloader preserves extra menu entries.
Fixes <https://bugs.gnu.org/36876>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

Previously 'guix system delete-generations' or 'switch-generation' would
lose the extra bootloader menu entries specified in the current system's
configuration.  This fixes that.

* guix/scripts/system.scm (reinstall-bootloader): Turn PARAMS into a
single <boot-parameters>.  Adjust ENTRIES to include extra menu entries
specified in PARAMS.
2019-08-30 01:33:45 +02:00
Jakob L. Kreuze 5c8c8c4554
guix system: Reimplement 'reconfigure'.
* guix/scripts/system.scm (switch-to-system)
(upgrade-shepherd-services, install-bootloader): Delete variable.
(local-eval): New variable.
(install): Remove 'bootloader-installer' and 'bootcfg-file' parameters.
(install): Add 'bootloader' parameter.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-07-26 19:19:49 +02:00
Ludovic Courtès 5c3d44303e
guix gc: Correctly handle '--delete-generations' with no arguments.
Previously, 'guix gc --delete-generations' would crash: the "" pattern
would be passed to 'matching-generations', which would return #f instead
of returning a list.

Reported by Raghav Gururajan <rvgn@disroot.org>
in <https://bugs.gnu.org/36466>.

* guix/ui.scm (matching-generations): Raise an error when passed an
invalid pattern.
* guix/scripts/gc.scm (delete-old-generations): Check if PATTERN is
true.
(%options): Leave ARG as-is for 'delete-generations'.
(guix-gc): Use 'assq' instead of 'assoc-ref' for 'delete-generations'.
* guix/scripts/package.scm (delete-matching-generations):
Replace (string-null? pattern) with (not pattern).  Remove 'else'
clause.
(%options): Leave ARG as-is for 'delete-generations'.
* guix/scripts/pull.scm (%options): Leave ARG as-is for
'list-generations'.
(process-query): Replace (string-null? pattern) with (not pattern).
* guix/scripts/system.scm (list-generations): Likewise, and remove
'else' clause.
(process-command): Use #f instead of "" when no pattern is given.
2019-07-11 23:13:26 +02:00
Ludovic Courtès ce10e6053b
guix system: Type-check the file or expression.
Previously, users would get a wrong-type-arg exception down the road
with an intimidating backtrace.

* guix/scripts/system.scm (process-action)[ensure-operating-system]: New
procedure.
Use it.
2019-05-16 13:24:06 +02:00
Maxim Cournoyer d03de6be0a
vm: Auto-detect if inputs should be registered.
The default value of the argument REGISTER-CLOSURE? of the ISO9660-IMAGE,
QEMU-IMAGE and SYSTEM-DOCKER-IMAGE procedures can be computed automatically,
since the operating-system definition is available in its context.  When the
operating-system definition does not contain the GUIX-SERVICE-TYPE, do not
register the closure in the database of Guix, as it takes time and doesn't
serve a purpose.

* gnu/system/vm.scm (has-guix-service-type): Add predicate.
(iso9660-image)[register-closures?]: Use it to compute the argument's default
value.
(qemu-image)[register-closures?]: Likewise, and update docstring.
(system-docker-image)[register-closures?]: Likewise.
(system-disk-image): Do not explicit a value for the REGISTER-CLOSURES?
argument of the ISO9660-IMAGE and QEMU-IMAGE procedure calls, so that its
default value is used instead.
* guix/scripts/system.scm (system-derivation-for-action): Do not explicit a
value for the REGISTER-CLOSURES? argument of the SYSTEM-DOCKER-IMAGE
procedure call, so that its default value is used instead.
2019-05-13 22:59:09 -04:00
Arun Isaac b33454ae0b
linux-container: Support container network sharing.
* gnu/system/linux-container.scm (container-essential-services): If network is
to be shared with the host, remove network configuration files from etc
service.
(containerized-operating-system): If network is to be shared with the host,
remove nscd service and map host's /var/run/nscd if it exists.
(container-script): If network is to be shared with the host, do not create
network namespace.
* guix/scripts/system.scm (system-derivation-for-action): Add
#:container-shared-network? argument.
(perform-action): Add #:container-shared-network? argument.
(show-help): Add "-N, --network" help information.
(%options): Add network option.
(process-action): Call perform-action with #container-shared-network? argument.
* doc/guix.texi (Invoking guix system): Document the "-N, --network" option.

Co-authored-by: Christopher Baines <mail@cbaines.net>
2019-05-14 02:54:58 +05:30
Ludovic Courtès af41e504cf
guix system: Compute 'bootcfg' only for 'init' and 'reconfigure'.
Previously, 'guix system vm' would start by computing the bootcfg
derivation, which itself depended on an incorrect OS derivation (for the
original OS instead of the one passed through
'virtualized-operating-system'.)  That added overhead and would force
the user's config file to define a root file system, for example, even
though it makes no sense in the case of a VM.

* guix/scripts/system.scm (perform-action)[bootcfg]: Limit to the 'init'
and 'reconfigure' actions.
2019-04-23 23:44:35 +02:00
Ludovic Courtès 985730c1af
scripts: More commands default to verbosity level 1.
* guix/scripts/environment.scm (%default-options): Change 'verbosity' to 1.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/system.scm (guix-system): Likewise, except for the
'build' command.
2019-04-04 17:47:02 +02:00
Ludovic Courtès 8ffab257dd
guix system: Fix success report of the bootloader installation.
Fixes <https://bugs.gnu.org/34890>.
Reported by Jack Hill <jackhill@jackhill.us>.

Regression introduced in 21fcfe1ee9.

* guix/scripts/system.scm (bootloader-installer-script): Ungexp DEVICE.
2019-03-17 16:30:00 +01:00
Ludovic Courtès 21fcfe1ee9
bootloader: Use 'invoke/quiet' when running 'grub-install' and co.
This hides potentially confusing GRUB messages from the user, such as
"Installing for i386-pc platform."

* gnu/bootloader/extlinux.scm (install-extlinux): Use 'invoke/quiet'
instead of 'system*' and 'error'.
* gnu/bootloader/grub.scm (install-grub, install-grub-efi): Likewise.
* guix/scripts/system.scm (bootloader-installer-script): Guard against
'message-condition?' and handle them properly.
2019-03-16 18:15:13 +01:00
Ludovic Courtès 1e9698344d
guix system: List old generations from newest to oldest.
Previously 'guix system switch-generation' or 'delete-generations' would
yield a GRUB menu where entries for old generations were in the wrong
order (i.e., oldest first.)

* guix/scripts/system.scm (reinstall-bootloader): Reverse the list
returned by 'generation-numbers'.
2019-02-13 16:19:54 +01:00
Ludovic Courtès 499b166d1c
guix system: Add 'delete-generations'.
* guix/scripts/package.scm (delete-matching-generations): Export.
* guix/scripts/system.scm (show-help): Add 'delete-generations'.
(process-command): Honor it.
(guix-system): Support it.
* doc/guix.texi (Invoking guix system): Document it.
2019-02-13 16:19:54 +01:00
Ludovic Courtès 2637cfd7a4
Avoid name clash with 'build' from (guix store) and (guix status).
Since commit 976ef2d978, (guix status)
exports 'build', which clashes with 'build' from (guix store).

* build-aux/run-system-tests.scm: Select 'with-status-verbosity'
from (guix status).
* guix/scripts/archive.scm: Likewise.
* guix/scripts/build.scm: Likewise.
* guix/scripts/copy.scm: Likewise.
* guix/scripts/environment.scm: Likewise.
* guix/scripts/pack.scm: Likewise.
* guix/scripts/package.scm: Likewise.
* guix/scripts/pull.scm: Likewise.
* guix/scripts/system.scm: Likewise.
2019-02-11 23:23:28 +01:00
Ludovic Courtès f1de676ea8
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for.  The new option provides a consistent way to choose
whether or not to display the build log.

* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
 #:verbosity.
(%standard-build-options): Change "verbosity" to "debug".  Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.  Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-11 12:14:38 +01:00
Ludovic Courtès 7804c45b9c
status: Add 'with-status-verbosity'.
* guix/status.scm (logger-for-level, call-with-status-verbosity): New
procedures.
(with-status-verbosity): New macro.
* guix/scripts/environment.scm (guix-environment): Use
'with-status-verbosity' instead of 'with-status-report'.
* guix/scripts/pack.scm (guix-pack): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* build-aux/run-system-tests.scm (run-system-tests): Likewise.
2019-01-11 12:14:38 +01:00
swedebugia bd5a81f9b8
guix system: Clarify the three strategies available.
* guix/scripts/system.scm (show-help): Clarify the three choices.
* doc/guix.texi (Invoking guix system): Add 3 @cindex to make on-error=strategy
easier to find.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-12-18 16:04:25 +01:00
Ludovic Courtès 6ddc63e599
guix system: Fix bootloader config file generation by 'guix system roll-back'.
Fixes <https://bugs.gnu.org/33623>.
Reported by Diego Nicola Barbato <dnbarbato@posteo.de>.

Regression introduced in commit
46c296dcc4.

* guix/scripts/system.scm (reinstall-bootloader): Add call to
'lower-object'.
2018-12-07 15:14:12 +01:00
Ludovic Courtès a29ce1f97d
guix system: Fix 'init' again.
Fixes a regression introduced in
52ee4479ef, whereby 'install' would now be
passed a procedure instead of a lowerable object.

* guix/scripts/system.scm (perform-action): Pass BOOTLOADER-SCRIPT as
the #:bootloader-installer argument of 'install'.
2018-11-21 23:26:58 +01:00
Ludovic Courtès 1d6669afef
guix system: Fix 'init'.
Fixes a regression introduced in
52ee4479ef, whereby 'install' would now be
passed a <computed-file> object instead of a derivation.

* guix/scripts/system.scm (install): Call 'lower-object' on BOOTCFG.
2018-11-19 09:59:07 +01:00
Ludovic Courtès ab6caf4f1d
guix system: Clarify 'perform-action'.
* guix/scripts/system.scm (perform-action): Move non-monadic local
variables outside the 'mlet' form.
2018-11-18 23:37:45 +01:00
Ludovic Courtès 52ee4479ef
guix system: De-monadify bootloader installation script.
* guix/scripts/system.scm (bootloader-installer-derivation): Rename
to...
(bootloader-installer-script): ... this.  Use 'scheme-file' instead of
'gexp->file'.
(perform-action): Adjust accordingly.  Move 'lower-object' call to the
point where DRVS is computed.
2018-11-18 23:37:45 +01:00
Ludovic Courtès 6e47628d4c
guix system: Simplify bootloader package handling.
* guix/scripts/system.scm (perform-action): Remove 'bootloader-package'
variable.  Pass (bootloader-package bootloader) as the 2nd argument to
'bootloader-installer-derivation'.  Remove BOOTLOADER-PACKAGE from DRVS
since it's redundant.
2018-11-18 23:37:45 +01:00
Ludovic Courtès 9782c82217
system: De-monadify 'operating-system-bootcfg'.
* gnu/system.scm (operating-system-bootcfg): Remove 'mlet*' and
'lower-object' call.
* gnu/system/vm.scm (system-disk-image)
(system-qemu-image/shared-store): Adjust accordingly.
* guix/scripts/system.scm (perform-action): Add 'lower-object' call for
BOOTCFG.
2018-11-18 23:37:45 +01:00
Ludovic Courtès 6c843907e9
guix system: Invoking 'guix system init' twice keeps timestamps zeroed.
Fixes a bug whereby running 'guix system init config.scm /mnt' twice
would, on the second run, change timestamps in /mnt/gnu/store from the
Epoch to now.  This is because the 'register-path' call would bypass the
'reset-timestamps' phase altogether in that case, as a consequence of
commit bb3b6ccb05.

Reported by Christopher Baines.

* guix/scripts/system.scm (install): When TARGET/var/guix exists, delete
it.  As a side-effect, this ensures that later on, the 'register-path'
call invokes 'reset-timestamps' on all the copied store items.
2018-11-11 23:53:29 +01:00
Ludovic Courtès 62a14bd26f
scripts: Suggest running 'guix gc' when we're short on disk space.
* guix/scripts.scm (%disk-space-warning): New variable.
(warn-about-disk-space): New procedure.
* guix/scripts/package.scm (build-and-use-profile): Use it.
* guix/scripts/system.scm (process-action): Likewise.
2018-10-23 01:04:39 +02:00
Ludovic Courtès f9a8fce10f
status: Build upon multiplexed build output.
This allows for more accurate status tracking and parsing of extended
build traces.

* guix/status.scm (multiplexed-output-supported?): New procedure.
(print-build-event): Don't print \r when PRINT-LOG? is true.
Adjust 'build-log' handling for when 'multiplexed-output-supported?'
returns true.
(bytevector-index, split-lines): New procedures.
(build-event-output-port)[%build-output-pid, %build-output]
[%build-output-left]: New variables.
[process-line]: Handle "@ build-output" traces.
[process-build-output]: New procedure.
[write!]: Add case for when %BUILD-OUTPUT-PID is true.  Use
'bytevector-index' rather than 'string-index'.
(compute-status): Add #:derivation-path->output-path.  Use it.
* tests/status.scm ("compute-status, multiplexed build output"):
New test.
("build-output-port, UTF-8")
("current-build-output-port, UTF-8 + garbage"): Adjust to new
'build-log' output.
* guix/scripts/build.scm (set-build-options-from-command-line):
Pass #:multiplexed-build-output?.
(%default-options): Add 'multiplexed-build-output?'.
* guix/scripts/environment.scm (%default-options): Likewise.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/package.scm (%default-options): Likewise.
* guix/scripts/pull.scm (%default-options): Likewise.
* guix/scripts/system.scm (%default-options): Likewise.
2018-10-15 23:06:55 +02:00
Ludovic Courtès dc0f74e5fc
Add (guix status) and use it for pretty colored output.
* guix/progress.scm (progress-reporter/trace): New procedure.
(%progress-interval): New variable.
(progress-reporter/file): Use it.
* guix/scripts/build.scm (set-build-options-from-command-line): Pass
 #:print-extended-build-trace?.
(%default-options): Add 'print-extended-build-trace?'.
(guix-build): Parameterize CURRENT-TERMINAL-COLUMNS.  Use
'build-status-updater'.
* guix/scripts/environment.scm (%default-options): Add
'print-extended-build-trace?'.
(guix-environment): Wrap body in 'with-status-report'.
* guix/scripts/pack.scm (%default-options): Add 'print-build-trace?' and
'print-extended-build-trace?'.
(guix-pack): Wrap body in 'with-status-report'.
* guix/scripts/package.scm (%default-options, guix-package): Likewise.
* guix/scripts/system.scm (%default-options, guix-system): Likewise.
* guix/scripts/pull.scm (%default-options, guix-pull): Likewise.
* guix/scripts/substitute.scm (progress-report-port): Don't call STOP
when TOTAL is zero.
(process-substitution): Add #:print-build-trace? and honor it.
(guix-substitute)[print-build-trace?]: New variable.
Pass #:print-build-trace? to 'process-substitution'.
* guix/status.scm: New file.
* guix/store.scm (set-build-options): Add #:print-extended-build-trace?;
pass it into PAIRS.
(%protocol-version): Bump.
(protocol-version, nix-server-version): New procedures.
(current-store-protocol-version): New variable.
(with-store, build-things): Parameterize it.
* guix/ui.scm (build-output-port): Remove.
(colorize-string): Export.
* po/guix/POTFILES.in: Add guix/status.scm.
* tests/status.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x162.
* nix/libstore/build.cc (DerivationGoal::registerOutputs)
(SubstitutionGoal::finished): Print a "@ hash-mismatch" trace before
throwing.
2018-09-27 23:21:53 +02:00
Carlo Zancanaro 4245ddcbc9
guix system: Load all services on reconfigure, not just stopped ones.
This uses the 'replacement' service slot introduced in the Shepherd
version 0.5.0.

* gnu/services/shepherd.scm (shepherd-service-upgrade): Return a list of
  services that need to be restarted to complete their upgrade.
* guix/scripts/system.scm (call-with-service-upgrade-info): Rename an internal
  variable to reflect the change to shepherd-service-upgrade.
  (upgrade-shepherd-services): Call 'load-services/safe' instead of
  'load-services'.  Print a message about services that need to be
  manually restarted.
* gnu/services/herd.scm (load-services/safe): New procedure.
* doc/guix.texi (Invoking guix system): Document the new behaviour.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2018-09-26 23:40:36 +02:00
Ludovic Courtès f3f1d0a557
guix system: Make 'init' idempotent again.
This fixes a regression introduced in
df2f6400b1fbc282ef4d6dd7124ea1c17adc23c2: since the new
'register-path' (actually 'reset-timestamps') would make files
read-only, 'delete-file-recursively' would fail to delete them.  Thus,
re-running 'guix system init' on an already-populated store would fail
with a 'delete-file' EPERM.

* guix/scripts/system.scm (copy-item): Use 'lstat' instead of
'file-exists?'.  Call 'make-file-writable' on each directory below
DEST.
2018-07-03 17:50:04 +02:00
Ludovic Courtès 71bf6cb700
guix system: init: Check the available space before copying.
* guix/scripts/system.scm (copy-closure): Call 'query-path-info*' on
TO-COPY and REFS.  Compute the total size.  Call 'check-available-space'.
2018-07-03 00:39:11 +02:00
Ricardo Wurmus 945449b40b
guix: Fix system reconfigure.
This is a follow-up to 378daa8cb6.

* guix/scripts/system.scm (switch-to-system): Lower the script.
2018-06-21 16:54:06 +02:00
Ludovic Courtès e203f4c26a
guix system: 'list-generation' correctly displays file system labels.
* guix/scripts/system.scm (display-system-generation): Correctly display
file system labels.  Previously, starting from commit
a5acc17a3c, it'd print #<file-system-label "foo">.
2018-06-20 23:47:08 +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 df2f6400b1
store: Remove 'register-path'.
* guix/store.scm (register-path): Remove.
* guix/nar.scm: Use (guix store database).
* guix/scripts/system.scm: Likewise.
* tests/store-database.scm: Remove #:hide (register-path).
* tests/store.scm ("register-path"): Remove.
2018-06-14 11:17:00 +02:00
Ludovic Courtès 75e24d7b0e
pull: Install the new Guix in a profile.
* guix/scripts/pull.scm (%pull-version): New variable.
(build-from-source): Pass #:pull-version to BUILD.
(whole-package-for-legacy, derivation->manifest-entry): New procedure.
(build-and-install): Rewrite in terms of 'build-and-use-profile'.
* guix/scripts/system.scm (maybe-suggest-running-guix-pull)[latest]:
Switch to "/current".
* scripts/guix.in (augment-load-paths!): Remove use of
~/.config/guix/latest.
* build-aux/compile-as-derivation.scm: Replace "/guix/latest/" with
"/current/share/guile/site/X.Y"
* guix/scripts.scm (warn-about-old-distro)[age]: Check "/current"
instead of "/latest".
* doc/guix.texi (Invoking guix pull): Document it.
* doc/contributing.texi (Running Guix Before It Is Installed): Remove
footnote about abusing ~/.config/guix/latest.
2018-06-09 12:02:27 +02:00
Mathieu Othacehe 8fc3a971b0
scripts: system: Sort profile generations in reverse order.
* guix/scripts/system.scm (profile-boot-parameters): Reverse
generation-numbers list. This allows old generations to be listed from most
recent to oldest in bootloaders configuration files.
2018-06-01 09:40:07 +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
Ludovic Courtès 6ddb59607b
guix system: Report wrong file system 'device' fields.
Previously, if you wrote (device "my-label") without (title 'label),
you'd get:

  guix system: error: stat: No such file or directory: "my-label"

Now you get a proper error and a hint.

Reported by Pierre-Antoine Rouby.

* guix/scripts/system.scm (check-file-system-availability)[literal]: New
variable.  Loop over LITERAL.
* gnu/system/file-systems.scm (%pseudo-file-system-types): New variable.
* guix/ui.scm (display-hint): Make public.
2018-04-27 18:45:02 +02:00
Chris Marusich a335f6fcc9
system: Add "guix system docker-image" command.
* gnu/system/vm.scm (system-docker-image): New procedure.
* guix/scripts/system.scm (system-derivation-for-action): Add a case for
  docker-image, and in that case, call system-docker-image.
  (show-help): Document docker-image.
  (guix-system): Parse arguments for docker-image.
* doc/guix.texi (Invoking guix system): Document "guix system
  docker-image".
* gnu/system/examples/docker-image.tmpl: New file.
2018-03-24 03:04:11 +01:00
Ludovic Courtès 61b1dbbdcd
guix system: Add '--skip-checks'.
Fixes <https://bugs.gnu.org/30760>.
Reported by Tomáš Čech <sleep_walker@gnu.org>.

* guix/scripts/system.scm (perform-action): Add #:skip-safety-checks?
and honor it.
(show-help, %options): Add --skip-checks.
(process-action): Pass #:skip-safety-checks? to 'perform-action'.
* doc/guix.texi (Invoking guix system): Document --skip-checks.
2018-03-15 10:28:22 +01:00
Ludovic Courtès ca23693d28
linux-initrd: Factorize 'check-device-initrd-modules'.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Move to...
* gnu/system/linux-initrd.scm (check-device-initrd-modules): ... here.
New procedure.
* po/guix/POTFILES.in: Add it.
* guix/scripts/system.scm (check-initrd-modules)[check-device]: Remove.
Use 'check-device-initrd-modules' instead.
2018-03-07 11:22:42 +01:00
Ludovic Courtès 424cea8083
guix system: Check for the lack of modules in the initrd.
* guix/scripts/system.scm (check-mapped-devices): Take an OS instead of
a list of <mapped-device>.  Pass #:needed-for-boot? and #:initrd-modules
to CHECK.
(check-initrd-modules): New procedure.
(perform-action): Move 'check-mapped-devices' call first.  Add call to
'check-initrd-modules'.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): New
procedure.
(check-luks-device): Add #:initrd-modules and #:needed-for-boot?.  Use
them to call 'check-device-initrd-modules'.
2018-03-02 13:53:15 +01:00
Ludovic Courtès 33033a620e
services: shepherd: Make 'shepherd-configuration-file' non-monadic.
Suggested by atw on #guix.

* gnu/services/shepherd.scm (shepherd-service-file): Use 'scheme-file'
instead of 'gexp->file'.
(shepherd-configuration-file): Likewise, and adjust to non-monadic
style.
(shepherd-boot-gexp): Adjust accordingly.
* guix/scripts/system.scm (upgrade-shepherd-services): Use
'lower-object' in addition to 'shepherd-service-file'.
2018-01-21 00:24:02 +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 893d0b0bf3
guix system: Check mapped devices upon 'init' and 'reconfigure'.
* guix/scripts/system.scm (check-mapped-devices): New procedure.
(perform-action): Add call to 'check-mapped-devices'.
2017-12-22 09:48:41 +01:00
Mathieu Othacehe 5a72ddf176
scripts: system: Add --expression option.
* guix/scripts/system.scm (show-help): Add expression option.
(%options): Ditto.
(guix-system): Allow commands taking a file as an argument to use an
expression instead.
(process-action): Read operating-system from expression or file.
* doc/guix.texi (Invoking guix system): Introduce the expression option.
2017-12-15 12:15:15 +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
Ludovic Courtès 7920e187c1
scripts: All commands enable build hooks by default.
* guix/scripts/archive.scm (%default-options): Add 'build-hook?'.
* guix/scripts/copy.scm (%default-options): Likewise.
* guix/scripts/environment.scm (%default-options): Likewise.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/package.scm (%default-options): Likewise.
* guix/scripts/pull.scm (%default-options): Likewise.
2017-12-07 23:12:37 +01:00
Mathieu Othacehe 4307397b5e
bootloader: extlinux: Stop using dd binary.
* gnu/bootloader/extlinux.scm (dd): Remove it,
(install-extlinux): replace dd call by Guile I/O procedures.
* gnu/system/vm.scm (qemu-image): Add (ice-9 binary-ports) to used-modules
list to provide "get-bytevector-n" and "put-bytevector".
* guix/scripts/system.scm (bootloader-installer-derivation): Ditto.
2017-12-04 18:26:59 +01:00
Ludovic Courtès e261e27676
guix system: 'init' displays a progress bar while copying.
Until now it would print the name of each store item being copied, which
was verbose and unhelpful.

* guix/scripts/system.scm (copy-closure): Use 'progress-reporter/bar'
and 'call-with-progress-reporter'.
(guix-system): Parameterize 'current-terminal-columns'.
2017-12-01 16:00:14 +01:00