From 1a1faa78b0498fbb71f1533beb4b65817c1d3f2a Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 14 May 2020 15:13:12 +0200 Subject: etc: Add a systemd unit to bind-mount @storedir@ read-only. * etc/gnu-store.mount.in: New file. * nix/local.mk (nodist_systemdservice_DATA): Add it. (etc/%.mount): New rule for it. * etc/guix-install.sh (sys_enable_guix_daemon): Install it. * doc/guix.texi (Binary Installation): Document it. * .gitignore: Ignore changes to it. --- nix/local.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'nix') diff --git a/nix/local.mk b/nix/local.mk index a64bdd2137..435fdd389a 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -155,7 +155,17 @@ noinst_HEADERS = \ # The '.service' files for systemd. systemdservicedir = $(libdir)/systemd/system -nodist_systemdservice_DATA = etc/guix-daemon.service etc/guix-publish.service +nodist_systemdservice_DATA = \ + etc/gnu-store.mount \ + etc/guix-daemon.service \ + etc/guix-publish.service + +etc/%.mount: etc/%.mount.in \ + $(top_builddir)/config.status + $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ + $(SED) -e 's|@''storedir''@|$(storedir)|' < \ + "$<" > "$@.tmp"; \ + mv "$@.tmp" "$@" etc/guix-%.service: etc/guix-%.service.in \ $(top_builddir)/config.status -- cgit v1.2.3 From ebbf91542269fcb36d64928d4a4992e6afbf2acf Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 17 May 2020 14:09:43 +0200 Subject: etc: Install mount unit only if it exists. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This follows up on 1a1faa78b0498fbb71f1533beb4b65817c1d3f2a, and avoids the (non-fatal) error seen in . /gnu/store will remain writable on new foreign distribution installations until the next release. * etc/guix-install.sh (sys_enable_guix_daemon): Check for ‘gnu-store.mount’ presence before trying to cp it. Update forgotten copyright header. --- etc/guix-install.sh | 11 +++++++---- nix/local.mk | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'nix') diff --git a/etc/guix-install.sh b/etc/guix-install.sh index d252c132fb..bcce1d8869 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -3,7 +3,7 @@ # Copyright © 2017 sharlatan # Copyright © 2018 Ricardo Wurmus # Copyright © 2018 Efraim Flashner -# Copyright © 2019 Tobias Geerinckx-Rice +# Copyright © 2019, 2020 Tobias Geerinckx-Rice # # This file is part of GNU Guix. # @@ -344,9 +344,12 @@ sys_enable_guix_daemon() systemd) { # systemd .mount units must be named after the target directory. # Here we assume a hard-coded name of /gnu/store. - cp "${ROOT_HOME}/.config/guix/current/lib/systemd/system/gnu-store.mount" \ - /etc/systemd/system/; - chmod 664 /etc/systemd/system/gnu-store.mount; + # XXX Work around until next release. + if [ -f "${ROOT_HOME}/.config/guix/current/lib/systemd/system/gnu-store.mount" ]; then + cp "${ROOT_HOME}/.config/guix/current/lib/systemd/system/gnu-store.mount" \ + /etc/systemd/system/; + chmod 664 /etc/systemd/system/gnu-store.mount; + fi cp "${ROOT_HOME}/.config/guix/current/lib/systemd/system/guix-daemon.service" \ /etc/systemd/system/; diff --git a/nix/local.mk b/nix/local.mk index 435fdd389a..dbcdde8b0d 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -1,6 +1,7 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019 Ludovic Courtès # Copyright © 2016 Mathieu Lirzin +# Copyright © 2020 Tobias Geerinckx-Rice # # This file is part of GNU Guix. # -- cgit v1.2.3