Commit Graph

841 Commits (150e20ddde726abdfe77fa666351738cccb06281)

Author SHA1 Message Date
Ludovic Courtès 150e20ddde vm: Support initialization of the store DB when the store is shared.
* gnu/system/vm.scm (qemu-image): Rename #:inputs-to-copy to #:inputs,
  and #:initialize-store? to #:register-closures?.  Add #:copy-inputs?.
  Adjust build gexp accordingly.
  (system-qemu-image): Remove #:initialize-store? argument and add
  #:copy-inputs?.
  (system-qemu-image/shared-store): Add #:inputs, #:register-closures?,
  and #:copy-inputs? arguments.
* guix/build/vm.scm (register-closure): New procedure.
  (MS_BIND): New variable.
  (initialize-hard-disk): Rename #:initialize-store? to
  #:register-closures?, #:closures-to-copy to #:closures, and add
  #:copy-closures?.
  Add 'target-directory' and 'target-store' variables.
  Call 'populate-store' only when COPY-CLOSURES?.
  Bind-mount the store to TARGET-STORE when REGISTER-CLOSURES? and not
  COPY-CLOSURES?.  Add call to 'register-closure'.
2014-05-15 22:55:14 +02:00
Ludovic Courtès f3b692acdd activation: Silence warning from 'useradd'.
* guix/build/activation.scm (add-user): Don't pass '--create-home' when
  HOME already exists.
2014-05-14 19:07:04 +02:00
Ludovic Courtès 7f17ff7841 linux-initrd: Make /dev/ttyS0, for debugging.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Make
  /dev/ttyS0.
2014-05-14 19:07:04 +02:00
Ludovic Courtès 7d57cfd3b6 system: When unionfs-fuse is used for /, don't kill it when halting.
* guix/build/linux-initrd.scm (pidof): New procedure.
  (mount-root-file-system)[mark-as-not-killable]: New procedure.
  Use it for unionfs when VOLATILE-ROOT?.
* gnu/services/base.scm (%do-not-kill-file): New variable.
  (user-processes-service)[stop]: Honor it.
2014-05-14 19:07:03 +02:00
Ludovic Courtès 17a4d34489 syscalls: Add 'processes' to list all the live processes.
* guix/build/syscalls.scm (kernel?, processes): New procedures.
2014-05-14 19:07:03 +02:00
Ludovic Courtès ab6a279abb system: Make accounts and groups at activation time.
* gnu/services/base.scm (guix-build-accounts): Remove #:gid parameter;
  add #:group.  Remove 'password' and 'gid' fields in 'user-account'
  form, and add 'group'.
  (guix-service): Remove #:build-user-gid parameter.  Remove 'id' field
  in 'user-group' form.
* gnu/system.scm (etc-directory): Remove #:groups and #:accounts.  No
  longer produce files "passwd", "shadow", and "group".  Adjust caller
  accordingly.
  (%root-account): New variable.
  (operating-system-accounts): Add 'users' variable.  Add %ROOT-ACCOUNT
  only of 'operating-system-users' doesn't already contain a root
  account.
  (user-group->gexp, user-account->gexp): New procedures.
  (operating-system-boot-script): Add calls to 'setenv' and
  'activate-users+groups' in gexp.
* gnu/system/linux.scm (base-pam-services): Add PAM services for
  "user{add,del,mode}" and "group{add,del,mod}".
* gnu/system/shadow.scm (<user-account>)[gid]: Rename to...
  [group]: ... this.
  [supplementary-groups]: New field.
  [uid, password]: Default to #f.
  (<user-group>)[id]: Default to #f.
  (group-file, passwd-file): Remove.
* gnu/system/vm.scm (operating-system-default-contents)[user-directories]:
  Remove.  Add "/home" to the directives.
* guix/build/activation.scm (add-group, add-user,
  activate-users+groups): New procedures.
2014-05-11 22:41:58 +02:00
Ludovic Courtès 023f391c78 services: Add 'file-system-service'.
* gnu/services/base.scm (file-system-service): New procedure.
  (user-processes-service): Add 'requirements' parameter.
