Italiano English
Modifica History Actions

Differenze per "OpenWRT-UML-Netkit"

Differenze tra le versioni 1 e 2
Versione 1 del 2009-12-09 18:04:35
Dimensione: 1486
Autore: ZioPRoTo
Commento:
Versione 2 del 2009-12-09 18:07:50
Dimensione: 2038
Autore: ZioPRoTo
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 48: Linea 48:
== Adjust inittab ==


== Notes ==
=== Remount Read Write ===
Linea 57: Linea 54:

=== Adjust inittab ===

Original {{{/etc/inittab}}} in OpenWRT looks like this:

{{{
root@OpenWrt:/# cat /etc/init
/etc/init.d/ /etc/inittab
root@OpenWrt:/# cat /etc/inittab
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tts/0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
root@OpenWrt:/#
}}}

modify like this:
{{{
root@OpenWrt:/# cat /etc/inittab
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tty0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
root@OpenWrt:/#
}}}

Notes on OpenWRT UML + Netkit

The goal of this guide is to use Netkit with OpenWRT hosts in the emulated environment.

UML binaries are built with the host toolchain and are meant to run on the host they were built on.

We used a Gentoo machine amd64 profile (64bit processor)

Create OpenWRT UML images

Download and compile OpenWRT for the UML target (tested at 9/12/2009 revision 18717)

svn co svn://svn.openwrt.org/openwrt/trunk/
cd trunk
make menuconfig

select the UML target and compile

we are using the following CHOST x86_64-pc-linux-gnu-4.3.4

we had a problem with some script looking for a lib64 dir that was not existing, solved like this:

cd $trunk_dir$/staging_dir/toolchain-x86_64_gcc-4.1.2_uClibc-0.9.30.1/
ln -s lib lib64

if the firmware compiles you have the binaries in $trunk_dir$/bin/uml

Test the UML binary

To test if your UML binary boots just use the guide from zoobab http://www.zoobab.com/openwrt-and-user-mode-linux

Integrate in Netkit

Launch in Netkit like this:

cd bin/uml
vstart openwrt --eth0=0 --con0=xterm --con1=xterm --verbose -m openwrt-uml-ext2.img -k ./openwrt-uml-vmlinux

You will have a OpenWRT machine launched within Netkit, but only the second terminal is properly working for now, adjust inittab (see later)

Remount Read Write

To remount the filesystem readwrite

mount --remount -o rw /dev/root /

Adjust inittab

Original /etc/inittab in OpenWRT looks like this:

root@OpenWrt:/# cat /etc/init
/etc/init.d/  /etc/inittab
root@OpenWrt:/# cat /etc/inittab 
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tts/0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
root@OpenWrt:/# 

modify like this:

root@OpenWrt:/# cat /etc/inittab 
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tty0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
root@OpenWrt:/#