[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/07: vm: Preserve file permissions on /dev.
From: |
guix-commits |
Subject: |
05/07: vm: Preserve file permissions on /dev. |
Date: |
Mon, 6 Apr 2020 13:33:25 -0400 (EDT) |
civodul pushed a commit to branch wip-hurd-vm
in repository guix.
commit 6ecb8e28d0e10c0d7902245daac3fe423916727b
Author: Ludovic Courtès <address@hidden>
AuthorDate: Mon Apr 6 15:16:09 2020 +0200
vm: Preserve file permissions on /dev.
Previously, when REGISTER-CLOSURES? was false, we'd set all the files
under /dev to #o644, including /dev/null, /dev/zero, etc.
* gnu/build/vm.scm (root-partition-initializer): Call 'reset-timestamps'
separately for /dev, with #:preserve-permissions? #t.
---
gnu/build/vm.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index c53dacf..d4ded62 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -32,6 +32,7 @@
#:use-module (guix records)
#:use-module ((guix combinators) #:select (fold2))
#:use-module (ice-9 format)
+ #:use-module (ice-9 ftw)
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
#:use-module (ice-9 popen)
@@ -418,7 +419,16 @@ system that is passed to 'populate-root-file-system'."
;; 'register-closure' resets timestamps and everything, so no need to do it
;; once more in that case.
(unless register-closures?
- (reset-timestamps target))))
+ ;; 'reset-timestamps' also resets file permissions; do that everywhere
+ ;; except on /dev so that /dev/null remains writable, etc.
+ (for-each (lambda (directory)
+ (reset-timestamps (string-append target "/" directory)))
+ (scandir target
+ (match-lambda
+ ((or "." ".." "dev") #f)
+ (_ #t))))
+ (reset-timestamps (string-append target "/dev")
+ #:preserve-permissions? #t))))
(define (register-bootcfg-root target bootcfg)
"On file system TARGET, register BOOTCFG as a GC root."
- branch wip-hurd-vm updated (3a6eb2c -> eef7e0f), guix-commits, 2020/04/06
- 01/07: squash! DRAFT: gnu: hurd: Provide our own /libexec/rc script., guix-commits, 2020/04/06
- 02/07: gnu: hurd: Install the UTF-8 motd., guix-commits, 2020/04/06
- 03/07: system: hurd: Create /etc/{hostname,motd,login} and /root., guix-commits, 2020/04/06
- 04/07: database: 'reset-timestamps' can optionally preserve permissions., guix-commits, 2020/04/06
- 05/07: vm: Preserve file permissions on /dev.,
guix-commits <=
- 06/07: squash! gnu: hurd: Ensure startup scripts refer to the right programs., guix-commits, 2020/04/06
- 07/07: linux-boot: 'make-essential-device-nodes' root parameter is optional., guix-commits, 2020/04/06