]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
feat(lsinitrd): notify user on missing compressor
authorFrederick Grose <fgrose@sugarlabs.org>
Wed, 29 Mar 2023 14:29:39 +0000 (10:29 -0400)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Thu, 30 Mar 2023 15:56:53 +0000 (11:56 -0400)
Provide a notice to user if the required compressor package is
missing.  This rather than failing silently.

lsinitrd.sh

index b6f436cb468a3c9442348deb5d4b4c35a2ea70f1..987a6bfc33b7c8dd4ff47301f50e3df1aa711a96 100755 (executable)
@@ -342,6 +342,11 @@ case $bin in
         ;;
 esac
 
+type "${CAT%% *}" > /dev/null 2>&1 || {
+    echo "Need '${CAT%% *}' to unpack the initramfs."
+    exit 1
+}
+
 skipcpio() {
     $SKIP "$@" | $ORIG_CAT
 }