mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 13:58:15 -05:00
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.
This commit is contained in:
parent
7fa6155b23
commit
6a488a3504
1 changed files with 11 additions and 1 deletions
|
@ -33,6 +33,7 @@ (define-module (gnu build vm)
|
|||
#: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)
|
||||
|
@ -419,7 +420,16 @@ (define target-store
|
|||
;; '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."
|
||||
|
|
Loading…
Reference in a new issue