Commit Graph

334 Commits (ff31136edaf9565a6fcbba64b2d3b41267a108e7)

Author SHA1 Message Date
Ludovic Courtès 2ed11b3a3e utils: Change 'wrap-program' to preserve the original argv[0].
Suggested by Mark H Weaver <mhw@netris.org>
in <http://bugs.gnu.org/19138>.

* guix/build/utils.scm (wrap-program): Change wrapper to use "exec -a
  PROG" instead of just "exec".
2014-12-14 11:54:12 +01:00
Ludovic Courtès c809ec94d1 utils: Change 'patch-makefile-SHELL' to support ":=" assignments.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/build/utils.scm (patch-makefile-SHELL): Update regexp to match
  ":=" assignments.
2014-12-13 00:06:32 +01:00
Ludovic Courtès 5e5deea952 utils: Use 'which' to find the shell in 'patch-makefile-SHELL'.
* guix/build/utils.scm (patch-makefile-SHELL)[find-shell]: Use 'which'.
2014-12-13 00:04:25 +01:00
Alex Kost 0b08600ca5 build: emacs-utils: Add 'emacs-generate-autoloads'.
* guix/build/emacs-utils.scm (emacs-generate-autoloads): New procedure.
2014-12-02 22:09:23 +03:00
Ludovic Courtès 73aa8ddb75 build-system/glib-or-gtk: Allow specific outputs to be excluded from wrapping.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Add
  #:glib-or-gtk-wrap-excluded-outputs parameter and honor it.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Add
  #:glib-or-gtk-wrap-excluded-outputs parameter and pass it in BUILDER.
* doc/guix.texi (Build Systems): Mention it.
2014-12-01 22:41:04 +01:00
Ludovic Courtès c8b7569558 build-system/glib-or-gtk: Correctly handle multiple-output packages.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Move body
  to 'handle-output' inner procedure, and parametrize it by output name
  and directory.  Call it for each element of OUTPUTS.
  (compile-glib-schemas): Likewise.
2014-12-01 22:41:04 +01:00
Ludovic Courtès 4efdabb810 build-system/glib-or-gtk: Use 'for-each' and 'cut' as appropriate.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Use
  'for-each' instead of 'map' in for-effect contexts.  Use 'cut' instead
  of 'lambda' when appropriate.
2014-12-01 22:41:04 +01:00
Ludovic Courtès 85dbd3dcd0 build-system/glib-or-gtk: Clean up whitespace.
* guix/build/glib-or-gtk-build-system.scm: M-x whitespace-cleanup.
2014-12-01 22:41:04 +01:00
Ludovic Courtès 7cc7dec139 build-system/gnu: Add 'compress-documentation' phase.
* guix/build/gnu-build-system.scm (compress-documentation): New
  procedure.
  (%standard-phases): Add it.
2014-12-01 16:50:28 +01:00
Ludovic Courtès 9741aca9a5 utils: Add 'symbolic-link?'.
* guix/build/utils.scm (symbolic-link?): New procedure.
2014-12-01 15:46:38 +01:00
Ludovic Courtès d68fe74162 build-system/gnu: Add 'validate-documentation-location' phase.
* guix/build/gnu-build-system.scm (validate-documentation-location): New
  procedure.
  (%standard-phases): Add it.
2014-12-01 14:09:36 +01:00
Taylan Ulrich Bayırlı/Kammer 094b2efc3c utils: Improve docstring of 'substitute*' & co.
* guix/build/utils.scm (substitute): Clarify first sentence of
  docstring and add warning to the docstring about using '$' to match
  an end of line.
  (substitute*): Add warning to the docstring about using '$' to match
  an end of line.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-11-26 11:17:48 +01:00
Ludovic Courtès f8bcf1935a build-system/gnu: Gracefully handle dangling symlinks in the 'strip' phase.
* guix/build/gnu-build-system.scm (strip): Check whether 'file-exists?'
  before calling 'elf-file?' and 'ar-file?'.  This should fix build
  failures in the presence of dangling symlinks, as in
  <http://hydra.gnu.org/build/167521/nixlog/1/raw>.
