mirror of
https://github.com/dynup/kpatch
synced 2024-12-12 08:24:37 +00:00
6ee3c0f8fa
Instead of building *.patch, allow the user to specify patch files on the command line. For example: kpatch-test --quick centos-7/cmdline-string.patch centos-7/data-new.patch Update the top-level Makefile as well, so it can be similarly invoked: PATCHES="centos-7/cmdline-string.patch centos-7/data-new.patch" make quick If no patches are specified on the kpatch-test command line, then fall back to the previous behavior of *.patch. NOTE: If patches *are* specified, then only the .test files corresponding to those patches will be executed. Provided patch paths will also override any --directory value.
44 lines
1017 B
Makefile
44 lines
1017 B
Makefile
include /etc/os-release
|
|
|
|
PATCH_DIR?=${ID}-${VERSION_ID}
|
|
|
|
all:
|
|
$(error please specify local or remote)
|
|
|
|
local: slow
|
|
|
|
remote: remote_slow
|
|
|
|
slow: clean
|
|
./kpatch-test -d $(PATCH_DIR) $(PATCHES)
|
|
|
|
quick: clean
|
|
./kpatch-test -d $(PATCH_DIR) --quick $(PATCHES)
|
|
|
|
cached:
|
|
./kpatch-test -d $(PATCH_DIR) --cached $(PATCHES)
|
|
|
|
clean:
|
|
rm -f *.ko *.log COMBINED.patch
|
|
|
|
check_host:
|
|
ifndef SSH_HOST
|
|
$(error SSH_HOST is undefined)
|
|
endif
|
|
|
|
SSH_USER ?= root
|
|
|
|
remote_setup: check_host
|
|
ssh $(SSH_USER)@$(SSH_HOST) exit
|
|
ssh $(SSH_USER)@$(SSH_HOST) "ls kpatch-setup &> /dev/null" || \
|
|
(scp remote-setup $(SSH_USER)@$(SSH_HOST):kpatch-setup && \
|
|
ssh $(SSH_USER)@$(SSH_HOST) "./kpatch-setup")
|
|
|
|
remote_sync: remote_setup
|
|
ssh $(SSH_USER)@$(SSH_HOST) "rm -rf kpatch-test"
|
|
rsync -Cavz --include=core $(shell readlink -f ../../..) $(SSH_USER)@$(SSH_HOST):kpatch-test
|
|
ssh $(SSH_USER)@$(SSH_HOST) "cd kpatch-test/kpatch && make"
|
|
|
|
remote_slow: remote_sync
|
|
ssh $(SSH_USER)@$(SSH_HOST) "cd kpatch-test/kpatch/test/integration && make slow"
|