blob: 106dc3f1eefb1bc3e2715f1796bcf809452d5fda [file] [log] [blame]
Andrew Geisslerf1e44062021-04-15 15:52:46 -05001Upstream-Status: Pending
2
3This needs more work. Its my starting point.
4
5Signed-off-by: Armin Kuster <akuster808@gmail.com>
6
7Index: lkrg-0.9.0/Makefile
8===================================================================
9--- lkrg-0.9.0.orig/Makefile
10+++ lkrg-0.9.0/Makefile
11@@ -4,28 +4,10 @@
12 # Author:
13 # - Adam 'pi3' Zabrocki (http://pi3.com.pl)
14 ##
15-
16-P_OUTPUT = output
17 P_PWD ?= $(shell pwd)
18-P_KVER ?= $(shell uname -r)
19-P_BOOTUP_SCRIPT ?= scripts/bootup/lkrg-bootup.sh
20-TARGET := p_lkrg
21-ifneq ($(KERNELRELEASE),)
22- KERNEL := /lib/modules/$(KERNELRELEASE)/build
23-else
24- ## KERNELRELEASE not set.
25- KERNEL := /lib/modules/$(P_KVER)/build
26-endif
27-
28-#
29-# Uncomment for debug compilation
30-#
31-# ccflags-m := -ggdb -DP_LKRG_DEBUG_BUILD -finstrument-functions
32-# ccflags-y := ${ccflags-m}
33-# p_lkrg-objs += src/modules/print_log/p_lkrg_debug_log.o
34
35-obj-m += $(TARGET).o
36-$(TARGET)-objs += src/modules/ksyms/p_resolve_ksym.o \
37+obj-m := p_lkrg.o
38+p_lkrg-y := src/modules/ksyms/p_resolve_ksym.o \
39 src/modules/hashing/p_lkrg_fast_hash.o \
40 src/modules/comm_channel/p_comm_channel.o \
41 src/modules/integrity_timer/p_integrity_timer.o \
42@@ -91,23 +73,14 @@ $(TARGET)-objs += src/modules/ksyms/p_re
43 src/p_lkrg_main.o
44
45
46-all:
47-# $(MAKE) -C $(KERNEL) M=$(P_PWD) modules CONFIG_DEBUG_SECTION_MISMATCH=y
48- $(MAKE) -C $(KERNEL) M=$(P_PWD) modules
49- mkdir -p $(P_OUTPUT)
50- cp $(P_PWD)/$(TARGET).ko $(P_OUTPUT)
51-
52-install:
53- $(MAKE) -C $(KERNEL) M=$(P_PWD) modules_install
54- depmod -a
55- $(P_PWD)/$(P_BOOTUP_SCRIPT) install
56
57-uninstall:
58- $(P_PWD)/$(P_BOOTUP_SCRIPT) uninstall
59+modules:
60+ $(MAKE) -C $(KERNEL_SRC) M=$(P_PWD) modules
61+
62+modules_install:
63+ $(MAKE) -C $(KERNEL_SRC) M=$(P_PWD) modules_install
64
65 clean:
66- $(MAKE) -C $(KERNEL) M=$(P_PWD) clean
67- $(RM) Module.markers modules.order
68- $(RM) $(P_PWD)/src/modules/kmod/client/kmod/Module.markers
69- $(RM) $(P_PWD)/src/modules/kmod/client/kmod/modules.order
70- $(RM) -rf $(P_OUTPUT)
71+ rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
72+ rm -f Module.markers Module.symvers modules.order
73+ rm -rf .tmp_versions Modules.symvers