* gnu/services/dmd.scm (dmd-configuration-file): Use (guix build
  linux-initrd).
* guix/build/linux-initrd.scm (guix): Export 'check-file-system'.
* gnu/system.scm (file-union): New procedure.
  (essential-services): Use it.  Add that to the returned list.
2014-05-10 23:33:52 +02:00
Ludovic Courtès 29fa45f45d Add (guix build syscalls).
* guix/build/syscalls.scm, tests/syscalls.scm: New files.
* Makefile.am (MODULES): Add guix/build/syscalls.scm.
  (SCM_TESTS): Add tests/syscalls.scm.
* guix/utils.scm (%libc-errno-pointer, errno): Remove; take from (guix
  build syscalls).
2014-05-10 22:55:34 +02:00
Ludovic Courtès 02139eb9b2 linux-initrd: Append to /etc/mtab.
* guix/build/linux-initrd.scm (mount-file-system): Open /etc/mtab in
  append mode.
2014-05-10 21:47:05 +02:00
Ludovic Courtès 474b832d5e linux-initrd: Don't leak /dev/console file descriptors.
* guix/build/linux-initrd.scm (switch-root): Simplify /dev/console
  code.  This fixes a bug where we would leak the IN and OUT file
  descriptors.
2014-05-08 23:42:15 +02:00
Ludovic Courtès 03178aec1d git-download: Disable TLS certificate verification.
* guix/build/git.scm (git-fetch): Add 'setenv' call.
2014-05-08 23:42:15 +02:00
Ludovic Courtès b1995341ce linux-initrd: Update /etc/mtab.
* guix/build/linux-initrd.scm (mount-root-file-system): Populate
  /root/etc/mtab.
  (mount-file-system): Update ROOT/etc/mtab.
2014-05-08 00:22:26 +02:00
Ludovic Courtès 538cc2e016 Remove now unneeded (guix build gnome) module.
* guix/build/gnome.scm: Remove.
* Makefile.am (MODULES): Update accordingly.
2014-05-07 14:32:36 +02:00
Ludovic Courtès 26a728eb09 linux-initrd: Delete files from the initrd ramfs when switching roots.
* guix/build/linux-initrd.scm (switch-root): Delete file from the old
  root.  Chdir to / after 'chroot' call.  Re-open file descriptors 0, 1,
  and 2.
  (boot-system): Move 'loading' message after the 'switch-root' call.
* gnu/system.scm (operating-system-boot-script): Add loop that closes
  file descriptor before calling 'execl'.
2014-05-06 18:18:22 +02:00
Ludovic Courtès 515eba4543 gnu-maintenance: Add missing type check.
* guix/gnu-maintenance.scm (gnu-package?): Only call 'mirror-type' when
  URL is a string.
2014-05-05 09:00:00 +02:00
Ludovic Courtès 1d4628329d linux-initrd: Improve root file system switching.
* guix/build/linux-initrd.scm (move-essential-file-systems,
  switch-root): New procedures.
  (MS_MOVE): New variable.
  (boot-system): Remove 'mount-essential-file-systems' call for ROOT.
  Use 'switch-root' instead of chdir + chroot.
2014-05-04 22:24:47 +02:00
Ludovic Courtès 3c05b4bc25 linux-initrd: Check the root and other early file systems.
* gnu/system.scm (operating-system-derivation)[boot-file-systems]: Keep "/".
* gnu/system/linux-initrd.scm (file-system->spec): Keep the 'check?'
  flag.
  (qemu-initrd)[helper-packages]: New variable.  Pass it as #:to-copy.
  <gexp>: Add 'set-path-environment-variable' call.  Remove #:unionfs
  argument for 'boot-system'.
* gnu/system/vm.scm (%linux-vm-file-systems): Add 'check?' field/
  (virtualized-operating-system): Likewise for the "9p" file system.
* guix/build/linux-initrd.scm (mount-root-file-system): Change #:unionfs
  default.  Call 'check-file-system' before mounting ROOT, when
  VOLATILE-ROOT? is false.
  (check-file-system): New procedure.
  (mount-file-system): Honor 'check?' element in list; add
  'check-file-system' call.
  (boot-system): Remove #:root-fs-type and #:unionfs parameters.
  [root-mount-point?, root-fs-type]: New variables.
  Call 'mount-file-system' on all MOUNTS but "/".
