From 43c33047da55f8974682e66112ce131fa4c3f088 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 15 Jul 2015 15:08:07 +0200 Subject: doc: Reinstate bit about creating build accounts. * doc/guix.texi (Binary Installation): Reinstate bit about creating group and user accounts, which was inadvertently removed in 01dbc7e0. --- doc/guix.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index ad5b38af31..7d18c00cb2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -319,6 +319,10 @@ Make @code{root}'s profile available under @file{~/.guix-profile}: ~root/.guix-profile @end example +@item +Create the group and user accounts for build users as explained below +(@pxref{Build Environment Setup}). + @item Run the daemon: -- cgit v1.2.3 From d2825c96141c7b6844d9e04f982919c0509165e1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 15 Jul 2015 17:13:16 +0200 Subject: Add 'guix-daemon.service' file for systemd. * etc/guix-daemon.service.in: New file, provided by Ricardo Wurmus. * daemon.am (CLEANFILES): Add etc/guix-daemon.service. (systemdservicedir, nodist_systemdservice_DATA): New variables. (EXTRA_DIST): Add etc/guix-daemon.service.in. * doc/guix.texi (Binary Installation, Build Environment Setup): Mention 'guix-daemon.service'. --- .gitignore | 1 + daemon.am | 15 +++++++++++++-- doc/guix.texi | 12 ++++++++++-- etc/guix-daemon.service.in | 15 +++++++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 etc/guix-daemon.service.in (limited to 'doc') diff --git a/.gitignore b/.gitignore index c1061d73e5..c7a6cddaa0 100644 --- a/.gitignore +++ b/.gitignore @@ -125,3 +125,4 @@ GTAGS /doc/os-config-bare-bones.texi /doc/os-config-desktop.texi /doc/*.1 +/etc/guix-daemon.service diff --git a/daemon.am b/daemon.am index eecfea1c7e..1fee9b7e57 100644 --- a/daemon.am +++ b/daemon.am @@ -21,7 +21,7 @@ # BUILT_SOURCES += nix/libstore/schema.sql.hh -CLEANFILES += $(BUILT_SOURCES) +CLEANFILES += $(BUILT_SOURCES) etc/guix-daemon.service noinst_LIBRARIES = libformat.a libutil.a libstore.a @@ -181,10 +181,21 @@ endif BUILD_DAEMON_OFFLOAD nodist_libexec_SCRIPTS = \ nix/scripts/guix-authenticate +# The '.service' file for systemd. +systemdservicedir = $(libdir)/systemd/system +nodist_systemdservice_DATA = etc/guix-daemon.service + +etc/guix-daemon.service: etc/guix-daemon.service.in \ + $(top_builddir)/config.status + $(SED) -e 's|@''bindir''@|$(bindir)|' < \ + "etc/guix-daemon.service.in" > "$@.tmp" + mv "$@.tmp" "$@" + EXTRA_DIST += \ nix/libstore/schema.sql \ nix/AUTHORS \ - nix/COPYING + nix/COPYING \ + etc/guix-daemon.service.in AM_TESTS_ENVIRONMENT += \ top_builddir="$(abs_top_builddir)" diff --git a/doc/guix.texi b/doc/guix.texi index 7d18c00cb2..e4662cbfe1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -330,6 +330,10 @@ Run the daemon: # ~root/.guix-profile/bin/guix-daemon --build-users-group=guixbuild @end example +On hosts using the systemd init system, drop +@file{~root/.guix-profile/lib/systemd/system/guix-daemon.service} in +@file{/etc/systemd/system}. + @item Make the @command{guix} command available to other users on the machine, for instance with: @@ -512,8 +516,12 @@ Bash syntax and the @code{shadow} commands): @noindent The number of build users determines how many build jobs may run in parallel, as specified by the @option{--max-jobs} option -(@pxref{Invoking guix-daemon, @option{--max-jobs}}). -The @code{guix-daemon} program may then be run as @code{root} with: +(@pxref{Invoking guix-daemon, @option{--max-jobs}}). The +@code{guix-daemon} program may then be run as @code{root} with the +following command@footnote{If your machine uses the systemd init system, +dropping the @file{@var{prefix}/lib/systemd/system/guix-daemon.service} +file in @file{/etc/systemd/system} will ensure that +@command{guix-daemon} is automatically started.}: @example # guix-daemon --build-users-group=guixbuild diff --git a/etc/guix-daemon.service.in b/etc/guix-daemon.service.in new file mode 100644 index 0000000000..28ef000920 --- /dev/null +++ b/etc/guix-daemon.service.in @@ -0,0 +1,15 @@ +# This is a "service unit file" for the systemd init system to launch +# 'guix-daemon'. Drop it in /etc/systemd/system or similar to have +# 'guix-daemon' automatically started. + +[Unit] +Description=Build daemon for GNU Guix + +[Service] +ExecStart=@bindir@/guix-daemon --build-users-group=guixbuild +RemainAfterExit=yes +StandardOutput=syslog +StandardError=syslog + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3 From ee2a6304f3bcf19df895310aedff372ed7e17c34 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Jul 2015 01:07:50 +0200 Subject: system: Add 'kernel-arguments' field. * gnu/system.scm ()[kernel-arguments]: New field. (operating-system-grub.cfg): Honor it. (operating-system-parameters-file): Add 'kernel-arguments' to the parameters file. * guix/scripts/system.scm (previous-grub-entries)[system->grub-entry]: Read the 'kernel-arguments' field of the parameters file, when available. * gnu/system/vm.scm (system-qemu-image/shared-store-script): Use (operating-system-kernel-arguments os) in '-append'. * doc/guix.texi (operating-system Reference): Document it. --- doc/guix.texi | 4 ++++ gnu/system.scm | 16 +++++++++++----- gnu/system/vm.scm | 3 ++- guix/scripts/system.scm | 11 +++++++---- 4 files changed, 24 insertions(+), 10 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index e4662cbfe1..2f8c52c8b6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4825,6 +4825,10 @@ The package object of the operating system kernel to use@footnote{Currently only the Linux-libre kernel is supported. In the future, it will be possible to use the GNU@tie{}Hurd.}. +@item @code{kernel-arguments} (default: @code{'()}) +List of strings or gexps representing additional arguments to pass on +the kernel's command-line---e.g., @code{("console=ttyS0")}. + @item @code{bootloader} The system bootloader configuration object. @xref{GRUB Configuration}. diff --git a/gnu/system.scm b/gnu/system.scm index efad14596a..ed37c320f7 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -68,6 +68,7 @@ operating-system-host-name operating-system-hosts-file operating-system-kernel + operating-system-kernel-arguments operating-system-initrd operating-system-users operating-system-groups @@ -103,6 +104,8 @@ operating-system? (kernel operating-system-kernel ; package (default linux-libre)) + (kernel-arguments operating-system-kernel-arguments + (default '())) ; list of gexps/strings (bootloader operating-system-bootloader) ; (initrd operating-system-initrd ; (list fs) -> M derivation @@ -866,11 +869,12 @@ listed in OS. The C library expects to find it under (label (kernel->grub-label kernel)) (linux kernel) (linux-arguments - (list (string-append "--root=" - (file-system-device root-fs)) - #~(string-append "--system=" #$system) - #~(string-append "--load=" #$system - "/boot"))) + (cons* (string-append "--root=" + (file-system-device root-fs)) + #~(string-append "--system=" #$system) + #~(string-append "--load=" #$system + "/boot") + (operating-system-kernel-arguments os))) (initrd #~(string-append #$system "/initrd")))))) (grub-configuration-file (operating-system-bootloader os) entries #:old-entries old-entries))) @@ -887,6 +891,8 @@ this file is the reconstruction of GRUB menu entries for old configurations." (label #$label) (root-device #$(file-system-device root)) (kernel #$(operating-system-kernel os)) + (kernel-arguments + #$(operating-system-kernel-arguments os)) (initrd #$initrd))))) (define (operating-system-derivation os) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 2520493e2e..b293009127 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -493,7 +493,8 @@ exec " #$qemu "/bin/" #$(qemu-command (%current-system)) #~(" -kernel " #$(operating-system-kernel os) "/bzImage \ -initrd " #$os-drv "/initrd \ -append \"" #$(if graphic? "" "console=ttyS0 ") - "--system=" #$os-drv " --load=" #$os-drv "/boot --root=/dev/vda1\" ")) + "--system=" #$os-drv " --load=" #$os-drv "/boot --root=/dev/vda1 " + (string-join (list #+@(operating-system-kernel-arguments os))) "\" ")) #$(common-qemu-options image (map file-system-mapping-source (cons %store-mapping mappings))) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 6084ab8a37..45f598219d 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -249,16 +249,19 @@ it atomically, and then run OS's activation script." (('boot-parameters ('version 0) ('label label) ('root-device root) ('kernel linux) - _ ...) + rest ...) (menu-entry (label (string-append label " (#" (number->string number) ", " (seconds->string time) ")")) (linux linux) (linux-arguments - (list (string-append "--root=" root) - #~(string-append "--system=" #$system) - #~(string-append "--load=" #$system "/boot"))) + (cons* (string-append "--root=" root) + #~(string-append "--system=" #$system) + #~(string-append "--load=" #$system "/boot") + (match (assq 'kernel-arguments rest) + ((_ args) args) + (#f '())))) ;old format (initrd #~(string-append #$system "/initrd")))) (_ ;unsupported format (warning (_ "unrecognized boot parameters for '~a'~%") -- cgit v1.2.3 From e51710d1efd406890285907876ad20ec787394b3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Jul 2015 19:24:15 +0200 Subject: file-systems: Add a 'dependencies' field to . * gnu/system/file-systems.scm ()[dependencies]: New field. * gnu/system.scm (other-file-system-services)[requirements]: Honor 'file-system-dependencies'. * doc/guix.texi (File Systems): Document it. --- doc/guix.texi | 8 ++++++++ gnu/system.scm | 14 ++++++++++---- gnu/system/file-systems.scm | 6 +++++- 3 files changed, 23 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 2f8c52c8b6..0d24b12f8c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5027,6 +5027,14 @@ errors before being mounted. @item @code{create-mount-point?} (default: @code{#f}) When true, the mount point is created if it does not exist yet. +@item @code{dependencies} (default: @code{'()}) +This is a list of @code{} objects representing file systems +that must be mounted before (and unmounted after) this one. + +As an example, consider a hierarchy of mounts: @file{/sys/fs/cgroup} is +a dependency of @file{/sys/fs/cgroup/cpu} and +@file{/sys/fs/cgroup/memory}. + @end table @end deftp diff --git a/gnu/system.scm b/gnu/system.scm index ed37c320f7..cf9ee123c7 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -228,10 +228,16 @@ as 'needed-for-boot'." (operating-system-mapped-devices os))) (define (requirements fs) - (map (lambda (md) - (symbol-append 'device-mapping- - (string->symbol (mapped-device-target md)))) - (device-mappings fs))) + ;; XXX: Fiddling with dmd service names is not nice. + (append (map (lambda (fs) + (symbol-append 'file-system- + (string->symbol + (file-system-mount-point fs)))) + (file-system-dependencies fs)) + (map (lambda (md) + (symbol-append 'device-mapping- + (string->symbol (mapped-device-target md)))) + (device-mappings fs)))) (sequence %store-monad (map (lambda (fs) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 0f3e6fbcaa..a3230dce48 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -37,6 +37,7 @@ file-system-options file-system-check? file-system-create-mount-point? + file-system-dependencies file-system->spec string->uuid @@ -97,7 +98,10 @@ (check? file-system-check? ; Boolean (default #t)) (create-mount-point? file-system-create-mount-point? ; Boolean - (default #f))) + (default #f)) + (dependencies file-system-dependencies ; list of strings (mount + ; points depended on) + (default '()))) (define-inlinable (file-system-needed-for-boot? fs) "Return true if FS has the 'needed-for-boot?' flag set, or if it's the root -- cgit v1.2.3 From 6e9f2913ba800e3488b95c661438f3981095a259 Mon Sep 17 00:00:00 2001 From: pjotrp Date: Mon, 13 Jul 2015 15:32:36 +0200 Subject: build-system/ruby: Add #:gem-flags parameter. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build-system/ruby.scm (build): add 'gem-flags' key * guix/build/ruby-build-system.scm (build): use 'gem-flags' key * doc/guix.texi (Build Systems): Mention #:gem-flags. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 3 ++- guix/build-system/ruby.scm | 2 ++ guix/build/ruby-build-system.scm | 12 +++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 0d24b12f8c..71b3b2d529 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2458,7 +2458,8 @@ implements the RubyGems build procedure used by Ruby packages, which involves running @code{gem build} followed by @code{gem install}. Which Ruby package is used can be specified with the @code{#:ruby} -parameter. +parameter. A list of additional flags to be passed to the @command{gem} +command can be specified with the @code{#:gem-flags} parameter. @end defvr @defvr {Scheme Variable} waf-build-system diff --git a/guix/build-system/ruby.scm b/guix/build-system/ruby.scm index e4fda30cf3..135eda665b 100644 --- a/guix/build-system/ruby.scm +++ b/guix/build-system/ruby.scm @@ -71,6 +71,7 @@ (define* (ruby-build store name inputs #:key + (gem-flags ''()) (test-target "test") (tests? #t) (phases '(@ (guix build ruby-build-system) @@ -95,6 +96,7 @@ (source source)) #:system ,system + #:gem-flags ,gem-flags #:test-target ,test-target #:tests? ,tests? #:phases ,phases diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm index fce39b8dfd..307ac919dd 100644 --- a/guix/build/ruby-build-system.scm +++ b/guix/build/ruby-build-system.scm @@ -63,7 +63,8 @@ directory." (zero? (system* "rake" test-target)) #t)) -(define* (install #:key source inputs outputs #:allow-other-keys) +(define* (install #:key source inputs outputs (gem-flags '()) + #:allow-other-keys) (let* ((ruby-version (match:substring (string-match "ruby-(.*)\\.[0-9]$" (assoc-ref inputs "ruby")) @@ -72,10 +73,11 @@ directory." (gem-home (string-append out "/lib/ruby/gems/" ruby-version ".0"))) (setenv "GEM_HOME" gem-home) (mkdir-p gem-home) - (zero? (system* "gem" "install" "--local" - (first-matching-file "\\.gem$") - ;; Executables should go into /bin, not /lib/ruby/gems. - "--bindir" (string-append out "/bin"))))) + (zero? (apply system* "gem" "install" "--local" + (first-matching-file "\\.gem$") + ;; Executables should go into /bin, not /lib/ruby/gems. + "--bindir" (string-append out "/bin") + gem-flags)))) (define %standard-phases (modify-phases gnu:%standard-phases -- cgit v1.2.3