mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-28 20:44:26 +01:00
bak
This commit is contained in:
@@ -1,13 +1,10 @@
|
|||||||
obj-m += $(addsuffix .o, $(notdir $(basename $(wildcard $(BR2_EXTERNAL_KERNEL_MODULE_PATH)/*.c))))
|
obj-m += $(addsuffix .o, $(notdir $(basename $(wildcard $(BR2_EXTERNAL_KERNEL_MODULE_PATH)/*.c))))
|
||||||
ccflags-y := -Wno-declaration-after-statement -std=gnu99
|
ccflags-y := -Wno-declaration-after-statement -std=gnu99
|
||||||
|
|
||||||
.PHONY: all clean test
|
.PHONY: all clean
|
||||||
|
|
||||||
all: test
|
all:
|
||||||
$(MAKE) -C '$(LINUX_DIR)' M='$(PWD)' modules
|
$(MAKE) -C '$(LINUX_DIR)' M='$(PWD)' modules
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C '$(LINUX_DIR)' M='$(PWD)' clean
|
$(MAKE) -C '$(LINUX_DIR)' M='$(PWD)' clean
|
||||||
|
|
||||||
test:
|
|
||||||
$(MAKE) -C '$(PWD)/test'
|
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ KERNEL_MODULE_SITE_METHOD = local
|
|||||||
|
|
||||||
define KERNEL_MODULE_BUILD_CMDS
|
define KERNEL_MODULE_BUILD_CMDS
|
||||||
$(MAKE) -C '$(@D)' LINUX_DIR='$(LINUX_DIR)' PWD='$(@D)' CC='$(TARGET_CC)' LD='$(TARGET_LD)'
|
$(MAKE) -C '$(@D)' LINUX_DIR='$(LINUX_DIR)' PWD='$(@D)' CC='$(TARGET_CC)' LD='$(TARGET_LD)'
|
||||||
|
$(MAKE) -C '$(@D)/user' CC='$(TARGET_CC)' LD='$(TARGET_LD)'
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define KERNEL_MODULE_INSTALL_TARGET_CMDS
|
define KERNEL_MODULE_INSTALL_TARGET_CMDS
|
||||||
$(INSTALL) -D -m 0655 $(@D)/*.ko '$(TARGET_DIR)'
|
$(INSTALL) -D -m 0655 $(@D)/*.ko '$(TARGET_DIR)'
|
||||||
$(INSTALL) -D -m 0755 $(@D)/test/ins_rm_mod '$(TARGET_DIR)'
|
$(INSTALL) -D -m 0755 $(@D)/user/ins_rm_mod '$(TARGET_DIR)'
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(kernel-module))
|
$(eval $(kernel-module))
|
||||||
|
|||||||
Binary file not shown.
@@ -1,5 +1,3 @@
|
|||||||
CC = gcc
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
ins_rm_mod: ins_rm_mod.c
|
ins_rm_mod: ins_rm_mod.c
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Test
|
# User
|
||||||
|
|
||||||
Userland C programs used to test our kernel module.
|
Userland C programs used to test our kernel modules.
|
||||||
|
|
||||||
`sh` programs are simpler, and installed copied directly with an overlay.
|
`sh` programs are simpler, and installed copied directly with an overlay.
|
||||||
|
|
||||||
BIN
kernel_module/user/ins_rm_mod
Executable file
BIN
kernel_module/user/ins_rm_mod
Executable file
Binary file not shown.
Reference in New Issue
Block a user