This patch adds option "-m|--mod" to lsinitrd to list dracut
modules in the image because sometimes having an option to
only list the dracut modules in the image could be handy.
Sample output:
--------------
[hbathini@localhost dracut]$ sudo ./lsinitrd.sh initramfs-3.11.10-100.fc18.x86_64.img -m
Image: initramfs-3.11.10-100.fc18.x86_64.img: 33M
========================================================================
Version: dracut-029-1.fc18.2
dracut modules:
i18n
network
ifcfg
drm
plymouth
btrfs
crypt
dm
dmraid
kernel-modules
lvm
mdraid
cifs
iscsi
nfs
resume
rootfs-block
terminfo
udev-rules
biosdevname
systemd
usrmount
base
fs-lib
shutdown
========================================================================
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
lsinitrd (and hence dracut) currently fail to list the contents of any
LZO-compressed image, and merely spit out misleading xzcat errors.
I guess no-one actually uses them.
Running dracut in a chroot environment, which has /dev not correctly
setup will result in errors like:
/usr/bin/lsinitrd: line 164: /dev/fd/62: No such file or directory
cpio: Malformed number �5�OK��
cpio: Malformed number 5�OK��
cpio: Malformed number �OK��
This is because bash wants /dev/fd/<num> for constructs like:
foo < <$(bar)
Dracut claims to have LZ4 support, but trying to use it will result in an xzcat failure at the end due to missing CAT support.
The lz4 command chokes on '--', so abstract that out into the CAT select.
Something similar will need to be done for LZO.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
if /boot/<machine-id> exists; then
use /boot/<machine-id>/<kernel-version>/initrd as the default image;
else fallback to /boot/initramfs-<kernel-version>.img
The F16 installation image is two concatenated cpio images:
[xz-compressed dracut initramfs][uncompressed cpio with /squashfs.img]
So to show the contents, use xz with the "--single-stream" option.
https://bugzilla.redhat.com/show_bug.cgi?id=742299