aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2021-12-30 11:24:27 +0100
committerMathieu Othacehe <othacehe@gnu.org>2022-01-14 14:29:12 +0100
commit7c923e6cf4412db3ef22792d639b98f8fbf7f037 (patch)
tree7a0d0259b8fd4afe588e0f3265f65360df87f142
parentee897e5f51104f41b3c2a0c2cbc7eb4e6c1e4d3e (diff)
downloadguix-7c923e6cf4412db3ef22792d639b98f8fbf7f037.tar.gz
guix-7c923e6cf4412db3ef22792d639b98f8fbf7f037.zip
installer: Remove an unused procedure.
* gnu/installer/final.scm (kill-cow-users): Remove it.
-rw-r--r--gnu/installer/final.scm30
1 files changed, 0 insertions, 30 deletions
diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm
index fc0b7803fa..c6987e6e58 100644
--- a/gnu/installer/final.scm
+++ b/gnu/installer/final.scm
@@ -105,36 +105,6 @@ USERS."
(write-passwd password (string-append etc "/passwd"))
(write-shadow shadow (string-append etc "/shadow")))
-(define* (kill-cow-users cow-path #:key (spare '("udevd")))
- "Kill all processes that have references to the given COW-PATH in their
-'maps' file. The process whose names are in SPARE list are spared."
- (define %not-nul
- (char-set-complement (char-set #\nul)))
-
- (let ((pids
- (filter-map (lambda (pid)
- (false-if-exception
- (call-with-input-file
- (string-append "/proc/" pid "/maps")
- (lambda (port)
- (and (string-contains (get-string-all port)
- cow-path)
- (string->number pid))))))
- (scandir "/proc" string->number))))
- (for-each (lambda (pid)
- ;; cmdline does not always exist.
- (false-if-exception
- (call-with-input-file
- (string-append "/proc/" (number->string pid) "/cmdline")
- (lambda (port)
- (match (string-tokenize (read-string port) %not-nul)
- ((argv0 _ ...)
- (unless (member (basename argv0) spare)
- (syslog "Killing process ~a (~a)~%" pid argv0)
- (kill pid SIGKILL)))
- (_ #f))))))
- pids)))
-
(define (call-with-mnt-container thunk)
"This is a variant of call-with-container. Run THUNK in a new container
process, within a separate MNT namespace. The container is not jailed so that
re/deduplication.scm (copy-file/deduplicate): New procedure. * tests/store-deduplication.scm ("copy-file/deduplicate"): New test. * guix/build/store-copy.scm (populate-store): Add #:deduplicate? parameter and honor it. * tests/gexp.scm ("gexp->derivation, store copy"): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/image.scm (initialize-root-partition): Pass #:deduplicate? to 'populate-store'. Pass #:deduplicate? #f to 'register-closure'. * gnu/build/vm.scm (root-partition-initializer): Likewise. * gnu/build/install.scm (populate-single-profile-directory): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/linux-initrd.scm (build-initrd): Likewise. * guix/scripts/pack.scm (self-contained-tarball)[import-module?]: New procedure. [build]: Pass it as an argument to 'source-module-closure'. * guix/scripts/pack.scm (squashfs-image)[build]: Wrap in 'with-extensions'. * gnu/system/linux-initrd.scm (expression->initrd)[import-module?]: New procedure. [builder]: Pass it to 'source-module-closure'. * gnu/system/install.scm (cow-store-service-type)[import-module?]: New procedure. Pass it to 'source-module-closure'. Ludovic Courtès 2020-12-15database: Remove #:reset-timestamps? from 'register-items'.•••The assumption now is that the caller took care of resetting timestamps and permissions. * guix/store/database.scm (register-items): Remove #:reset-timestamps? parameter and the call to 'reset-timestamps'. (register-path): Adjust accordingly and add call to 'reset-timestamps'. * gnu/build/image.scm (register-closure): Remove #:reset-timestamps? parameter to 'register-items'. * gnu/build/vm.scm (register-closure): Likewise. * guix/nar.scm (finalize-store-file): Adjust accordingly. * guix/scripts/pack.scm (store-database)[build]: Likewise. Ludovic Courtès 2020-12-15nar: Deduplicate files right as they are restored.•••This avoids having to traverse and re-read the files that we have just restored, thereby reducing I/O. * guix/serialization.scm (dump-file): New procedure. (restore-file): Add #:dump-file parameter and honor it. * guix/store/deduplication.scm (tee, dump-file/deduplicate): New procedures. * guix/nar.scm (restore-one-item): Pass #:dump-file to 'restore-file'. (finalize-store-file): Pass #:deduplicate? #f to 'register-items'. * tests/nar.scm <top level>: Call 'setenv' to set "NIX_STORE". Ludovic Courtès 2020-12-08database: Remove unnecessary module imports.•••* guix/store/database.scm: Remove unnecessary imports added in 4b9eecd322e566783369795ebea63a479b51f486. Ludovic Courtès