-
Notifications
You must be signed in to change notification settings - Fork 304
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
joe-lawrence
merged 4 commits into
dynup:master
from
joe-lawrence:small-upstream-kernel-fixes
Jul 18, 2024
Merged
Small upstream kernel fixes #1397
joe-lawrence
merged 4 commits into
dynup:master
from
joe-lawrence:small-upstream-kernel-fixes
Jul 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When kpatch-build is invoked with a -s|--sourcedir USERSRCDIR value, kpatch-build doesn't source the /etc/os-release file as it can't assume that the user-specified kernel source config matches any particular distribution. Subsequent is_supported_{rpm,deb}_distro() function calls will result in ugly syntax errors like: kpatch-build: line 697: SUPPORTED_RPM_DISTROS: bad array subscript kpatch-build: line 692: SUPPORTED_DEB_DISTROS: bad array subscript Enhance the is_supported_{rpm,deb}_distro() functions to check that a non-NULL distribution string argument exists before indexing the SUPPORTED_{RPM,DEB}_DISTROS associative arrays. Signed-off-by: Joe Lawrence <[email protected]>
Commit 69e71f8 ("kpatch-build: cleanup kernel file backup/restore") consolidated a bunch of kernel-tree copy and restoring. As part of that effort, when kpatch-build is invoked with a -s|--sourcedir USERSRCDIR value the vmlinux file is now saved to "$TEMPDIR/kernel-backup/" and not simply "$TEMPDIR/". This results in kpatch-build confusion like: readelf: /home/jolawren/.kpatch/tmp/vmlinux: Error: No such file Update the VMLINUX reassignment in this case to point to the new path. Fixes: 69e71f8 ("kpatch-build: cleanup kernel file backup/restore") Signed-off-by: Joe Lawrence <[email protected]>
Commit 629b5ac ("kpatch-build: Fix setlocalversion issue with 6.3 kernel") fixed VERMAGIC_STRING between kpatch original/patched kernel builds by creating a temporary scripts/setlocalversion script. This was accomplished by saving the output from `make kernelversion` into a KERNELVERSION environment variable and running the (original) scripts/setlocalversion to gather a "vX.Y" + "<src version>" pair of strings. Unfortunately pre-v6.3 scripts/setlocalversion does not use the KERNELVERSION environment variable, so the same efforts results in an unusable "<NULL>" + "<src version>" version string pair. Restore the original `scripts/setlocalversion --save-scmversion` invocation for source trees that (still) support the --save-scmversion option. Fixes: 629b5ac ("kpatch-build: Fix setlocalversion issue with 6.3 kernel") Signed-off-by: Joe Lawrence <[email protected]>
joe-lawrence
force-pushed
the
small-upstream-kernel-fixes
branch
from
June 7, 2024 14:23
8085be3
to
0cefb53
Compare
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]>
joe-lawrence
force-pushed
the
small-upstream-kernel-fixes
branch
from
June 25, 2024 20:14
0cefb53
to
7d89578
Compare
joe-lawrence
changed the title
Draft: Small upstream kernel fixes
Small upstream kernel fixes
Jun 25, 2024
@jpoimboe , @yhcote , @ryanbsull : can I get a quick review on this MR? Thanks. |
jpoimboe
approved these changes
Jul 18, 2024
yhcote
approved these changes
Jul 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Three minor fix-ups for kpatch-build and upstream kernel trees:
USERSRCDIR
. Protect against indexing their associated arrays with empty stringsVMLINUX
path whenUSERSRCDIR
is specified ($TEMPDIR vs. $KERNEL_BACKUPDIR)