[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-cpio] [PATCH] Add option "--reproducible" for reproducible arch
From: |
Tim Kientzle |
Subject: |
Re: [Bug-cpio] [PATCH] Add option "--reproducible" for reproducible archives |
Date: |
Fri, 7 Nov 2014 08:51:17 -0800 |
On Nov 7, 2014, at 4:34 AM, Pavel Raiskup <address@hidden> wrote:
> As the $Subject is still the same.. I haven't done a review of this patch
> TBH, but the inode numbers are a real problem (I tend to say a bug) of GNU
> cpio.
>
> Having a possibility to deal with that (even with option) does not sound
> as a bad idea. If I remember correctly, scpio (or other alternative cpio
> implementation) also constructs inode numbers as an artificial sequence by
> default.
Libarchive’s cpio writer module (used by both bsdcpio and bsdtar) also does
this. We don’t even offer an option for using the original inode numbers.
Rewriting inode numbers turns out to be pretty simple in practice: If the
number of links is >= 2, then you do need to store the map from old inode to
new inode to properly reconcile hard links, but in practice that map stays
quite small so can be managed very simply.
You may find libarchive’s implementation useful as a source of ideas on how to
implement this for GNU cpio:
https://github.com/libarchive/libarchive/blob/master/libarchive/archive_write_set_format_cpio.c#L175
Cheers,
Tim