Merge pull request #134 from jpoimboe/find-core-module-git-tree

kpatch: look for core module in git dir
This commit is contained in:
Seth Jennings 2014-04-22 11:10:23 -05:00
commit 99ae097b08
2 changed files with 9 additions and 6 deletions

View File

@ -39,10 +39,13 @@ Compile kpatch:
make
Install kpatch to /usr/local:
OPTIONAL: Install kpatch to /usr/local:
sudo make install
Alternatively, the kpatch and kpatch-build scripts can be run directly from the
git tree.
Quick start
-----------
@ -51,10 +54,6 @@ Quick start
kernel on any distribution, the "kpatch-build" command currently
only works on Fedora.*
Load the kpatch core module:
sudo insmod /usr/local/lib/modules/$(uname -r)/kpatch/kpatch.ko
Make a source patch against the kernel tree:
# from a kernel git tree:
@ -67,7 +66,7 @@ Build the patch module:
This outputs a patch module named `kpatch-foo.ko` in the current
directory. Now apply it to the running kernel:
sudo insmod kpatch-foo.ko
sudo kpatch load kpatch-foo.ko
Done! The kernel is now patched.

View File

@ -26,6 +26,7 @@
KERNELRELEASE="$(uname -r)"
SYSDIR="/usr/lib/kpatch/$KERNELRELEASE"
USERDIR="/var/lib/kpatch/$KERNELRELEASE"
SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))"
usage () {
echo "usage: kpatch <command> [<args>]" >&2
@ -72,6 +73,9 @@ find_module () {
}
find_core_module() {
COREMOD="$SCRIPTDIR"/../kmod/core/kpatch.ko
[[ -f "$COREMOD" ]] && return
COREMOD="/usr/local/lib/modules/$(uname -r)/kpatch/kpatch.ko"
[[ -f "$COREMOD" ]] && return