Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small upstream kernel fixes #1397

Merged
merged 4 commits into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions kpatch-build/kpatch-build
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ restore_kernel_files() {
}

cleanup() {
rm -f "$BUILDDIR/.scmversion"

remove_patches
restore_kernel_files

Expand Down Expand Up @@ -689,11 +691,11 @@ module_name_string() {
}

is_supported_deb_distro(){
[[ -n "${SUPPORTED_DEB_DISTROS[$1]:-}" ]]
[[ -n "$1" ]] && [[ -n "${SUPPORTED_DEB_DISTROS[$1]:-}" ]]
}

is_supported_rpm_distro(){
[[ -n "${SUPPORTED_RPM_DISTROS[$1]:-}" ]]
[[ -n "$1" ]] && [[ -n "${SUPPORTED_RPM_DISTROS[$1]:-}" ]]
}

print_supported_distro(){
Expand Down Expand Up @@ -956,7 +958,7 @@ if [[ -n "$USERSRCDIR" ]]; then
# save original vmlinux before it gets overwritten by sourcedir build
if [[ "$VMLINUX" -ef "$KERNEL_SRCDIR"/vmlinux ]]; then
backup_kernel_file "vmlinux"
VMLINUX="$TEMPDIR/vmlinux"
VMLINUX="$KERNEL_BACKUPDIR/vmlinux"
fi
elif [[ -n "$OOT_MODULE" ]]; then
if [[ -z "${CONFIGFILE}" ]]; then
Expand Down Expand Up @@ -1118,18 +1120,23 @@ fi
# appended to the kernel version string (VERMAGIC_STRING), even if the original
# kernel was not dirty. That can complicate both the build (create-diff-object
# false positive changes) and the patch module link (module version mismatch
# load failures).
# load failures). Before making any changes to the source:
#
# For pre-v6.3 kernels:
# Run `./scripts/setlocalversion --save-scmversion`.
#
# Prevent that by replacing the original setlocalversion with a friendlier one
# which just echo's the original version. This should be done before any
# changes to the source.
# For v6.3+ kernels:
# Replace the original setlocalversion with a friendlier one which just echo's
# the original version.
if [[ -n "$USERSRCDIR" && -e "$KERNEL_SRCDIR/.git" ]]; then
cd "$KERNEL_SRCDIR" || die
backup_kernel_file "scripts/setlocalversion"
LOCALVERSION="$(make kernelversion)"
LOCALVERSION="$(KERNELVERSION="$LOCALVERSION" ./scripts/setlocalversion)"
[[ -n "$LOCALVERSION" ]] || die "setlocalversion failed"
echo "echo $LOCALVERSION" > scripts/setlocalversion
if ! ./scripts/setlocalversion --save-scmversion &>/dev/null; then
backup_kernel_file "scripts/setlocalversion"
LOCALVERSION="$(make --no-print-directory kernelversion)"
LOCALVERSION="$(KERNELVERSION="$LOCALVERSION" ./scripts/setlocalversion)"
[[ -n "$LOCALVERSION" ]] || die "setlocalversion failed"
echo "echo $LOCALVERSION" > scripts/setlocalversion
fi
fi

# kernel option checking
Expand Down
Loading