Test Openmoko Emulation with chroot image

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (outdated)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
There is an image to provide a fresh Ubuntu 7.04 (feisty) containing the OpenMoko installation as generated by [[MokoMakefile]] including working [[OpenMoko under QEMU|QEMU]].
+
{{Languages|Test Openmoko Emulation with chroot image}}
 +
There is an image to provide a fresh Ubuntu 7.04 (feisty) containing the Openmoko installation as generated by [[MokoMakefile]] including working [[Openmoko under QEMU|QEMU]].
  
  
Line 7: Line 8:
  
  
If you do just want to test some of the functionality and need a starting point,  
+
If you do just want to test some of the functionality and need a starting point,
you can download an ext3 Image.  
+
you can download an ext3 Image.
  
 
The Image is just a first test and may contain errors as it's not tested well yet
 
The Image is just a first test and may contain errors as it's not tested well yet
Line 16: Line 17:
 
=== Installation ===
 
=== Installation ===
  
Get the Image (about 3.2 GB) from http://b030.tfh-berlin.de/OpenMoko-Dev-x86_2007-07-16.img.bz2:
+
Get the Image (about 3.2 GB) from http://b030.tfh-berlin.de/Openmoko-Dev-x86_2007-07-16.img.bz2:
wget http://b030.tfh-berlin.de/OpenMoko-Dev-x86_2007-07-16.img.bz2
+
wget http://b030.tfh-berlin.de/Openmoko-Dev-x86_2007-07-16.img.bz2
  
  
 
Check the md5sum:
 
Check the md5sum:
md5sum OpenMoko-Dev-x86_2007-07-16.img.bz2
+
md5sum Openmoko-Dev-x86_2007-07-16.img.bz2
# it print "41715e06d7e59a94e4f05cf33ba054b5  OpenMoko-Dev-x86_2007-07-16.img.bz2"
+
# it print "41715e06d7e59a94e4f05cf33ba054b5  Openmoko-Dev-x86_2007-07-16.img.bz2"
  
  
Line 28: Line 29:
 
and loop back device support in your kernel.
 
and loop back device support in your kernel.
  
bzip2 -d OpenMoko-Dev-x86_2007-07-16.img.bz2
+
bzip2 -d Openmoko-Dev-x86_2007-07-16.img.bz2
  
 
To install chroot in GNU/Debian / Ubuntu you can use:
 
To install chroot in GNU/Debian / Ubuntu you can use:
  
sudo sh
+
sudo sh
apt-get install dchroot
+
apt-get install dchroot
  
  
 
==== To mount and activate the chroot image use ====
 
==== To mount and activate the chroot image use ====
  
mkdir /var/chroot
+
mkdir /var/chroot
mount -o loop OpenMoko-Dev-x86_2007-07-16.img /var/chroot
+
mount -o loop Openmoko-Dev-x86_2007-07-16.img /var/chroot
  
 
Add a new chroot configuration:
 
Add a new chroot configuration:
  
echo "OpenMoko /var/chroot" | tee -a /etc/dchroot.conf
+
echo "Openmoko /var/chroot" | tee -a /etc/dchroot.conf
  
 
Edit /etc/fstab and insert:
 
Edit /etc/fstab and insert:
/tmp            /var/chroot/tmp        none    bind            0      0  
+
/tmp            /var/chroot/tmp        none    bind            0      0
proc-chroot    /var/chroot/proc        proc    defaults        0      0  
+
proc-chroot    /var/chroot/proc        proc    defaults        0      0
devpts-chroot  /var/chroot/dev/pts    devpts  defaults        0      0  
+
devpts-chroot  /var/chroot/dev/pts    devpts  defaults        0      0
  
 
Tell mount to re-scan fstab and mount the new directories automatically:
 
Tell mount to re-scan fstab and mount the new directories automatically:
mount -a
+
mount -a
  
 
(optional) Manual mount:  If you do not want the system to mount these directories at boot, they can instead be mounted by hand.  Note that this will need to be repeated each time the system is rebooted:
 