2014-05-04 00:30:39 +02:00
Ludovic Courtès ad896f23a5 activation: Fix deletion of setuid programs.
* guix/build/activation.scm (activate-setuid-programs): When
  %SETUID-DIRECTORY exists, pass the right file names to 'delete-file'.
2014-05-04 00:18:46 +02:00
Ludovic Courtès 03ddfaf5fb vm: Make root file system type a parameter, and default to ext4.
* gnu/system/vm.scm (qemu-image): Add #:file-system-type parameter.
  Pass it to 'initialize-hard-disk'.
* guix/build/linux-initrd.scm (mount-root-file-system): Always honor
  TYPE.
  (boot-system): Change #:root-fs-type to default to "ext4".  Update
  docstring.
* guix/build/vm.scm (initialize-hard-disk): Remove #:mkfs parameter; add
  #:file-system-type.  Adjust 'mkfs' invocation and 'mount' call to
  honor #:file-system-type.
2014-05-03 12:16:23 +02:00
Ludovic Courtès 3c986b75f5 ftp-client: Add missing CR in "USER" command.
* guix/ftp-client.scm (%ftp-login): Add #\return before #\newline.
  Fixes access to some FTP servers, such as
  ftp://invisible-island.net ("ProFTPD 1.3.4a Server").
2014-05-03 00:46:51 +02:00
Ludovic Courtès 83bcd0b895 system: Add first-class file system declarations.
* gnu/system.scm (<operating-system>)[initrd]: Default to
  'qemu-initrd'.
  (<file-system>): New record type.
  (operating-system-root-file-system): New procedure.
  (operating-system-derivation): Take the device name for GRUB from
  'operating-system-root-file-system'.  Pass the
  'operating-system-initrd' procedure the list of boot file systems.
* gnu/system/linux-initrd.scm (file-system->spec): New procedure.
  (qemu-initrd): Add 'file-systems' parameter, and remove #:mounts
  parameter.
  [file-system-type-predicate]: New procedure.
  [linux-modules]: Use it.
  Adjust #:mounts argument in 'boot-system' call.
  (gnu-system-initrd): Remove.
* gnu/system/vm.scm (%linux-vm-file-systems): New variable.
  (expression->derivation-in-linux-vm): Adjust call to 'qemu-initrd'.
  (virtualized-operating-system): New procedure.
  (system-qemu-image/shared-store-script)[initrd]: Remove.  Use
  'virtualized-operating-system'.  Get the 'initrd' file from OS-DRV.
* guix/build/linux-initrd.scm (mount-qemu-smb-share, mount-qemu-9p):
  Remove.
  (MS_RDONLY, MS_BIND): New global variables.
  (bind-mount): Remove local 'MS_BIND' definition.
  (mount-root-file-system): New procedure, with code formerly in
  'boot-system'.
  (mount-file-system): New procedure.
  (boot-system): Add #:root-fs-type parameter.  Remove 'MS_RDONLY' local
  variable.  Use 'mount-root-file-system' and 'mount-file-system'.
* doc/guix.texi (Using the Configuration System): Add 'file-system'
  declaration.
2014-05-03 00:46:51 +02:00
Ludovic Courtès 6f8f8ccb5b download: Rewrite using gexps.
* guix/download.scm (gnutls-derivation): Remove.
  (gnutls-package): New procedure.
  (url-fetch): Rewrite using 'gexp->derivation'.
2014-05-01 22:31:36 +02:00
Ludovic Courtès 53e89b1732 monads, gexp: Remove unintended dependency on (gnu packages …).
* guix/gexp.scm (gexp->derivation, gexp->script): Use 'default-guile'
  instead of an explicit reference to 'guile-final'.
  (default-guile): New procedure.
* guix/monads.scm (run-with-store)[default-guile]: New procedure.
  Use it.
