Debian In An Extend


give me two more days ..
let me find out what is the command and what is the comment...


:huh:
 
screen100828225530.png

Not using an extend, booting from a SD so I just installed the chroot environment straight on the boot SD. I made a "debenv" script based on the extendutils scripts :) /media works, /angstrom does not.
 
You probably did the same hiccup I did at one point by symlinking "/Angstrom" to "/" ;)
That symlink will move to your chrooted "/" instead of the Angstrom "/"

I tend to just use mount --rbind for the /Angstrom link. You'd need to do this before jumping into the chroot, but it'll work - just cause some mental cyclic dependency as you can get to your chrooted "/" through the /Angstrom link, which can get you to your chroot, etc... you generally cannot unbind this.

I'm pretty sure there's another way, but I can't quite remember it.. it'll be lurking in a txt file on my machine though, as I remember noting it down for being a downright crazy way of getting back to the main root filesystem. However, it shouldn't have that cyclic dependency.. I'll have a look for it tonight, but no promises!


N_2 said:
give me two more days ..
let me find out what is the command and what is the comment...


:huh:

I don't get what you mean?
Was this aimed at me? Or am I just getting paranoid these days? hehe
 
Last edited by a moderator:
Probably an Ext2 formatted SD card with the chroot directly on it, but that's a bit crazy for most people I imagine, hence why I used a loop back file instead.
Not sure if an Ext3 formatted SD would fare any better with it's journaling, though.. and I doubt which slot matters much, either.

The premount scripts are exactly that, runnable scripts.. so you could just "chmod +x path/To/my.preMount" then add a link to that file on your menu/desktop and that should work :)
Infact, the Extend Utils GUI effectively just passes the script to /bin/bash to run it, which is near enough the same thing.
 
Stuckie said:
You probably did the same hiccup I did at one point by symlinking "/Angstrom" to "/" ;)
That symlink will move to your chrooted "/" instead of the Angstrom "/"

I tend to just use mount --rbind for the /Angstrom link. You'd need to do this before jumping into the chroot, but it'll work - just cause some mental cyclic dependency as you can get to your chrooted "/" through the /Angstrom link, which can get you to your chroot, etc... you generally cannot unbind this.

I'm pretty sure there's another way, but I can't quite remember it.. it'll be lurking in a txt file on my machine though, as I remember noting it down for being a downright crazy way of getting back to the main root filesystem. However, it shouldn't have that cyclic dependency.. I'll have a look for it tonight, but no promises!


N_2 said:
give me two more days ..
let me find out what is the command and what is the comment...


:huh:

I don't get what you mean?
Was this aimed at me? Or am I just getting paranoid these days? hehe


Because I am a bit confusing about......which is the command I sould follow .

..the 'Advanced Filesystem Hackery' is clearer for me to follow .. lol

You use ' to quote all the command..... and you explain the command so our linux noob not only can follow but learn a lot....-o-

but this time I have to figure out 'what' is what.....
 
Last edited by a moderator:
Ah.. not entirely sure going through the first post would be of much use, to be hugely honest unless you want to know what's effectively going on behind the scenes.
The current end result is the Extend Utils GUI thing... with the preferred result being a proper GUI as SomeGuy described earlier in this thread ( somewhere.. this is a rather large thread ;) )

I haven't had time to sit down and go through the first posts and properly "tutorialise" and stick them on the Wiki.
Work's slightly mad just now ( but hooray for lunch and long compile times! ) so I won't be able to go through them for a while, yet.

Though if you've ideas on a style to use for me to stick to when I do clean them up, by all means let me know :)
Something like quotes for comments, and bold for commands, perhaps?
 
Stuckie said:
Ah.. not entirely sure going through the first post would be of much use, to be hugely honest unless you want to know what's effectively going on behind the scenes.
The current end result is the Extend Utils GUI thing... with the preferred result being a proper GUI as SomeGuy described earlier in this thread ( somewhere.. this is a rather large thread ;) )

I haven't had time to sit down and go through the first posts and properly "tutorialise" and stick them on the Wiki.
Work's slightly mad just now ( but hooray for lunch and long compile times! ) so I won't be able to go through them for a while, yet.

Though if you've ideas on a style to use for me to stick to when I do clean them up, by all means let me know :)
Something like quotes for comments, and bold for commands, perhaps?

Bold or quotes are ok as long as they are not mixed with the comments.
And I really hope you can tell us what's effectively going on behind the scenes......(might be a huge work)
Because then we can know more about pandora(linux) and if we have problems we can find an existed post to look for the answers....
 
