Running Puppy ARM for Raspberry Pi without Raspberry Pi

This HOWTO is dedicated to those who wants to help Barry with sap6 ((Debian) Squeeze Arm Puppy for ARMv6) but do not own a Rasberry Pi (Raspi for short).

Pre-requisites

  1. Familiarity with terminal; all the commands are run in terminal.
  2. Recent puppies that support xz compression (unxz command is available, unsquashfs supports xz) (e.g. Slacko 5.3 as of the time of writing)
  3. 6 GB of freespace
  4. A relatively powerful machine, emulation is slow ...

Ingredients

  1. Qemu with arm emulation (qemu-system-arm)
  2. Barry's sap6 http://distro.ibiblio.org/quirky/arm/test/raspi-sap6-5.91-pre-alpha/raspi-sd-4gb-sap6-5.91.img.xz
  3. sap6-compatible linux kernel http://xecdesign.com/downloads/linux-qemu/kernel-qemu
  4. Optional - sap6 devx http://distro.ibiblio.org/quirky/arm/test/raspi-sap6-5.91-pre-alpha/devx_sap6_5.91.sfs

Steps

  1. Get all the ingredients. Especially for qemu - get it from your favorite repository, if it is not available there, pester your favorite pet maker to make one for you :)
    Note for pet maker: All that is needed --target-list="arm-softmmu" --- this will speed-up compilation of qemu by telling it to create only the qemu-system-arm binary, which is all that is needed.
    Note: qemu-0.14.txz from Slackware repository doesn't work, I don't know where to find the missing libbluetooth.so.3.
  2. Install qemu pet.
  3. Move the rest of the ingredients into a directory (e.g. /mnt/sda10/raspi)
  4. Open terminal within that directory.
  5. expand the sap6 disk image:
    unxz raspi-sd-4gb-sap6-5.91.img.xz
    
  6. Start sap6 like this:
    qemu-system-arm -M versatilepb -cpu arm1176 -hda raspi-sd-4gb-sap6-5.91.img -kernel kernel-qemu -m 256 -append "root=/dev/sda2" -serial stdio -redir tcp:2222::22
    
    If you get an error saying "unable to find cpu definition" or something like that, you've got an older qemu.

    Try this instead:

    qemu-system-arm -M versatilepb -cpu arm1136-r2 -hda raspi-sd-4gb-sap6-5.91.img -kernel kernel-qemu -m 256 -append "root=/dev/sda2" -serial stdio -redir tcp:2222::22
    
    That's it!

Optional Steps - Making the Screen larger

  1. Inside sap6, do the following.
  2. Use geany to edit /etc/X11/xorg.conf.armsystem
  3. Add the following at the end of line:
    Section "Screen"
    Identifier "Default Screen"
    SubSection "Display"
    Depth 16
    Modes "800×600" "640×480"
    EndSubSection
    EndSection
    

  4. Copy that file over to /etc/X11/xorg.conf (Basically, /etc/X11/xorg.conf.armsystem and /etc/X11/xorg.conf must be identical and have the added content as above)
  5. Restart X server. You should get the system running

Optional Steps - installing devx

  1. From within sap6
    1. Open terminal
    2. run
      nc -lp 22 | tar -xvf - -C /
      
  2. From within the host system
    1. Goto where the devx is stored
    2. Extract it
      unsquashfs devx_sap6_5.91.sfs
      cd squashfs-root
      tar -cvf - * | nc localhost 2222
      

  3. Be patient until the process finished.
  4. Test that devx is installed successfully: from within sap6 type in terminal gcc and make. You should not see anything that says "command not found".

Data transfer

How to transfer data to/from the emulated sap? There are hard ways, and there are easy ways. For the easy way, follow the direction:

On sap6 machine (real/emulated)

  1. From within sap6, download dropbear-sftp-arm.pet (shouldn't be a problem that 5.95 now comes with proper web browser)
  2. Install it (from terminal:
    petget dropbear-sftp-arm.pet)
    
  3. Once installed, type dropbear in terminal to start the dropbear SSH server.
  4. If you want to stop the server, just type killall dropbear from terminal.

On PC (host machine)

  1. Start gFTP (available from Network menu), or just type gftp from terminal.
  2. Enter localhost for Host, enter 2222 for Port, enter root for User, and enter woofwoof for Pass (or whatever you set sap6's root password), and lastly set the transfer type as SSH2.
  3. Click the big computer icon on the leftmost of the toolbar.
  4. If asked to verify the keys etc - click Yes.
  5. You are connected. You can upload/download files to/from your sap6.
  6. When done, just close gftp.

The pet and this instruction should also work on the real Raspi. Instead of "localhost" and port "2222", use the real Pi's IP address and port "22". Everything else is the same.

Note

  1. Sound does not work because Qemu currently does not emulate any sound device for arm.
  2. HOWTO tested and confirmed to with Barry's latest Squeeze Puppy Alpha 1 too http://murga-linux.com/puppy/viewtopic.php?p=637338#637338 Just get the image from http://distro.ibiblio.org/quirky/arm/test/raspi-sap-5.95-alpha1/raspi-sd-4gb-sap6-5.95.img.xz instead. The rest remains the same.

References

  1. http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
  2. http://linux-news.org/index.php/2012/06/02/raspberry-pi-emulation/
  3. The dropbear binary comes from landley.net (of Aboriginal Linux fame) here: http://landley.net/aboriginal/downloads/binaries/extras/dropbearmulti-armv6l
  4. The sftp-server binary comes from Debian Squeeze armel openssh-server package here: http://packages.debian.org/squeeze/armel/openssh-server/download
Originally posted here: Puppy Linux Forum - Running sap6 without Raspberri Pi