Projecte

General

Perfil

OpenWRT playground » Historial » Revisió 11

Revisió 10 (Xavier León, 12-07-2011 09:58) → Revisió 11/16 (Xavier León, 12-07-2011 10:18)

h1. OpenWRT playground 

 h2. Preparing build scenario 

 You need some packages like: gcc, make, zlib, flex, quilt, subversion and some others. Also you need to install the devel packages of each of them. But don't worry about this, during the compilation process openwrt will tell you which one is missing. 

 First of all we are going to download the sources: 
 <pre> 
 svn co svn://svn.openwrt.org/openwrt/branches/backfire 
 </pre> 

 A good practice is to put download directory (where all packages will be stored) outside your source directoy. By this way you can use it for more source checkouts. 

 <pre> 
 cd backfire 
 mkdir ../dl 
 ln -s ../dl 
 </pre> 

 Let's go to install all feeds (extra packages). 
 <pre> 
 scripts/feeds update -a 
 scripts/feeds install -a 
 </pre> 

 And now we can start with configuration process: 
 <pre> 
 make menuconfig 
 make kernel_menuconfig 
 </pre> 

 menuconfig: you can select the packages you want to have inside your system installed (*) or only avaiable to install (M) 
 kernel_menuconfig: this is the standard menuconfig of the linux vanilla kernel 

 Then we can start compilation: 
 <pre> 
 make V=99 
 </pre> 
 First time it can have one or more hours. 

 If all goes fine. You will find the images ready to install inside: bin/ARCH/openwrt-* 

 For instance, if you want to use squashfs image using a USB pendrive, SD or CF: 
 <pre> 
 dd if=openwrt-*-generic-combined-squashfs.img of=/dev/sdX 
 </pre> 

 The first time openWRT boots, you can access using telnet to change the password. 

 <pre> 
 telnet 192.168.1.1 
   passwd root 
   reboot 
 </pre> 

 After that, telnet session will disappear. Then you can use ssh to manage the device. 

 h2. PlanetLab & OpenWRT 

 - PlanetLab boot process mail http://lists.planet-lab.org/pipermail/devel/2006-November/001739.html 

 Requirements: 
 Need packages: 
 * /bin/bash 
 * python 
 * perl 
 * lvm2 

 Filesystem: 
 * /etc/resolv.conf cannot    be a symbolic link 
 * /boot should be copied from build_dir/linux*/root.grub/boot (script in /home/xleon) 
 * Everything you put on <pre>~/backfire/files</pre> directory overwrites the base file system in <pre>~/backfire/build_dir/target-i386_uClibc-0.9.30.1/root-x86</pre> 

 once copied in myplc, remember to do a sha1sum of the bootstrapfs-openwrt.... 

 Problems: 
 the BootManager code needs to update the rpm database with the PLC ssh keys... but the rpm version of busybox does not allow that. 

 Need to change the BootManager code. To deploy the new code, from the source tree (and once the code has been modified) just do: 
 <pre>make sync DEPLOYMENT=openwrt DEPOLOYMENT=openwrt PLC=myplc.pc.ac.upc.edu</pre> 
 where `openwrt` is the deployment tag of the node and myplc.pc.ac.upc.edu is the boot server of the PLC.