Hamid Fadishei's Blog

October 13, 2012

Emulate OLinuxino Archlinux Image

Filed under: Uncategorized — fadishei @ 11:14 pm
Tags: , , , ,

OLinuxino is getting more and more popular for offering a good price-performance-size tradeoff. Archlinux now officially supports OLinuxino which means you have access to many prebuilt packages (openjdk, multimedia recorders and players, web servers, etc, etc) ready to be installed by the ‘pacman’ command.
A problem that you may still face as a developer is that due to the limited board resources, compiling programs and building new packages consumes lots of time, if possible at all.
If you want to use the power of your PC in develping for OLinuxino you can either setup a cross compilation environment or an emulation environment. In this post I describe an easy method for emulating the official Archlinux image of OLinuxino.

1. Download kernel, initrd, and filesystem provided by aurel32 for debian emulation from here
kernel: vmlinuz-2.6.32-5-versatile
initrd: initrd.img-2.6.32-5-versatile
filesystem image: debian_squeeze_armel_standard.qcow2

2. mount the first partition of debian_squeeze_armel_standard.qcow2 in /mnt (see here if you don’nt know how)

3. backup /mnt/lib/modules/* somewhere safe, then remove all the files in /mnt

4. extract the official OLinuxino Archlinux filesystem as root into /mnt

5. restore the the backup modules/* folder into /mnt/usr/lib/modules

6. Adjust the filesystem for changes posed by the emulation environment, such as:
change ttyAMA0 to tty1 in /mnt/etc/inittab
change usb0 to eth0 in /etc/rc.conf

7. unmount debian_squeeze_armel_standard.qcow2 and rename it to archlinux_olinuxino.qcow2

8. startup your emulated environment:
sudo qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.img-2.6.32-5-versatile -hda archlinux_olinuxino.qcow2 -append “root=/dev/sda1”

Advertisements

5 Comments »

  1. I’m getting errors:
    “Target filesystem doesn’t have requested /sbin/init”
    and
    “/bin/sh: can’t access tty: job control turned off”

    Could you help me with this?

    Comment by azerty88pl — November 6, 2012 @ 3:09 pm | Reply

    • Ok. I have overcome this issue. Now I have another one 🙂
      After machine boots up but before I can do anything with it I see a message:
      INIT: Id “s0” respawning too fast: disabled for 5 minutes
      and also during starup I stiil see error message regarding usb0:
      usb0: ERROR while getting interface flags: No such device.

      Any hints?

      Comment by azerty88pl — November 7, 2012 @ 2:58 pm | Reply

  2. After machine boots up but before I can do anything with it I see a message:
    INIT: Id “s0″ respawning too fast: disabled for 5 minutes
    and also during starup I stiil see error message regarding usb0:
    usb0: ERROR while getting interface flags: No such device.

    Any hints?

    Comment by azerty88pl — November 8, 2012 @ 7:31 am | Reply

    • I wonder whether you’ve followed Step 6.
      Regarding usb0 error, please note that in olinuxino-maxi, ethernet device is usb0 while in the emulated instance it is eth0.
      did you replace references to usb0 with eth0 in /etc/rc.conf?
      Regarding s0 error, you should replace ttyAMA0 with tty0 in /etc/inittab:

      Good luck!

      Comment by fadishei — November 8, 2012 @ 8:48 am | Reply

  3. Hi
    I will try your’s technote and it doesn’t works for me 😥
    I have a kernel panic at last.
    I have not found “ttyAMA0 to tty1 in /mnt/etc/inittab” and “/etc/rc.conf” perhaps image from A20-linux is not good ?
    HAve you any idea ?

    Thank you and congrat’

    Comment by Steph — January 25, 2014 @ 1:51 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: