|
From: | Robert Rochford |
Subject: | Bug in cpio causing problems in dracut initramfs tools |
Date: | Tue, 18 Feb 2020 16:01:19 +1100 |
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
Kind Regards, Robert Robert Rochford | Vice President Programme Development 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. |
[Prev in Thread] | Current Thread | [Next in Thread] |