HOWTO: Compile your own OpenWrt firmware with the OpenWRT buildroot
Compiling OpenWrt from the buildroot allows you to make modifications to the Linux kernel and other source code. If you just want to edit scripts, files etc. then use the BuildHowto. More information on the buildroot can be found here.
Note that you will probably need at lest 1GB of free space available to use the buildroot.
OpenWrt-3G current changes to buildroot
- Modified comgt package.
Old 3G scripts for button, led, etc. are removed.
- Patched usbserial module for maxDSize and maxUSize parameters.
The patch can be found in /whiterussian/openwrt/target/linux/linux-2.4/patches/generic/219-usbserial_buffer.patch
- Patched usbserial module for 3G card detection with prod and vendor ID's.
The patch can be found in /whiterussian/openwrt/target/linux/linux-2.4/patches/generic/220-usbserial_3g_cards.patch
Install prerequisites
The following programs need to be installed: build-essential binutils flex bison autoconf gettext texinfo sharutils libncurses5-dev ncurses-term zlib1g-dev gcc-3.4 subversion
Commands differ per distribution, this command for Ubuntu installs all the prerequisites (run in a terminal):
sudo aptitude install build-essential binutils flex bison autoconf gettext texinfo sharutils subversion libncurses5-dev ncurses-term zlib1g-dev gcc-3.4
Downgrade GCC to 3.4
Using GCC newer than 3.4 can create errors with the buildroot.
To downgrade, run in a terminal:
sudo ln -sf /usr/bin/gcc-3.4 /usr/bin/gcc
Set up the OpenWrt buildroot
Download the OpenWrt White Russian 0.9 buildroot via SVN. In a terminal, cd to the folder that you want the buildroot to be downloaded, such as your home folder. Then, run these commands:
svn co https://svn.openwrt.org/openwrt/branches/whiterussian/ rm ./whiterussian/openwrt/package/comgt svn export --force http://tools.assembla.com/svn/openwrt-3g/trunk/buildroot/whiterussian/
Make your modifications to the buildroot
Again, more information on the OpenWrt buildroot can be found here.
Select options for the OpenWrt buildroot
In a terminal, cd to your /whiterussian/openwrt/ folder. In that same terminal, run
make menuconfig
Here you can choose what you want compiled into your firmware or as packages. Whatever has a * will be compiled into the firmware. Whatever has an M will be compiled as a package, which can be installed on a router seperately or used in the imagebuilder.
When you are done, save your changes and exit.
Compile OpenWrt
This will take some time, as a substantial amount of files need to be downloaded, and the compiler needs to run. This could take an hour or more, depending on how much needs to be compiled. To start the compiling process, in /whiterussian/openwrt/, run:
make
When make finishes, your compiled firmware can be found in /whiterussian/openwrt/bin/. Packages can be found in /whiterussian/openwrt/bin/packages/.
You can use your compiled packages in the imagebuilder, by placing the packages into /imagebuilder/packages/ then adding the package name to a list in /imagebuilder/lists/. Read more about using the imagebuilder at the BuildHowto page.