Skip to content

openwrtCustomKernel

jcard0na edited this page Mar 1, 2012 · 4 revisions

Build openwrt with custom kernel and wpa_supplicant

  1. Point to our kernel git tree

make menuconfig

Advanced configuration options (for developers)
-> Enter git repository to clone
-> git://o11s.org/open80211s.git

Kernel Modules
-> Wireless Drivers
  -> mac80211

Networking
-> wpa_supplicant
  -> choose openssl as TLS provider

Look at ./include/kernel-defaults.mk for other external kernel configuration options (local tree, git local reference, etc.)

If you've built your toolchain for another kernel, you'll have to rebuild it:


make toolchain/clean
make target/linux/clean
make

UPDATE: I could ONLY get an external kernel to build under a fresh checkout of openwrt.

  1. Enable mesh in the kernel

make kernel_menuconfig
 networking support -> wireless -> generic IEEE 802.11 stack ->
     Enable mac80211 mesh networking (pre-802.11s) support
  1. Include elliptic curves support in openssl

Edit package/openssl/Makefile


- OPENSSL_OPTIONS:= shared no-err no-ec no-hw no-threads zlib-dynamic no-sse2
+ OPENSSL_OPTIONS:= shared no-err no-hw no-threads zlib-dynamic no-sse2
  1. Use our wpa_supplicant fork

Clean up previous hostapd tarfile, if any.


make package/hostapd/clean V=99
rm dl/hostapd-*

Edit package/hostapd/Makefile


+PKG_SOURCE_URL:=git://github.com/cozybit/hostap-sae.git

Edit package/hostapd/files/wpa_supplicant-full.config


CONFIG_MESH_RSN=y
CONFIG_DRIVER_NL80211=y

HACK: I don't know how to make openwrt to pull from git. Workaround: overwrite the downloaded file.


make package/hostapd
ls dl/hostap*
  dl/hostapd-20100705.tar.bz2
cp -r /path/to/your/hostapd hostapd-20100705
tar tvjf hostapd-20100705.tar.bz hostapd-20100705 --exclude .git
cp hostapd-20100705.tar.bz dl/hostapd-20100705.tar.bz2
make package/hostapd/clean
make package/hostapd/compile V=99

If you trust your hostapd to be newer than the openwrt release, wipe out all its patches:


rm -f ./package/hostapd/patches/*

Other useful openwrt recipes

  1. Create your network config file under files/etc/config/network

config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option ifname   eth0
        option proto    dhcp

Fixes

  1. iptables has lots of kernel dependencies. Given we don't need it for development, it is better to disable it (i could not get it to build anyway). Just mv package/iptables/Makefile{,.gone}
Clone this wiki locally