2014-05-01 22:31:36 +02:00
Ludovic Courtès 79c0c8cdf7 gexp: Add support for 'origin?' objects in 'ungexp' forms.
* guix/gexp.scm (lower-inputs, gexp-inputs, gexp->sexp,
  canonicalize-reference): Add 'origin?' case.
* guix/monads.scm (origin->derivation): New procedure.
* tests/gexp.scm ("one input origin"): New test.
2014-05-01 22:31:36 +02:00
Ludovic Courtès 7560b00b1c gexp: Add pretty printer.
* guix/gexp.scm (write-gexp): New procedure.
  <top level>: Add call to 'set-record-type-printer!'.
2014-04-30 23:16:23 +02:00
Ludovic Courtès 09e028f45f system: Add support for setuid binaries.
* gnu/system.scm (<operating-system>)[pam-services, setuid-programs]:
  New fields.
  (etc-directory)[bashrc]: Prepend /run/setuid-programs to $PATH.
  (operating-system-etc-directory): Honor
  'operating-system-pam-services'.
  (%setuid-programs): New variable.
  (operating-system-boot-script): Add (guix build utils) to the set of
  imported modules.  Call 'activate-setuid-programs' in boot script.
* gnu/system/linux.scm (base-pam-services): New procedure.
* guix/build/activation.scm (%setuid-directory): New variable.
  (activate-setuid-programs): New procedure.
* build-aux/hydra/demo-os.scm: Add 'pam-services' field.
2014-04-30 23:16:23 +02:00
Ludovic Courtès d8a7a5bfd5 linux-initrd: Allow setuid binaries from the unionfs to run.
* guix/build/linux-initrd.scm (boot-system): Pass the 'suid' option to
  UNIONFS.
2014-04-30 23:16:23 +02:00
Ludovic Courtès 4dfe6c58ee system: Add (guix build activation).
* gnu/services/dmd.scm (dmd-configuration-file): Remove 'etc'
  parameter.  Move /etc activation code to...
* guix/build/activation.scm: ... here; new file.
* gnu/system.scm (operating-system-boot-script): Augment script: add
  (guix build activation) to the load path; call 'activate-etc'.
* Makefile.am (MODULES): Add guix/build/activation.scm.
2014-04-30 23:16:22 +02:00
Ludovic Courtès be4e38fb6f derivations: Micro-optimize 'derivation'.
* guix/derivations.scm (derivation->string): New procedure.
  (derivation-hash, derivation): Use it.
  Memoization here yields a 5% improvement on "guix build -e '(@ (gnu
  packages emacs) emacs)' -n --no-substitutes".
2014-04-29 18:13:10 +02:00
Ludovic Courtès 187eb5f643 gnu-maintenance: Avoid network access in 'gnu-package?'.
* guix/gnu-maintenance.scm (gnu-package?): Add 'mirror-type' procedure.
  Resort to 'official-gnu-packages' only when 'mirror-type' returns #f.
2014-04-29 18:02:16 +02:00
Ludovic Courtès bfd9eed955 gexp: Remove leftover parameter.
* guix/gexp.scm (gexp->sexp): Remove #:outputs parameter.  Adjust
  callers accordingly.
2014-04-29 17:58:34 +02:00
Ludovic Courtès ada3df03e3 monads: Hide 'derivation-expression' and 'lower-inputs'.
* guix/monads.scm: Unexport 'lower-inputs' and 'derivation-expression'.
  (text-file*): Add comment about the switch to 'gexp->derivation'.
  (lower-inputs): Add comment about its doom.
  (derivation-expression): Likewise.
* guix/gexp.scm (lower-inputs*): Rename to...
  (lower-inputs): ... this.  Update callers.
* tests/monads.scm (derivation-expression): New procedure.
* doc/guix.texi (The Store Monad): Use 'gexp->derivation' instead of
  'derivation-expression'.  Remove documentation of
  'derivation-expression'.
* guix/ui.scm (read/eval): Use THE-ROOT-MODULE so that macros are
  properly expanded.
* tests/guix-build.sh: Use 'gexp->derivation' instead of
  'derivation-expression'.monads: Hide 'derivation-expression' and 'lower-inputs'.
