OpenWrt Kernel Module Creation Howto

Source: Internet
Author: User

OpenWrt Kernel module Creation howtoabout OpenWrt Kernel module compilation

Planning to compile a kernel module? This howto would explain what we have to does, to the your kernel module installable as an ipkg.

Enable the kernel options

Enable the kernel options want by modifying Build_mipsel/linux/.config. We are assuming, so 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 is not the getting lost, when doing a ' make Dirclean '. Here we assume this is compiling for Broadcom chipset based devices:

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 was 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-kbdpriority:optionalsection:sysmaintainer:markus Becker <[email Protected]>Source: BuildRoot Internaldescription: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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.