Debian In An Extend


It works!

I don't know about the name mangling. But at first 1.0b wasn't working for me either. It turned out to be a permissions problem. My SD card is bootable (with the Pandora OS) and I wanted to put the swapfile in the root directory, away from my home which should start getting regular backups (soon, right?). So I just created the swapfile in my home directory and "sudo mv"'d it out to its final resting place before creating the premount file. It took forever (the actual creation of the file) but it worked like a champ. Thanks again!
Ahhh... yea it runs as user, so it won't access privileged areas by default ;) and there definitely was a name mangling issue as I caught it on my Pandora as well before fixing it.

The creation does take ages... if you pick a pre-configured variant, it unzips a pre-made extend and uses that. Other wise, it literally DDs a new file direct to where you told it - which takes a horrific amount of time to do!

I think I was also a bit too paranoid in the swap mount scripts.. it calls mkswap on it every time it mounts to effectively "clean" it.. not sure how annoying that'll become, but you can just remove that line if need be ( though you'll have to have called it at least once, obviously )

Anything else, let me know :) even suggestions for added functionality! ( I'm somewhat intrigued as to what you mean by regular backups for your home... )
Stuckie said:
Anything else, let me know :) even suggestions for added functionality! ( I'm somewhat intrigued as to what you mean by regular backups for your home... )

Nothing exciting re: backups. I have a script (involving rsync) which I've used to make incremental backups to an external HD. I need to set up the same script (or similar) for the Pandora as I start keeping more information on it. When it comes down to it, I bought the Pandora to replace my Palm Pilot. It's not quite as convenient to carry around, but it's hard to beat the breadth of available software!
Last edited by a moderator:
Nice hacks Stuckie, yeah, don't have a Pandora yet, but fully understand the uses that chroot have in a traditional *nix OS, just never thought I'd see the command abused so badly, well done :D

Read the whole thread, and yeah, a neat quick way to get access to the ARM Deb repository, and also all the dependencies! Never mind Ubuntu, hell, maybe this would also enable someone to pass stage 1 with a Linux From Scratch creation for the Pandy!
Hmm.... abused so badly, or abused so well? ;)

I'm hoping to have a bit of free time this weekend to update the Debian stuff, and have a look at merging the package lists on multiple extends..
That'll pretty obviously be distribution dependent, so I'll probably only do Angstrom and Debian for the moment.

I've also done a complete debootstrap from the Pandora, so doing crazy stuff like an LFS build should be doable :) I wouldn't like to do that on an SD Card though! perhaps through an external hard drive, hehe

For the most part, many Linux distros do follow roughly the same root hierarchy enough to work in a chroot environment like I'm doing.. /proc, /sys and /dev are generally special file systems you can remount inside the chroot, along with /tmp and bits of /var ( which are generally marked volatile on the Pandora anyway. ) So the only things left to push over are really the resolv.conf and possibly mtab ( though I'll be happy to know a cleaner way of allowing the guest to mount/unmount stuff! ) I do add an /Angstrom link and a /media link however... and it's those two which cause issues in that you really can't get the damn chroot fully unbound from the system as you've effectively created recursive links ( check mount after binding one of these things, it goes a bit mad ;) )

Effectively, once the package merging is done, my next task will be trying to slim down the amount of stuff that gets bound in an attempt to try and provide a means to unbind it.

It's pretty usable as-is however :) and probably the easiest way to get access to the Debian repositories on your Pandora, without completely sacrificing an SD card! ( and once I clean up the compressed one a bit, you'll only really need about 100-200MB for the base Debian image plus whatever size you choose as an overlay )
Most people using this Debian extend hack probably already know their way around. But just in case, I wanted to offer a few ideas that I've been toying with.

Today I reflashed my Pandora because DeaDBeeF would run when I booted from SD, but not from NAND. Apparently I corrupted something on the NAND. I thought about reinstalling my few additions to the NAND one at a time (using opkg) and trying out DeaDBeeF in between each one. Then I realized -- I could get those same app's on debian. And likely they would be updated more frequently, too! So what do I really need on the NAND? Not much. A fresh install and the codecs.

So here are some of the shell games I'm playing:

My SD0 card (/media/mmcblk0p1) is a permanent resident. Its holds my debian extend. It's also bootable. So in both Angstrom and debian, I moved my home directory aside and soft-linked to the one on the SD card. All writes to my home directory are now contained there.

To further that little hack, I also pushed aside the /etc/passwd file in debian and soft-linked from /Angstrom/etc/passwd. I can assume my own identity (not just root) while operating in the debian chroot. Unfortunately, there seem to be odd permissions problems when running as a user in the chroot jail. I'm not sure if I need to be a little more complete in my piggy-backing off of Angstrom, if it's just the nature of a chroot. When running gedit, I get, "GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash." It runs fine as root. Any suggestions?

