OpenWrt Kernel Module Creation Howto
2016-06-30 22:35
302 查看
OpenWrt Kernel Module Creation Howto
About OpenWrt Kernel Module Compilation
You are planning to compile a kernel module? This howto will explain what you have to do, to have your kernel module installable as an ipkg.Enable the kernel options
Enable the kernel options you want by modifying build_mipsel/linux/.config. We are assuming, that you already had your kernel compiled once here. You can do the modification by hand or by$ cd build_mipsel/linux $ make menuconfig
And copy it, so your changes are not getting lost, when doing a 'make dirclean'. Here we assume that you are compiling for Broadcom chipset based devices:
$ cp .config ../../../target/linux/linux-2.4/config/brcm
Create a buildroot option
Create a buildroot option by modifying/inserting into target/linux/Config.in, e.g.config BR2_PACKAGE_KMOD_USB_KEYBOARD tristate "Support for USB keyboards" default m depends BR2_PACKAGE_KMOD_USB_CONTROLLER
Define the binary files for the kernel module
Define the binary files for the kernel module by modifying/inserting into target/linux/linux-2.4/Makefile, e.g.$(eval $(call KMOD_template,USB_KEYBOARD,usb-kbd,\ $(MODULES_DIR)/kernel/drivers/input/input.o \ $(MODULES_DIR)/kernel/drivers/input/keybdev.o \ $(MODULES_DIR)/kernel/drivers/usb/usbkbd.o \ ,CONFIG_USB_KEYB,kmod-usb-core,60,input keybdev usbkbd))
Where CONFIG_USB_KEYB is the kernel option, USB_KEYBOARD is the last part of BR2_PACKAGE_KMOD_USB_KEYBOARD and usb-kbd is part of the filename of the created ipkg.
Specify the ipkg control file
Create e.g. target/linux/control/kmod-usb-kbd.control with content similar to this:Package: kmod-usb-kbd Priority: optional Section: sys Maintainer: Markus Becker <mab@comnets.uni-bremen.de> Source: buildroot internal Description: Kernel Support for USB Keyboards
Compile the kernel module
Enable the kernel module with$ make menuconfig
in TOPDIR and selecting it. Compile with
$ make dirclean && make
相关文章推荐
- Linux入门之一步一步安装系统
- 路由器OpenWrt如何脱机(离线)下载BT文件
- 路由器OpenWrt如何脱机(离线)下载BT文件
- OpenGL学习笔记4:纹理
- linux下不使用rm命令删除文件和文件夹
- opencv 解决vs2013 opencv3.0 0xC000007b运行错误问题
- 图解Linux命令之--enable命令
- OPENWRT X86 安装使用教程 (未完成)
- OPENWRT X86 安装使用教程 (未完成)
- 项目:TEDxDUT 演讲报名网站
- 《Linux内核设计与实现》学习笔记——中断、中断处理程序
- 每天一个linux命令(27)--tar命令
- 图解Linux命令之--uname命令
- 图解Linux命令之--pwd命令
- Linux工作队列实现机制
- ArchLinux 下 virtualbox 报错 libQtCore.so.4: cannot open shared object file
- Apache+PHP windows
- Linux 时钟中断处理(一)
- 读薄《Linux 内核设计与实现》(4) - 中断与同步
- Tomcat实战-调优方案