(optional) Manual mount:  If you do not want the system to mount these directories at boot, they can instead be mounted by hand.  Note that this will need to be repeated each time the system is rebooted:
mount -o bind /tmp /var/chroot/tmp
+
mount -o bind /tmp /var/chroot/tmp
mount -t proc proc-chroot /var/chroot/proc
+
mount -t proc proc-chroot /var/chroot/proc
mount -t devpts devpts-chroot /var/chroot/dev/pts
+
mount -t devpts devpts-chroot /var/chroot/dev/pts
  
 
Copy your /etc/resolv.conf:
 
Copy your /etc/resolv.conf:
cp /etc/resolv.conf /var/chroot/etc/
+
cp /etc/resolv.conf /var/chroot/etc/
  
 
As the user who started X11:
 
As the user who started X11:
xhost +                  # assuming you are behind NAT
+
xhost +                  # assuming you are behind NAT
  
 
Start the chroot environment (as root again):
 
Start the chroot environment (as root again):
dchroot -d -c OpenMoko   # -d to take the environment variables with you
+
dchroot -d -c Openmoko   # -d to take the environment variables with you
  
 
=== Starting the Emulation ===
 
=== Starting the Emulation ===
  
 
You can start the emulation by running:
 
You can start the emulation by running:
cd /home/moko/openmoko/trunk/src/host/qemu-neo1973/
+
cd /home/moko/openmoko/trunk/src/host/qemu-neo1973/
export DISPLAY=:0.0
+
export DISPLAY=:0.0
arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image \
+
arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image \
-kernel openmoko/openmoko-kernel.bin -usb -show-cursor -usbdevice keyboard
+
-kernel openmoko/openmoko-kernel.bin -usb -show-cursor -usbdevice keyboard
  
 
=== Additional Notes ===
 
=== Additional Notes ===
  
There is no root password set and no user moko in the systems right now which should  
+
There is no root password set and no user moko in the systems right now which should
 
not be a problem when used in an emulator or a chroot environment, here you have both.
 
not be a problem when used in an emulator or a chroot environment, here you have both.
  
[[Category:Developer software]]
+
[[Category:Emulation]]
[[Category:Guides]]
+

Latest revision as of 10:19, 24 October 2008

There is an image to provide a fresh Ubuntu 7.04 (feisty) containing the Openmoko installation as generated by MokoMakefile including working QEMU.


Contents

[edit] Usage of the chroot image

NOTE: This Image is outdated (OM 2007.1)



If you do just want to test some of the functionality and need a starting point, you can download an ext3 Image.

The Image is just a first test and may contain errors as it's not tested well yet (and the build process was not running through without user interferences).


[edit] Installation

Get the Image (about 3.2 GB) from http://b030.tfh-berlin.de/Openmoko-Dev-x86_2007-07-16.img.bz2: wget http://b030.tfh-berlin.de/Openmoko-Dev-x86_2007-07-16.img.bz2


Check the md5sum: md5sum Openmoko-Dev-x86_2007-07-16.img.bz2

  1. it print "41715e06d7e59a94e4f05cf33ba054b5 Openmoko-Dev-x86_2007-07-16.img.bz2"


You will need to decompress the Image (about 15 Gbyte). An you'll also need the chroot software and loop back device support in your kernel.

bzip2 -d Openmoko-Dev-x86_2007-07-16.img.bz2

To install chroot in GNU/Debian / Ubuntu you can use:

sudo sh apt-get install dchroot


[edit] To mount and activate the chroot image use

mkdir /var/chroot mount -o loop Openmoko-Dev-x86_2007-07-16.img /var/chroot

Add a new chroot configuration:

echo "Openmoko /var/chroot" | tee -a /etc/dchroot.conf

Edit /etc/fstab and insert: /tmp /var/chroot/tmp none bind 0 0 proc-chroot /var/chroot/proc proc defaults 0 0 devpts-chroot /var/chroot/dev/pts devpts defaults 0 0

