From caa2405338f1af8e05023306dfd416d7606ae89b Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Wed, 3 Nov 2021 15:40:15 +0800 Subject: [PATCH] mkfadumprd: make _dracut_isolate_args an array upstream: fedora resolves: bz2003832 conflict: none commit 982205d6072b1c10b2f0eff44c3ccbfa92dd3198 Author: Kairui Song Date: Wed Aug 4 03:06:57 2021 +0800 mkfadumprd: make _dracut_isolate_args an array To make arguments list work as expected, array is preferred. Check following link for details: https://github.com/koalaman/shellcheck/wiki/SC2089 Signed-off-by: Kairui Song Acked-by: Philipp Rudo Signed-off-by: Tao Liu --- mkfadumprd | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mkfadumprd b/mkfadumprd index aecf2a8..5c87933 100644 --- a/mkfadumprd +++ b/mkfadumprd @@ -51,14 +51,17 @@ if ! (pushd "$MKFADUMPRD_TMPDIR/fadumproot" > /dev/null && lsinitrd --unpack "$F fi ### Pack it into the normal boot initramfs with zz-fadumpinit module -_dracut_isolate_args="--rebuild $REBUILD_INITRD --add zz-fadumpinit \ - -i $MKFADUMPRD_TMPDIR/fadumproot /fadumproot \ - -i $MKFADUMPRD_TMPDIR/fadumproot/usr/lib/dracut/hostonly-kernel-modules.txt - /usr/lib/dracut/fadump-kernel-modules.txt" +_dracut_isolate_args=(\ + --rebuild "$REBUILD_INITRD" --add zz-fadumpinit \ + -i "$MKFADUMPRD_TMPDIR/fadumproot" /fadumproot + -i "$MKFADUMPRD_TMPDIR/fadumproot/usr/lib/dracut/hostonly-kernel-modules.txt" + /usr/lib/dracut/fadump-kernel-modules.txt +) if is_squash_available; then - _dracut_isolate_args="$_dracut_isolate_args --add squash" + _dracut_isolate_args+=( --add squash ) fi -if ! dracut --force --quiet $_dracut_isolate_args $@ "$TARGET_INITRD"; then + +if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then perror_exit "mkfadumprd: failed to setup '$TARGET_INITRD' with dump capture capability" fi