]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut.sh): exit when installing the squash loader fails
authorPhilipp Rudo <prudo@redhat.com>
Tue, 27 Aug 2024 10:14:40 +0000 (12:14 +0200)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Wed, 28 Aug 2024 11:59:47 +0000 (07:59 -0400)
The postinstall phase in 99squash-lib can fail, e.g. when 99squash-lib
is added without one of the required back ends. Usually this isn't fatal
and simply results in a "normal" initrd, i.e. one without squashed
image, being created. Nevertheless, a user needs to explicitly add one
of the required modules for the code to be triggered.  So it is better
to fail with an error rather than giving the user something he didn't
ask for.

Signed-off-by: Philipp Rudo <prudo@redhat.com>
dracut.sh

index 96003abc3810117affbf34cf62188ff6ad0ca464..56f8ae35caef9269b013f3f6d5a1d9ff5977bd6e 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -2310,7 +2310,7 @@ fi
 
 if dracut_module_included "squash-lib"; then
     dinfo "*** Squashing the files inside the initramfs ***"
-    DRACUT_SQUASH_POST_INST=1 module_install "squash-lib"
+    DRACUT_SQUASH_POST_INST=1 module_install "squash-lib" || exit 1
     rm -rf "$squashdir"
     dinfo "*** Squashing the files inside the initramfs done ***"