Stuckie
Member
Heya!
-- For First Time Readers --
You're probably going "ARGH! so many pages and a huge amount of information to read!" about now.. but don't fret!
The vast majority of these pages have been development back and forth between several people and myself as we work out the kinks in the Extend Utils.
While reading it all is possibly a good idea, it's not hugely necessary.. a quick run down is as follows:
I used a chroot environment to get a Debian terminal running within Angstrom. I then extended this and got X running. I then had a look at Arch and Ubuntu and had some small successes with them.
Due to somewhat popular demand at the time, I had a further look into Ubuntu and made some headway, before giving up due to Ubuntu's custom services giving me some headaches and I ended up hitting a brick wall in terms of progress.
I then went back to the Extend Utils suite and updated it from a bunch of hard-coded scripts, to what is essentially a mount script generator, and that's where we are at today
Documentation for the Extend Utils suite, with a better layout than spread all about these posts, is available on the Wiki here: http://pandorawiki.org/Extend_Utils
And now back to our regular scheduling...
----------------------------
Tonight's mental hack, is getting an install of Debian up and running on the Pandora within Angstrom itself
This is sneaky, as it means we get all the drivers for us loaded up in the kernel, and can just chroot into the Debian shell to do whatever we need/want.
And that's 28209 Packages Listed, if you're wondering
Firstly, if you haven't been watching my exploits in Developer's Corner with my crazy extend overlay system stuff, you wont know what this Extend business is.
Basically, it's a loop back file formatted as ext2/ext3/reiserfs/your-favourite-filesystem, that's then mounted as normal - hence "loop back."
It's great for doing all sorts of little hacks like this, and as a rather nice way of keeping versioned backups of file systems should you be hacking away through the twilight hours, and bugger stuff up *cough*
Some quick terminology as to what you're about to face.
We're doing a debootstrap. This is a funky thing that Debian has which allows you to install a full working base of Debian to a folder. Magic, isn't it?
We then do a chroot into this. This literally "CHanges ROOT" to another folder. This means that our normal root / changes from Angstrom to our Debian one. It's also handy for security reasons, should you want to lock people to a certain folder hierarchy.
It's a bit strange to get your head around if you come from a Windows only background, so I suggest some googling if you want to know more
Anyway, back to getting Debian on our favourite mini laptop.
If you just want to USE this, jump to the bottom of this post for the Quick Start stuff.. if you'd rather follow through the mind of a mad man, read on to build yours from scratch!
I highly advise you to use an extend file... as big as you can get away with, to be perfectly honest. The absolute smallest you'll be able to get away with is 256Mb, and you wont be installing much afterwards!
So grab the extendutils.pnd and two of the pre-formatted extend files here: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/
Unzip the extend files somewhere on your card ( careful, it will expand to the size it says! ) and stick the PND in your favourite place.
Call up Extend Root in the System Menu on XFCE, and select your Extend file ( this one can be quite small if you want. )
Go through the Zenity prompts, and when you get to the Terminal, check we have everything by typing: mount ... this should show you all the mounts, of which there should be a crap load of AUFS mounts all over the place.
Next we want to do the same but with a Home Extend ( this is the one you want to be as big as you can! )
Once the terminal pops up, type "mount" again, and you should see the extra /home entry.
Right, assuming all our AUFS binds are in place ( if not, reboot and try again.. I've noticed that uncleanly mounted PND files tie up a /dev/loop slot, and we need a few of them for the binding to work with a loop back file. ) we can get down to business: sudo opkg update && sudo opkg install dpkg
This will update the opkg cache and install dpkg.
** NOTE ** I don't know if this is just my hacky setup or not, but I found that after jumping from clean install to HotFix 2, opkg complained about the boost library list not existing. To fix this, you'll need to force an uninstall of boost and a reinstall of it: sudo opkg remove boost --force-depends && sudo opkg install boost --force-depends ... the install with force-depends is probably not necessary, but I did it anyway.
Once dpkg is installed, there's a few other things it needs... it doesn't seem to install cleanly for whatever reason so: sudo touch /var/dpkg/status && sudo touch /var/dpkg/available .. this'll stop it complaining these files don't exist.
Now we need to grab debootstrap: wget -c http://ftp.uk.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.10lenny1_all.deb ( or your favourite mirror )
We can't just do a sudo dpkg -i debootstrap_1.0.10lenny1_all.deb ... as much as that would've made things so much easier for us. Instead: sudo dpkg -x debootstrap_1.0.10lenny1_all.deb debootstrap
This extracts the contents to ./debootstrap.
sudo cp -R ./debootstrap/* /
Now we've just copied the contents to root ( effectively a forced install. )
Let's get our bootstrap going!
sudo debootstrap lenny pandebian
You could use sid, if you prefer.
This will take a while to do, so go make a sandwich.
Finished?
You have effectively installed Debian into a folder called "pandebian" in an extend file, congratulations!
So, what can we do with this?
sudo chroot pandebian /bin/bash
You're now in your Debian space...
apt-get update
apt-get install whatever-the-smeg-i-like
BUT HOLD UP! NOT SO FAST!
This install isn't finished yet!
exit
We need to bind some parts of our main system into our shell to be able to fully use it:
sudo mount -o bind /dev pandebian/dev
sudo mount -o bind /dev/pts pandebian/dev/pts
sudo mount -o bind /dev/shm pandebian/dev/shm
sudo mount -o bind /proc pandebian/proc
sudo mount -o bind /proc/bus/usb pandebian/proc/bus/usb
sudo mount -o bind /sys pandebian/sys
sudo mount -o bind /tmp pandebian/tmp
( Now there's some stuff for a script! )
Now let's go for it!
sudo chroot pandebian /bin/bash
For a test, let's install synaptic.
This is a good one as it'll pull down all manner of crap that we'll end up needing sooner or later.
sudo apt-get install synaptic
This is where you see that getting as big an Extend as you can pays off.. 253mb this is going to eat up! After downloading ~80mb! ( don't worry if your WiFi is flaky and it dies.. apt-get will resume from where it left off .. mine died in the middle of it, and I had to do the Disable/Enable WiFi trick for it to come back up. )
Suffice to say, this'll take a while.. so go make some food.. I suggest Cantonese Chicken and Egg Fried Noodles.
Once it's done, however, you do have an install of X, and enough bits and pieces of everything to get going. This is a bit superfluous as after all, you have X running already in Angstrom.. but one day you may actually be installing Debian on the NAND, now how cool would it be to just take your Extend file and go *splat* with everything you've installed and setup? So there's a bit of method in that madness!
Anyway, you've probably wined and dined, and synaptic's finished installing.. so let's run it: synaptic
Synaptic is great as it's a GUI method of package management on Debian... so you can point'n'click your installs
Should you be tired of messing with Debian (seriously?), you really should clean up the binds once you've exited the chroot jail:
exit
sudo umount pandebian/dev
sudo umount pandebian/dev/pts
sudo umount pandebian/dev/shm
sudo umount pandebian/proc
sudo umount pandebian/proc/bus/usb
sudo umount pandebian/sys
sudo umount pandebian/tmp
And we're done!
Simple
Now, here's one I made earlier! ... SURPRISE! You actually already have the tools to do so, they're in the ExtendUtils.pnd
My ExtendUtils has been updated to cope with Debian Extend files.. these are just standard Extend files but they have the above debootstrap done.
Calling Mount Debian Extend will create a mount point in /tmp, do all the bindings, then call up a Terminal and chroot straight in for you. UnMount Debian Extend will do what you think as well ( or it'll try to.. unmounting doesn't always play ball, so you may need to give it some loving - hit it with a stick! )
I also come bearing gifts of two Extend files to play with:
512mb Debian Lenny: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/debian-lenny.512MbExtend.zip
1gb Debian Sid: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/debian-sid.1GbExtend.zip
1gb Debian Sid with Synaptic: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/debian-sid-synaptic.1GbExtend.zip ( cause I'm nice, and it took absolutely AGES )
There is of course, nothing stopping you mounting these and "cp -R * /newExtend/" to a bigger one, or to an external Hard Drive, or gigantic USB Stick, or whichever Assuming it's a Linux friendly formatted partition, of course!
You may wonder why Lenny is only 512mb.. I only have 2Gig SD cards and I was doing both at the same time + my dev environment extend ( which is 512mb as well ) so I had no space left! As I said, nothing is stopping you from copying it over into a bigger Extend file, or to an actual Linux formatted partition of some description.
It's a bit fiddly, but you now have Debian running on your Pandora inside Angstrom.
You have full access to Debian's archives, with the added benefit of all the driver support from your standard Pandora install available ( may need to symlink some things, but least it's there! )
If you bugger something up in Debian, it's just as easy to delete the Extend file, and start again. Simple. Just how it should be
One important thing to note: by default, you're logged in as root.
Now, although you're in a chroot jail and shouldn't be able to cause much harm, it's still a good idea to add yourself as a user with the "adduser" command, as we do bind a lot of system critical areas from Angstrom into Debian.
Brownie points for the first lunatic to high jack the bootup process to load up their Debian Extend file and head into X that way, with whatever Desktop Environment they've grabbed and have the PowerVR demos running ( and documented it, of course! share the wealth and all that ) Considering KDE4 seems to have an armel port, this could be interesting!
Anyway, this is just a start.. there's bound to be something I missed ( perhaps you need to symlink the omap3 driver stuff into Debian for it to pick it up, for instance ) but, I think it's a great start! and certainly something else to fiddle with
Quick Start.
You'll need this: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/extendutils.pnd
And This: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/debian-sid-synaptic.1GbExtend.zip
There'll be other debian extend files in the folder here: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev just pick what you want to start with.. I suggest one with synaptic pre-installed unless you're upto other stuff.
Extract that to an SD of at least 1Gb in size, call System->Mount Debian Extend and follow the prompts.
Welcome to your Debian System in an Extend
-- For First Time Readers --
You're probably going "ARGH! so many pages and a huge amount of information to read!" about now.. but don't fret!
The vast majority of these pages have been development back and forth between several people and myself as we work out the kinks in the Extend Utils.
While reading it all is possibly a good idea, it's not hugely necessary.. a quick run down is as follows:
I used a chroot environment to get a Debian terminal running within Angstrom. I then extended this and got X running. I then had a look at Arch and Ubuntu and had some small successes with them.
Due to somewhat popular demand at the time, I had a further look into Ubuntu and made some headway, before giving up due to Ubuntu's custom services giving me some headaches and I ended up hitting a brick wall in terms of progress.
I then went back to the Extend Utils suite and updated it from a bunch of hard-coded scripts, to what is essentially a mount script generator, and that's where we are at today
Documentation for the Extend Utils suite, with a better layout than spread all about these posts, is available on the Wiki here: http://pandorawiki.org/Extend_Utils
And now back to our regular scheduling...
----------------------------
Tonight's mental hack, is getting an install of Debian up and running on the Pandora within Angstrom itself
This is sneaky, as it means we get all the drivers for us loaded up in the kernel, and can just chroot into the Debian shell to do whatever we need/want.
And that's 28209 Packages Listed, if you're wondering
Firstly, if you haven't been watching my exploits in Developer's Corner with my crazy extend overlay system stuff, you wont know what this Extend business is.
Basically, it's a loop back file formatted as ext2/ext3/reiserfs/your-favourite-filesystem, that's then mounted as normal - hence "loop back."
It's great for doing all sorts of little hacks like this, and as a rather nice way of keeping versioned backups of file systems should you be hacking away through the twilight hours, and bugger stuff up *cough*
Some quick terminology as to what you're about to face.
We're doing a debootstrap. This is a funky thing that Debian has which allows you to install a full working base of Debian to a folder. Magic, isn't it?
We then do a chroot into this. This literally "CHanges ROOT" to another folder. This means that our normal root / changes from Angstrom to our Debian one. It's also handy for security reasons, should you want to lock people to a certain folder hierarchy.
It's a bit strange to get your head around if you come from a Windows only background, so I suggest some googling if you want to know more
Anyway, back to getting Debian on our favourite mini laptop.
If you just want to USE this, jump to the bottom of this post for the Quick Start stuff.. if you'd rather follow through the mind of a mad man, read on to build yours from scratch!
I highly advise you to use an extend file... as big as you can get away with, to be perfectly honest. The absolute smallest you'll be able to get away with is 256Mb, and you wont be installing much afterwards!
So grab the extendutils.pnd and two of the pre-formatted extend files here: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/
Unzip the extend files somewhere on your card ( careful, it will expand to the size it says! ) and stick the PND in your favourite place.
Call up Extend Root in the System Menu on XFCE, and select your Extend file ( this one can be quite small if you want. )
Go through the Zenity prompts, and when you get to the Terminal, check we have everything by typing: mount ... this should show you all the mounts, of which there should be a crap load of AUFS mounts all over the place.
Next we want to do the same but with a Home Extend ( this is the one you want to be as big as you can! )
Once the terminal pops up, type "mount" again, and you should see the extra /home entry.
Right, assuming all our AUFS binds are in place ( if not, reboot and try again.. I've noticed that uncleanly mounted PND files tie up a /dev/loop slot, and we need a few of them for the binding to work with a loop back file. ) we can get down to business: sudo opkg update && sudo opkg install dpkg
This will update the opkg cache and install dpkg.
** NOTE ** I don't know if this is just my hacky setup or not, but I found that after jumping from clean install to HotFix 2, opkg complained about the boost library list not existing. To fix this, you'll need to force an uninstall of boost and a reinstall of it: sudo opkg remove boost --force-depends && sudo opkg install boost --force-depends ... the install with force-depends is probably not necessary, but I did it anyway.
Once dpkg is installed, there's a few other things it needs... it doesn't seem to install cleanly for whatever reason so: sudo touch /var/dpkg/status && sudo touch /var/dpkg/available .. this'll stop it complaining these files don't exist.
Now we need to grab debootstrap: wget -c http://ftp.uk.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.10lenny1_all.deb ( or your favourite mirror )
We can't just do a sudo dpkg -i debootstrap_1.0.10lenny1_all.deb ... as much as that would've made things so much easier for us. Instead: sudo dpkg -x debootstrap_1.0.10lenny1_all.deb debootstrap
This extracts the contents to ./debootstrap.
sudo cp -R ./debootstrap/* /
Now we've just copied the contents to root ( effectively a forced install. )
Let's get our bootstrap going!
sudo debootstrap lenny pandebian
You could use sid, if you prefer.
This will take a while to do, so go make a sandwich.
Finished?
You have effectively installed Debian into a folder called "pandebian" in an extend file, congratulations!
So, what can we do with this?
sudo chroot pandebian /bin/bash
You're now in your Debian space...
apt-get update
apt-get install whatever-the-smeg-i-like
BUT HOLD UP! NOT SO FAST!
This install isn't finished yet!
exit
We need to bind some parts of our main system into our shell to be able to fully use it:
sudo mount -o bind /dev pandebian/dev
sudo mount -o bind /dev/pts pandebian/dev/pts
sudo mount -o bind /dev/shm pandebian/dev/shm
sudo mount -o bind /proc pandebian/proc
sudo mount -o bind /proc/bus/usb pandebian/proc/bus/usb
sudo mount -o bind /sys pandebian/sys
sudo mount -o bind /tmp pandebian/tmp
( Now there's some stuff for a script! )
Now let's go for it!
sudo chroot pandebian /bin/bash
For a test, let's install synaptic.
This is a good one as it'll pull down all manner of crap that we'll end up needing sooner or later.
sudo apt-get install synaptic
This is where you see that getting as big an Extend as you can pays off.. 253mb this is going to eat up! After downloading ~80mb! ( don't worry if your WiFi is flaky and it dies.. apt-get will resume from where it left off .. mine died in the middle of it, and I had to do the Disable/Enable WiFi trick for it to come back up. )
Suffice to say, this'll take a while.. so go make some food.. I suggest Cantonese Chicken and Egg Fried Noodles.
Once it's done, however, you do have an install of X, and enough bits and pieces of everything to get going. This is a bit superfluous as after all, you have X running already in Angstrom.. but one day you may actually be installing Debian on the NAND, now how cool would it be to just take your Extend file and go *splat* with everything you've installed and setup? So there's a bit of method in that madness!
Anyway, you've probably wined and dined, and synaptic's finished installing.. so let's run it: synaptic
Synaptic is great as it's a GUI method of package management on Debian... so you can point'n'click your installs
Should you be tired of messing with Debian (seriously?), you really should clean up the binds once you've exited the chroot jail:
exit
sudo umount pandebian/dev
sudo umount pandebian/dev/pts
sudo umount pandebian/dev/shm
sudo umount pandebian/proc
sudo umount pandebian/proc/bus/usb
sudo umount pandebian/sys
sudo umount pandebian/tmp
And we're done!
Simple
Now, here's one I made earlier! ... SURPRISE! You actually already have the tools to do so, they're in the ExtendUtils.pnd
My ExtendUtils has been updated to cope with Debian Extend files.. these are just standard Extend files but they have the above debootstrap done.
Calling Mount Debian Extend will create a mount point in /tmp, do all the bindings, then call up a Terminal and chroot straight in for you. UnMount Debian Extend will do what you think as well ( or it'll try to.. unmounting doesn't always play ball, so you may need to give it some loving - hit it with a stick! )
I also come bearing gifts of two Extend files to play with:
512mb Debian Lenny: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/debian-lenny.512MbExtend.zip
1gb Debian Sid: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/debian-sid.1GbExtend.zip
1gb Debian Sid with Synaptic: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/debian-sid-synaptic.1GbExtend.zip ( cause I'm nice, and it took absolutely AGES )
There is of course, nothing stopping you mounting these and "cp -R * /newExtend/" to a bigger one, or to an external Hard Drive, or gigantic USB Stick, or whichever Assuming it's a Linux friendly formatted partition, of course!
You may wonder why Lenny is only 512mb.. I only have 2Gig SD cards and I was doing both at the same time + my dev environment extend ( which is 512mb as well ) so I had no space left! As I said, nothing is stopping you from copying it over into a bigger Extend file, or to an actual Linux formatted partition of some description.
It's a bit fiddly, but you now have Debian running on your Pandora inside Angstrom.
You have full access to Debian's archives, with the added benefit of all the driver support from your standard Pandora install available ( may need to symlink some things, but least it's there! )
If you bugger something up in Debian, it's just as easy to delete the Extend file, and start again. Simple. Just how it should be
One important thing to note: by default, you're logged in as root.
Now, although you're in a chroot jail and shouldn't be able to cause much harm, it's still a good idea to add yourself as a user with the "adduser" command, as we do bind a lot of system critical areas from Angstrom into Debian.
Brownie points for the first lunatic to high jack the bootup process to load up their Debian Extend file and head into X that way, with whatever Desktop Environment they've grabbed and have the PowerVR demos running ( and documented it, of course! share the wealth and all that ) Considering KDE4 seems to have an armel port, this could be interesting!
Anyway, this is just a start.. there's bound to be something I missed ( perhaps you need to symlink the omap3 driver stuff into Debian for it to pick it up, for instance ) but, I think it's a great start! and certainly something else to fiddle with
Quick Start.
You'll need this: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/extendutils.pnd
And This: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev/debian-sid-synaptic.1GbExtend.zip
There'll be other debian extend files in the folder here: http://www.stuckiegamez.co.uk/apps/pandora/SimpleDev just pick what you want to start with.. I suggest one with synaptic pre-installed unless you're upto other stuff.
Extract that to an SD of at least 1Gb in size, call System->Mount Debian Extend and follow the prompts.
Welcome to your Debian System in an Extend