My debian.premount no longer spawns a shell at the end: I changed it to fire up "lxpanel". I plan to look around for something I like better. I may end up keeping nothing but the notification tray (with the network manager) and pandora-menu on the Angstrom side, and run nearly everything else from a debian-based panel. Or vice-versa. We can mix-and-match at will here!

Even better, I made launchers for other applications so I can fire them up from within Angstrom:


# Check for debian extend
[ -e /tmp/debian-sid.extend ] || ~/bin/debian.premount

# Run debian app
gksudo chroot /tmp/debian /usr/bin/keepassx &

This will set up my extend if it's not already going, then chroot into it and fire up the desired app. This could be linked to a hot-key, an icon on the XFCE bar, whatever.

So I'm working on making Stuckie's work a practical, regular part of my Pandora usage. Just a few more wrinkles to smooth out.
ooo some usability hacks, very nice :)

I think I can explain some of your madness with your user inside the chroot. Your UID may be different between Debian and Angstrom if you haven't created the user completely inside Debian. You might get away with this by linking the other files - /etc/group /etc/group- /etc/shadow /etc/shadow- and possibly /etc/passwd- if you haven't done that as well.. that should be everything user based.. though you may want to merge them, rather than a blanket overwrite if there is any discrepancy between the two, else you may have just overwritten important services and stuff.

Personally, I'd have just created a user inside the chroot to match the user/pass that I have - as that means if I install any services within either Angstrom or Debian that require a user/group modification, they're still separated.

There are chroot variants that login as users.. though as they weren't part of the Angstrom repository when I looked, I didn't attempt to use them... just wanted to keep things simple :) Either way, have a look for schroot and dchroot.. they're in the Debian repository, as far as I'm aware. Getting schroot running correctly would be interesting as it supports "kernel personalities" as it's documentation calls it - IE: kernels written for other architectures ;) It gives the example of 32bit on 64bit architectures.. we can possibly come up with other more interesting examples for our nefarious purposes! I haven't had time to look into it yet though, but might be worth a shot seeing as qemu + chroot seem to have issues.

-- Edit --
I've updated the first post with a bit of a quick rundown and link direct to the wiki documentation so first time readers don't have a heart attack at the amount of posts in this topic!

If anyone has some better blurb to add, feel free to let me know and I'll change it :)

-- Another Edit --
I'm also going to have a look at Android this weekend.. seeing as the giant topic in General has sparked some interesting debate, and the amount of link backs in there to this topic is quite interesting.. may as well see if it's possible.. it should be, I just couldn't be arsed with building a rootfs at the time and wanted to take a pre-made one!
How can I check how much free space is left in the extend file? df just lists a lot of errors.

This makes the Pandora much more like I expected it to be. Can't wait for the day where I can use Debian as "first" OS on it.
df should work from outside the chroot.. when you're inside, because of mtab being copied over, the mount points don't match up fully, so it gets confused.

As for using Debian as the main OS, you can already do that... just create a bootable SD card with Debian on it, with all the right drivers and everything which you could copy from your Angstrom install. If you want to install it over your NAND however, that could be a bit of a more interesting experiment to try.

In reference to Android buggery in a chroot, it's really not going to work right at all.
Just to add more flames on the fire in a certain General thread ( I may cross-post this there as well, ) Android is Linux with "other bits," where these other bits cause issues.

The reason that this chroot hackery works is that most Linux distros follow a few guidelines.
They mostly all use the same system hierarchy for the most part ( though some have the habit of going their own way in places. )
And they generally use the same kernel, though sometimes with little patches.

Android doesn't follow either of those two, which are the most critical in getting a chroot to work.
Android's kernel is a rather modified Linux kernel, where their changes have already been revoked from the main tree due to stagnated updates. Nice. ( see: ) And their root filesystem is "a bit weird" too. /dev /sys and /proc are where you'd expect, but that's about it.. everything else linux-y tends to live under /system .. and due to their kernel changes, will do nothing but segfault if you try to run them either directly on the Pandora, or as a chroot argument.

If you're wanting to run Android alongside Angstrom, I see a more VM-based environment working, and considering it comes with one in the SDK, I'm surprised no-one's recompiled that on the Pandora yet...
However, I do seem to be spreading myself a bit thin again, so for the time being, I won't be looking at it.
I still have to get out these Compressed Debian extends! I keep forgetting and mangling them while looking at x86 or Android code :p
So I shall be setting up a Compressed Debian extend with enough to run Synaptic today, and that'll be that for a while ( save bug fixing and support ), as I've other projects ( which for me, are more fun at the moment ) that are wasting away!
Creature found a spectacular bug in Extend Utils that I somehow managed to completely miss ( and so did all of you lot! )
Root Overlays and Dev Extends didn't work properly at all.