Last edited by a moderator:
Stuckie or anyone, what is the best way to tarball the running debian/ubuntu OS extend and grab the other necessary files to make this a bootable SD solution? I'd really like to make this boot via SD. Any hints on what needs to be pulled from Angstrom?

PS: Alerino, can you post your taskbar graphic for the debian shortcut please??? :)
 
Alerino said:
xopher said:
Stuckie or anyone, what is the best way to tarball the running debian/ubuntu OS extend and grab the other necessary files to make this a bootable SD solution? I'd really like to make this boot via SD. Any hints on what needs to be pulled from Angstrom?

PS: Alerino, can you post your taskbar graphic for the debian shortcut please??? :)

i too want the howto boot from SD

xopher, "chmod +x path/To/my.preMount" first then (edit: right click on the icon box and Add New Items)

View attachment 480

Thanks, but what is the path to your debian icon for the shortcut, is it with the other pixmaps? Sorry I'm too lazy to look at the moment please forgive me. :)
 
Last edited by a moderator:
Someone can upload a video of all the process to set up debian in a extend?
Thanks
 
Oops.. I kinda disappeared for a bit, didn't I?

I should have some time this weekend to give to the various bits and pieces I have lying about.. and if no-one's done so yet, I'll do a video of setting up the debian thing if you want.

However, how much information do you want?
Setting it up from scratch, and going through the debootstrap process is pretty indepth really.. whereas just running through the ExtendUtils app with a pre-configured extend is just a few minutes, and is explained in the documentation.
If the documentation is confusing at all, let me know and I'll update it :)

Of course, I still have to go back and document the process properly anyway, so I might do both.

