Running sap6 without Raspberri Pi

How to do things, solutions, recipes, tutorials
Message
Author
jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

Running sap6 without Raspberri Pi

#1 Post by jamesbond »

This HOWTO is dedicated to those who wants to help Barry with sap6 but do not own Raspi (yet).
If you already have a Pi there is no need to read :)

[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)
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/te ... .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/te ... 6_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 create in 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:

Code: Select all

unxz raspi-sd-4gb-sap6-5.91.img.xz
6. Start sap6 like this:

Code: Select all

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:

Code: Select all

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]
7. Inside sap6, do the following.
8. Use geany to edit /etc/X11/xorg.conf.armsystem
9. Add the following at the end of line:

Code: Select all

Section "Screen"
Identifier "Default Screen"
SubSection "Display"
Depth 16
Modes "800×600" "640×480"
EndSubSection
EndSection
10. 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)
11. Restart X server. You should get the system running

[Optional Steps - installing devx]
12. From within sap6
12.1 Open terminal
12.2 run

Code: Select all

nc -lp 22 | tar -xvf - -C /
13. From within the host system
13.1 Goto where the devx is stored
13.2 Extract it

Code: Select all

unsquashfs devx_sap6_5.91.sfs
13.3 cd squashfs-root
13.4 tar -cvf - * | nc localhost 2222

14. Be patient until the process finished.
15. 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"

[References]
1. http://xecdesign.com/qemu-emulating-ras ... -easy-way/
2. http://linux-news.org/index.php/2012/06 ... emulation/

[Note]
Sound does not work because Qemu currently does not emulate any sound device for arm.

[Edits]
- Change memory size from 512 to 256. Real Raspi has 256MB of RAM, I used 512MB in the hope of running things faster; but apparently the kernel I referred above only supports 256 MB.
Last edited by jamesbond on Fri 29 Jun 2012, 11:17, edited 3 times in total.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#2 Post by jamesbond »

HOWTO tested and confirmed to with Barry's latest Squeeze Puppy Alpha 1 too http://murga-linux.com/puppy/viewtopic. ... 338#637338
Just get the image from http://distro.ibiblio.org/quirky/arm/te ... .95.img.xz instead. The rest remains the same.

[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 the attached 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.

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

[References]
1. The dropbear binary comes from landley.net (of Aboriginal Linux fame) here: http://landley.net/aboriginal/downloads ... lti-armv6l
2. The sftp-server binary comes from Debian Squeeze armel openssh-server package here: http://packages.debian.org/squeeze/arme ... r/download

[Edits]
Add data-transfer section.
Last edited by jamesbond on Sat 30 Jun 2012, 13:08, edited 2 times in total.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

Thanks to jamesbond for this initiative. :)
jamesBond is one of our smartdogs who helps Kirk with Fatdog and programmed Puppy phone (new version) and also knows a little bit about security (did the name give it away?)

Micko who worked on Lucid and created Slacko is getting a Pi
Will Jemimah be joining us I wonder?

We need people to update the wik - darkcity is getting a Raspberry Pi - good news as he works hard on the wiki
http://puppylinux.org/wikka/PuppiPlan

We need Nooby and other testers, Icyos to do an impartial Youtube video
and so on.

Mark (antiloquax) has practically tried every programming language available and this is so early in our ability to run on ARM

Woof Woof :)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#4 Post by 01micko »

jamesbond wrote:Note: qemu-0.14.txz from Slackware repository doesn't work, I don't know where to find the missing libbluetooth.so.3.
libbluetooth is in the bluez package, but never mind, slackware version fails anyway, so.. I'm off to compile qemu!

-

LATER: So I compiled qemu ... sap6 is booting :)

-

EVEN LATER: Posting from latest sap6 right now using chromium.. I wonder how BK got around the "run as root" thingy.. I'll check later. Bit of fun!

-

THE NEXT DAY: Here is a pet for qemu-arm for Slacko, ymmv in other pups:

qemu-1.1.0-s-i486.pet ~3.3M, tested in stock Slacko-533

REQUIRES: libaio-0.3.109-i486-1.txz

-

Thanks jamesbond!
Attachments
sap6.png
(123.63 KiB) Downloaded 5920 times
Last edited by 01micko on Tue 03 Jul 2012, 23:27, edited 1 time in total.
Puppy Linux Blog - contact me for access

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#5 Post by jamesbond »

Thanks 01micko!
Prompted by Micko, I added instructions and pet on how to transfer files to/from the Pi (real or emulated).
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#6 Post by nooby »

Lobster wrote: "We need Nooby and other tester"
So sure do need testers but not Nooby he is not reliable today.
He is too much into his own lack of brain something. So try to find others.
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#7 Post by Karl Godt »

bash-3.2#

Code: Select all