2014-04-28 23:41:12 +02:00
Ludovic Courtès eee2127109 store: (direct-store-path? (%store-prefix)) returns #f.
* guix/store.scm (direct-store-path?): Return #f if PATH
  is (%store-prefix).
* tests/store.scm ("direct-store-path?"): Add test.
2014-04-28 23:24:18 +02:00
Ludovic Courtès 21b679f694 Add (guix gexp).
* guix/gexp.scm: New file.
* tests/gexp.scm: New file.
* Makefile.am (MODULES): Add guix/gexp.scm.
  (SCM_TESTS): Add tests/gexp.scm.
* doc/guix.texi (Derivations): Add #:inputs in 'derivation' example.
  Mark 'build-expression->derivation' as deprecated, refer to
  "G-Expressions".  Remove paragraph about code strata.
  (G-Expressions): New node.
2014-04-28 23:24:17 +02:00
Andreas Enge 06ed59825e guix: cmake: Add input and package libraries to the rpath, and adapt package
definitions accordingly.

* guix/build/cmake-build-system.scm (configure): Add flags.
* gnu/packages/maths.scm (lapack): Drop special code.
* gnu/packages/ssh.scm (libssh): Drop special code.
* gnu/packages/slim.scm (slim): Drop special code and enable shared library.

Co-authored-by: Eric Bavier <bavier@member.fsf.org>
2014-04-27 11:35:26 +02:00
Ludovic Courtès 6ef3644e34 pk-crypto: Add pretty-printer to 'gcry-error' exceptions.
* guix/pk-crypto.scm (string->canonical-sexp, sign, generate-key): Pass
  the procedure name as the first argument to 'throw'.
  (gcrypt-error-printer): New procedure.
  <top level>: Add call to 'set-exception-printer!'.
* guix/nar.scm (restore-one-item): Add 'proc' parameter to 'catch'
  handler for 'gcry-error.
* guix/scripts/archive.scm (%options, generate-key-pair, authorize-key):
  Likewise.
* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp):
  Likewise.
2014-04-22 11:41:52 +02:00
Ludovic Courtès 6f69588529 authenticate: Allow signatures with binary data to be written to stdout.
Fixes <http://bugs.gnu.org/17312>.

* guix/scripts/authenticate.scm (guix-authenticate): Add calls to
  'set-port-encoding!' and 'set-port-conversion-strategy!'.  Wrap body
  in 'with-fluids' form that sets '%default-port-encoding' and
  '%default-port-conversion-strategy'.
