Debian On An Sd Card


Stuckie

Member
Joined
Apr 7, 2004
Messages
492
Age
38
Location
Tired, and sleeping in the basement...
Website
www.stuckieworld.net
Debian Squeeze is now running on the Pandora via SD - please see this post for more details: http://www.gp32x.de/board/index.php?/topic/57097-debian-on-an-sd-card/page__view__findpost__p__940030

Hiding old post for posterity, and to confuse people less ;)

Splitting this somewhat from the Debian in an Extend topic ( well, 17 pages is a huge amount for anyone to read, and this is a bit different. )

This morning, my favourite forum dwellers, I bring you a working rootfs for Debian to boot from SD card on the Pandora.
Originally, what I was doing was rewriting the Debian in an Extend guide to help make it much more clearer as to what was going on.. I then decided to try going a step further and seeing if I could boot from it - and you can, with some fiddling.

[youtube]http://www.youtube.com/watch?v=TuqDNS4oQrE[/youtube]

*** IMPORTANT NOTE *** This is NOT complete, and is more of a proof of concept just now.. it is only marginally usable at the moment due to some bits not quite configured and setup yet. At time of writing, this includes Audio, WiFi, accelerated graphics, as well as the nubs and a full keymap for the Pandora's keyboard.. but it's enough to start with. *** IMPORTANT NOTE ***

For those wanting a quick start guide ( and know roughly what they're doing ):
Download the DebianPandora.tar.gz here: http://stuckiegamez.co.uk/apps/pandora/Debian/pandoraDebianPOC.tar.gz [edit] it's up now, sorry for the wait! [/edit]
This is a gzipped tarball just shy of 900mb, and will expand to about 2.5GB... so ensure you've a large sacrificial card at the ready.
Partition an SD card to have one large Ext2 partition, and a swap partition ( if you're going anywhere near gnome, you're going to need swap! about 512mb will be suffice. )
Format the two partitions - mke2fs and mkswap respectively.
Extract DebianPandora.tar.gz to the Ext2 Partition.
Ensure your SD card is in the first slot ( next to the volume wheel. )
Reboot; holding the right shoulder button on boot and select boot from SD.
Boot to SD.
Default username is: pandora
Default password is: debian
Default root password: craigforprimeminister
( There's a reason for the root password - it made setting things up far easier - touchscreen especially - as I still ran into odd permission issues and devices not being found when using sudo. The root password will obviously be scrambled before any "proper" release is done. This is only a proof of concept, and I wanted to get things sorted quickly than jump through sudo/su/permission hoops )

The above package has already done everything else in this post, the rest of this post is just a continuation from the Debian in an Extend Guide here: http://www.gp32x.de/board/index.php?/topic/54651-debian-in-an-extend/page__view__findpost__p__922100

I suggest you read that first before continuing on here.. the reason this has been split is to save people 17 pages of waffle, and the goals have changed to get Debian to run outside of Angstrom. The initial Parts of that guide are still valid, and to save your sanity, ensure you install sid rather than lenny!

Part Five - Debian on an SD Card
We're treading new ground here... so bear with me as I type as I work. I'll try not to make it as much of a brain dump as the original post was ;)

I'm assuming you've just booted up your Pandora again, and that this time your Debian card is in Slot 0 ( next to the power switch. )
If you're continuing on from the previous part, ensure that you've unmounted /tmp before swapping your cards.
Angstrom: sudo umount /media/mmcblk1p1/tmp
And if you have swap enabled: sudo swapoff /dev/mmcblk1p2

Debian and Angstrom are somewhat compatible.. which is good for us as we can be sneaky and pinch bits and pieces from Angstrom in order to get stuff to work. This is exactly what I'll be doing.
Now, if you've created a bootable SD card with the current Pandora firmware on it for messing with, you'll know roughly what we're upto here, as we need the uImage and a boot.txt installed onto our Debian card so it can boot.

My current boot.txt contains the following:
Code:
setenv bootargs root=/dev/mmcblk0p1 rw rootdelay=2 vram=6272K omapfs.vram=0:3000K
ubi part boot && ubifsmount boot && ubifsload ${loadaddr} uImage && bootm ${loadaddr} && boot
Save this to /media/mmcblk0p1/boot.txt
You could use whatever text editor you like to create it, as long as it's saved to that file.
Then in a terminal:
Angstrom: sudo cp /boot/uImage /media/mmcblk0p1/boot We're copying our uImage that we know works ( as we've booted with it ) to our Debian SD