2014-11-24 22:45:41 +01:00
Ludovic Courtès c23d17095d utils: 'elf-file?' and 'ar-file?' return #f for directories.
This avoids uncaught exceptions when the 'strip' phase would call these
procedures on symlinks to directories, such as 'lib/terminfo' in
ncurses (see <http://hydra.gnu.org/build/167310/nixlog/1/tail-reload>.)

* guix/build/utils.scm (file-header-match): Catch 'system-error', and
  return #f upon EISDIR.
2014-11-23 19:19:35 +01:00
Ludovic Courtès 1d1fa9327c utils: Turn 'parallel-job-count' into a parameter.
* guix/build/utils.scm (parallel-job-count): Turn into a SRFI-39 parameter.
2014-11-22 21:57:05 +01:00
Ludovic Courtès e8c7fdda5d build-system/gnu: Strip 'ar' archives as well.
* guix/build/gnu-build-system.scm (strip): Also strip when (ar-file?
  PATH) is true.
2014-11-22 21:54:27 +01:00
Ludovic Courtès 2bbc6db5e2 utils: Factorize magic bytes detection.
* guix/build/utils.scm (file-header-match): New procedure.
  (%elf-magic-bytes): New variable.
  (elf-file?, ar-file?): Define using 'file-header-match'.
2014-11-22 21:52:57 +01:00
Ludovic Courtès 91ee959b03 utils: Add 'ar-file?'.
* guix/build/utils.scm (%ar-magic-bytes): New variable.
  (ar-file?): New procedure.
2014-11-22 21:52:12 +01:00
Ludovic Courtès 50b87bd54b build-system/gnu: Strip only ELF files.
Suggested by Mark H Weaver <mhw@netris.org>
at <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00395.html>.

* guix/build/gnu-build-system.scm (strip)[strip-dir]: Strip only
  when (elf-file? PATH) is true.
2014-11-22 12:49:14 +01:00
Ludovic Courtès 99533da50d utils: Add 'elf-file?'.
* guix/build/utils.scm (elf-file?): New procedure.
2014-11-22 12:44:56 +01:00
Ludovic Courtès e6039b9c70 utils: Export 'parallel-job-count'.
* guix/build/utils.scm (parallel-job-count): New procedure.
* guix/build/gnu-build-system.scm (%parallel-job-count): Remove.
  (build, check): Use 'parallel-job-count' instead.
2014-11-22 12:32:32 +01:00
Ludovic Courtès cd4a3cb359 syscalls: Update /etc/mtab, not /etc/fstab.
* guix/build/syscalls.scm (remove-from-mtab): Replace "fstab" with
  "mtab".
2014-11-14 00:41:01 +01:00
Ludovic Courtès ccea821bef syscalls: Add 'mount-points'.
* guix/build/syscalls.scm (mount-points): New procedure.
* tests/syscalls.scm ("mount-points"): New test.
2014-11-10 22:42:14 +01:00
Ludovic Courtès f81ac34dd9 pull: Use the build procedure provided by the newly-downloaded Guix.
Fixes <http://bugs.gnu.org/18534>.

* guix/scripts/pull.scm (with-environment-variable, with-PATH): New
  macros.
  (temporary-directory, first-directory, interned-then-deleted): New
  procedures.
  (unpack): Rewrite to do the unpacking in the current process rather
  than as a separate derivation.
  (%self-build-file): New variable.
  (build-from-source): New procedure.
  (build-and-install): Use it.
* guix/build/pull.scm (build-guix): Rename 'tarball' argument to
  'source'.  Remove #:tar and #:gzip parameters, as well as 'tar'
  invocation.  Remove 'scandir' invocation.  Wrap body in
  'with-directory-excursion'.
* build-aux/build-self.scm: New file.
* Makefile.am (EXTRA_DIST): Add it.
2014-11-09 22:33:45 +01:00
Ludovic Courtès 38bf090e7c download: Add "Accept: */*" to the headers.
Fixes downloads from https://alioth.debian.org.
Reported by John Darrington <jmd@gnu.org>.

* guix/build/download.scm (http-fetch)[headers]: Add 'Accept'.
2014-10-19 12:07:53 +02:00
Federico Beffa be3425e5a9 gnu: Add the 'glib-or-gtk' build system.
* guix/build-system/glib-or-gtk.scm, guix/build/glib-or-gtk-build-system.scm:
  New files.
* Makefile.am (MODULES): Add them.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-10-08 12:01:50 +02:00
Ludovic Courtès fb59e275dd derivations: Add 'graft-derivation'.
* guix/derivations.scm (graft-derivation): New procedure.
* guix/build/graft.scm: New file.
* Makefile.am (MODULES): Add it.
* tests/derivations.scm ("graft-derivation"): New test.
2014-10-08 12:01:49 +02:00
Ludovic Courtès 9849cfc12c build-system/cmake: Add #:build-type parameter, default to "RelWithDebInfo".
* guix/build-system/cmake.scm (cmake-build): Add #:build-type.  Pass it
  in BUILDER.
* guix/build/cmake-build-system.scm (configure): Add #:build-type
  parameter and honor it.
* doc/guix.texi (Build Systems): Document #:configure-flags and
  #:build-type for CMake.
2014-10-04 22:59:38 +02:00
David Thompson c08f9818f9 build: Add ruby build system.
* guix/build-system/ruby.scm: New file.
* guix/build/ruby-build-system: New file.
* Makefile.am (MODULES): Add new files.
* doc/guix.texi (Build Systems): Document ruby-build-system.
2014-09-28 15:09:24 -04:00
Mark H Weaver b5b73a8269 Use #:prefix instead of #:renamer with 'symbol-prefix-proc'.
* gnu/packages/abiword.scm, gnu/packages/admin.scm, gnu/packages/aidc.scm,
  gnu/packages/backup.scm, gnu/packages/bittorrent.scm,
  gnu/packages/boost.scm, gnu/packages/compression.scm,
  gnu/packages/cryptsetup.scm, gnu/packages/curl.scm,
  gnu/packages/cyrus-sasl.scm, gnu/packages/dc.scm, gnu/packages/emacs.scm,
  gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/geeqie.scm,
  gnu/packages/ghostscript.scm, gnu/packages/gimp.scm,
  gnu/packages/gkrellm.scm, gnu/packages/gl.scm, gnu/packages/glib.scm,
  gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm,
  gnu/packages/gnutls.scm, gnu/packages/gnuzilla.scm, gnu/packages/gsasl.scm,
  gnu/packages/gtk.scm, gnu/packages/gv.scm, gnu/packages/image.scm,
  gnu/packages/indent.scm, gnu/packages/inkscape.scm,
  gnu/packages/lesstif.scm, gnu/packages/links.scm, gnu/packages/lisp.scm,
  gnu/packages/lsh.scm, gnu/packages/lsof.scm, gnu/packages/maths.scm,
  gnu/packages/mp3.scm, gnu/packages/openssl.scm, gnu/packages/ots.scm,
  gnu/packages/pciutils.scm, gnu/packages/pcre.scm, gnu/packages/pdf.scm,
  gnu/packages/pulseaudio.scm, gnu/packages/python.scm, gnu/packages/slim.scm,
  gnu/packages/ssh.scm, gnu/packages/texlive.scm, gnu/packages/vim.scm,
  gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wv.scm,
  gnu/packages/xiph.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm,
  gnu/packages/yasm.scm, gnu/packages/zip.scm,
  guix/build/cmake-build-system.scm, guix/build/perl-build-system.scm,
  guix/build/python-build-system.scm, guix/download.scm: Replaces uses of
  #:renamer and 'symbol-prefix-proc' with #:prefix.
2014-09-23 18:52:29 -04:00
Ludovic Courtès f07aa672fd Merge branch 'core-updates' 2014-09-22 23:06:33 +02:00
Ludovic Courtès 8591fae4cf syscalls: Adjust /proc/net/dev parser for old kernels.
* guix/build/syscalls.scm (%interface-line): Remove whitespace in rest
  pattern.  (There's no extra whitespace after the colon with Linux
  2.6.32.)
2014-09-22 21:12:26 +02:00
Ludovic Courtès 077bd18d22 download: Use the 'SERVER NAME' TLS extension when possible.
Fixes <http://bugs.gnu.org/18526>.
Reported by Mark H. Weaver.

* guix/build/download.scm (tls-wrap): Add 'server' parameter.  Call
  'set-session-server-name!' when (gnutls) defines it.
  (open-connection-for-uri): Adjust 'tls-wrap' call accordingly.
2014-09-22 21:06:39 +02:00
Ludovic Courtès 715fc9d44d syscalls: Add 'swapon' and 'swapoff'.
* guix/build/syscalls.scm (swapon, swapoff): New procedures.
* tests/syscalls.scm ("swapon, ENOENT/EPERM", "swapoff, EINVAL/EPERM"):
  New tests.
2014-09-18 20:19:56 +02:00
Ludovic Courtès 4d54785c69 syscalls: Add 'all-network-interfaces'.
* guix/build/syscalls.scm (network-interfaces): Update docstring.
  (%interface-line): New variable.
  (all-network-interfaces): New procedure.
* tests/syscalls.scm ("all-network-interfaces"): New test.
  ("network-interfaces"): Change to make sure the result is a subset
  of (all-network-interfaces).
2014-09-14 23:49:02 +02:00
Ludovic Courtès 973eea3478 syscalls: Add 'network-interface-flags'.
* guix/build/syscalls.scm (SIOCGIFFLAGS, IFF_UP, IFF_BROADCAST,
  IFF_LOOPBACK, IF_NAMESIZE): New variables.
  (network-interface-flags, loopback-network-interface?): New
  procedures.
* tests/syscalls.scm ("network-interface-flags",
  "loopback-network-interface?"): New tests.
2014-09-14 23:49:02 +02:00
Ludovic Courtès 7585016f53 syscalls: Add 'network-interfaces'.
* guix/build/syscalls.scm (SIOCGIFCONF, ifconf-struct,
  ifreq-struct-size): New variables.
  (%ioctl, bytevector->string-list, network-interfaces): New
  procedures.
* tests/syscalls.scm ("network-interfaces"): New test.
2014-09-14 23:49:02 +02:00
Mark H Weaver c041886d92 utils: Import (ice-9 format).
* guix/build/utils.scm: Import (ice-9 format).
2014-09-14 11:54:25 -04:00
Eric Bavier de61113857 utils: Allow wrap-program to be called multiple times.
* guix/build/utils.scm (wrap-program): Multiple invocations of
  wrap-program for the same file create successive wrappers.  Adjust
  docstring.
* tests/build-utils.scm: Test new wrap-program behavior.
  (%store): New variable.
2014-09-13 21:53:21 -05:00
Mark H Weaver e759c0a38c Merge branch 'master' into core-updates 2014-09-08 11:00:06 -04:00
Ludovic Courtès b50c5b7418 pull: Add a compilation progress report.
* guix/build/pull.scm (report-build-progress): New procedure.
  (p-for-each): Add #:progress parameter.
  [loop]: Keep track of the number of completed processes.  Tail-call
  PROGRESS at each loop iteration.
  (build-guix): Add #:debug-port parameter.  Use it for verbose
  messages.  Change 'tar' flags to 'xf'.  Around 'compile-file' call,
  bind CURRENT-WARNING-PORT to DEBUG-PORT.
* guix/scripts/pull.scm (unpack): Add #:verbose? parameter.
  [builder]: Pass #:debug-port to 'build-guix'.
  (guix-pull): Leave CURRENT-BUILD-OUTPUT-PORT unchanged.  Pass
  #:verbose? to 'unpack'.
2014-09-05 23:11:04 +02:00
Eric Bavier 1145938496 utils: Clean trailing whitespace at end of SHELL
* guix/build/utils.scm (patch-makefile-SHELL): Remove trailing whitespace.
2014-09-05 00:02:19 -05:00
Ludovic Courtès 6fd1a79674 vm: Move store copy handling to (guix build store-copy).
* gnu/build/vm.scm (read-reference-graph, populate-store): Move to...
* guix/build/store-copy.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Adjust default
  #:modules values accordingly.
* tests/gexp.scm ("gexp->derivation, store copy"): New test.
2014-09-04 23:24:54 +02:00
Ludovic Courtès 548f7a8fa2 Move operating system helpers from (guix build …) to (gnu build …).
* guix/build/activation.scm, guix/build/install.scm,
  guix/build/linux-initrd.scm, guix/build/vm.scm: Move to...
* gnu/build: ... here.
* Makefile.am (MODULES): Remove the above guix/build/ files.
* gnu-system.am (GNU_SYSTEM_MODULES): Add the above gnu/build/ files
  here.
* gnu/services/base.scm, gnu/services/dmd.scm, gnu/system.scm,
  gnu/system/linux-initrd.scm, gnu/system/vm.scm,
  guix/scripts/system.scm: Adjust to the new module names.
2014-09-03 15:43:07 +02:00
Mark H Weaver c00a9fbfef Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/base.scm
2014-08-28 14:22:15 -04:00
Eric Bavier 83291101c3 utils: Preserve makefile shell arguments during patch.
* guix/build/utils.scm (patch-makefile-SHELL): Preserve shell arguments.
2014-08-28 11:16:19 -05:00
Ludovic Courtès 5c3eb14e07 linux-initrd: Wait a bit longer for partitions to appear.
Reported by Sveltana on #guix.

* guix/build/linux-initrd.scm (canonicalize-device-spec): Increase
  MAX-TRIALS.  Add "waiting for partition" 'format' call.
2014-08-28 09:21:21 +02:00
Mark H Weaver 8a0576f175 gnu-build-system: Add 'patch-usr-bin-file' to %standard-phases.
* guix/build/gnu-build-system.scm (patch-usr-bin-file): New procedure.
  (%standard-phases): Add it.
2014-08-23 20:48:18 -04:00
Ludovic Courtès c0b9213dbb linux-initrd: Do not create /etc/resolv.conf.
* guix/build/linux-initrd.scm (configure-qemu-networking): Don't create
  /etc/resolv.conf.
2014-08-15 16:26:28 +02:00
Mark H Weaver 75f3b1a12d Add (guix build emacs-utils).
* guix/build/emacs-utils.scm: New file.
* Makefile.am (MODULES): Add it.
* .dir-locals.el: Add indentation rules.
2014-08-14 23:53:04 -04:00
Ludovic Courtès c8fa34265d system: Add the 'system?' field for user groups.
Suggested by Mark H. Weaver.

* gnu/system/shadow.scm (<user-group>)[system?]: New field.
  (%base-groups): Introduce 'system-group' macro, and use it.
* gnu/system.scm (user-group->gexp): Pass the 'system?' field.
* guix/build/activation.scm (add-group): Add #:system? and honor it.
  (activate-users+groups): Handle the 'system?' field.
* gnu/system/file-systems.scm (%tty-gid): Choose an ID below 1000.
* doc/guix.texi (User Accounts): Document the 'system?' field.
2014-07-25 00:12:35 +02:00
Ludovic Courtès 2c071ce96e system: Recognize more file system flags.
* guix/build/linux-initrd.scm (MS_NOSUID, MS_NODEV, MS_NOEXEC): New
  variables.
  (mount-flags->bit-mask): New procedure.
  (mount-file-system)[flags->bit-mask]: Remove.
  Use 'mount-flags->bit-mask' instead.
  In /etc/mtab, use the empty string when OPTIONS is false.
* gnu/services/base.scm (file-system-service): Add #:flags parameter and
  honor it.
* gnu/system.scm (other-file-system-services): Pass FLAGS to
  'file-system-service'.
2014-07-23 02:02:07 +02:00
Ludovic Courtès 7f239fd33f system: Add 'file-system' decl. for /dev/pts, and use the right options.
Fixes <http://bugs.gnu.org/18081>.

* gnu/system/file-systems.scm (%devtmpfs-file-system): Add
  'needed-for-boot?' field.
  (%tty-gid, %pseudo-terminal-file-system): New variables.
  (%base-file-systems): Add %PSEUDO-TERMINAL-FILE-SYSTEM.
* gnu/services/base.scm (udev-service): Remove dependency on
  'file-system-/dev'.
* gnu/system/shadow.scm (%base-groups): Add 'id' field for group 'tty'.
* guix/build/linux-initrd.scm (boot-system): Remove 'mount' call for
  /dev/pts.
* doc/guix.texi (File Systems): Add %pseudo-terminal-file-system.
2014-07-23 02:02:07 +02:00
Ludovic Courtès 66c2703f09 install: Set the store's permission to #o1775.
Fixes <http://bugs.gnu.org/18053>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/build/install.scm (directives): Add mode #o1775 for STORE.
2014-07-19 14:26:19 +02:00
Ludovic Courtès 3485716fd9 install: Make /var/db and /mnt.
* guix/build/install.scm (directives): Add /var/db and /mnt.
2014-07-13 16:37:47 +02:00
Ludovic Courtès 66670cf39c vm: Add support for i686.
Partially fixes <http://bugs.gnu.org/18002>.
Reported by David Thompson <dthompson2@worcester.edu>.

* guix/build/vm.scm (qemu-command): Add optional 'system' parameter.
  Special-case "^i[3456]86$".
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Use it.
2014-07-13 16:37:11 +02:00
Ludovic Courtès e3ced65af0 linux-initrd: Use 'call-with-error-handling' when booting.
* guix/build/linux-initrd.scm (canonicalize-device-spec): When label
  resolution fails, call 'error' instead of 'format' + 'start-repl'.
  (boot-system): Wrap most of body in 'call-with-error-handling'.
  Remove 'catch' around 'primitive-load' call.
2014-07-03 22:44:14 +02:00
Ludovic Courtès dccab4df20 linux-initrd: Remove unused local procedure.
* guix/build/linux-initrd.scm (boot-system)[resolve]: Remove.
2014-07-03 22:24:56 +02:00
Ludovic Courtès d266b79332 linux-initrd: Gracefully handle lack of or invalid ext2 superblocks.
Reported by David Thompson <dthompson2@worcester.edu>.

* guix/build/linux-initrd.scm (read-ext2-superblock): Add
  'superblock-size' variable.  Read with 'get-bytevector-n!' instead of
  'getbytevector-n', and make sure we read exactly SUPERBLOCK-SIZE
  bytes.
2014-07-02 12:18:36 +02:00
Ludovic Courtès 6750877f46 git-download: Support recursive clones.
* guix/git-download.scm (<git-reference>)[recursive?]: New field.
  (git-fetch): Add 'inputs' variable.  Add it to the #:inputs argument
  of 'build-expression->derivation'.  Augment builder with call to
  'set-path-environment-variable', and pass #:recursive? to
  'git-fetch'.
* guix/build/git.scm (git-fetch): Add #:recursive? parameter.  Pass
  --recursive when RECURSIVE? is true, and delete all the '.git' files.
2014-06-27 23:04:48 +02:00
Ludovic Courtès 459dd9eaf2 system: Add a 'system?' field to user accounts.
* gnu/system/shadow.scm (<user-account>)[system?]: New field.
* gnu/system.scm (user-account->gexp): Add it.
* guix/build/activation.scm (add-user): Add #:system? parameter and
  honor it.
  (activate-users+groups): Handle the 'system?' part of user tuples.
  Pass it to 'add-user'.  Don't create PROFILE-DIR when SYSTEM? is
  true.
* gnu/services/dbus.scm (dbus-service): Add 'system?' field for
  "messagebus" account.
* gnu/services/base.scm (guix-build-accounts): Likewise.
* gnu/services/avahi.scm (avahi-service): Likewise.
2014-06-27 19:06:08 +02:00
Ludovic Courtès f2c403eab6 system: Install /var/guix/profiles/system-1-link on new systems.
* guix/build/install.scm (directives): Add /var/guix/profiles/system.
  (populate-root-file-system): Add 'system' parameter.  Create
  /var/guix/profiles/system-1-link.
* guix/scripts/system.scm (install): Pass OS-DIR to
  'populate-root-file-system'.
* guix/build/vm.scm (initialize-root-partition): Add #:system-directory
  parameter, and pass it to 'populate-root-file-system'.
  (initialize-hard-disk): Add #:system-directory parameter, and pass it
  to 'initialize-root-partition'.
* gnu/system/vm.scm (qemu-image): Add #:os-derivation parameter and pass
  it to 'initialize-hard-disk'.
  (system-disk-image, system-qemu-image,
  system-qemu-image/shared-store): Pass #:os-derivation to 'qemu-image.
2014-06-27 19:06:08 +02:00
Ludovic Courtès f01efec09a activation: Preserve /etc/groups upon reboots.
This is a followup to e2fcc23.  The /etc/group file would be cleared
when booting.

* guix/build/activation.scm (activate-users+groups)[touch]: Rewrite so
  it does not wipe out FILE's contents.
2014-06-27 00:12:40 +02:00
Ludovic Courtès 9b9148d8bb linux-initrd: Allow unionfs to have a large number of open files.
Fixes <http://bugs.gnu.org/17827>.

* guix/build/linux-initrd.scm (mount-root-file-system) [volatile-root?]:
  Pass unionfs '-o max_file=65536'.
2014-06-21 17:35:56 +02:00
Ludovic Courtès 7470df5ddf Merge branch 'master' into core-updates 2014-06-14 23:25:59 +02:00
Ludovic Courtès 9d0b8fbd78 pull: Copy and compile gnu.scm.
* guix/build/pull.scm (build-guix): Copy gnu.scm to OUT.
2014-06-13 11:42:33 +02:00
Ludovic Courtès 872c69d00e Merge branch 'master' into core-updates 2014-06-06 17:23:14 +02:00
Ludovic Courtès e97c5be914 services: Use a fixed GID for the build group and use that for the store.
This partly reverts commit 185f669 ("services: Make sure the store's
group is the build group.")

* gnu/services/base.scm (guix-service)[activate]: Remove 'chown' call.
  Add 'id' field to 'user-group' form.
* guix/build/install.scm (directives): Set the store's GID to 30000.
2014-06-06 00:28:21 +02:00
Ludovic Courtès e2fcc23a3a activation: Only create groups that do not exist yet.
Before that the effect would be to re-create groups at each boot, and
thus remove any members of the groups.

* guix/build/activation.scm (activate-users+groups): Call 'add-group'
  only when (getgrname name) fails.
2014-06-04 23:08:09 +02:00
Ludovic Courtès 185f669109 services: Make sure the store's group is the build group.
* gnu/services/base.scm (guix-service)[activate]: New variable.  Add
  'chown' call for (%store-prefix).  Set the 'activate' field to
  ACTIVATE.
* guix/build/install.scm (directives): Add comment about STORE's group.
2014-06-04 22:19:30 +02:00
Ludovic Courtès d4c87617e5 system: File system sources can be marked as labels or devices.
* gnu/system/file-systems.scm (<file-system>)[title]: New field.
* gnu/services/base.scm (file-system-service): Add #:title parameter.
  In 'start' gexp, use 'canonicalize-device-spec' and honor TITLE.
* gnu/system.scm (other-file-system-services,
  operating-system-root-file-system, operating-system-initrd-file):
  Adjust accordingly.
* gnu/system/linux-initrd.scm (file-system->spec): Likewise.
* gnu/system/vm.scm (system-disk-image): Add 'title' field for the root
  file system.
* guix/build/linux-initrd.scm (mount-file-system): Expect the second
  element of SPEC to be the title.
  (boot-system)[root-mount-point?, root-fs-type]: Likewise.
* gnu/services/dmd.scm (dmd-configuration-file): Select
  'canonicalize-device-spec'.
2014-06-03 00:14:58 +02:00
Ludovic Courtès 2405858a04 linux-initrd: Wait for devices to appear when resolving a label.
* guix/build/linux-initrd.scm (canonicalize-device-spec): Add #:title
  parameter.  When resolving a label, wait a little and try several
  times before bailing out.
2014-06-02 23:48:55 +02:00
Ludovic Courtès 9b4a163a87 linux-initrd: Actually create /dev/console.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Add
  "dev/console".
2014-06-01 23:51:12 +02:00
Ludovic Courtès ac52e80b4e linux-initrd: Make more device nodes for SCSI disks and CD-ROM devices.
* guix/build/linux-initrd.scm (make-disk-device-nodes): New procedure.
  (make-essential-device-nodes): Use it.  Make more devices nodes for
  SCSI disks and CD-ROM devices.
2014-06-01 21:48:57 +02:00
Ludovic Courtès 009d831167 linux-initrd: Gracefully handle missing /dev nodes.
* guix/build/linux-initrd.scm (partition-label-predicate): Catch
  'system-error' around 'read-ext2-superblock'; return #f upon ENOENT.
2014-06-01 21:20:54 +02:00
Ludovic Courtès 1bb784ea05 linux-initrd: Gracefully deal with partitions with no label.
* guix/build/linux-initrd.scm (partition-label-predicate): Check whether
  'ext2-superblock-volume-name' returns #f, and return #f if it does.
2014-05-31 15:55:38 +02:00
Ludovic Courtès 85a83edb36 linux-initrd: Allow use of volume labels in 'file-system' declarations.
* guix/build/linux-initrd.scm (%ext2-endianness, %ext2-sblock-magic,
  %ext2-sblock-creator-os, %ext2-sblock-uuid, %ext2-sblock-volume-name):
  New macros.
  (read-ext2-superblock, ext2-superblock-uuid,
  ext2-superblock-volume-name, disk-partitions,
  partition-label-predicate, find-partition-by-label,
  canonicalize-device-spec): New procedures.
  (mount-file-system): Use 'canonicalize-device-spec' on SOURCE.
  (boot-system): Likewise for ROOT.
* doc/guix.texi (Using the Configuration System): Adjust 'file-system'
  declaration accordingly.
2014-05-30 23:46:17 +02:00
Ludovic Courtès ef9fc40dda vm: Allow a volume name to be specified for the root partition.
* guix/build/vm.scm (format-partition): Add #:label parameter, and honor
  it.
  (initialize-hard-disk): Add #:file-system-label parameter, and pass it
  to 'format-partition'.
* gnu/system/vm.scm (qemu-image): Add #:file-system-label parameter and
  pass it to 'initialize-hard-disk'.
2014-05-29 23:32:46 +02:00
Ludovic Courtès af018f5e0a Merge branch 'master' into core-updates 2014-05-27 23:19:49 +02:00
Ludovic Courtès 4b2615e1ca services: nscd: Provide an 'activate' script to make /var/run/nscd.
* gnu/services/base.scm (nscd-service): Add 'activate' field.
* guix/build/install.scm (directives): Remove /var/run/nscd; add
  /var/run.
* doc/guix.texi (Defining Services): Add 'activate' field in example.
  Document it.
2014-05-24 18:10:05 +02:00
Ludovic Courtès 517830cc01 system: Always create /var/empty.
* guix/build/install.scm (directives): Add /var/empty.
2014-05-24 18:10:05 +02:00
Ludovic Courtès 484a2b3a5a system: Separate the activation script from the boot script.
* gnu/system.scm (operating-system-activation-script): New procedure,
  containing most of the former 'operating-system-boot-script'.
  (operating-system-boot-script): Call it, and 'primitive-load' its
  result.
* guix/build/activation.scm (%booted-system): Remove.
  (activate-current-system): Remove #:boot? parameter and related code.
2014-05-24 18:10:05 +02:00
Ludovic Courtès a68d976b66 download: Enlarge your receive buffer.
* guix/build/download.scm (open-connection-for-uri): Remove call to
  'setsockopt'.
* guix/http-client.scm (open-socket-for-uri)[rmem-max, buffer-size]: New
  variables.  Add call to 'setsockopt'.
2014-05-23 22:19:37 +02:00
Ludovic Courtès f19c6e5fe7 vm: Use a para-virtualized disk when creating an image.
* guix/build/vm.scm (load-in-linux-vm): When MAKE-DISK-IMAGE?, use
  '-drive ...,if=virtio' for better performance.
* gnu/system/vm.scm (qemu-image): Use /dev/vda instead of /dev/sda.
2014-05-22 23:24:13 +02:00
Ludovic Courtès c4a74364b9 vm: Make the image format a parameter.
* guix/build/vm.scm (load-in-linux-vm): Add #:disk-image-format
  parameter; add 'image-file' variable.  Honor DISK-IMAGE-FORMAT.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add
  #:disk-image-format parameter, and honor it.
  (qemu-image): Likewise.
2014-05-22 23:24:13 +02:00
Ludovic Courtès 3035b50f28 linux-initrd: Build /dev/loop* nodes.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Build
  /dev/loop[0-7].
2014-05-22 23:24:13 +02:00
Ludovic Courtès 641f9a2a1f vm: Modularize build-side code.
* guix/build/install.scm (install-grub): Call 'error' if 'system*'
  returns non-zero.
* guix/build/vm.scm (initialize-partition-table): Make 'partition-size'
  a positional parameter.  Call 'error' when 'system*' returns
  non-zero'.
  (format-partition, initialize-root-partition): New procedures.
  (initialize-hard-disk): Use them.
2014-05-21 23:31:46 +02:00
Ludovic Courtès d1f477199d vm: Remove misleading comment.
* guix/build/vm.scm (load-in-linux-vm): Remove misleading comment.
2014-05-21 23:19:13 +02:00
Ludovic Courtès eb7ccb1afa linux-initrd: Display a backtrace when the initial program fails.
* guix/build/linux-initrd.scm (boot-system): Add pre-unwind handler in
  'catch' form around 'primitive-load', and call 'format' and
  'display-backtrace' from there.
2014-05-20 23:37:11 +02:00
Ludovic Courtès 9bea3b42b4 vm: Fix typo.
Regression introduced in e38e18f.

* guix/build/vm.scm (initialize-hard-disk)[partition]: Use a string.
2014-05-20 23:37:11 +02:00
Ludovic Courtès d84a7be667 utils: 'delete-file-recursively' doesn't follow mount points by default.
* guix/build/utils.scm (delete-file-recursively): Add #:follow-mounts?
  parameter and honor it.
2014-05-20 14:45:58 +02:00
Ludovic Courtès e38e18ff01 vm: Make the device name a parameter.
* guix/build/vm.scm (initialize-partition-table): Honor 'device'
  parameter.
  (initialize-hard-disk): Add 'device' parameter and honor it.
* gnu/system/vm.scm (qemu-image): Adjust accordingly.
2014-05-19 23:52:39 +02:00
Ludovic Courtès 6ffd11f129 system: Prevent grub.cfg from being GC'd.
* guix/build/install.scm (install-grub): Use 'copy-file' instead of
  'symlink' for GRUB.CFG.
2014-05-18 22:27:23 +02:00
Ludovic Courtès 15d299874c vm: Avoid resetting timestamps twice.
* guix/build/vm.scm (initialize-hard-disk): Don't call
  'reset-timestamps' when REGISTER-CLOSURES? is true.
* guix/build/install.scm (register-closure): Mention timestamps in
  docstring.
2014-05-18 22:27:22 +02:00
Ludovic Courtès b4140694ac system: Make /run/current-system at activation time.
* gnu/system.scm (etc-directory): Change default value of #:profile.
  Change contents of SHELLS.  Use /run/current-system/profile/{s,}bin in
  BASHRC.
  (operating-system-boot-script)[%modules]: Add (guix build
  linux-initrd).  Add call to 'activate-current-system' in gexp.
  (operating-system-initrd-file, operating-system-grub.cfg): New
  procedures.
  (operating-system-derivation): Don't build grub.cfg here and remove it
  from the file union.
* gnu/system/vm.scm (qemu-image): Remove #:populate.
  (operating-system-build-gid, operating-system-default-contents):
  Remove.
  (system-qemu-image): Remove call to
  'operating-system-default-contents'.  Use 'operating-system-grub.cfg'
  to get grub.cfg.  Add GRUB.CFG to #:inputs.
  (system-qemu-image/shared-store): Likewise, but don't add GRUB.CFG to
  #:inputs.
  (system-qemu-image/shared-store-script): Pass --system kernel option.
* guix/build/activation.scm (%booted-system, %current-system): New
  variables.
  (boot-time-system, activate-current-system): New procedures.
* guix/build/install.scm (evaluate-populate-directive): Add case
  for ('directory name uid gid mode).
  (directives, populate-root-file-system): New procedures.
* guix/build/vm.scm (initialize-hard-disk): Replace calls to
  'evaluate-populate-directive' by a call to
  'populate-root-file-system'.
* gnu/services/dmd.scm (dmd-configuration-file): Use
  /run/current-system/profile/bin.
* gnu/services/xorg.scm (slim-service): Likewise.
2014-05-18 00:04:01 +02:00
Ludovic Courtès 87a52da7d0 linux-initrd: Factorize kernel command-line option parsing.
* guix/build/linux-initrd.scm (find-long-option): New procedure.
  (boot-system): Use it instead of the local 'option'.
2014-05-16 23:31:48 +02:00
Ludovic Courtès 5ce3defed1 system: Add (guix build install) module.
* guix/build/vm.scm (install-grub, evaluate-populate-directive,
  reset-timestamps, register-closure): Move to...
* guix/build/install.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add (guix
  build install) to #:modules.
2014-05-15 23:37:46 +02:00
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