mirror of
https://github.com/dynup/kpatch
synced 2024-12-23 13:42:09 +00:00
Merge pull request #134 from jpoimboe/find-core-module-git-tree
kpatch: look for core module in git dir
This commit is contained in:
commit
99ae097b08
11
README.md
11
README.md
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user