X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/b75b8c4a3c73ba71a98071cbab333cf5ce1d0e0b..27de7a050d264aa73df1c83eeab8b9967ad57b55:/docs/buildroot-documentation.html diff --git a/docs/buildroot-documentation.html b/docs/buildroot-documentation.html index 85cce4780..d23763987 100644 --- a/docs/buildroot-documentation.html +++ b/docs/buildroot-documentation.html @@ -17,7 +17,7 @@

Usage and documentation by Felix Fietkau and Waldemar Brodkorb, based on uClibc Buildroot documentation by Thomas Petazzoni. Contributions from Karsten Kruse, - Ned Ludd, Martin Herren.

+ Ned Ludd, Martin Herren. OpenWrt Kernel Module Creation Howto by Markus Becker.

Last modification : $Id$

@@ -37,6 +37,14 @@
  • Location of downloaded packages
  • Extending OpenWrt with more Software
  • Ressources
  • +
    +
  • About OpenWrt Kernel Module Compilation
  • +
  • Enable the kernel options
  • +
  • Create a buildroot option
  • +
  • Define the binary files for the kernel module
  • +
  • Specify the ipkg control file
  • +
  • Compile the kernel module
  • +

    About OpenWrt Buildroot

    @@ -87,11 +95,18 @@

    Obtaining OpenWrt Buildroot

    -

    OpenWrt Buildroot is available via CVS - Concurrent Version System. - For any kind of development you should get the latest version from cvs via:

    +

    OpenWrt Buildroot is available via SVN aka subversion. + For any kind of OpenWrt development you should get the latest version from svn via:

    - $ cvs -d:pserver:anonymous@openwrt.org:/openwrt co openwrt
    + $ svn co https://svn.openwrt.org/openwrt/trunk/
     
    +

    If you only like to create your own custom firmware images and packages we + strongly suggest to use the SVN branch of the stable version (whiterussian): +

    +
    + $ svn co https://svn.openwrt.org/openwrt/branches/whiterussian/
    +
    +

    Using OpenWrt Buildroot

    @@ -153,7 +168,7 @@ tools or packages, these changes will be lost.
  • Customize the target filesystem skeleton, available under - target/default/target_skeleton/. You can customize + package/base-files/default/. You can customize configuration files or other stuff here. However, the full file hierarchy is not yet present, because it's created during the compilation process. So you can't do everything on this target filesystem skeleton, but @@ -280,7 +295,7 @@ default) and the target filesystem skeleton. This directory will contain the final root filesystem. To set it up, it first deletes it, then it copies the skeleton available in target/default/target_skeleton - and then removes useless CVS/ directories.
  • + and then removes useless SVN/ directories.
  • Call the prepare, compile and install targets for the subdirectories toolchain, package @@ -593,7 +608,7 @@ foo-compile: bar-compile

    If you package software that might be useful for other persons, don't forget to send a patch to OpenWrt developers! - Use the mail address: patches@openwrt.org + Use the mail address: openwrt-devel@openwrt.org

    Resources

    @@ -602,5 +617,94 @@ foo-compile: bar-compile http://openwrt.org/

    + +
    +
    +

    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
    +
    +

    +
    +