Bug 1254537

Summary: [RFE] support for cpio --reproducible
Product: [Fedora] Fedora Reporter: Giuseppe Scrivano <gscrivan>
Component: cpioAssignee: Pavel Raiskup <praiskup>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: kdudka, ovasik, praiskup
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1386662 (view as bug list) Environment:
Last Closed: 2015-09-14 12:03:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1386662    

Description Giuseppe Scrivano 2015-08-18 10:53:33 UTC
Description of problem:

The OSTree system uses content-addressed storage, and when initramfs images generated by dracut are in the tree, because the cpio format contains modification and it causes a different checksum every time
it's created, so causing the download of the initrd even if not changed from last time.

Dracut has already support for --reproducible and it is used whenever it is supported by cpio.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. cpio --help | grep reproducible


Actual results:

no support for --reproducible


Expected results:

--reproducible is supported

Additional info:

The backport of the upstream patch:

commit 3945f9db44c935608caa5f084fd7f67ae59ee9e1
Author: Sergey Poznyakoff <gray.ua>
Date:   Mon Dec 1 15:02:38 2014 +0200

    New options to create device and inode-independent archives.
    
    * src/util.c (inode_val): New member trans_inode
    (find_inode_val): New function.
    (find_inode_file): Rewrite using the above.
    (add_inode): Initialize the trans_inode member
    depending on the value of renumber_inodes_option.
    (get_inode_and_dev): New function.
    (stat_to_cpio): Use get_inode_and_dev.
    (arf_stores_inode_p): New function.
    * src/extern.h (renumber_inodes_option)
    (ignore_devno_option): New externs.
    * src/global.c (renumber_inodes_option)
    (ignore_devno_option): New variables.
    * src/main.c: Add new options.
    
    * NEWS: Document changes.
    * doc/cpio.1: Document new options.
    * doc/cpio.texi: Likewise.


is required

Comment 1 Ondrej Vasik 2015-08-18 13:35:04 UTC
It is 5 years since the cpio-2.11 was released. I think it would be better to ask upstream to release cpio-2.12 - this might be good excuse for it. Backport is of course doable (although almost all hunks fail when applying directly) - but there are more useful commits in cpio upstream in the last 5 years (and we backported just a few).

Pavel, will you ask Sergey there?

Comment 2 Giuseppe Scrivano 2015-08-20 09:35:50 UTC
Good idea.

I have sent some patches to bug-cpio (still didn't appear in the archives)  to get the latest version built on Fedora 22 and get "make check" to pass.

Comment 3 Giuseppe Scrivano 2015-08-26 13:37:25 UTC
now they are on the archives:

https://lists.gnu.org/archive/html/bug-cpio/2015-08/msg00000.html

Comment 4 Giuseppe Scrivano 2015-09-13 10:24:29 UTC
cpio 2.12 that was released on the 12th of September contains --reproducible:

http://lists.gnu.org/archive/html/bug-cpio/2015-09/msg00004.html