You are here: TWiki > LinuxDevTools Web > SboxQemuAnother r8 - 11 Jun 2007 - 12:51 - PeterPearse


Start of topic | Skip to actions

Log Of Another Scratchbox qemu Installation

Construct VMWare Machine

Used a Red Hat Enterprise 4 32 bit image.
No problems, other than that, on my network, I have to by pass the Red Hat Login screen by taking the "Why Register?" option.
Then I have to ask the administrator to register my image.

Ubuntu

Later I realised using a Ubuntu image might make life easier, since then both scratchbox & it's host would speak Debian....

Build qemu

  • Had to install these rpms to supply SDL.h to satisfy configure that SDL was installed.
    • rpm -i rpms/alsa-lib-devel-1.0.6-5.RHEL4.i386.rpm (required by SDL-devel)
    • rpm -i rpms/SDL-devel-1.2.7-8.i386.rpm
Since I don't speak rpm I had to find out
  • The source rpms are provided with the distribution but not installed by default.
    Our network has them with the boot images.
  • The command to list the files in an uninstalled package is
    rpm -query -p -l rpms/SDL-devel-1.2.7-8.i386.rpm

Kernel

Used an unpatched 2.6.21
Made initrd size 16384
Built with 2007q1-10 toolchain

Make initrd file system

Made from ARM_Embedded_Linux-2.3.0
First was too large - had to use a framebuffer reference system with no optional packages. Added in the existing sbrsh files - TODO Patch sbrsh-7.4 with my redirection patches.

Set up TAP for model

Had to install bridge-utils

Run model

OK.
Won't mount external drives until the VMWare machine firewall is turned off.
Wont mount the scratchbox drives (to /mnt) until their ids are added to the VMWare /etc/hosts

Install scratchbox

Up to host qemu OK.
sbrsh OK (once the scratchbox drives could be mounted - see above)
but still has the timing problem

Add latest CodeSourcery arm toolchain as foreign toolchain

  • darcs failing from scratchbox
    Need to /sbin/dhclient br0
    to get the bridge on the network, rather than eth0
  • ran make CONFIG=meta/alien-tc/arm-2007q1_arm.conf -C meta/alien-tc
    twice to overcome error
  • had to link include/C== from arm-none-linux-gnueabi/include/c++
  • Re-run gives patching errors - assumed OK
  • Need newly rebuilt sbrshd in file system
  • Added it to qemu230_initrd_new_sbrshd
  • had to configure with sbrsh-conf rather than in sb-menu
  • Hello world runs.

Apt-get, darcs problems

If the scratchbox cant access the internet e.g.
[sbox-host_qemu: ~] > darcs get --set-scripts-executable http://scratchbox.org/repos/1.0/sb-toolchain-extras
Invalid repository:  http://scratchbox.org/repos/1.0/sb-toolchain-extras
darcs failed:  Failed to download URL http://scratchbox.org/repos/1.0/sb-toolchain-extras/_darcs/inventory
libcurl: couldn't resolve host
then edit /scratchbox/etc/nsswitch.conf to the hosts line:
# Original:: hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
# Suggested::
hosts:          files dns

Install Prebuilt armel X11

  • Changed all three environment variables from arm to armel
[sbox-2007q1_arm_sq: ~] > set | grep arm
ARCH=arm
SBOX_DPKG_INST_ARCH=arm
SBOX_UNAME_MACHINE=arm
target=2007q1_arm_sq
  • libx11-dev is probably all we need but the dependecies say it depends on x11-common >br> Could probably force but experience suggests its best to accept defeat.....
  • and everything will argue about debconf.....
  • used --force-configure-any on debconf-english
  • needed perl-base as well
  • now lsb-base && debianutils
  • ncurses-bin
  • sed
  • coreutils

Remembered how Debian works

Can't (easily) install armel libc6 without losing the CodeSourcery one
if you empty LD_LIBRARY_PATH, the complains about ld. So
  • Use apt-get -d install to get the package, or copy direct from armel
  • dpkg -i it
  • Most will need --force-depends to get past libc6
TODO:: Fiddle debconf database to indicate libc6 is installed

My Preferred Networking Setup

Allows
  1. Connection to model as sbrsh for scratchbox
  2. Model can mount drives from remote hosts
  3. Scratchbox host (Vmware) can browse web allowing Debian package update
  • VmWare machine starts with bridged ethernet
  • Firewall is off
  • Make a bridge
    - /usr/sin/brctl addbr br0
  • Take down the ethernet
    - /sbin/ifconfig eth0 down
  • Add it to the bridge
    - /usr/sbin/brctl addif eth0
  • Kill any dhclient
    - process ps ax | grep dhclient
    - kill -9 <dhclient process if found>
  • Bring up the ethernet interface without an IP address
    - /sbin/ifconfig eth0 0.0.0.0 up
  • Run dhclient to get an address for the bridge
    - /sbin/dhclient br0
  • Set up model /etc/qemu-ifup as
#!/bin/sh
# Add tap0 to br0
/sbin/ifconfig $1 up
/usr/sbin/brctl addif br0 $1
  • Start the model
qemu-system-arm -M versatilepb -kernel <some zImage> -append "console=ttyAMA0 mem=128M root=/dev/ram0" -initrd <some initrd file system> -nographic -net nic -net tap
  • Add ip=dhcp to the command line to get a dynamic ipaddress for the model.
    Now you can telnet in from anywhere on the network.....
  • To NFS mount the rootfs on the model, drop the -inintrd parameter and add the necessary commands to the kernel command line.
      ip=dhcp root=/dev/nfs nfsroot=<exported root fs>

-- PeterPearse - 30 May 2007

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r8 < r7 < r6 < r5 < r4 | More topic actions
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Use of this site is governed by these TermsAndConditions
Ideas, requests, problems regarding TWiki? Send feedback