Bug 1321335

Summary: rpm2cpio does not provide all rpm package content
Product: [Fedora] Fedora Reporter: billiboy
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jzeleny, lkardos, novyjindrich, packaging-team-maint, pknirsch, yaneti
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-25 17:13:51 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:

Description billiboy 2016-03-25 15:44:10 UTC
Description of problem:

rpm2cpio does not provide all rpm package content

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

How reproducible:

always with kernel-core-*.rpm

Steps to Reproduce:

check package content
e.g. "rpm -qlp kernel-core-4.6.0-0.rc0.git25.1.fc25.armv7hl.rpm"
the output will list content for "boot", "lib" and "usr" directory
extract content with rpm2cpio
e.g. "rpm2cpio kernel-core-4.6.0-0.rc0.git25.1.fc25.armv7hl.rpm > kernel-core-4.6.0-0.rc0.git25.1.fc25.armv7hl.cpio"

Actual results:

The *.cpio is missing the "boot" directory
No way to access e.g /boot/initramfs-4.6.0-0.rc0.git25.1.fc25.armv7hl.img

Expected results:

The *.cpio will contain "boot", "lib" and "usr" directory with all content for access

Additional info:

"rpm2cpio kernel-core-4.6.0-0.rc0.git25.1.fc25.armv7hl.rpm | cpio -dium" will also left out "boot" directory
rpm2archive is missing "boot" directory also in the *.tgz

Comment 1 Yanko Kaneti 2016-03-25 17:13:51 UTC
Everything under /boot is a %ghost file http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-GHOST-DIRECTIVE
, its created at the moment the kernel package is actually installed, as in current fedora by the kernel-install script.

Specifically
/boot/vmlinuz-XXX is a copy of /lib/modules/XXX/vmlinuz
/boot/config-XXX is a copy of /lib/modules/XXX/config
/boot/System.map-XXX is a copy of /lib/modules/XXX/System.map
/boot/initramfs-XXX is the intrd thats created on each kernel install by dracut

Comment 2 billiboy 2016-03-25 18:28:05 UTC
Thank you for the clarification, I almost suspected something like this.
But from the provided link:
"There file touched in the %install stage will not be installed to /var/log/blather.log although it will be added to the rpm database, as we can see from querying the file, however it is not visible from a package listing, but as it is owned by the package it will be removed when the package is removed."
it should not be listed by "rpm -ql". This was what confused me in the first place assuming rpm2cpio has left out something. Maybe not listing the files as stated or mark the %ghost files as such in the listing may prevent someone else struggle about this, but solved for me.