This has now been fixed, so Extend Utils 1.1 is available at the usual place:

Any other issues, let me know. That was an evil one!
This is probably more of a general Linux question, but since Im doing it in your Debian extend I guess Ill risk asking here :)

Im running the 2GB Debian sid extend with synaptic. Ive ran synaptic and installed Galculator, just to try something small. It seems to have downloaded and installed OK, but where the hell is it? Just writing galculator in a terminal doesnt work.

Another question: should I be seeing something different GUI-wise using this extend? I thought that I could type something like GDM in a terminal and it would start up some other kind of interface, but I get nothing.

Anyway, keep up the good work! This is the first time Ive tried your OS extends: I was using your dev extends to compile some gp2x apps a few weeks ago and they worked great! Thanks so much for this!
GDM probably isn't installed, so that's why it wont start up ;) I try and label my extends with what's in them ( debian-sid-synaptic, for example ) and GDM also requires a bit of fiddling to run right next to Angstrom, if I remember correctly. I'll sort this out this week.. just been busy with a million different things!

As for finding galculator.. I'm not entirely sure why it wont start up if you've installed it.. you could try installing lxde and calling up an lxde-panel as has been discussed in this thread to get both an Angstrom panel and a Debian panel side by side, as perhaps it's installed a menu item in that for you.

Otherwise, search the "usual" places - /usr/bin and /bin - to see if it's installed in there.

Unfortunately, the month of August is a bit mental for me, so not sure much work will be done on Extend Utils till September... so if anyone is going to break it, find bugs or request stuff, best to do it this week ;)
Well I tried again today and this time I found it. Maybe it needed a reboot to refresh or something.

Now to try and get a GUI installed and working :)
That's a tad worrying... though you're using an OS Extend and they weren't affected by the bug I just fixed yesterday.. or shouldn't be.. PM me your mount script to make sure nothing odd with it, as I'm a bit paranoid just now!

As for a GUI, there's a few ways you can do it:
1) start up a completely separate X session via GDM so that you have Angstrom on VT7 and Debian on VT2.
2) use Xnest to embed a Debian X session inside a window within Angstrom.
3) install some sort of panel-type system ( XFCE, LXDE, etc.. ) and run the panel separate so you have access to an Angstrom program panel and a Debian program panel.

Each have benefits and draw backs...
A separate X session would allow you to effectively kill Angstrom's XFCE and give full control over to Debian... but you'll need to do some more fiddling to ensure Debian understands the hardware fully. It's not hard, just fiddly.
Embedding the X session via XNest gives you less screen real estate, which is already a bit tight, and is possibly the slowest - but does get things running with the minimal of fuss.
The panel method should be the fastest with running alongside Angstrom, but could be quite fiddly to setup as well.

So, there's options for everyone!
Well the current mount script I have I redid with the new extend tools pnd, and deleted the old one.

I wouldnt worry about it: its highly probable I just didnt see the executable in /bin, and the problem with not running it from the terminal could simply have been a typo on my part (still getting used to this case-sensitive linux malarky!).

As for the rest of your post, Ill just nod my head and pretend I know what you're talking about ;) (linux newb alert!)
I'll do write-ups for all three options tomorrow, hopefully..
Means I can also set up a compressed Debian extend properly in the process!

If there's any other tutorials and things people want, let me know as soon as.. as I said, after this week, my spare time is pretty much non-existent for a month.
I've just updated the Wiki page with a more centralized download area for all files.

Please note that most of the older Uncompressed OS Extend files will be DEPRECATED and REMOVED from my server on 1st August.
If you want them, grab them now!
This include most of the older Debian and Ubuntu extends.

I also noticed that the tutorials I was going to write have technically already been done, they're just scattered throughout this thread, so I'll be concatenating them and adding them to the Wiki tomorrow.

Finally, I got off my bum and uploaded a fresh Debian Sid Compressed Extend, with Synaptic immediately available. It's about 250mb and can be downloaded directly here:
Remember, this is a COMPRESSED EXTEND, so you will need to setup a mount script to have this as Read Only, along with an Overlay to use it; but this means that anything you install is trapped in the Overlay, so you could use it as a crude method of catching Debian apps for processing into PNDs ;)
I tried running crawl-tiles which needs OpenGL. "No matching GLX visual found". Is there a way to get GL working for software from/in the extend? Or is it maybe completely unrelated to the extend but in need of a different API (ie it is not trying OpenGLES)?