OpenWrt and x86.

Building of openWrt for PC.

It is very useful to build openWrt for X86 by analysing of openWrt or by device developing based on openWrt. It makes the debug process much more quicker and understanding how it works comes faster. Let's learn doing this because it is fairly simply.

OpenWrt is evolving constantly and those step instructions that work today can be not working in some time. Probably it happens to the previous how-to that you can find on this web site. Nevertheless «make menuconfig» remains changeless :)). Therefore let's run it and apply the following configuration.

Target System:
<*> x86

Utilities:
filemanager:
<*> mc

Let's run make.

I think there are many ways to install OpenWrt on PC, therefore the version from this site doesn't pretend to anything, it is just a variant of installing that seemed interesting to me.

1) For installing of OpenWrt for x86 one should create a partitition on the hard disk drive for ex. by Acronis Partition Magic or by some other utility.

2) Let's mount the partitition like this:

mount /dev/sda6 /media/openwrt/

3) Let's copy the file system of openwrt from the directory /openwrtX86/bin/x86. Let's also create the directory /boot there and copy the kernel image «openwrt-x86-generic-vmlinuz» in this directory from here /openwrtX86/bin/x86/.

4) Let's unmount the partitition like this:

umount /media/openwrt

The installation is over, it is left to add an entry to the boot menu grub. Because I use burg, so burg is to be added to the boot menu.

To do this is quite simple. Sometimes I say "thank you" to myself that I was not lazy and wrote on the site what, where and how to be done because today one remembers it, but tomorrow doesn't. The same concerns how-to, today I remember about burg - tomorrow don't. Therefore I'd like to tell about burg setting step-by-step:
1) To make changes to the configuration file /etc/burg.d/40_custom, for the file looks like this:

#!/bin/sh

exec tail -n +3 $0

# This file provides an easy way to add custom menu entries. Simply type the

# menu entries you want to add after this comment. Be careful not to change

# the 'exec tail' line above.

menuentry 'OpenWrt' --class gnu-linux --class gnu --class os --group group_main {

insmod ext3

set root='(hd0,6)'

echo 'Loading OpenWrt kernel ...'

linux /boot/openwrt-x86-generic-vmlinuz root=/dev/sda6

}

2) To update the configuration burg, running the following command:

sudo update-burg

The current configuration burg is in the file /boot/burg/burg.cfg, It is not allowed to make changes in this file (that is written on the top). All changes can be made by the procedure
sudo update-burg

for deleting of needless lines in the burg menu:
1) uname -r
2) to delete the entries «linux-image-» of the nonusable versions by using of synaptic.
3) sudo update-burg

PC can be rebooted now.
The burg menu looks like this. It is unusual to see the word «openWrt» there :))

It is very useful to add a package with gcc by configuring of openWrt. Then we can get a fully-featured machine for programming.
On the stage of configuration the following modules are to be selected for adding of gcc to openWrt:
Global build settings:
Binary stripping method (none)
Development:
<*> gcc

The building and installation method of openWrt for PC, described above, can be useful by debugging of some hardware drivers or software. In general it is not complicated, but it is much more simply and faster to run openWrt on a virtual machine like «VMware Player» or «VM VirtualBox».

On the stage of configuration the following modules are to be selected for getting images of openWrt for «VMware Player» and «VM VirtualBox»:
Target Images:
<*> Build VirtualBox image files (VDI)
<*> Build VMware image files (VMDK)