Hi,

 

A summary of the bug in cpio is like this:

 

Details:

 

Using dracut, my initramfs-4.1.12-112.16.4.el7uek.x86_64.img picks up
contents from the drive from two separate identical files, and creates a
gzip+cpio file with the following contents:

'etc/sysctl.conf'

'etc/sysctl.d/99-oracle-database-server-12cR2-preinstall-sysctl.conf'

 

Inside the cpio archive:

'etc/sysctl.conf' [this is a hard link to the other file]

'etc/sysctl.d/99-oracle-database-server-12cR2-preinstall-sysctl.conf'

 

The dracut package lsinitrd can be used to verify the contents of a
initramfs file using a command such as 

 

lsinitrd -f /etc/sysctl.conf 

 

With this bug, lsinitrd -f returns no data.

 

Diagnosis:

 

Internally, lsinitrd calls the following (command cut down for brevity)

 

zcat initramfs-4.1.12-112.16.4.el7uek.x86_64.img 2>/dev/null | cpio
--extract --verbose --quiet --to-stdout etc/sysctl.conf

 

Inside the archive, etc/sysctl.conf is a hard link to the other file in the
archive, and is therefore of file size zero.

 

Bug:

 

When cpio extracts a file to stdout, it should follow hard linked files and
output the hard link data. Hard linked files are equivalent. It's not as if
File A is linked to File B. File A and file B are the same file. The should
both extract to the same data.

 

Effect:

 

I spent a long time trying to determine why my initramfs file had an empty
sysctl.conf, when there was no real problem. The instruction here
https://access.redhat.com/solutions/2798411 uncovered this bug via the
following step:

Verify that the initramfs contains the /etc/sysctl.conf file and matches the
one on the system

# diff -u /etc/sysctl.conf <(lsinitrd -f /etc/sysctl.co

 

 

 

 

Kind Regards,

 

Robert

 

 

Robert Rochford | Vice President Programme Development 
Constraint Technologies International
Level 9, 456 Lonsdale Street, Melbourne 3000 Australia
+61 3 9604 9822 (direct) 
 <mailto:[email protected]>
[email protected] 

 <http://www.constrainttec.com/> www.constrainttec.com

 

The information contained in this email message is, unless stated,
confidential, may contain copyright material and is for the use of the
intended recipient only. Messages to and from the company are monitored for
operational reasons and in accordance with lawful business practices. If you
have received this message in error, we would appreciate if you would notify
us by return and delete the message and any attachments. 

 

Reply via email to