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

OpenWrt Kernel Module Creation Howto的更多相关文章

  1. The vboxdrv kernel module is not loaded

    背景: 在没有关虚拟机的情况下, 直接关了电脑, 我的电脑系统是Centos 6 错误的提示: 在终端执行virtualbox -v 时提示 The vboxdrv kernel module is ...

  2. Xamarin.Android模拟器提示HAX kernel module is not Installed

    Xamarin.Android模拟器提示HAX kernel module is not Installed 错误信息:emulator : ERROR : x86 emulation current ...

  3. HAX kernel module is not installed

    dev.android.emulator.haxm 运行emulator -avd xxx来启动名为xxx的模拟器,但报如下错误: emulator: ERROR: x86 emulation cur ...

  4. emulator: ERROR: x86 emulation currently requires hardware acceleration!Please ensure Intel HAXM is properly installed and usable.CPU acceleration status: HAX kernel module is not installed!

    Android Studio 1.0 已经放出来了,以后的Android平台开发激昂逐步从Eclipse向Android Studio迁移,为了能不落伍我也特意从Google下载了Android St ...

  5. Compiling a kernel module for the raspberry pi 2 via Ubuntu host

    Compiling a kernel module for the raspberry pi 2 via Ubuntu host Normally compiling a kernel module ...

  6. Virtualbox报错------>make sure the kernel module has been loaded successfully

    错误描述 很久没有用virtualbox了,今天打算在virtualbox上安装一个Ubuntu系统的时候,新建好Ubuntu后启动的时候,直接报错: Cannot access the kernel ...

  7. qemu 出现Could not access KVM kernel module: No such file or directory failed to initialize KVM: No such file or directory

    使用qemu命令 qemu-system-x86_64 -hda image/ubuntu-test.img -cdrom ubuntu-16.04.2-server-amd64.iso -m 102 ...

  8. 如何处理VirtualBox启动错误消息:The vboxdrv kernel module is not loaded

    我在启动minikube时,遇到如下错误消息: Starting local Kubernetes v1.10.0 cluster... Starting VM... E1010 03:27:37.9 ...

  9. kernel/module.c

    #include <linux/errno.h>#include <linux/kernel.h>#include <asm/segment.h>#include ...

随机推荐

  1. MyEclipse代码提示功能和自动提示功能

    1.菜单window->Preferences->Java->Editor->Content Assist->Enable auto activation 选项要打上勾 ...

  2. [自考]C++中一些特殊用法 2016-10-16 22:12 318人阅读 评论(30) 收藏

    做了一段时间的C++的试题了,总结一些这段时间经常犯错和需要注意的地方. 一.常用的保留字和符号 const 定义常量或者参数 void 定义空类型变量或空类型指针,或指定函数没有返回值 static ...

  3. 分享 KubeCon 2019 (上海)关于 Serverless 及 Knative 相关演讲会议

    有幸参加了 KubeCon 2019 上海大会,并参加了 Knative 及 Serverless 相关的几场分享会,收获满满.这里简单介绍一下各个演讲主题的主要内容.详细的演讲主题文档可以在Kube ...

  4. 洛谷 3174 [HAOI2009]毛毛虫

    题目描述 对于一棵树,我们可以将某条链和与该链相连的边抽出来,看上去就象成一个毛毛虫,点数越多,毛毛虫就越大.例如下图左边的树(图 1 )抽出一部分就变成了右边的一个毛毛虫了(图 2 ). 输入输出格 ...

  5. async/await运用-前端表单弹窗验证同步书写方式(React)

    在前端项目中,我们经常会碰到这样的场景: 当前我们有一个表单需要填写,在完成表单填写后经过校验之后会弹出短信或者其他形式验证码,进行补充校验,然后一起提交给接口. 场景如下图: 当前为创建操作,编辑操 ...

  6. uni-app中使用Echarts绘画图表

    enmnm...一般会使用npm下载echarts这个包,但是不知道是我自己的配置问题还是别的原因,一直出不来图线, 于是,把Hello uni-app模板里的那个组件抱过来,然后,成了! 首先, 1 ...

  7. springboot&mybatis 增删改查系列(一)

    创建父项目 首先,我们需要创建一个Maven项目. 在这个项目的pom文件中加入以下几个依赖: <!-- spring boot --> <parent> <groupI ...

  8. vue2——指令渲染,{{}}渲染

    博客地址 :https://www.cnblogs.com/sandraryan/ 声明式的渲染,以{{}}的形式调用数据 <!DOCTYPE html> <html lang=&q ...

  9. JS获取手机型号和系统

    废话不多说,直接上源码 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type&q ...

  10. H3C 网络接口层