OpenWrt Kernel Module Creation Howto
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
最新文章
- 常用doc命令
- MySQL数据类型——数值类型
- MPlayer-2016-bin-noConsole
- Android 5.x特性概览二
- Android Studio 实用插件整理
- jsp中四种传递参数的方法
- 学习Windows Azure 视频集合大全
- Memcache的基本应用
- [置顶] Android图片异步加载之Android-Universal-Image-Loader
- C语言之循环结构
- 管理 Machine - 每天5分钟玩转 Docker 容器技术(47)
- 五分钟学习React(二):我的第一个Hello World
- jstl标签库示例一
- 查看linux的进程到底用了多少内存
- 套接字工厂——ServerSocketFactory
- jQuery在页面加载的时候自动调用某个函数的方法
- 为什么我的Linux ls命令不能用了?
- 查询大数据表的效率对比:Linq to SQL、Entity Framework、企业库存储过程、ADO.Net
- guzzle http异步 post
- 2019.1.22 zigbee test
热门文章
- QT,QLabel添加超链接
- VS2017 打包成exe
- docker-compose进入容器出现unable to find user root: no matching entries in passwd file
- SQLServer —— 用户权限操作
- 【JZOJ4887】【NOIP2016提高A组集训第13场11.11】最大匹配
- Linux 下的mysql+centos7+主从复制
- 解决:";UnicodeEncodeError: &#39;ascii&#39; codec can&#39;t encode character u&#39;\xa0&#39; in position";错误
- python的sorted排序具体解释
- 笔记:在 Windows 10 WSL Ubuntu 18.04 安装 Odoo12 (2019-06-09)
- 洛谷 1463[SDOI2005] 反素数ant