OpenWRT playground » Historial » Revisió 13
« Anterior |
Revisió 13/16
(diferencies)
| Següent »
Xavier León, 15-07-2011 18:01
OpenWRT playground¶
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:
svn co svn://svn.openwrt.org/openwrt/branches/backfire
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.
cd backfire mkdir ../dl ln -s ../dl
Let's go to install all feeds (extra packages).
scripts/feeds update -a scripts/feeds install -a
And now we can start with configuration process:
make menuconfig make kernel_menuconfig
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:
make V=99
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:
dd if=openwrt-*-generic-combined-squashfs.img of=/dev/sdX
The first time openWRT boots, you can access using telnet to change the password.
telnet 192.168.1.1 passwd root reboot
After that, telnet session will disappear. Then you can use ssh to manage the device.
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
- /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
~/backfire/files
directory overwrites the base file system in~/backfire/build_dir/target-i386_uClibc-0.9.30.1/root-x86
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:
make sync DEPLOYMENT=openwrt PLC=myplc.pc.ac.upc.edu
where `openwrt` is the deployment tag of the node and myplc.pc.ac.upc.edu is the boot server of the PLC.
Testing ConfineLab environment (MyPLC + virtualized node with KVM)¶
Objective: Run a openwrt image using the MyPLC infrastructure to create and manage nodes (bootcd, bootstrapfs and bootmanager).
Requirements: MyPLC code (http://git.onelab.eu/ bootcd, bootstrapfs, bootmanager).
Very unfinished/disorganized (to understand some things you may have need to read the documentation provided by MyPLC).
myplc.pc.ac.upc.edu (http). MyPLC deployment (ConfineLab). Accessible through http. If you want to play with it, just create a new account (below the login box, remember to associate the account to the UPC site) and I will give you admin access.
We prepared in sorma2.pc.ac.upc.edu (root:openwrt11confine) a openwrt build environment (to create openwrt custom images) and a virtual node environment to execute a node on ConfineLab (the PlanetLab/OpenWRT test environment).
Steps:
- install virt-manager package on your PC (there are mainstream packages for ubuntu/fedora).
- connect to the libvirtd daemon in sorma2.pc.ac.upc.edu through virt-manager (it will ask for the root pass of sorma2.pc).
- start de virtual machine (called openwrt1.pc.ac.upc.edu)
- > sorma2.pc is configured to use a bridge interface so the virtual machine is able to get a public IP for testing (already registered on the DAC network).
- > this virtual machine has a bootCD attached (an image of the BootCD actually) which checks the state of the node with MyPLC. If the state is `boot`, the node will try to boot from the hard drive. If the state is `reinstall`, the node will pull a bootstrapfs (/var/www/html/boot/bootstrapfs-openwrt.tar.bz2 on myplc.pc.ac.upc.edu).
- This bootstrapfs is selected because in MyPLC with have defined this node with the `deployment` tag = `openwrt`. If we don't do this, it will download the regular image which is a Fedora based system already prepared for running on MyPLC (not based on openwrt).
How to create bootstrapfs-openwrt.tar.bz2¶
Read sections before `Testing ConfineLab`.
Once we have an image on ~/backfire/bin/x86/openwrt*, execute the script in ~/backfire/genera_imatge.sh
This script do:
- decompresses the openwrt rootfs
- includes a boot directory with the openwrt kernel and some necessary files for the boot process to succeed (/dev/random, /dev/null, etc.). They may not be necessary in the future if we change the bootmanager behaviour.
- connects to myplc.pc.ac.upc.edu to put the image on the corresponding directory (/var/www/html/boot).
Problems so far:
- The node's fs is installed and configured with LVM.
- Kernel Panic in the last step of the boot process (when changing from the kernel of the bootcd to the openwrt kernel). I have the impression it's something related to modules not compiled in the kernel althgouh I have compiled the kernel with LVM support in it (not as modules but inside the kernel). We may need a initrd image but I haven't found a way to create an initrd image for openwrt so far (you can create a WHOLE INITRAMDDISK, but it will not apply changes to the HD).
Maybe we should change how the bootmanager manages the partition.
If you need to change the bootmanager code¶
Within your source tree (pulled from the git repo), change whatever you want and do:
To deploy the new code, from the source tree (and once the code has been modified) just do:
make sync DEPLOYMENT=openwrt PLC=myplc.pc.ac.upc.edu
where `openwrt` is the deployment tag of the node and myplc.pc.ac.upc.edu is the boot server of the PLC.
Remember!
If you change the bootstrapfs the node has to use, you need to set it as reinstall on MyPLC.¶
Actualitzat per Xavier León fa més de 13 anys · 13 revisions