* tests/guix-authenticate.sh: Add test.
* tests/pk-crypto.scm ("hash corrupt due to restrictive locale
  encoding"): Add reference to bug.
2014-04-22 11:30:58 +02:00
Ludovic Courtès 6030d8493e pk-crypto: Use ISO-8859-1 for strings passed to 'gcry_sexp_new'.
* guix/pk-crypto.scm (string->canonical-sexp): Pass "ISO-8859-1" as the
  2nd argument to 'string->pointer'.
* tests/pk-crypto.scm ("version"): New test.
  ("hash corrupt due to restrictive locale encoding"): New test.
2014-04-22 01:39:31 +02:00
Ludovic Courtès 50db7d82b3 nar: Really really protect the temporary store directory from GC.
This is a follow-up to 6071b55e10.
See <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00167.html>
for the original report, and
<https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00198.html>
for an alternate solution that has been discussed.

* guix/nar.scm (temporary-store-file): Remove call to
  'add-permanent-root'; don't loop.
  (with-temporary-store-file): Rewrite using 'with-store' and
  'add-temp-root'.
2014-04-21 23:24:23 +02:00
Ludovic Courtès 395bea2a53 download: Improve progress report output.
* guix/build/download.scm (url-fetch): Make current-output-port
  unbuffered.
2014-04-16 12:25:52 +02:00
Ludovic Courtès 1c96c1bbab linux-initrd: Mount / as a unionfs when asking for a volatile root.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Make
  /dev/fuse.
  (boot-system): Add #:unionfs parameter.  Invoke UNIONFS instead of
  copying files over when VOLATILE-ROOT? is true.
* gnu/system/linux-initrd.scm (expression->initrd): Add #:inputs
  parameter.
  [files-to-copy]: New procedure.
  [builder]: Add 'to-copy' parameter; honor it.
  (qemu-initrd)[linux-modules]: Add 'fuse.ko' when VOLATILE-ROOT?.
  Pass UNIONFS-FUSE/STATIC as #:inputs; change builder to pass #:unionfs
  to 'boot-system'.
2014-04-14 23:59:08 +02:00
Ludovic Courtès 30ce8012cd offload: '{send,receive}-files' wait for completion of the transfer.
Fixes situations where the remote 'guix build' is invoked before the
.drv has been completely copied, as reported at
<https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00174.html>.

In some cases 'send-files' would return before the other end is done
importing the files, and so the subsequent 'guix build' invocation would
just miss the .drv file it refers to.

* guix/utils.scm (call-with-decompressed-port): Don't close PORT.
  (call-with-compressed-output-port): Likewise.
* tests/utils.scm ("compressed-output-port + decompressed-port"): Adjust
  accordingly.
* guix/scripts/offload.scm (send-files): Add explicit (close-pipe pipe)
  call.
  (retrieve-files): Likewise.
2014-04-14 00:24:24 +02:00
Ludovic Courtès 66ef541147 offload: Better synchronize with remote invocation of 'guix archive --missing'.
* guix/scripts/offload.scm (send-files)[missing-files]: Call 'waitpid'
  after reading all of MISSING.
2014-04-14 00:17:43 +02:00
Ludovic Courtès 99e17dc927 derivations: Fix 'fixed-output-derivation?'.
Reported by Nikita Karetnikov <nikita@karetnikov.org>.

* guix/derivations.scm (fixed-output-derivation?): Fix pattern.
* tests/derivations.scm ("fixed-output-derivation?"): Add test.
2014-04-13 00:42:07 +02:00
Ludovic Courtès 6071b55e10 nar: Really protect the temporary store directory from GC.
Prevents garbage collection of the temporary store directory while
restoring a file set, as it could previously happen:
<https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00167.html>.

* guix/nar.scm (temporary-store-directory): Rename to...
  (temporary-store-file): ... this.  Use 'add-permanent-root' instead of
  'add-indirect-root'.
  (with-temporary-store-file): New macro.
  (restore-one-item): New procedure, with code formerly in
  'restore-file-set'.  Use 'with-temporary-store-file'.
  (restore-file-set): Use it.
2014-04-12 23:03:56 +02:00
Ludovic Courtès a9d2a10546 store: Add 'add-permanent-root' and 'remove-permanent-root'.
* guix/store.scm (add-indirect-root): Improve docstring.
  (%gc-roots-directory): New variable.
  (add-permanent-root, remove-permanent-root): New procedures.
* tests/store.scm ("permanent root"): New test.
2014-04-12 22:32:10 +02:00
Ludovic Courtès 857ecb3df5 packages: Correctly handle patching for inputs with no extension.
Reported by Manolis Ragkousis <manolis837@gmail.com>.

* guix/packages.scm (patch-and-repack)[numeric-extension?]: Handle
  FILE-NAME with no extension.
2014-04-12 14:39:43 +02:00
Ludovic Courtès 55651ff207 vm: Move image creation to (guix build vm); split into several procedures.
* guix/build/vm.scm (read-reference-graph, initialize-partition-table,
  install-grub, populate-store, evaluate-populate-directive,
  reset-timestamps, initialize-hard-disk): New procedures.
* gnu/system/vm.scm (qemu-image): Change 'builder' to a call to
  'initialize-hard-disk'.
2014-04-11 19:08:25 +02:00
Ludovic Courtès e1a87b904a vm: Add (guix build vm) module.
* guix/build/vm.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Use it.
2014-04-11 19:08:24 +02:00
Ludovic Courtès 9132b9bd72 nar: 'restore-file-set' registers the temporary result as a GC root.
* guix/nar.scm (temporary-store-directory): Use 'add-indirect-root', not
  'add-temp-root'.  Reported by Andreas Enge <andreas@enge.fr> at
  <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00161.html>.
2014-04-09 23:01:02 +02:00