Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 23 Jul 2014, 14:05
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Running sap6 without Raspberri Pi
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Author Message
jamesbond

Joined: 26 Feb 2007
Posts: 2043
Location: The Blue Marble

PostPosted: Fri 29 Jun 2012, 04:46    Post subject:  Running sap6 without Raspberri Pi  

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 Smile

[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/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 Smile
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:
unxz raspi-sd-4gb-sap6-5.91.img.xz

6. Start sap6 like this:
Code:
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:
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:
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:
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:
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-raspberry-pi-the-easy-way/
2. http://linux-news.org/index.php/2012/06/02/raspberry-pi-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.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13

Last edited by jamesbond on Fri 29 Jun 2012, 07:17; edited 3 times in total
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 2043
Location: The Blue Marble

PostPosted: Fri 29 Jun 2012, 05:46    Post subject:  

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.

[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. Very Happy

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

[Edits]
Add data-transfer section.
dropbear-sftp-arm.pet
Description  Dropbear SSH server with sftp-server for ARM (that is, for Raspi)
pet

 Download 
Filename  dropbear-sftp-arm.pet 
Filesize  219.21 KB 
Downloaded  437 Time(s) 

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13

Last edited by jamesbond on Sat 30 Jun 2012, 09:08; edited 2 times in total
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Fri 29 Jun 2012, 06:20    Post subject:  

Thanks to jamesbond for this initiative. Smile
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 Smile

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 7782
Location: qld

PostPosted: Fri 29 Jun 2012, 06:56    Post subject:  

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 Smile

-

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!
sap6.png
 Description   
 Filesize   123.63 KB
 Viewed   3322 Time(s)

sap6.png


_________________
Woof Mailing List | keep the faith Cool |

Last edited by 01micko on Tue 03 Jul 2012, 19:27; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
jamesbond

Joined: 26 Feb 2007
Posts: 2043
Location: The Blue Marble

PostPosted: Sat 30 Jun 2012, 09:02    Post subject:  

Thanks 01micko!
Prompted by Micko, I added instructions and pet on how to transfer files to/from the Pi (real or emulated).

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13
Back to top
View user's profile Send private message 
nooby

Joined: 29 Jun 2008
Posts: 10557
Location: SwedenEurope

PostPosted: Sat 30 Jun 2012, 12:03    Post subject:  

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
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Sat 30 Jun 2012, 20:41    Post subject:    

bash-3.2#
Code:
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

Quote:
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 ?
Quote:
/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 ?
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 7782
Location: qld

PostPosted: Sat 30 Jun 2012, 20:46    Post subject:  

Karl,

Read point #3 in the ingredients Wink (top post of jamesbond)

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Sat 30 Jun 2012, 21:11    Post subject:  

Quote:
3. sap6-compatible linux kernel http://xecdesign.com/downloads/linux-qemu/kernel-qemu

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 Confused 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 . Smile
Back to top
View user's profile Send private message Visit poster's website 
jamesbond

Joined: 26 Feb 2007
Posts: 2043
Location: The Blue Marble

PostPosted: Sat 30 Jun 2012, 22:25    Post subject:  

Karl Godt wrote:
Quote:
3. sap6-compatible linux kernel http://xecdesign.com/downloads/linux-qemu/kernel-qemu

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

Quote:
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

Quote:
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.

Quote:
edit : http://xecdesign.com/compiling-a-kernel/#more-5 is a very helpful site to read . Smile
It is Very Happy
_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7782
Location: qld

PostPosted: Sun 01 Jul 2012, 06:57    Post subject:  

Just to confirm that the file transfer in qemu using the dropbear/gftp combo works fine Smile
file.jpg
 Description   Guess what I got in the mail? (No, not Pi yet!)
 Filesize   49.33 KB
 Viewed   3026 Time(s)

file.jpg


_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Sun 01 Jul 2012, 07:29    Post subject:    

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" .
quicksetup-in-qemu.png
 Description   
 Filesize   846.4 KB
 Viewed   3026 Time(s)

quicksetup-in-qemu.png

Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Sun 01 Jul 2012, 15:58    Post subject:  

Quote:
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:
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 :
Quote:
--- 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
Quote:
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
Back to top
View user's profile Send private message Visit poster's website 
Tman


Joined: 22 Jan 2011
Posts: 814
Location: Toronto

PostPosted: Sun 01 Jul 2012, 22:27    Post subject:  

Karl,

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

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:

./configure --prefix=/usr --sysconfdir=/etc --target-list=arm-softmmu,arm-linux-user --enable-uuid --cpu=i686 --enable-linux-user --enable-system
qemu_sap.png
 Description   
 Filesize   61.9 KB
 Viewed   2973 Time(s)

qemu_sap.png

Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Mon 02 Jul 2012, 17:34    Post subject:    

Quote:
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:
dc 2048 1024 \* p

2097152
Code:
dc 2097152 78643200 \+ p

80740352

makes "kind of" sense . Laughing

Quote:
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 .
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1258s ][ Queries: 13 (0.0059s) ][ GZIP on ]