Now to test, you can reboot here, and hold R - the right shoulder button - while booting to get the startup menu, select the SD option, and watch as Debian boots! ... but not many things will work and you'll likely get dumped to a terminal. If you haven't set up any users or passwords at this point, you'll likely be a bit stuffed. You'll also likely see lots of errors fly past, about modules.dep not existing, and /etc/fstab not existing either. These are some of the things we'll need to fix if we've to get this up and running.

Modules are easy, reboot back to Angstrom if you haven't already by typing: reboot if you've logged in, or doing the CTRL+ALT+DEL salute from a USB keyboard, or failing that, pandora+power as a last resort... we're going to pinch the modules we have available to us!

Once Angstrom has started back up, open up a Terminal.
Angstrom: sudo cp -R /lib/modules/* /media/mmcblk0p1/lib/modules We're copying all the modules that are linked to our uImage directly to where Debian expects to find them.
Angstrom: sudo cp /etc/fstab /media/mmcblk0p1/etc/fstab We may as well copy our fstab over while we're here.

Now, depending on if you install Debian Lenny or Sid, we're going to have to deviate a bit here.
After installing GDM and fluxbox, and somewhat expecting them to "just work," I found out that although Sid does have the omapfb driver we need, Lenny does not... so X isn't going to start regardless of what you do in Lenny - well, you could recompile the omapfb driver I suppose.. if you really wanted to!
So lets upgrade our Debian to Sid.. we need to do this in Angstrom as we don't have WiFi access in Debian as yet.
Angstrom: sudo chroot /media/mmcblk0p1

Open another Terminal window/tab.. again this gives us our Debian Terminal and Angstrom Terminal.
Angstrom: sudo mount --rbind /tmp /media/mmcblk0p1/tmp
Debian: nano /etc/apt/sources.list If you haven't installed nano, you might as well grab it just now - apt-get install nano

We're going to change this line to the following:
deb http://ftp.debian.org/debian sid main contrib non-free
Which gives us all the sid packages in the main, contrib and non-free (as in, non-GPL) repositories.
You can also change to a closer mirror if you want.
Those clever folks who already have a Sid install, may want to add contrib and non-free repositories to their sources anyway.

Then tell apt to update and a distribution upgrade:
Debian: apt-get update
Debian: apt-get dist-upgrade This is likely to chew through a huge amount of space... with my minimal install with just nano, GDM and fluxbox added, it's going to chew up another 300MB in total. Be aware of how much space you have left! We can kill apt's cache later to regain the majority of the space though. This'll take a huge amount of time, unfortunately... infact, in retrospect, it's probably quicker to wipe your current install, and redo the bootstrap using Sid, it's seriously that slow!

Now everyone's sitting with a Sid install of Debian, we shall continue.

We need the omapfb driver in order to get X to work, as well as the dri2 extension. I know this from peeking at the xorg.conf that powers the Pandora ( you can find it in /etc/X11/xorg.conf if you want a peek too! )
Debian: apt-get install xserver-xorg-video-omap3 libxcb-dri2-0 xserver-xorg-input-tslib tslib-bin Curiously, the Debian package site recommends to try xserver-xorg-video-omap3 for better performance on OMAP3 chipsets.. so we'll try that. Additionally, we're installing the touchscreen drivers while we're here
Debian: apt-get install gdm fluxbox I like fluxbox, but you can pretty much choose whichever window manager you like, but stick with GDM as the desktop manager. You may have already installed these in Part Four anyway, but it's here incase you skipped down. If you're going to go install gnome, be aware of the VAST amount of time it's going to take to install. Consider yourself warned. Why do you think this guide is so late? ;)

Right, we might as well setup the touchscreen while we're here.. or at least do as much as we can.
Debian: nano /etc/skel/.profile
You'll want to add the following to the bottom of the file:
Code:
TSLIB_TSDEVICE=/dev/input/event7
TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_TSDEVICE TSLIB_CONFFILE

You'll also need to add that to the .profile of any users you have already created.
If you haven't created any, we'll do one now...

Debian: adduser username Obviously, replace username with whatever username you want. We might as well sort this out now if you haven't done so already.
Debian: visudo visudo should load up nano, and give you access to the sudoers file. We want to add our username to the list so we can use sudo.
Find the line that reads root ALL=(ALL) ALL and add this beneath:
Code:
<username>	ALL=(ALL) ALL
Replacing <username> with your actual username, of course.

If, like me, you like checking out your current progress, feel free to reboot at this point, and try to boot from SD and see where it takes you.
At this point, GDM should show up and if you've created a user, you can login!
You'll notice your touchscreen is messed up though, but we shall fix that in a minute... for now, marvel at running Debian on your Pandora ;)

Let's fix this touchscreen madness.
If you've been insane enough to install gnome, open up a Terminal from the Applications menu. If you've installed fluxbox, press ALT+F1 - which on the Pandora keyboard is, Fn+Alt+1

Either way, in your terminal run this:
Debian: sudo chvt 1 We need to change to the first terminal to do this.
Login as root.
Debian: ts_calibrate You'll then get to click some boxes.
Debian: chvt 7 Your mouse should be fine now, if not, just logout and back in again which should fix it.

Currently, this is up to where I am.
Seeing as the community has always been awesome in taking a project and running with it, I give you my current proof-of-concept, so we can get all the driver issues sorted, and have something else to play with :)
Especially as I don't really have as much time to hack about as I'd like to, these days.
 
Last edited by a moderator:
Thanks Stuckie, can't wait to begin playing with this. This is pretty sweet. Wish I had an extra card here at work with me...damn! I know you stopped working on the Ubuntu releases and are probably busy but have you looked at the recent images for 10.10 yet? I was thinking of taking a crack at it, I'd love to get Plasma running :)
 
Ubuntu should be more doable as a bootable SD card than in an Extend that runs on top of the system.
I think I still have the Lucid extend I did a while back ( probably still on my site ) so I'll have a quick look at that tonight.. if I can get it to the same level as I have Debian just now, they should both be able to continue at the same pace.
 
Here, in case you wanted to have a quick look at the pre-installed images

http://cdimage.ubuntu.com/kubuntu-mobile/ports/releases/10.10/release/

http://cdimage.ubuntu.com/ubuntu-netbook/ports/releases/10.10/release/
 
Stuckie said:
Will post my findings when I get home :)

I gave it a quick rip. It started to boot the kernel then froze. I didn't look any further at the time. You're good with this stuff so you'll probably get it booted swiftly.
 
Last edited by a moderator:
My quick attempt got it to boot, but it decided to ignore all input devices, so all I got was the pretty Maverick GDM screen.
I then copied the uImage over from Angstrom.. and it didn't finish booting.. hmm..

I had to rip the rootfs out the img file anyway, so I possibly buggered that up a bit.. so I got rootstock to build me a nice clean minimal Ubuntu rootfs of Maverick, and I've currently got my Pandora upgrading to the ubuntu-netbook meta-package. I imagine it'll be ready to have a prod with in the morning.

I think Ubuntu is taunting me though, as this is my second attempt at getting it on the Pandora... so hopefully this'll work in the morning :)
 
Stuckie said:
My quick attempt got it to boot, but it decided to ignore all input devices, so all I got was the pretty Maverick GDM screen.
I then copied the uImage over from Angstrom.. and it didn't finish booting.. hmm..

I got it to boot also (Netbook edition not the Kubuntu image). No input like yours. I renamed the boot.scr and added autoboot.txt to the first partition pointing to the second. Guess I'll hack away at this with you, I'm learning as I go.

EDIT: Might a USB keyboard work for input....guess I'll try later.
 
Last edited by a moderator:
I might've tamed the bugger!

I grabbed my Jaunty extend and splatted it across an SD card, copied in the libraries and kernel image, and it booted without much issue :)
Well, without much issue as in I buggered up the permissions so couldn't log in, but I'm fixing that just now ;)
I also got sound! And it at least registered the touchscreen - but was using the wrong driver, so I'll fix that too.

Ok, so it may be Jaunty which is 9.04, but I shall try Lucid next - which seeing as it's the latest LTS release, shouldn't have people complaining too much about it "being old" :p
I'll then attempt Maverick again, but it seems to be a bit picky.. as a number of times I booted a minimal install of Maverick and it actually gave up booting part way through, annoyingly.

Once the permissions are sorted, I'll tar and upload it for people to play with.

[edit]
Instructions:
Grab Jaunty Extend from: http://stuckiegamez.co.uk/apps/pandora/UbuntuExtend/ubuntu-arm-jaunty-desktop-3.5G.7z
Unzip somewhere.
mkdir tmpMount
sudo mount -o loop ubuntu-arm*.extend tmpMount
sudo cp -a tmpMount/* /path/To/SD/
sudo cp uImage /path/To/SD/boot/
sudo cp boot.txt /path/To/SD/
sudo cp -R modules /path/To/SD/lib/
Reboot Pandora.

User: ubuntu
pass: pandora
[/edit]
 
Shouldn't matter about ext2 or ext3.

Ubuntu has the same driver issues as Debian, however.. so you still wont get WiFi yet, but you do have the addition of sound.
Interestingly, Ubuntu did run faster than Debian did; not wholly sure how either.

I didn't have time this morning to tar up the filesystem, so you'll need to follow my quick guide in my previous post if you want to fiddle with Ubuntu before I get home again, and you'll want to chroot in and grab the tslib stuff as well else your touchscreen will be quite quite mad.
 
Stuckie said:
My quick attempt got it to boot, but it decided to ignore all input devices, so all I got was the pretty Maverick GDM screen.
I then copied the uImage over from Angstrom.. and it didn't finish booting.. hmm..
Stuckie said:
Ubuntu has the same driver issues as Debian, however.. so you still wont get WiFi yet, but you do have the addition of sound.
Interestingly, Ubuntu did run faster than Debian did; not wholly sure how either.
Debian haven't migrated to upstart ?
That could explain the speed difference
 
Last edited by a moderator:
Upstart would only explain the bootup running fast ( which was pretty comparable, to be honest ) not the system itself feeling more responsive.

I'm also not a fan of upstart after the chaos it caused me last time, so I'm quite happy for Debian not to bother migrating ;) especially since it severely buggers up chroots.
 
Stuckie said:
Upstart would only explain the bootup running fast ( which was pretty comparable, to be honest ) not the system itself feeling more responsive.

I'm also not a fan of upstart after the chaos it caused me last time, so I'm quite happy for Debian not to bother migrating ;) especially since it severely buggers up chroots.

So the part I didn't get, is that you have actually used ubuntu (ses my previous quotes). Sorry about that, and congrats :p
 
Last edited by a moderator:
Yep, I got Jaunty booting rather than Maverick, but was still Ubuntu on Pandora :)

My posts always seem to be hard to follow; perhaps I should take a bit more time to think about what I'm typing, rather than just a brain dump ;)
Though I had wondered why you had quoted a post I did a couple days ago, rather than the one this morning where I mentioned I got it working!
 
I got it to boot but it was from the original Ubuntu extend you posted some time ago. I couldn't get GDM to start. Going to get the new extend you posted because I'm guessing you did some fixes in there? Running at it again.... btw thanks for the work and help.

EDIT: ok new image starts gnome, I must've done something wonky, no mousing (nubs) and I didn't do the touchscreen steps but further along now.... :)
 
For the lazy, here's a tarball of the Jaunty Ubuntu release ... just extract on an ext2/3 formatted SD card and boot.
http://stuckiegamez.co.uk/apps/pandora/Debian/jaunty-ubuntu-sd.tar.gz

Touchscreen doesn't quite work as you'd expect.. it seems to think it's a trackpad for some reason.. I'm sure there's some setting deep in Ubuntu's settings structure to change this, but I don't have the time to fiddle with it much.

Working on getting Lucid running just now, then onto Maverick again.. after that, I'll pick one of the better ones and run with that and Debian.
 
Stuckie said:
For the lazy, here's a tarball of the Jaunty Ubuntu release ...

Touchscreen doesn't quite work as you'd expect.. it seems to think it's a trackpad for some reason.. I'm sure there's some setting deep in Ubuntu's settings structure to change this, but I don't have the time to fiddle with it much.

Just got home and was going to muck with the touch screen. I'll be lazy and grab this and try to get other things to work, I don't expect much except for fun.
 
Last edited by a moderator:
I messed with debian on an SD card a few months ago. Much less smooth than you people are experiencing, I had a hell of a time because debootstrap didn't quite work, but I coaxed the system in to booting up and finished installing packages manually, as well as getting wireless (not with built in but with a dongle that died a couple days later) by downloading and installing debs one by one in the correct order by following dependencies on the debian packages browser on their site. That sucked but it was cool while it worked (couldn't use it for much without a network connectiion). I even got the screen to kinda work, forget how, but I couldn't get it to calibrate so I couldn't touch the far edges, but it was in absolute mode. X11 seemed super slow, though, even with using omapfb. I didn't bother with sgx but copied a few pandora scripts over so I could get LEDs, charging and nubs and a few other things. Mostly usable aside from slowness, screen calibration and no built in wifi.

Edit: not sure if I still have it. One of my cards recently fell victim to the "randomly corrupt to hell" bug and the filesystem couldn't be salvaged, but I forget which card that was... I think debian is on the 4GB one and the corrupted one I know was the 32GB one so I imagine I still have the image, but it's some couple GB.
 
Stuckie said:
For the lazy, here's a tarball of the Jaunty Ubuntu release ... just extract on an ext2/3 formatted SD card and boot.
http://stuckiegamez.co.uk/apps/pandora/Debian/jaunty-ubuntu-sd.tar.gz

Touchscreen doesn't quite work as you'd expect.. it seems to think it's a trackpad for some reason.. I'm sure there's some setting deep in Ubuntu's settings structure to change this, but I don't have the time to fiddle with it much.

Working on getting Lucid running just now, then onto Maverick again.. after that, I'll pick one of the better ones and run with that and Debian.


Root password?
 
Last edited by a moderator:
Back
Top