Skip to content

Commit c799fde

Browse files
committed
tree: fix latest shellcheck complaints
Fix the following: In kpatch/kpatch line 358: break ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In kpatch-build/kpatch-build line 1424: "$TOOLSDIR"/create-diff-object $CDO_FLAGS "orig/$i" "patched/$i" "$KOBJFILE_NAME" \ ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. In kpatch-build/kpatch-build line 1494: MAKEVARS[$idx]=${MAKEVARS[$idx]/${KPATCH_CC_PREFIX}/} ^--^ SC2004 (style): $/${} is unnecessary on arithmetic variables. In kpatch-build/kpatch-build line 1510: "$TOOLSDIR"/create-klp-module $extra_flags "$TEMPDIR/patch/tmp.ko" "$TEMPDIR/patch/$MODNAME.ko" 2>&1 | logger 1 ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. In test/integration/lib.sh line 119: tdnf install -y linux-$flavor-debuginfo ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Signed-off-by: Joe Lawrence <[email protected]> squash
1 parent 2f6a812 commit c799fde

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

kpatch-build/kpatch-build

+5-5
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ if [[ -n "$CONFIG_LIVEPATCH" ]] && (kernel_is_rhel || kernel_version_gte 4.9.0);
11671167
if use_klp_arch; then
11681168
USE_KLP_ARCH=1
11691169
KPATCH_LDFLAGS="--unique=.parainstructions --unique=.altinstructions"
1170-
CDO_FLAGS="--klp-arch"
1170+
CDO_FLAGS+=("--klp-arch")
11711171
fi
11721172

11731173
if [[ "$KLP_REPLACE" -eq 1 ]] ; then
@@ -1421,7 +1421,7 @@ for i in $FILES; do
14211421

14221422
# create-diff-object orig.o patched.o parent-name parent-symtab
14231423
# Module.symvers patch-mod-name output.o
1424-
"$TOOLSDIR"/create-diff-object $CDO_FLAGS "orig/$i" "patched/$i" "$KOBJFILE_NAME" \
1424+
"$TOOLSDIR"/create-diff-object "${CDO_FLAGS[@]}" "orig/$i" "patched/$i" "$KOBJFILE_NAME" \
14251425
"$SYMTAB" "$SYMVERS_FILE" "${MODNAME//-/_}" \
14261426
"output/$i" 2>&1 | logger 1
14271427
check_pipe_status create-diff-object
@@ -1491,7 +1491,7 @@ cd "$TEMPDIR/patch" || die
14911491

14921492
# We no longer need kpatch-cc
14931493
for ((idx=0; idx<${#MAKEVARS[@]}; idx++)); do
1494-
MAKEVARS[$idx]=${MAKEVARS[$idx]/${KPATCH_CC_PREFIX}/}
1494+
MAKEVARS[idx]=${MAKEVARS[idx]/${KPATCH_CC_PREFIX}/}
14951495
done
14961496

14971497
export KPATCH_BUILD="$KERNEL_SRCDIR" KPATCH_NAME="$MODNAME" \
@@ -1504,10 +1504,10 @@ make "${MAKEVARS[@]}" 2>&1 | logger || die
15041504

15051505
if [[ "$USE_KLP" -eq 1 ]]; then
15061506
if [[ "$USE_KLP_ARCH" -eq 0 ]]; then
1507-
extra_flags="--no-klp-arch-sections"
1507+
extra_flags+=("--no-klp-arch-sections")
15081508
fi
15091509
cp -f "$TEMPDIR/patch/$MODNAME.ko" "$TEMPDIR/patch/tmp.ko" || die
1510-
"$TOOLSDIR"/create-klp-module $extra_flags "$TEMPDIR/patch/tmp.ko" "$TEMPDIR/patch/$MODNAME.ko" 2>&1 | logger 1
1510+
"$TOOLSDIR"/create-klp-module "${extra_flags[@]}" "$TEMPDIR/patch/tmp.ko" "$TEMPDIR/patch/$MODNAME.ko" 2>&1 | logger 1
15111511
check_pipe_status create-klp-module
15121512
[[ "$rc" -ne 0 ]] && die "create-klp-module: exited with return code: $rc"
15131513
fi

kpatch/kpatch

-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ load_module () {
355355
i=$((i+1))
356356
if [[ $i -eq $MAX_LOAD_ATTEMPTS ]]; then
357357
die "failed to load module $module"
358-
break
359358
else
360359
warn "retrying..."
361360
sleep $RETRY_INTERVAL

test/integration/lib.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ kpatch_photon_dependencies()
116116
if [[ -z "$flavor" ]]; then
117117
tdnf install -y linux-debuginfo
118118
else
119-
tdnf install -y linux-$flavor-debuginfo
119+
tdnf install -y linux-"$flavor"-debuginfo
120120
fi
121121
}
122122

0 commit comments

Comments
 (0)