Compilation de OpenWRT.
Compilation de l’image OpenWrt pour Raspberry Pi avec le kernel v3.6
Distribution : Ubuntu 12.04
1) Sous Ubuntu, installation des paquetages de développement :
[~] ➔ sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip
2) Répertoire de travail :
[~] ➔ mkdir RPIOPENWRT [~] ➔ cd RPIOPENWRT/ [~/RPIOPENWRT] ➔
3) Téléchargement du code source :
[~/RPIOPENWRT] ➔ git clone git://git.openwrt.org/openwrt.git
4) Téléchargement des paquetages :
[~/RPIOPENWRT] ➔ cd openwrt/ [~/RPIOPENWRT/openwrt (master)] ➔ mkdir dl [~/RPIOPENWRT/openwrt (master)] ➔ ./scripts/feeds update -a [~/RPIOPENWRT/openwrt (master)] ➔ ./scripts/feeds install -a
5) Vérification :
[~/RPIOPENWRT/openwrt (master)] ➔ make defconfig [~/RPIOPENWRT/openwrt (master)] ➔ make prereq
6) Téléchargement du kernel :
[~/RPIOPENWRT/openwrt (master)] ➔ cd .. [~/RPIOPENWRT] ➔ mkdir tmp [~/RPIOPENWRT] ➔ cd tmp/ [~/RPIOPENWRT/tmp] ➔ wget https://github.com/raspberrypi/linux/archive/rpi-3.6.y.tar.gz [~/RPIOPENWRT/tmp] ➔ tar xfvz rpi-3.6.y.tar.gz
7) Préparation de l’archive du kernel :
[~/RPIOPENWRT/tmp] ➔ mv linux-rpi-3.6.y linux-3.6.11 [~/RPIOPENWRT/tmp] ➔ tar cvf - linux-3.6.11/ | lzma > linux-3.6.11.tar.xz [~/RPIOPENWRT/tmp] ➔ mv linux-3.6.11.tar.xz ../openwrt/dl/ [~/RPIOPENWRT/tmp] ➔ cd ../openwrt/
8) Configuration du Makefile :
Ouvrir :
target/linux/brcm2708/Makefile
Chercher :
LINUX_VERSION:=3.10.15
Remplacer par :
LINUX_VERSION:=3.6.11
9) Préparation des patchs :
[~/RPIOPENWRT/openwrt (master)⚡] ➔ cd target/linux/brcm2708/ [~/RPIOPENWRT/openwrt/target/linux/brcm2708 (master)⚡] ➔ mkdir patches-3.6 [~/RPIOPENWRT/openwrt/target/linux/brcm2708 (master)⚡] ➔ cp config-3.10 config-3.6 [~/RPIOPENWRT/openwrt/target/linux/brcm2708 (master)⚡] ➔ cd ../generic/
Supprimer les patchs inutils :
[~/RPIOPENWRT/openwrt/target/linux/generic (master)⚡] ➔ cd patches-3.6 [~/RPIOPENWRT/openwrt/target/linux/generic/patches-3.6 (master)⚡] ➔ rm *-mips* [~/RPIOPENWRT/openwrt/target/linux/generic/patches-3.6 (master)⚡] ➔ rm *-phy* [~/RPIOPENWRT/openwrt/target/linux/generic/patches-3.6 (master)⚡] ➔ rm a* [~/RPIOPENWRT/openwrt/target/linux/generic/patches-3.6 (master)⚡] ➔ rm 880-gateworks_system_controller.patch [~/RPIOPENWRT/openwrt/target/linux/generic/patches-3.6 (master)⚡] ➔ cd ../../../.. [~/RPIOPENWRT/openwrt (master)⚡] ➔
10) Configuration de la compilation :
– Target System
– < Select >
– Target System : Broadcom BCM2708/BCM235
– < Select >
– < Save >
– < Ok >
– < Exit >
– < Exit >
11) Extrait le noyau et le patch :
[~/RPIOPENWRT/openwrt (master)⚡] ➔ make target/linux/{clean,prepare} V=99
12) Construction des outils de compilation :
[~/RPIOPENWRT/openwrt (master)⚡] ➔ make kernel_oldconfig
13) Configuration du kernel :
[~/RPIOPENWRT/openwrt (master)⚡] ➔ make kernel_menuconfig
14) Configuration du noyau :
[~/RPIOPENWRT/openwrt (master)⚡] ➔ make kernel_menuconfig
– Image configuration
– [Espace]
– < Select >
– Image configuration
– < Select >
– Version configuration options
– [Espace]
– < Select >
– Release repository (NEW)
– < Select >
– http://downloads.openwrt.org/attitude_adjustment/12.09/%T/generic/packages
– < Ok >
– < Exit >
– < Exit >
– Target Images
– < Select >
– Root filesystem partition size
– < Select >
– 64
– < Ok >
– < Exit >
– < Save >
– < Ok >
– < Exit >
– < Exit >
15) Compilation :
[~/RPIOPENWRT/openwrt (master)⚡] ➔ make V=99 -j 3
16) Vérification :
[~/RPIOPENWRT/openwrt (master)⚡] ➔ ls -l bin/brcm2708 total 155068 -rw-r--r-- 1 util01 util01 189 oct. 15 23:53 md5sums -rw-r--r-- 1 util01 util01 67108864 oct. 15 23:53 openwrt-brcm2708-ext4.img -rwxr-xr-x 1 util01 util01 3586852 oct. 15 23:53 openwrt-brcm2708-Image -rw-r--r-- 1 util01 util01 96468992 oct. 15 23:53 openwrt-brcm2708-sdcard-vfat-ext4.img drwxr-xr-x 2 util01 util01 4096 oct. 15 23:53 packages
17) Lien :
http://www.nico-maas.de/wordpress/?p=799