I also might have a fiddle with getting it to boot direct from SD card.. though this depends greatly on how much time I have.. something which I have a distinct lack of, recently :(
 
Stuckie said:
I also might have a fiddle with getting it to boot direct from SD card.. though this depends greatly on how much time I have.. something which I have a distinct lack of, recently :(

I think this would be greatly appreciated by many. If you do not have time, a link to download a rootfs would suffice. That way someone else (maybe me) could write up something.

Also, thanks for this. I don't use it but it looks like a really cool idea.

Canguy
 
Last edited by a moderator:
Stuckie said:
Oops.. I kinda disappeared for a bit, didn't I?

I should have some time this weekend to give to the various bits and pieces I have lying about.. and if no-one's done so yet, I'll do a video of setting up the debian thing if you want.

However, how much information do you want?
Setting it up from scratch, and going through the debootstrap process is pretty indepth really.. whereas just running through the ExtendUtils app with a pre-configured extend is just a few minutes, and is explained in the documentation.
If the documentation is confusing at all, let me know and I'll update it :)

Of course, I still have to go back and document the process properly anyway, so I might do both.

I also might have a fiddle with getting it to boot direct from SD card.. though this depends greatly on how much time I have.. something which I have a distinct lack of, recently :(
I would like the complete video of the process because for me undertanding both english and linux console language is very hard. Sorry for making you pass through such annoying process.
 
Last edited by a moderator:
Well that was annoying.. I had a rather large post ready to go, and my machine dutifully crashed and I lost what I wrote.
So here's take two.

A video of the entire bootstrap process probably would not be of much use.. it's effectively about ten commands, and lots of waiting for things to happen! So a very boring video it would make, indeed.
That said, I'm going to redo the process now, and type it up in a more comprehendable manner than the original post, as this'll get pushed to the Pandora Wiki as well.

I'll also hopefully try and cover booting Debian from SD card.. depending on if I manage to get it to work on the first few tries!

Part One - Setting Up
I'm going to do this entirely on the Pandora for the most part.
Everyone that wants to do this is likely to have a Pandora, but they may not have access to a Linux PC for example. Granted, the PC is going to be many times faster at performing the initial bootstrap, but a lot of the configuration has to be done on the Pandora anyway.
We'd also have needed to do a partial bootstrap on the PC, and transfer it over to the Pandora in order for it to work, and that's a pain in the backside to do, so we shall skip this altogether and perform everything on the Pandora.

This however, presents a couple of caveats:
i. We need to sacrifice a (possibly) large SD card.
ii. We also need to install a small application to the NAND.

If you're unhappy with these, stop now!
Otherwise, continue on...

To keep us all on the same path, put your sacrificial SD card into Slot 1 - this is the right slot, next to the volume wheel.
It needs to be at least 1GB, but if you're going to be running Debian directly from it; the bigger, the better.

Now open up Terminal from the menu.
We'll be using Terminal a lot, so in order to keep us sane, I'll use the following stylings.
Commands you should run will be in bold, like this Additional information about the commands will be formatted like this, where keywords from the command will be in bold to help identify bits and pieces.
I'll try to keep commands on a new line as well, so it's easier to follow.

Right, now we need to re-partition our card, as it's likely formatted to FAT32, and we need it as ext2 at least.
sudo cfdisk /dev/mmcblk1 You'll probably get prompted for your password, and given the usual warning about using commands as root. Either way, what we're doing is launching cfdisk to repartition our Slot 1 card; which again is the right slot next to the volume wheel.

This tool is relatively straight forward to use.
You'll want to highlight [ Delete ] via using the dpad, and wipe out all the partitions on the card - probably just the one W95 LBA partition, or FAT32 - by pressing Enter.
Next, we shall create a [ New ] partition. If we just want to use the whole card ( which by default, we do ) just hit return. If however, you want a swap partition for whatever reason, you'll need to cut this number down a bit ( say by 512 ) to fit it on.

If you've created a Swap Parition, you'll need to change the type, so highlight the swap partition using the dpad, and select [ Type ] from the commands. You'll get a huge list of partition types, but you can ignore them all, as swap is what it picks by default.

Once you've finished gutting your SD card, highlight [ Write ] and press Enter. You'll need to actually type yes in order to proceed, but don't just hit enter if you only see y, you still need to type the rest of the es in.

Finally, highlight [ Quit ] and hit Enter.

We now need to format it, which can be done as follows:
sudo mke2fs /dev/mmcblk1p1 We're making an Ext2 filesystem on Partition 1 on the SD card in Slot 1.

And if you created swap, probably need to format too:
sudo mkswap /dev/mmcblk1p2 We're making Partition 2 on the SD card in Slot 1 be registered as Swap space, which we can then activate via sudo swapon /dev/mmcblk1p2 when we need it.

If you get an error about the partition being mounted: sudo umount /dev/mmcblk1p1 should fix it, then try again.
If you get an error about it not recognising the partition, eject and reinsert the card to refresh it's mount list and try again - though it'll likely have tried to automount the partition for you, and you'll need to do the above umount command!

That's our SD card setup.

Part Two - Bootstrap Fun
Now we need to get a bootstrap of Debian up and running on our newly created space.
To do this, we'll use cdebootstrap.. and this is the one small application we need to install.

Grab it from here: http://packages.debian.org/sid/cdebootstrap-static and select the armel package.
Download it to /tmp preferably, but your home folder will do, or anywhere you like. For now, I shall assume you downloaded it to /tmp

Let's get back to the Terminal.
cd /tmp Again, if you downloaded elsewhere, change to that directory instead.
ar xv cdebootstrap*.deb We're using the archive tool to extract with verbosity our cdebootstrap package.
sudo tar -zxvf data.tar.gz -C / Now we're using tar to extract, with gzip support, again with verbosity, the file data.tar.gz, changing the Current directory to / so that it extracts systemwide on our NAND. We're running this command sudo so we have write permissions.

Now we just run cdebootstrap-static with a few parameters, and wait.
cdebootstrap-static --allow-unauthenticated -f minimal lenny /media/mmcblk1p1 What we're doing here, is we're allowing "unauthenticated" packages to be installed. As we don't, or probably don't, have the gnupg keychain stuff configured, all packaged will be "unauthenticated" regardless of whether they are or not. We're telling it we also want a minimal install of the lenny release, and to install to where we have the mount point of Partition 1 of the SD card in Slot 1. We could've used sid, sarge, potato, squeeze, etc.. in place of lenny, or chosen a standard install. Curiously, we also could've specified an Ubuntu release - perhaps that's something to look into another time?

[edit]
Annoyingly, after just getting Debian booted via SD card, it seems you'd actually be better off grabbing sid here, instead of lenny if you want your X server to work - lenny doesn't have the omapfb driver available.
So keep this in mind.. if you want Debian to boot from SD, you'll want to grab sid here, rather than lenny!
[/edit]

Part Three - Debian in an Extend
Technically, once the bootstrap finishes, you're done.
You could just sudo chroot /media/mmcblk1p1 and you'd be in Debian and can do as you please ( or continue down to Part Four for some tweaks, or perhaps Part Five to boot from it. )

If however, your goal is to compress this into an Extend file to use with my Extend Utils suite, and have a completely customised version of Debian to start with, continue on.

Pushing this into an Extend file is incredibly easy.
At this point, if you've done the minimal install, you should have about 120MB of installed stuff. You may want to jump to Part Four, install some things and set stuff up before continuing here, or this might be all need - and you'll use the Overlay support of Extend Utils to create extensions to the minimal Debian install you now have.

Either way, you'll need to create the actual Extend file itself.
This is really easy, just takes some space and time.
Back to your Terminal. I'm going to assume you've got a FAT32 formatted SD card in Slot 0 - the one next to your power switch - and that it has a fair amount of space on it.
cd /media/mmcblk0p1
dd if=/dev/zero of=debian.extend bs=1MB count=2048 This command will take an age, and is also important to understand what it's doing. It's creating an Output File of debian.extend, populating it with zeros from /dev/zero - this makes it very compressable. We're using a Block Size of 1MB, and we're wanting the file to contain 2048 of them - essentially being around 2GB. Be aware that a 2GB SD card is not going to give you the whole 2GB and you'll like need to specify about 1700 at most. You can ofcourse change this to whatever size you like, as long as it's about 150MB to store your Debian system as it currently stands.
sudo mke2fs -F debian.extend We've seen this before, of sorts.. we're now Forcing mke2fs to turn our debian.extend file into an Ext2 formatted filesystem.
mkdir /tmp/debian.extend
sudo mount -o loop debian.extend /tmp/debian.extend We're mounting the debian.extend file as a loopback filesystem on our created folder in tmp.
sudo cp -R /media/mmcblk1p1/* /tmp/debian.extend Finally, we copy everything from our Debian filesystem over to our Extend file. The -R option ensures it recursively copies everything - ie: traverses the folder structure.
sudo umount /tmp/debian.extend

That's it :)
Your debian.extend file now contains your Debian install, so you can either wipe your Debian install SD card back to FAT32, or perhaps contine on with it to use for booting into Debian in Part Five.

Part Four - Configuration Tips and Tricks
You now have a Debian install somehow, be it in an Extend or on SD card. Let's add some stuff to bring it up from a minimal system, to a usable system.

First thing you'll want to do is ensure you've chrooted into the Debian install. So do so if you haven't already.
I shall assume you're continuing on with the Debian install on your SD card.
sudo chroot /media/mmcblk1p1

I'll now prepend Debian to all commands we'll perform in the Debian Chroot, and Angstrom to any commands to be done in an Angstrom Terminal.

Unless you're used to messing with apt, you'll probably want Synaptic - which is a graphical front end to apt. Apt being Debian's Package Manager - opkg being Angstrom's if you're wondering.

Debian: apt-get install synaptic
This'll take up another 230MB as it installs a HUGE amount of stuff, but it should set you up for various things you might want to fiddle with, so it's all good.

Once that finishes ( and it does take a while ) you'll probably want to run it. However, as it's an X application, it needs access to Angstrom's X server, or access to it's own. Getting Debian's X server running shall be something we tackle next, but for now, we'll use Angstrom's X server.

You'll need to either open another Terminal, or go to File->Open Tab in your current Terminal. This'll be our Angstrom Terminal.
Angstrom: xhost local:localhost We're telling our X server to accept all connections on localhost - our machine - as we're about to start programs it's not aware of - our Debian applications.
Angstrom: sudo mount --rbind /tmp /media/mmcblk1p1/tmp We're doing a recursive bind of /tmp to our Debian's /tmp. This is so X apps in Debian can access our Angstrom's X authority files and such... as /tmp is in volatile space anyway, we should be fine here.
Debian: synaptic You may also want to add & to detach it from the Terminal so we can launch other things from our Debian Terminal.

You can now go and install things till your heart's content, with a rather large 21509 packages at your disposal in the standard Lenny release. There's more in Sid, and there's even more if you add the contrib repositories.

I shall stop the guide here for the moment, and shall continue with getting Debian's X server up and running alongside Angstrom's X server, and getting Debian running from a bootable SD card later on ( IE: I shall start it in a few hours and see where it takes me! )

Hopefully this is clearer than the brain dump I did on the original post!

Part Five continues on here: http://www.gp32x.de/board/index.php?/topic/57097-debian-on-an-sd-card/
 
Last edited by a moderator:
Back
Top