qemu-system-arm -M versatilepb -cpu arm1136-r2 -hda /mnt/sda9/tmp/raspi-sd-4gb-sap6-5.95.img -kernel kernel-qemu -m 256 -append "root=/dev/sda2" -serial stdio -redir tcp:2222::22
kernel-qemu: No such file or directory
qemu: could not load kernel 'kernel-qemu'
bash-3.2# qemu --help
QEMU PC emulator version 0.12.5, Copyright (c) 2003-2008 Fabrice Bellard
usage: qemu [options] [disk_image]

Know nothing about Qemu, compiled on Macpup_O2-4.3.1 .
So what kernel from where should i use ?
/root/COMPILE/qemu-0.12.5/linux-user/syscall.c:3707: error: storage size of ‘fl’ isn’t known
Maybe make -i did not create the qemu-kernel ?

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#8 Post by 01micko »

Karl,

Read point #3 in the ingredients :wink: (top post of jamesbond)
Puppy Linux Blog - contact me for access

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#9 Post by Karl Godt »

used that, dropped that in the folder, sda2 seems to refer to the second partition of the .img .

Booted but hang for minutes while updating and then forever again after the optical/networking part .
Could not use the mouse or keyboard outside the Qemu window, except 'C+A+BS' with a unuseable terminal : OUT the range (VGA) . Grr :? hard power down and hopefully no corruptions .
Opera browser seems to try to convert .tar.xz to .tar.gz but .img.xz seem to be ok .

edit : http://xecdesign.com/compiling-a-kernel/#more-5 is a very helpful site to read . :)

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#10 Post by jamesbond »

Karl Godt wrote:
used that, dropped that in the folder, sda2 seems to refer to the second partition of the .img .
Correct.
Booted but hang for minutes while updating and then forever again after the optical/networking part .
Not hang, it's just slow. The first boot is slow --- apparently even on the real Pi too :wink:
Could not use the mouse or keyboard outside the Qemu window,
In my keyboard layout (us), pressing Ctrl+Alt will release the mouse capture from Qemu. Not sure what's the equivalent one in german keyboard. Anyway when the mouse is locked to Qemu, Qemu's titlebar should tell you what are the keys you need to press to release it (definiteliy not C-A-BS).

BTW: Your qemu (0.12.5) is a bit old. If you can upgrade a newer qemu, it would probably help. 01micko tested with 0.14 and it was no good.
edit : http://xecdesign.com/compiling-a-kernel/#more-5 is a very helpful site to read . :)
It is :D
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#11 Post by 01micko »

Just to confirm that the file transfer in qemu using the dropbear/gftp combo works fine :)
Attachments
file.jpg
Guess what I got in the mail? (No, not Pi yet!)
(49.33 KiB) Downloaded 5570 times
Puppy Linux Blog - contact me for access

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#12 Post by Karl Godt »

compiled that qemu-0.12.5 now
./configure --static
on Macpup_F3-430/2

also with make -i

and it runs :YIPPY:

Also closed everything and had no internet when starting it .

Boot did not hang, was unexpected fast (probably because of update had been done (might not have been an update but complete install to virt_sda2 ) ) .

Will explore the tips by James .. :FEAR: :wink:

For the kernel i had thought, that qemu ships like grub with a "test-kernel" .

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#13 Post by Karl Godt »

pressing Ctrl+Alt will release the mouse capture from Qemu
Yes, the window frame message "-Press Ctrl+Alt to exit grap" shows . Did not see it first time probably a little due to a black theme i used that time . But it works : Simply press these two keys and release them and move the mouse .

My dynamically build now also boots to desktop . It is really awfully and unusual for Puppy slow from mingetty login to Xorg-jwm .

*

Another thing to consider : I have no possibility to modprobe any modules for the QEMUlated image . I am getting the message :

MODULE : version magic '3.1.9+ mod_unload modversions ARMv6 ' should be '3.1.9+ mod_unload ARMv6 '

So i thought Barry had blogged about recompiling the kernel so i fetched the 5.91 version from the nluug mirror , which also threw out these messages , even with modprobe -f , --force-vermagic , --force-modversion options .

If i need the included kernel instead of "kernel-qemu" how do i get it using losetup --offset option ?

Code: Select all

losetup-FULL -o 2048 /dev/loop1 raspi-sd-4gb-sap6-5.91.img
mkdir /mnt/raspi
mount-FULL -t vfat -o -loop /dev/loop1 /mnt/raspi
did not work for me .

disktype :
--- raspi-sd-4gb-sap6-5.91.img
Regular file, size 3.595 GiB (3859808256 bytes)
DOS/MBR partition map
Partition 1: 75 MiB (78643200 bytes, 153600 sectors from 2048)
Type 0x0C (Win95 FAT32 (LBA))
FAT32 file system (hints score 5 of 5)
Volume size 74.40 MiB (78014464 bytes, 76186 clusters of 1 KiB)
Partition 2: 3.268 GiB (3508535296 bytes, 6852608 sectors from 157696)
Type 0x83 (Linux)
Ext4 file system
UUID 18C27E44-AD29-4264-9506-C93BB7083F47 (DCE, v4)
Last mounted at "/mnt/sdimagep2"
Volume size 3.268 GiB (3508535296 bytes, 856576 blocks of 4 KiB)
Partition 3: 256 MiB (268435456 bytes, 524288 sectors from 7014400)
Type 0x82 (Linux swap / Solaris)
Linux swap, version 2, subversion 1, 4 KiB pages, little-endian
Swap size 256.0 MiB (268427264 bytes, 65534 pages of 4 KiB)
fdisk -l /dev/loop1
Disk /dev/loop1: 3859 MB, 3859806208 bytes
255 heads, 63 sectors/track, 469 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/loop1 doesn't contain a valid partition table