Tell mount to re-scan fstab and mount the new directories automatically: mount -a

(optional) Manual mount: If you do not want the system to mount these directories at boot, they can instead be mounted by hand. Note that this will need to be repeated each time the system is rebooted: mount -o bind /tmp /var/chroot/tmp mount -t proc proc-chroot /var/chroot/proc mount -t devpts devpts-chroot /var/chroot/dev/pts

Copy your /etc/resolv.conf: cp /etc/resolv.conf /var/chroot/etc/

As the user who started X11: xhost + # assuming you are behind NAT

Start the chroot environment (as root again): dchroot -d -c Openmoko # -d to take the environment variables with you

[edit] Starting the Emulation

You can start the emulation by running: cd /home/moko/openmoko/trunk/src/host/qemu-neo1973/ export DISPLAY=:0.0 arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image \ -kernel openmoko/openmoko-kernel.bin -usb -show-cursor -usbdevice keyboard

[edit] Additional Notes

There is no root password set and no user moko in the systems right now which should not be a problem when used in an emulator or a chroot environment, here you have both.

Personal tools

There is an image to provide a fresh Ubuntu 7.04 (feisty) containing the OpenMoko installation as generated by MokoMakefile including working QEMU.


Usage of the chroot image

NOTE: This Image is outdated (OM 2007.1)



If you do just want to test some of the functionality and need a starting point, you can download an ext3 Image.

The Image is just a first test and may contain errors as it's not tested well yet (and the build process was not running through without user interferences).


Installation

Get the Image (about 3.2 GB) from http://b030.tfh-berlin.de/OpenMoko-Dev-x86_2007-07-16.img.bz2:

wget http://b030.tfh-berlin.de/OpenMoko-Dev-x86_2007-07-16.img.bz2


Check the md5sum:

md5sum OpenMoko-Dev-x86_2007-07-16.img.bz2
# it print "41715e06d7e59a94e4f05cf33ba054b5  OpenMoko-Dev-x86_2007-07-16.img.bz2"


You will need to decompress the Image (about 15 Gbyte). An you'll also need the chroot software and loop back device support in your kernel.

bzip2 -d OpenMoko-Dev-x86_2007-07-16.img.bz2

To install chroot in GNU/Debian / Ubuntu you can use:

sudo sh
apt-get install dchroot


To mount and activate the chroot image use

mkdir /var/chroot
mount -o loop OpenMoko-Dev-x86_2007-07-16.img /var/chroot

Add a new chroot configuration:

echo "OpenMoko /var/chroot" | tee -a /etc/dchroot.conf

Edit /etc/fstab and insert:

/tmp            /var/chroot/tmp         none    bind            0       0 
proc-chroot     /var/chroot/proc        proc    defaults        0       0 
devpts-chroot   /var/chroot/dev/pts     devpts  defaults        0       0 

Tell mount to re-scan fstab and mount the new directories automatically:

mount -a

(optional) Manual mount: If you do not want the system to mount these directories at boot, they can instead be mounted by hand. Note that this will need to be repeated each time the system is rebooted:

mount -o bind /tmp /var/chroot/tmp
mount -t proc proc-chroot /var/chroot/proc
mount -t devpts devpts-chroot /var/chroot/dev/pts

Copy your /etc/resolv.conf:

cp /etc/resolv.conf /var/chroot/etc/

As the user who started X11:

xhost +                   # assuming you are behind NAT

Start the chroot environment (as root again):

dchroot -d -c OpenMoko    # -d to take the environment variables with you

Starting the Emulation

You can start the emulation by running:

cd /home/moko/openmoko/trunk/src/host/qemu-neo1973/
export DISPLAY=:0.0
arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image \
-kernel openmoko/openmoko-kernel.bin -usb -show-cursor -usbdevice keyboard

Additional Notes

There is no root password set and no user moko in the systems right now which should not be a problem when used in an emulator or a chroot environment, here you have both.