GP2X Installing Chrootable Gentoo On The Gp2x (guide)


Hum, I never thought about making a gentoo chroot on the GP2X! Having my distro around is an interesting idea ;)

As for Gentoo cross-compile, crossdev + xmerge is a great combo! A few commands gave a working cross-compiler (gcc 4.1!) with interesting libs (SDL, ...), and a few locally-tweaked ebuilds even produce gp2x-enhanced sdl, allegro, sdl_mixer... on demand.
 
Voyageur I would love any information you could post about using crossdev for this setup. I plan on writing a follow up about it.

Also, I'm working on doing the same with debian. I've currently hit a snag though. A Gentoo install is ideally suited for this because this is standard issue Gentoo install. You chroot from a livecd and make a bootable system in the system.

Debian on the other hand needs a script debootstrap to set up the system. It has pretty minimal requirements, but not minimal enough.

Requirements I've discovered so far and taken care of:
wget (gp2x archive has one)
pkgdetails (supplied by debootstrap and compiled by me)
md5sum (found a standalone version called md5sumdeep and compiled it for the gp2x)

Still, debootstrap fails and I can't tell why. I do know it would like a copy of 'tr' and it will also need a copy of 'ar' before it's done. I'm not sure what else.

Therefore I may use the Gentoo environment as a stepping stone because I can debootstrap from there and get a chrootable debian environment :)

But ideally I would like to piece together the tools so some one could set it up on there own with out first installing Gentoo.

Finally, a dynamically linked chroot would be good too .

So yeah, any help from anyone would be appreciated. I have lots of work I still want to do :)
 
It opens you up to all the software in Gentoo's package management system, portage
http://packages.gentoo.org

There are a lot more things available for Gentoo on the ARM cpu than natively for the GP2X. I did it primarily because I want to play with Lisp on the GP2X, but there are a lot of things that you can now easily install on the GP2X inside the Gentoo chroot. It's full Linux environment.

The same would be true if and when I get Debian installed, again, it opens up potentially 10s of thousands of packages for the GP2X.

By it self it doesn't provide much, but it is a base upon which you can than go in many more directions than you could with a vanilla GP2X. It's really just a starting point

You could now make a GP2X web server with apache and mysql now for instance ;) It's easy with Gentoo. There are vastly more options now.
 
