9f65cc
From ba8f0e0502d3cda2f4222745eebed37f45a4c5a1 Mon Sep 17 00:00:00 2001
9f65cc
From: Kairui Song <kasong@redhat.com>
9f65cc
Date: Thu, 11 Feb 2021 00:39:17 +0800
9f65cc
Subject: [PATCH] fix(squash): post install should be the last step before
9f65cc
 stripping
9f65cc
9f65cc
Ensure dracut squash module doesn't effect other steps, and stripping
9f65cc
can cover the new binaries installed by it.
9f65cc
9f65cc
(cherry picked from commit 8c8aecdc63c9389038e78ee712d4809e49add5e1)
9f65cc
9f65cc
Cherry-picked from: 8c8aecdc
9f65cc
Resolves: #1959336
9f65cc
---
9f65cc
 dracut.sh | 16 ++++++++--------
9f65cc
 1 file changed, 8 insertions(+), 8 deletions(-)
9f65cc
9f65cc
diff --git a/dracut.sh b/dracut.sh
9f65cc
index 669bc6ce..1168fc16 100755
9f65cc
--- a/dracut.sh
9f65cc
+++ b/dracut.sh
9f65cc
@@ -1734,14 +1734,6 @@ if [[ $hostonly_cmdline == "yes" ]] ; then
9f65cc
     fi
9f65cc
 fi
9f65cc
 
9f65cc
-if dracut_module_included "squash"; then
9f65cc
-    readonly squash_dir="$initdir/squash/root"
9f65cc
-    readonly squash_img="$initdir/squash/root.img"
9f65cc
-
9f65cc
-    dinfo "*** Install squash loader ***"
9f65cc
-    DRACUT_SQUASH_POST_INST=1 module_install "squash"
9f65cc
-fi
9f65cc
-
9f65cc
 if [[ $kernel_only != yes ]]; then
9f65cc
     # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
9f65cc
     for _dir in $libdirs; do
9f65cc
@@ -1764,6 +1756,14 @@ if [[ $kernel_only != yes ]]; then
9f65cc
     fi
9f65cc
 fi
9f65cc
 
9f65cc
+if dracut_module_included "squash"; then
9f65cc
+    readonly squash_dir="$initdir/squash/root"
9f65cc
+    readonly squash_img="$initdir/squash/root.img"
9f65cc
+
9f65cc
+    dinfo "*** Install squash loader ***"
9f65cc
+    DRACUT_SQUASH_POST_INST=1 module_install "squash"
9f65cc
+fi
9f65cc
+
9f65cc
 if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
9f65cc
     dinfo "*** Stripping files ***"
9f65cc
     find "$initdir" -type f \
9f65cc