From: Topi Miettinen Date: Sun, 1 Mar 2020 10:22:30 +0000 (+0200) Subject: Make lsinitrd usable for images made with Debian mkinitramfs X-Git-Tag: 050~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce62465cafcc780fba13b0ae60d22ada2f77f436;p=thirdparty%2Fdracut.git Make lsinitrd usable for images made with Debian mkinitramfs Debian mkinitramfs does not create the file 'early_cpio', so detection of additional cpio images fails and only the first cpio is listed. I checked some Arch and Gentoo initramfs files and these didn't have 'early_cpio' either, but they also have only one cpio part. Fix this so that if check for 'early_cpio' fails, check if firmware files ('/kernel/*/microcode/*.bin') exist. Signed-off-by: Topi Miettinen --- diff --git a/lsinitrd.sh b/lsinitrd.sh index 67af769e0..b5c73f62f 100755 --- a/lsinitrd.sh +++ b/lsinitrd.sh @@ -236,6 +236,8 @@ case $bin in $'\x71\xc7'*|070701) CAT="cat --" is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null) + # Debian mkinitramfs does not create the file 'early_cpio', so let's check if firmware files exist + [[ "$is_early" ]] || is_early=$(cpio --list --verbose --quiet --to-stdout -- 'kernel/*/microcode/*.bin' < "$image" 2>/dev/null) if [[ "$is_early" ]]; then if [[ -n "$unpack" ]]; then # should use --unpackearly for early CPIO