bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue with creating an archive with reproducible content


From: Jan-Benedict Glaw
Subject: Issue with creating an archive with reproducible content
Date: Sat, 27 Apr 2024 21:23:37 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

Hi!

I'm trying to generate a reproducible archive of a directory
contianing a number of files using tar 1.34; there are just
directories and files, no device nodes or stuff like that. That
archive (with a completely bit-identical tree to be archived) is once
generated on an ext4 filesystem, and once within a Docker container
(so there is an overlay filesystem in place.)

It boils down to a call like this:

    tar     --sort=name                                                         
                                    \
            --mtime="@${SOURCE_DATE_EPOCH:-$(date +%s)}"                        
                                    \
            --owner=0                                                           
                                    \
            --group=0                                                           
                                    \
            --numeric-owner                                                     
                                    \
            --format=pax                                                        
                                    \
            
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime,delete=devmajor,delete=devminor
     \
            -cf - "${basename_dir}"                                             
                                    | \
            gzip -n9 > "${artifacts_dir}/${tarball_filename}"

(The "delete=devmajor,delete=devminor" part was a test.)  However, I
face an issue: With ext4, a devmajor / devminor is placed into the
archive, set to "0000000". With the overlayfs, the fields are filled
with 0x00 bytes. The "delete=devmajor,delete=devminor" was a test to
get rid of that data, but this didn't work.

  Do you have any suggestion for me to get rid of the
devmajor/devminor content in the headers? Or should my approach in
theory work and it's a small bug that it doesn't remove the "0000000"?

Thanks,
  Jan-Benedict Glaw
-- 

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]