Skip to content

Commit

Permalink
kpatch-build: suppress make directory info for make kernelversion
Browse files Browse the repository at this point in the history
When invoking kpatch-build through integration testing, like:

  $ make PATCH_DIR="linux-6.9.0" \
         KPATCH_BUILD_OPTS="--sourcedir /root/linux" \
         integration-slow

results in an error as kpatch-build's `make kernelversion` adds
directory information to its output:

  make[2]: Entering directory '/root/linux'
  6.9.0
  make[2]: Leaving directory '/root/linux'

This screws up kpatch-build's assignment of the make output to
LOCALVERSION, which was expecting only "6.9.0".

Add --no-print-directory to the make invocation to avoid the undesired
entering / leaving directory info.

Fixes: 629b5ac ("kpatch-build: Fix setlocalversion issue with 6.3 kernel")
Signed-off-by: Joe Lawrence <[email protected]>
  • Loading branch information
joe-lawrence committed Jun 7, 2024
1 parent 77d9346 commit 7d89578
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kpatch-build/kpatch-build
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ if [[ -n "$USERSRCDIR" && -e "$KERNEL_SRCDIR/.git" ]]; then
cd "$KERNEL_SRCDIR" || die
if ! ./scripts/setlocalversion --save-scmversion &>/dev/null; then
backup_kernel_file "scripts/setlocalversion"
LOCALVERSION="$(make kernelversion)"
LOCALVERSION="$(make --no-print-directory kernelversion)"
LOCALVERSION="$(KERNELVERSION="$LOCALVERSION" ./scripts/setlocalversion)"
[[ -n "$LOCALVERSION" ]] || die "setlocalversion failed"
echo "echo $LOCALVERSION" > scripts/setlocalversion
Expand Down

0 comments on commit 7d89578

Please sign in to comment.