aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts/system.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2015-05-23 22:24:19 -0400
committerMark H Weaver <mhw@netris.org>2015-05-23 22:24:19 -0400
commit30f9cbb072755cf76fe942038420cfda2af29f3e (patch)
tree6c2c77a7a248390f1b1215840bca2cc0c90006cc /guix/scripts/system.scm
parentf28084285af289c4649457208c98dcc66566add2 (diff)
parent4a35a866be51361b80a5618e422d135959960c3d (diff)
downloadgnu-guix-30f9cbb072755cf76fe942038420cfda2af29f3e.tar
gnu-guix-30f9cbb072755cf76fe942038420cfda2af29f3e.tar.gz
Merge branch 'master' into gtk-rebuild
Diffstat (limited to 'guix/scripts/system.scm')
-rw-r--r--guix/scripts/system.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 8d5fbe5a78..1feb821389 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -145,6 +145,16 @@ When GRUB? is true, install GRUB on DEVICE, using GRUB.CFG."
;; Copy items to the new store.
(copy-closure to-copy target #:log-port log-port)))))
+ ;; Make sure TARGET is root-owned when running as root, but still allow
+ ;; non-root uses (useful for testing.) See
+ ;; <http://lists.gnu.org/archive/html/guix-devel/2015-05/msg00452.html>.
+ (if (zero? (geteuid))
+ (chown target 0 0)
+ (warning (_ "not running as 'root', so \
+the ownership of '~a' may be incorrect!~%")
+ target))
+
+ (chmod target #o755)
(let ((os-dir (derivation->output-path os-drv))
(format (lift format %store-monad))
(populate (lift2 populate-root-file-system %store-monad)))