Cannot extract kernel source xz from c7 elrepo kernel-lt-4.4.236-1.el7.elrepo.nosrc.rpm

64 views Asked by At

Please let me know what I need to do to extract linux-4.4.236.tar.xz from the rpm

My goal is to extract the kernel source and repackage it for use in out build process. We use the standard pattern for this but something funny is happening with some elrepo packages (kernel-lt-4.4.236-1.el7.elrepo.nosrc.rpm specifically)

List the contents of the package

rpm -qlp kernel-lt-4.4.236-1.el7.elrepo.nosrc.rpm
warning: kernel-lt-4.4.236-1.el7.elrepo.nosrc.rpm: Header V4 DSA/SHA1 Signature, key ID baadae52: NOKEY
config-4.4.236-x86_64
cpupower.config
cpupower.service
kernel-lt-4.4.spec
linux-4.4.236.tar.xz 

List the contents of a cpio archive

We see linux-4.4.236.tar.xz. So, we'll use the rpm2cpio method and check the contents of the cpio archive but we've a problem as the table lacks linux-4.4.236.tar.xz

rpm2cpio kernel-lt-4.4.236-1.el7.elrepo.nosrc.rpm |cpio -t
config-4.4.236-x86_64
cpupower.config
cpupower.service
kernel-lt-4.4.spec

Extract contents from the archive

When we extract, we see all the items from the table and not linux-4.4.236.tar.xz

rpm2cpio kernel-lt-4.4.236-1.el7.elrepo.nosrc.rpm |cpio -idv
config-4.4.236-x86_64
cpupower.config
cpupower.service
kernel-lt-4.4.spec
514 blocks
1

There are 1 answers

2
Peter Kahn On

This is a NO source RPM and according to this blog post this class of package does not contain source