Skip to content

Commit

Permalink
Add a dummy module driver
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeChenL committed Dec 27, 2023
1 parent bcc41b7 commit 0179f8c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ DTBO-ROCKCHIP := $(addprefix arch/arm64/boot/dts/rockchip/overlays/,$(dtb-rockch
DTBO := $(DTBO-AMLOGIC) $(DTBO-ROCKCHIP)
TMP := $(addsuffix .tmp,$(DTBO))

.PHONY: all
KERNEL_HENDERS=/usr/src/linux-headers-$(shell uname -r)
ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu-
export ARCH CROSS_COMPILE

obj-m := radxa-overlays.o
all: build
$(MAKE) -C $(KERNEL_HENDERS) M=$(CURDIR) modules

cleanmodules:
$(MAKE) -C $(KERNEL_HENDERS) M=$(CURDIR) clean

#
# Build
Expand Down
2 changes: 1 addition & 1 deletion debian/dkms
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ PACKAGE_NAME="radxa-overlays"
PACKAGE_VERSION="#MODULE_VERSION#"
DEST_MODULE_LOCATION[0]="/updates/dkms"
MAKE="make all"
CLEAN="make clean"
CLEAN="make clean cleanmodules"
AUTOINSTALL="yes"
2 changes: 1 addition & 1 deletion debian/install
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/dh-exec

arch usr/src/radxa-overlays-${DEB_VERSION}/
radxa-overlays.ko usr/src/radxa-overlays-${DEB_VERSION}/
radxa-overlays.c usr/src/radxa-overlays-${DEB_VERSION}/
Makefile usr/src/radxa-overlays-${DEB_VERSION}/
21 changes: 21 additions & 0 deletions radxa-overlays.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>

static int __init mod_init(void)
{
printk(KERN_INFO "radxa-overlays: Init\n");
printk(KERN_INFO "radxa-overlays: radxa-overlays is a dummy module for radxa-overlays-dkms\n");
return 0;
}

static void __exit mod_exit(void)
{
printk(KERN_INFO "radxa-overlays: Exit\n");
}

module_init(mod_init);
module_exit(mod_exit);

MODULE_LICENSE("GPL2");
MODULE_AUTHOR("© 2022 Radxa Computer Co., Ltd");

0 comments on commit 0179f8c

Please sign in to comment.