From a6cc1975effd769f1d5d68532fceb8d8ba41514e Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Fri, 13 Sep 2024 17:12:43 +0800 Subject: [PATCH] fix(dracut): don't apply aggressive strip to kernel modules Unlike ordinary binaries, kernel module will be unusable if stripped with "-p". Fix this by always use "-g" only. So far it didn't cause many issues since most kernels have their modules signed or compressed so this is skipped. Signed-off-by: Kairui Song --- dracut.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dracut.sh b/dracut.sh index 3b292910f3..79c328973b 100755 --- a/dracut.sh +++ b/dracut.sh @@ -2111,6 +2111,7 @@ if [[ $do_strip == yes ]]; then fi done + kstrip_args=(-g) if [[ $aggressive_strip == yes ]]; then # `eu-strip` and `strip` both strips all unneeded parts by default strip_args=(-p) @@ -2260,7 +2261,7 @@ if [[ $do_strip == yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then | while read -r -d $'\0' f || [ -n "$f" ]; do SIG=$(tail -c 28 "$f" | tr -d '\000') [[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; } - done | xargs -r -0 $strip_cmd "${strip_args[@]}" + done | xargs -r -0 $strip_cmd "${kstrip_args[@]}" dinfo "*** Stripping files done ***" fi