-
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
kpatch: better support for livepatch modules #647
Conversation
if [[ ! -z $checksum ]] && [[ -e "$SYSFS/${modname}/checksum" ]] ; then | ||
sysfs_checksum=$(cat $SYSFS/${modname}/checksum) | ||
[[ $checksum == $sysfs_checksum ]] || return 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bash functions return the return the result of the last command -- in this case, the "if; fi" construct. It would probably be safer to explicitly return 0 at the end of the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed in v2
@@ -27,6 +27,14 @@ INSTALLDIR=/var/lib/kpatch | |||
SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))" | |||
VERSION="0.3.4" | |||
|
|||
# Assume livepatch core is built into the kernel, otherwise | |||
# use kpatch model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/model/core module/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworded in v2
Livepatch modules can be supported with minimal changes to the kpatch script. Adjust for appropriate sysfs paths, core-patching code (in kernel for livepatch, kpatch.ko for kpatch), and checksum verification (only verify the checksum if it exists). Fixes dynup#479.
bbcaae4
to
b55dfb7
Compare
v2 - reworded live/kpatch comment, explicitly return 0 from |
👍 |
Thanks @joe-lawrence! |
Livepatch modules can be supported with minimal changes to the kpatch
script. Adjust for appropriate sysfs paths, core-patching code (in
kernel for livepatch, kpatch.ko for kpatch), and checksum verification
(only verify the checksum if it exists).
Fixes #479.