Yes, I really should make a clean walkthrough on how to setup a full cross toolchain (with all the libs also provided by open2x/oopo's toolchain...) with gentoo...

I've tried a few times and each time this resulted on something not working, a ranting on the use of gcc 4.0, a ranting on libtool trying to be too smart... I'll try to wind up a few lines on the main steps before the end of the week (no promise though, the new job keeps me quite busy).
 
Woah, easy...

Installing gentoo in gp2x will not make you capable of using all software disponible, just the arm-based binaries, and still, there are a lot of things that need a keyboard, mouse or use X11 interface which will make you have to use x11 for gp2x (I think that's rather slow, but I've never tried it out to be sincere, so anyone could post a better opinion?)

but you can have some (un)useful utilities like a database manager in a handheld device... anyway it's a cool idea trying to boot full distros in gp2x, just for the fun :ph34r:
 
Lint posted on Dec 12 2006 at 08:42 PM said:
Woah, easy...

Installing gentoo in gp2x will not make you capable of using all software disponible, just the arm-based binaries, and still, there are a lot of things that need a keyboard, mouse or use X11 interface which will make you have to use x11 for gp2x (I think that's rather slow, but I've never tried it out to be sincere, so anyone could post a better opinion?)

but you can have some (un)useful utilities like a database manager in a handheld device... anyway it's a cool idea trying to boot full distros in gp2x, just for the fun :ph34r:
X11 isn't slow at all (you were told this yesterday too). Also Gentoo uses source packages, not binaries, so they should in theory run mostly anywhere :)
 
Last edited by a moderator:
Yes I know lots of software probably won't work, but a surprising amount probably will. Far more than for the GP2X currently. Besides, this is probably also more for power users. I plan on picking up a USB keyboard and the breakout board soon. I did this specifically so that I could install Lisp and emacs and slime on the GP2X and with a foldable keyboard then have a pocket sized lisp box. Porting emacs and SBCL to the GP2X would have been a nightmare of epic proportions, this however should in theory be as easy as
'emerge sbcl emacs slime'
So that was my motivation and I stand by it. I posted the guide because I'm sure this will give lots of other people lots of other ideas and options. Sure you probably aren't going to install X and play Quake this way, the GP2X version of Quake is just fine. Same for most games. As I said, this is more practical for other uses. More computer like uses.

As an aside, anyone know if I can just plug a USB keyboard into the GP2X's USB port with the suitable USB adapter?

(And yes, you can get a terminal on the GP2X screen with sterm)
 
Voyageur: I've gotten crossdev to install a toolchain that should work but xmerge-ing something fails saying the 'C compiler cannot create executables.'

Also, I'd ideally like to find a way to merge the stage3 tarball and the cross compile root so it doesn't have to reinstall new versions of everything, and instead uses the tarball ones

Also
USE="-*" crossdev -v --libc 2.3.6-r5 --gcc 3.4.6-r1 --kernel 2.4.26-r1 --ex-gdb --target arm-unknown-linux-gnu
Is what I sued to install the cross toolchain. It's as close to the stage3 ARM tarball and the gp2x as I can get. Anything less and it's too old to be supported with crossdev.
 
Here a few infos on my setup (I compile programs statically at the end, so the crossdev options are not that close to the GP2X system), my host system is a ~amd64 one.

crossdev settings (softfloat is needed for floating point):
Code:
crossdev --k 2.4.33.3 --l 2.3.6-r5 --ex-gdb -t arm-softfloat-linux-gnu
and then with:
Code:
export SYSROOT="/usr/arm-softfloat-linux-gnu"
/usr/arm-softfloat-linux-gnu/etc/make.profile points to embedded or arm profiles

/usr/arm-softfloat-linux-gnu/etc/make.conf (supplemental keywords are there because many ebuilds are not arm keyworded, yes I'm too lazy to fill package.keywords ;) ):
Code:
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://pandemonium.tiscali.de/pub/gentoo/"
ACCEPT_KEYWORDS="arm ~arm amd64 ~amd64" 
ARCH=arm
CFLAGS="-O3 -fomit-frame-pointer -mcpu=arm920t"
CHOST=arm-softfloat-linux-gnu
CXXFLAGS=$CFLAGS
LDFLAGS="-L/usr/arm-softfloat-linux-gnu/usr/lib -Wl,-rpath,/usr/arm-softfloat-linux-gnu/usr/lib"
MAKEOPTS="-j3"
USE="-* gif gp2x jpeg mikmod mp3 oss png readline tiff unicode vorbis zlib"
PORTDIR_OVERLAY="/usr/local/portage"


The overlay is mine (reachable here), and has a few ebuilds tweaked for gp2x (SDL 1.2.9 from Paeryn, SDL_mixer with tremor and libmad, allegro with HW acceleration, ...) but it is untested on any other computer than mine, you've been warned ;)

Tell me if I forgot something!
 
If you're running an X server on your PC and the GP2X and have the GP2X networked, you can use x2x to use the mouse and keyboard on the GP2X.

Just do

x2x -from :0 -to <gp2x IP address>:0 -east

on the PC and when you move the cursor off the right of the screen, it will move the cursor on the GP2X X server. When you move off the left of the GP2X screen, the cursor goes back to the PC window.
 
Oh yeah, sorry, I did not put much belief on that answer about x11... even why that guy throw the guilt of low system resources to other applications, not x11, that was quite weird...
Anyway, just curious: what you guys run in x11 on gp2x?
I'm now thinking about giving it a try, but usbnet don't work right on my linux, so I have to do it without any networking..
 
Lint posted on Dec 13 2006 at 07:10 PM said:
Oh yeah, sorry, I did not put much belief on that answer about x11... even why that guy throw the guilt of low system resources to other applications, not x11, that was quite weird...
Anyway, just curious: what you guys run in x11 on gp2x?
I'm now thinking about giving it a try, but usbnet don't work right on my linux, so I have to do it without any networking..
The background desktop programs in GPE take up about 15MB RAM, so that claim is totally accurate :)

What Linux distro do you run?
 
Last edited by a moderator:
I run Slackware 10.2 with kernel 2.6.17.9

that's weird that usbnet loads but don't come up with a usbX or ethX network interface (even more strange that I remember that it worked sometime ago... I think the problem is my new motherboard)

I'll be upgrading to the newer slackware release very soon, so I'm not bothering too much about this anyway
 
You need to look for the updates g_ether.o on the archives, copy in into place on the GP2X with a script then set up usb0 manually (e.g. "ifconfig usb0 192.168.0.1").
 
Sort of off-topicish, but does gp2x x11 use the kernels framebuffer or has someone written a gp2x hardware driver?
 
I'm guessing it just uses the framebuffer, but hardware acceleration would be nice if X turns out to be useful. What X on here really needs is a way to store data at >32MB, then it will save some memory on the X server side.
 
Back
Top