aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-06-24 18:02:15 +0200
committerLudovic Courtès <ludo@gnu.org>2015-06-24 18:05:03 +0200
commiteae5b3fff54e6f0a38d03d01187142accbed1eb8 (patch)
tree0af61ee613740e32f2ce26664a37f0ef2a81978c /guix
parent583323ca1d1af5462f1b45f4be50f96bc8f1e46b (diff)
downloadgnu-guix-eae5b3fff54e6f0a38d03d01187142accbed1eb8.tar
gnu-guix-eae5b3fff54e6f0a38d03d01187142accbed1eb8.tar.gz
linux-initrd: Produce cpio archives with zeroed timestamps, etc.
* guix/cpio.scm (file->cpio-header*): New procedure. * gnu/build/linux-initrd.scm (write-cpio-archive): Add #:file->header argument to 'cpio:write-cpio-archive'.
Diffstat (limited to 'guix')
-rw-r--r--guix/cpio.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/guix/cpio.scm b/guix/cpio.scm
index f1c2130bfa..e4692e2e9c 100644
--- a/guix/cpio.scm
+++ b/guix/cpio.scm
@@ -26,6 +26,7 @@
#:export (cpio-header?
make-cpio-header
file->cpio-header
+ file->cpio-header*
write-cpio-header
read-cpio-header
@@ -174,6 +175,18 @@ using FILE-NAME as its file name."
#:rdev (stat:rdev st)
#:name-size (string-length file-name))))
+(define* (file->cpio-header* file
+ #:optional (file-name file)
+ #:key (stat lstat))
+ "Similar to 'file->cpio-header', but return a header with a zeroed
+modification time, inode number, UID/GID, etc. This allows archives to be
+produced in a deterministic fashion."
+ (let ((st (stat file)))
+ (make-cpio-header #:mode (stat:mode st)
+ #:nlink (stat:nlink st)
+ #:size (stat:size st)
+ #:name-size (string-length file-name))))
+
(define %trailer
"TRAILER!!!")