User avatar
Tman
Posts: 808
Joined: Sat 22 Jan 2011, 21:39
Location: Toronto

#14 Post by Tman »

Karl,

I don't know how to mount with the losetup option, but was successful mounting the image with the following:

Code: Select all

mkdir /mnt/sap6
mount -o loop,offset=80740352 sap6.img /mnt/sap6
note: I renamed my image file

Sap6 is confirmed to work in the Linaro Qemu I compiled:
http://www.murga-linux.com/puppy/viewtopic.php?t=78095

Unfortunately, it is too slow on this computer to be productive.

Like Jamesbond said, perhaps your version of Qemu is too old.
There is a newer source here -> https://launchpad.net/qemu-linaro/+milestone/2012.06

I used the following .configure options for mine:

Code: Select all

./configure --prefix=/usr --sysconfdir=/etc --target-list=arm-softmmu,arm-linux-user --enable-uuid --cpu=i686 --enable-linux-user --enable-system
Attachments
qemu_sap.png
(61.9 KiB) Downloaded 5677 times

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#15 Post by Karl Godt »

mount -o loop,offset=80740352 sap6.img /mnt/sap6
Thanks, Tman for figuring out . Was not exactly was i had been looking for ( mounting sda1 ) but i would not have figured it out to mount even sda2 i guess .

Code: Select all

dc 2048 1024 \* p
2097152

Code: Select all

dc 2097152 78643200 \+ p
80740352

makes "kind of" sense . :lol:
Like Jamesbond said, perhaps your version of Qemu is too old
I got it (also) from here :http://mirror3.layerjet.com/nongnu/qemu/ directed from http://download.savannah.gnu.org/releases/qemu/ .

I finally got my compile error fixed : had been a double 'struct flock' in asm-generic/fcntl.h and bits/fcntl.h which made me commenting it out in bits/fcntl.h to avoid some "/usr/include/bits/fcntl.h:142: error: redefinition of ‘struct flock’" ~time ago . qemu-0.10.6 - 0.14.1 compiled fine now . qemu 0.14.1 is still slow but the load average while idling seems to be much lower .

User avatar
Tman
Posts: 808
Joined: Sat 22 Jan 2011, 21:39
Location: Toronto

#16 Post by Tman »

Karl Godt wrote:i had been looking for ( mounting sda1
oh, in that case the offset for the first partition would be 1048576.
( 2048 * 512 bytes per sector)

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#17 Post by Karl Godt »

Tman wrote:
Karl Godt wrote:i had been looking for ( mounting sda1
oh, in that case the offset for the first partition would be 1048576.
( 2048 * 512 bytes per sector)
Wow ! Works . Many thanks !

Will have to reorder my thoughts, because i had thought there had been a pup_sap6.sfs on the first partition, which would install to sda2 and sda2 would be an empty ext4 partition, which compressed would not use much space
and that would be the cause for the long update delay in Qemu .

Likely i would have detected it using an empty 4GB USB external flash device ( of course had none empty handy ) .

Googling for ' loader.bin ' i came up with this :

raspberrypi / firmware

Anyone knows what that raspberripi firmware git site is about ?

User avatar
DC
Posts: 360
Joined: Sun 30 Apr 2006, 15:07
Location: Maidenhead, England

missing lib

#18 Post by DC »

Hi 01micko,

Installed you slacko pet and libao-1.1.0-i486-1.txz into a clean frugal install of slacko-5.3.3.4g-SCSI.

When trying to run get this error message

Code: Select all

qemu-system-arm: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
tried reinstalling libao-1.1.0-i486-1.txz again by default install then tried by extracting and installing still the same. looked for libaio.so.1, could not find file or sym link.

thanks

DC
a little bit of knowledge and I'm dangerous

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#19 Post by 01micko »

Sorry DC, my mistake :oops:

Should be libaio.. link fixed in post

Thanks
Puppy Linux Blog - contact me for access

User avatar
DC
Posts: 360
Joined: Sun 30 Apr 2006, 15:07
Location: Maidenhead, England

not again

#20 Post by DC »

Hi 01micko tis me again,

Same beginning this time the error message is

Code: Select all

kernel-qemu: No such file or directory
qemu: could not load kernel 'kernel-qemu'
tried deleting various bits of command line but nothing improves

thanks

DC
a little bit of knowledge and I'm dangerous

Post Reply