Difference between revisions of "Debian On SD"

From Pandora Wiki
Jump to: navigation, search
(Initial Page for Debian on SD project... this isn't finished but will include full documentation on how to roll your own, as well as maintenance and help.)
 
(Massive update of information.. still not finished ( PND support needs adding, as does touch screen and other little bits and pieces here and there ))
Line 62: Line 62:
  
 
== Desktop Environment ==
 
== Desktop Environment ==
 
 
Now you have Debian, the world is yours for the taking!
 
Now you have Debian, the world is yours for the taking!
 
Or something like that...
 
Or something like that...
Line 83: Line 82:
  
 
'''''apt-get install lxde'''''
 
'''''apt-get install lxde'''''
 +
 +
This may well take an age, so go do something else in the meantime.<br />
 +
You may also want a login manager.. your choices are amongst XDM, GDM, KDM and SLIM to name a few. KDM is perhaps a bit heavy, whereas GDM works fairly well even though it's rather heavy too. SLIM is what you use on Pandora anyway, and XDM is rather basic but usable all the same. GDM is automatically pulled in via LXDE anyway, so we may as well just use that for now.
 +
 +
Once it's done, we'll start tackling the Drivers.
  
 
== Device Drivers and PNDs ==
 
== Device Drivers and PNDs ==
 
 
We shall tackle these one at a time, as there's quite a few of them.
 
We shall tackle these one at a time, as there's quite a few of them.
  
Line 95: Line 98:
 
* Wifi
 
* Wifi
 
* Bluetooth
 
* Bluetooth
* Kernel
+
* Kernel and Misc Bits and Pieces
 
* PNDs
 
* PNDs
 +
 +
=== X Display Driver ===
 +
Debian has a NEON-optimised omapfb driver. We shall use this, and pinch some configuration gubbins from Angstrom.
 +
 +
'''''apt-get install xserver-xorg-video-omap3'''''
 +
 +
We now need to create an xorg.conf .. though it'll be rather minimal as we only really want to overload what graphics device setup it has, so:<br />
 +
'''''nano /etc/X11/xorg.conf'''''<br />
 +
Section "Module"
 +
Load "extmod"
 +
Load "dbe"
 +
Disable "glx"
 +
Disable "dri"
 +
Load "dri2"
 +
EndSection
 +
 +
Section "ServerLayout"
 +
Identifier "DefaultLayout"
 +
Screen "Screen0"
 +
EndSection
 +
 +
Section "Screen"
 +
Identifier "Screen0"
 +
Device "OMAPFB"
 +
Monitor "Monitor0"
 +
DefaultDepth 16
 +
SubSection "Display"
 +
Depth 16
 +
Modes "800x480"
 +
EndSubSection
 +
EndSection
 +
 +
Section "Monitor"
 +
Identifier "Monitor0"
 +
EndSection
 +
 +
Section "Device"
 +
Identifier "OMAPFB"
 +
Driver "omapfb"
 +
Option "fb" "/dev/fb0"
 +
EndSection
 +
 +
Most of this is pinched from the Angstrom xorg.conf minus the fb Option at the bottom, as our framebuffer has a different device node.
 +
 +
That should be all you need for basic X though.
 +
 +
=== SGX Drivers ===
 +
Most of this has been pinched from http://elinux.org/BeagleBoardDebian#SGX_Video_Acceleration - why rewrite the wheel?<br />
 +
This mostly works apart from a few caveats, so I shall repeat it here for future reference and to keep all information in one place, and I've uploaded the resulting tarballs for convenience.
 +
 +
You can either follow the above guide - substituting the BeagleBoard for the Pandora, or use the following preconfigured packages.<br />
 +
'''''cd /tmp'''''
 +
'''''wget -c http://www.stuckiegamez.co.uk/apps/pandora/Debian/GFX_4_00_00_01_libs.tar.gz''''' ~20MB Libraries themselves<br />
 +
'''''wget -c http://www.stuckiegamez.co.uk/apps/pandora/Debian/GFX_Linux_SDK.tar.gz''''' ~220MB Demos and SDK gubbins<br />
 +
 +
Technically, you don't really need that fat 220MB GFX_Linux_SDK tarball unless you really want it, or want to test the libraries are in place.<br />
 +
I'll cover installing both anyway...
 +
 +
==== Libraries ====
 +
'''''tar -zxvf GFX_4_00_00_01_libs.tar.gz'''''<br />
 +
'''''chmod +x ./install-SGX.sh'''''<br />
 +
'''''./install-SGX.sh'''''<br />
 +
'''''rm /devmem2_0.0-0ubuntu1_armel.deb''''' - this is particularly useless to us... and why it dumps it at root, I don't know!<br />
 +
 +
That package contains ES2, ES3 and ES5 libraries.. we're only really interested in ES2 ( haven't tried if ES3 or ES5 would even work! ) so:<br />
 +
'''''cd /usr/lib'''''<br />
 +
'''''ln -s ES2.0/* .'''''<br />
 +
 +
Not hugely clean, but it works. For the brave, you could try ES3 or ES5 but.. you're on your own!
 +
 +
==== Demos/SDK ====
 +
'''''cd /tmp'''''<br />
 +
'''''tar -zxvf OGLES.tar.gz'''''<br />
 +
'''''tar -zxvf OGLES2.tar.gz'''''<br />
 +
 +
You can't run anything yet ( well, you might since you've chrooted in via Angstrom ) so we'll leave them in /tmp for the moment - or move them elsewhere - such as /opt if you're worried about Debian wiping out /tmp on boot.
 +
 +
=== Keymap ===
 +
 +
The keymap is fun and comes in two parts - the mapping extension, and an xmodmap script.<br />
 +
We shall steal them from Angstrom.. so open up another Terminal.<br />
 +
As of now, I shall prefix Angstrom commands with ''Angstrom'' and Debian commands with ''Debian'' so you know which Terminal to type them in.
 +
 +
''Angstrom'' '''''sudo cp /etc/keymap-extension-2.6.map /media/mmcblk0p1/etc''''' - this does assume you've got your SD card mounted in slot one, and with one ext2 partition.. adjust as necessary.<br />
 +
''Angstrom'' '''''sudo cp /etc/skel/.pndXmodmap /media/mmcblk0p1/etc/skel''''' - as above.<br />
 +
''Debian'' '''''nano /etc/skel/.xinitrc'''''<br />
 +
xmodmap ~/.pndXmodmap
 +
whoami > /tmp/currentuser
 +
killall -1 pndnotifyd &
 +
 +
Should probably copy more over but, this'll do for now.
 +
 +
=== Nubs ===
 +
The nubs just require some more config stuff to be copied over, and a few rc scripts to be setup right.<br />
 +
''Angstrom'' '''''sudo cp -R /etc/pandora /media/mmcblk0p1/etc'''''<br />
 +
This also copies over configurations for the LCD backlight, some pmenu and mmenu stuff, and some PND configuration bits.
 +
 +
''Angstrom'' '''''sudo cp /etc/init.d/pandora-state /media/mmcblk0p1/etc/init.d''''' - pandora-state restores nubs and backlight settings, as well as saves them on exit.
 +
 +
Configuration utils come in with the PND installation below.
 +
 +
=== Touchscreen ===
 +
tslib setup... though need to check if evdev will do it better as it seems to torment X at 100% CPU when the touchscreen is used just now...
 +
 +
=== Wifi ===
 +
Wifi is fun... most of it will come in the kernel and modules/firmware pack when we get to it, but there's some ancillary scripts and things that lay in wait to catch you off guard!<br />
 +
''Angstrom'' '''''sudo cp /etc/init.d/wl1251-init /media/mmcblk0p1/etc/init.d'''''<br />
 +
''Angstrom'' '''''sudo cp /lib/udev/rules.d/50-compat_firmware.rules /media/mmcblk0p1/lib/udev/rules.d'''''<br />
 +
''Angstrom'' '''''sudo cp /lib/udev/rules.d/compat_firmware.sh /media/mmcblk0p1/lib/udev/rules.d'''''
 +
 +
The rest come in the Kernel install below, and the PND install too.
 +
 +
=== Bluetooth ===
 +
Don't really have any bluetooth devices to test.. though I could try tethering my phone by bluetooth...
 +
 +
=== Kernel and Misc Bits and Pieces ===
 +
The kernel is easy... I advise grabbing a clean set from openpandora.org .. so we shall do that just now:<br />
 +
''Debian'' '''''cd /'''''
 +
''Debian'' '''''wget -c http://openpandora.org/firmware/images/modules-2.6.27-pandora+r24+git4bc490f3aa30d331d624faf2816851211a05f0b7-r24-omap3-pandora.tgz''''' - module and firmware pack.<br />
 +
''Debian'' '''''wget -c http://openpandora.org/firmware/images/uImage-2.6.27-pandora+r24+git4bc490f3aa30d331d624faf2816851211a05f0b7-r24-omap3-pandora.bin''''' - kernel itself.<br />
 +
''Debian'' '''''mv uImage* /boot/uImage''''' - yea, typing THAT long thing out again was going to happen!<br />
 +
''Debian'' '''''tar -zxvpf modules*.tgz''''' - again, no typing the giant filename!<br />
 +
''Debian'' '''''rm modules*.tgz''''' - bye bye giant scary named tarball!
 +
 +
That's essentially the kernel setup... we'll cover the boot script later.
 +
 +
==== RC Scripts ====
 +
There's quite a number of RC scripts kicking about.. we'll nick most of them from Angstrom again and deal with them one state at a time.
 +
 +
===== rc0.d =====
 +
sudo cp /etc/rc0.d/K05led-config /media/mmcblk0p1/etc/rc0.d/
 +
sudo cp /etc/rc0.d/K31pandora-state /media/mmcblk0p1/etc/rc0.d/
 +
sudo cp /etc/rc0.d/K40pndevmapperd-init /media/mmcblk0p1/etc/rc0.d/
 +
sudo cp /etc/rc0.d/K40pndnotifyd-init /media/mmcblk0p1/etc/rc0.d/
 +
 +
===== rc1.d =====
 +
sudo cp /etc/rc1.d/K05led-config /media/mmcblk0p1/etc/rc1.d/
 +
sudo cp /etc/rc1.d/K31pandora-state /media/mmcblk0p1/etc/rc1.d/
 +
sudo cp /etc/rc1.d/K40pndevmapperd-init /media/mmcblk0p1/etc/rc1.d/
 +
sudo cp /etc/rc1.d/K40pndnotifyd-init /media/mmcblk0p1/etc/rc1.d/
 +
 +
===== rc2.d =====
 +
sudo cp /etc/rc2.d/S05led-config /media/mmcblk0p1/etc/rc2.d/
 +
 +
oprun-init scripts live here too, but you're probably not going to want them!
 +
 +
===== rc3.d =====
 +
sudo cp /etc/rc3.d/S05led-config /media/mmcblk0p1/etc/rc3.d/
 +
sudo cp /etc/rc3.d/S30pndevmapperd-init /media/mmcblk0p1/etc/rc3.d/
 +
sudo cp /etc/rc3.d/S30pndnotifyd-init /media/mmcblk0p1/etc/rc3.d/
 +
 +
oprun-init scripts live here too, but you're probably not going to want them!
 +
 +
===== rc4.d =====
 +
sudo cp /etc/rc4.d/S05led-config /media/mmcblk0p1/etc/rc4.d/
 +
 +
oprun-init scripts live here too, but you're probably not going to want them!
 +
 +
===== rc5.d =====
 +
sudo cp /etc/rc5.d/S05led-config /media/mmcblk0p1/etc/rc5.d/
 +
sudo cp /etc/rc5.d/S30pndevmapperd-init /media/mmcblk0p1/etc/rc5.d/
 +
sudo cp /etc/rc5.d/S30pndnotifyd-init /media/mmcblk0p1/etc/rc5.d/
 +
 +
oprun-init scripts live here too, but you're probably not going to want them!
 +
 +
===== rc6.d =====
 +
sudo cp /etc/rc6.d/K05led-config /media/mmcblk0p1/etc/rc6.d/
 +
sudo cp /etc/rc6.d/K31pandora-state /media/mmcblk0p1/etc/rc6.d/
 +
sudo cp /etc/rc6.d/K40pndevmapperd-init /media/mmcblk0p1/etc/rc6.d/
 +
sudo cp /etc/rc6.d/K40pndnotifyd-init /media/mmcblk0p1/etc/rc6.d/
 +
 +
===== rcS.d =====
 +
sudo cp /etc/rcS.d/S39pandora-state /media/mmcblk0p1/etc/rcS.d/
 +
 +
You were expecting led-config again, weren't you!
 +
 +
==== Battery Monitor ====
 +
You'll likely want to know how much battery power you have!<br />
 +
''Debian'' '''''apt-get install apmd'''''
 +
 +
==== Misc Init Scripts ====
 +
There are a few random init scripts we need for things:<br />
 +
''Angstrom'' '''''sudo cp /etc/init.d/led-config /media/mmcblk0p1/etc/init.d''''' - configure the LEDs properly.<br />
 +
''Angstrom'' '''''sudo cp /etc/init.d/usb-gadget /media/mmcblk0p1/etc/init.d''''' - for initializing the usb gadget device - g_cdc for USB networking, for instance.<br />
 +
 +
=== PNDs ===
 +
There are some init scripts you need for the PNDs to work. These are:<br />
 +
''Angstrom'' '''''sudo cp /etc/init.d/pndevmapperd-init /media/mmcblk0p1/etc/init.d'''''<br />
 +
''Angstrom'' '''''sudo cp /etc/init.d/pndnotifyd-init /media/mmcblk0p1/etc/init.d'''''<br />
  
 
== Users and Permissions ==
 
== Users and Permissions ==
 
 
You may be wondering why Users haven't been done till the very end.. we've edited the /etc/skel setup which will be used to create your user details.
 
You may be wondering why Users haven't been done till the very end.. we've edited the /etc/skel setup which will be used to create your user details.
  
Line 105: Line 296:
  
 
== Reboot and Troubleshooting ==
 
== Reboot and Troubleshooting ==
 +
 +
=== auto/boot.txt ===
 +
We need either an autoboot.txt or a boot.txt now or we won't be able to boot up Debian.<br />
 +
There's no difference between either, other than autoboot will cause the Pandora to automatically boot from SD if it finds it, whereas boot requires holding the right shoulder button as usual.<br />
 +
''Debian'' '''''nano /autoboot.txt''''' - again, you could use boot.txt instead and press the right shoulder button during boot.<br />
 +
setenv bootargs debug root=/dev/mmcblk0p1 rw rootdelay=2 console=ttyS0,115200n8 vram=6272K omapfb.vram=0:3000K
 +
ex2load mmc 0:1 0x80300000 /boot/uImage
 +
bootm 0x80300000
  
 
All that's really left now is to reboot and catch any issues that may crop up!
 
All that's really left now is to reboot and catch any issues that may crop up!
 +
 +
=== Cleanup ===
 +
Potential clean-ups that should occur is packaging up the Pandora specific libraries and scripts into .deb files for maintenance purposes if nothing else. We can then either try and get them fed back into Debian, or provide our own Debian repo for Pandora.
  
 
= Maintenance and Upgrades =
 
= Maintenance and Upgrades =
 
 
Maintenance on Debian is very easy.. it's just a case of running '''''sudo apt-get update && sudo apt-get upgrade''''' from a console, or using Synaptic.
 
Maintenance on Debian is very easy.. it's just a case of running '''''sudo apt-get update && sudo apt-get upgrade''''' from a console, or using Synaptic.
  
 
= Common/Fun Things To Do =
 
= Common/Fun Things To Do =
 
 
There's a wealth of power at your fingertips with Debian, so place your fun things to do here!
 
There's a wealth of power at your fingertips with Debian, so place your fun things to do here!
  
 
[[Category:Documentation]] [[Category:Operating Systems]]
 
[[Category:Documentation]] [[Category:Operating Systems]]

Revision as of 23:42, 21 February 2011

Debian On SD

PLEASE NOTE THAT THIS IS NOT FINISHED AND IS WORK IN PROGRESS.. ONCE THIS LINE HAS BEEN REMOVED, IT WILL BE "COMPLETE"

This is split into three main sections - Building from Scratch, Maintenance and Upgrades, Common Things To Do.

  • Building From Scratch lets you customise everything from the outset, and lets you create your very own tailor-made distribution, rather than a pre-created one.

It does require a bit of Linux knowledge before diving in.. so if unsure, ask!

  • Maintenance and Upgrades covers standard Debian maintenance if you're not usually a Debian user.

It'll also ( in the future ) cover how to upgrade your pre-built distribution with new drivers as the official OS gets updated.

  • Common/Fun Things To Do will give you ideas on what to try in your new Debian installation.

Remember, this is a full desktop OS you now have squeezed into your hands, and feel free to share your cool ideas!

If you don't want to build from scratch, you have two choices;

The latest minimal is available here: http://www.stuckiegamez.co.uk/apps/pandora/Debian/pandora-debian6.0-minimal.tar.gz
The latest full build is available here: http://www.stuckiegamez.co.uk/apps/pandora/Debian/pandora-squeeze-1.0.tar.bz2

Remember to untar with permissions ( include p in your arguments to tar ) on to your ext2 formatted SD card.

Building From Scratch

This isn't for the feint of heart.. if you don't understand something - stop! Ask or read up on it before continuing. While I haven't mangled my Pandora or PC in any way from doing this, it's still possible to make a mess, so be careful!

This is split into many parts.. it's advised to go through this in order.

  • Getting a Minimal Install from Scratch
  • Desktop Environment
  • Device Drivers and PNDs
  • Users and Permissions
  • Reboot and Troubleshooting

Getting a Minimal Install from Scratch

There are two options here:

  • Linux PC
  • On Pandora

Linux PC

On a Linux PC, run debootstrap to grab the version you want. We shall be using Squeeze today:
sudo debootstrap --arch armel --foreign squeeze /tmp/pandora-debian ftp://ftp.uk.debian.org/debian Grab a large SD card, and repartition it to have one large ext2 partition and format as normal.
Copy all the files from /tmp/pandora-debian over to your new SD card partition.
Put it in your Pandora.
sudo chroot /media/mmcblk0p1 -- assuming it's in your first slot.
/debootstrap/deboostrap --second-stage
... this takes a while...

Pandora

Alternatively, you can run cdebootstrap on the Pandora itself... this bypasses the need of doing the second-stage madness.
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
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 squeeze /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 squeeze release, and to install to where we have the mount point of Partition 1 of the SD card in Slot 1 - which you should have already partitioned and formatted as ext2!
This takes a while... perhaps longer than doing the first stage on the PC and second-stage on Pandora.

Desktop Environment

Now you have Debian, the world is yours for the taking! Or something like that...

Debian comes with a wide variety of desktop environments and window managers; from XFCE as you use on Angstrom by default, to KDE, GNOME, LXDE, Fluxbox, Enlightenment, etc..
Now's the time to choose one of them to install.. be aware that the bigger they are, the longer they'll take to install and the more resources they will eat up while in use.. as a rough guide from heavy to light:

  • KDE
  • GNOME
  • Enlightenment
  • XFCE
  • LXDE
  • Fluxbox

Having recently tested KDE myself, it doesn't quite seem to work properly, so I'd avoid that for the moment... especially as it takes about ten hours to install!

We shall install LXDE as it's a bit more light weight than XFCE and still provides a reasonable mainstream environment. While I do prefer Fluxbox overall, it's a bit of a paradigm shift to use from your standard desktop machine.

If you haven't already, chroot into your environment. You should already be root, so we'll get on with the installing.

apt-get install lxde

This may well take an age, so go do something else in the meantime.
You may also want a login manager.. your choices are amongst XDM, GDM, KDM and SLIM to name a few. KDM is perhaps a bit heavy, whereas GDM works fairly well even though it's rather heavy too. SLIM is what you use on Pandora anyway, and XDM is rather basic but usable all the same. GDM is automatically pulled in via LXDE anyway, so we may as well just use that for now.

Once it's done, we'll start tackling the Drivers.

Device Drivers and PNDs

We shall tackle these one at a time, as there's quite a few of them.

  • X Display Driver
  • SGX Drivers
  • Keymap
  • Nubs
  • Touchscreen
  • Wifi
  • Bluetooth
  • Kernel and Misc Bits and Pieces
  • PNDs

X Display Driver

Debian has a NEON-optimised omapfb driver. We shall use this, and pinch some configuration gubbins from Angstrom.

apt-get install xserver-xorg-video-omap3

We now need to create an xorg.conf .. though it'll be rather minimal as we only really want to overload what graphics device setup it has, so:
nano /etc/X11/xorg.conf

Section "Module"
	Load	"extmod"
	Load	"dbe"
	Disable	"glx"
	Disable	"dri"
	Load	"dri2"
EndSection

Section "ServerLayout"
	Identifier	"DefaultLayout"
	Screen		"Screen0"
EndSection

Section "Screen"
	Identifier		"Screen0"
	Device			"OMAPFB"
	Monitor			"Monitor0"
	DefaultDepth	16
	SubSection "Display"
		Depth	16
		Modes	"800x480"
	EndSubSection
EndSection

Section "Monitor"
	Identifier		"Monitor0"
EndSection

Section "Device"
	Identifier		"OMAPFB"
	Driver			"omapfb"
	Option			"fb"		"/dev/fb0"
EndSection

Most of this is pinched from the Angstrom xorg.conf minus the fb Option at the bottom, as our framebuffer has a different device node.

That should be all you need for basic X though.

SGX Drivers

Most of this has been pinched from http://elinux.org/BeagleBoardDebian#SGX_Video_Acceleration - why rewrite the wheel?
This mostly works apart from a few caveats, so I shall repeat it here for future reference and to keep all information in one place, and I've uploaded the resulting tarballs for convenience.

You can either follow the above guide - substituting the BeagleBoard for the Pandora, or use the following preconfigured packages.
cd /tmp wget -c http://www.stuckiegamez.co.uk/apps/pandora/Debian/GFX_4_00_00_01_libs.tar.gz ~20MB Libraries themselves
wget -c http://www.stuckiegamez.co.uk/apps/pandora/Debian/GFX_Linux_SDK.tar.gz ~220MB Demos and SDK gubbins

Technically, you don't really need that fat 220MB GFX_Linux_SDK tarball unless you really want it, or want to test the libraries are in place.
I'll cover installing both anyway...

Libraries

tar -zxvf GFX_4_00_00_01_libs.tar.gz
chmod +x ./install-SGX.sh
./install-SGX.sh
rm /devmem2_0.0-0ubuntu1_armel.deb - this is particularly useless to us... and why it dumps it at root, I don't know!

That package contains ES2, ES3 and ES5 libraries.. we're only really interested in ES2 ( haven't tried if ES3 or ES5 would even work! ) so:
cd /usr/lib
ln -s ES2.0/* .

Not hugely clean, but it works. For the brave, you could try ES3 or ES5 but.. you're on your own!

Demos/SDK

cd /tmp
tar -zxvf OGLES.tar.gz
tar -zxvf OGLES2.tar.gz

You can't run anything yet ( well, you might since you've chrooted in via Angstrom ) so we'll leave them in /tmp for the moment - or move them elsewhere - such as /opt if you're worried about Debian wiping out /tmp on boot.

Keymap

The keymap is fun and comes in two parts - the mapping extension, and an xmodmap script.
We shall steal them from Angstrom.. so open up another Terminal.
As of now, I shall prefix Angstrom commands with Angstrom and Debian commands with Debian so you know which Terminal to type them in.

Angstrom sudo cp /etc/keymap-extension-2.6.map /media/mmcblk0p1/etc - this does assume you've got your SD card mounted in slot one, and with one ext2 partition.. adjust as necessary.
Angstrom sudo cp /etc/skel/.pndXmodmap /media/mmcblk0p1/etc/skel - as above.
Debian nano /etc/skel/.xinitrc

xmodmap ~/.pndXmodmap
whoami > /tmp/currentuser
killall -1 pndnotifyd &

Should probably copy more over but, this'll do for now.

Nubs

The nubs just require some more config stuff to be copied over, and a few rc scripts to be setup right.
Angstrom sudo cp -R /etc/pandora /media/mmcblk0p1/etc
This also copies over configurations for the LCD backlight, some pmenu and mmenu stuff, and some PND configuration bits.

Angstrom sudo cp /etc/init.d/pandora-state /media/mmcblk0p1/etc/init.d - pandora-state restores nubs and backlight settings, as well as saves them on exit.

Configuration utils come in with the PND installation below.

Touchscreen

tslib setup... though need to check if evdev will do it better as it seems to torment X at 100% CPU when the touchscreen is used just now...

Wifi

Wifi is fun... most of it will come in the kernel and modules/firmware pack when we get to it, but there's some ancillary scripts and things that lay in wait to catch you off guard!
Angstrom sudo cp /etc/init.d/wl1251-init /media/mmcblk0p1/etc/init.d
Angstrom sudo cp /lib/udev/rules.d/50-compat_firmware.rules /media/mmcblk0p1/lib/udev/rules.d
Angstrom sudo cp /lib/udev/rules.d/compat_firmware.sh /media/mmcblk0p1/lib/udev/rules.d

The rest come in the Kernel install below, and the PND install too.

Bluetooth

Don't really have any bluetooth devices to test.. though I could try tethering my phone by bluetooth...

Kernel and Misc Bits and Pieces

The kernel is easy... I advise grabbing a clean set from openpandora.org .. so we shall do that just now:
Debian cd / Debian wget -c http://openpandora.org/firmware/images/modules-2.6.27-pandora+r24+git4bc490f3aa30d331d624faf2816851211a05f0b7-r24-omap3-pandora.tgz - module and firmware pack.
Debian wget -c http://openpandora.org/firmware/images/uImage-2.6.27-pandora+r24+git4bc490f3aa30d331d624faf2816851211a05f0b7-r24-omap3-pandora.bin - kernel itself.
Debian mv uImage* /boot/uImage - yea, typing THAT long thing out again was going to happen!
Debian tar -zxvpf modules*.tgz - again, no typing the giant filename!
Debian rm modules*.tgz - bye bye giant scary named tarball!

That's essentially the kernel setup... we'll cover the boot script later.

RC Scripts

There's quite a number of RC scripts kicking about.. we'll nick most of them from Angstrom again and deal with them one state at a time.

rc0.d
sudo cp /etc/rc0.d/K05led-config /media/mmcblk0p1/etc/rc0.d/
sudo cp /etc/rc0.d/K31pandora-state /media/mmcblk0p1/etc/rc0.d/
sudo cp /etc/rc0.d/K40pndevmapperd-init /media/mmcblk0p1/etc/rc0.d/
sudo cp /etc/rc0.d/K40pndnotifyd-init /media/mmcblk0p1/etc/rc0.d/
rc1.d
sudo cp /etc/rc1.d/K05led-config /media/mmcblk0p1/etc/rc1.d/
sudo cp /etc/rc1.d/K31pandora-state /media/mmcblk0p1/etc/rc1.d/
sudo cp /etc/rc1.d/K40pndevmapperd-init /media/mmcblk0p1/etc/rc1.d/
sudo cp /etc/rc1.d/K40pndnotifyd-init /media/mmcblk0p1/etc/rc1.d/
rc2.d
sudo cp /etc/rc2.d/S05led-config /media/mmcblk0p1/etc/rc2.d/

oprun-init scripts live here too, but you're probably not going to want them!

rc3.d
sudo cp /etc/rc3.d/S05led-config /media/mmcblk0p1/etc/rc3.d/
sudo cp /etc/rc3.d/S30pndevmapperd-init /media/mmcblk0p1/etc/rc3.d/
sudo cp /etc/rc3.d/S30pndnotifyd-init /media/mmcblk0p1/etc/rc3.d/

oprun-init scripts live here too, but you're probably not going to want them!

rc4.d
sudo cp /etc/rc4.d/S05led-config /media/mmcblk0p1/etc/rc4.d/

oprun-init scripts live here too, but you're probably not going to want them!

rc5.d
sudo cp /etc/rc5.d/S05led-config /media/mmcblk0p1/etc/rc5.d/
sudo cp /etc/rc5.d/S30pndevmapperd-init /media/mmcblk0p1/etc/rc5.d/
sudo cp /etc/rc5.d/S30pndnotifyd-init /media/mmcblk0p1/etc/rc5.d/

oprun-init scripts live here too, but you're probably not going to want them!

rc6.d
sudo cp /etc/rc6.d/K05led-config /media/mmcblk0p1/etc/rc6.d/
sudo cp /etc/rc6.d/K31pandora-state /media/mmcblk0p1/etc/rc6.d/
sudo cp /etc/rc6.d/K40pndevmapperd-init /media/mmcblk0p1/etc/rc6.d/
sudo cp /etc/rc6.d/K40pndnotifyd-init /media/mmcblk0p1/etc/rc6.d/
rcS.d
sudo cp /etc/rcS.d/S39pandora-state /media/mmcblk0p1/etc/rcS.d/

You were expecting led-config again, weren't you!

Battery Monitor

You'll likely want to know how much battery power you have!
Debian apt-get install apmd

Misc Init Scripts

There are a few random init scripts we need for things:
Angstrom sudo cp /etc/init.d/led-config /media/mmcblk0p1/etc/init.d - configure the LEDs properly.
Angstrom sudo cp /etc/init.d/usb-gadget /media/mmcblk0p1/etc/init.d - for initializing the usb gadget device - g_cdc for USB networking, for instance.

PNDs

There are some init scripts you need for the PNDs to work. These are:
Angstrom sudo cp /etc/init.d/pndevmapperd-init /media/mmcblk0p1/etc/init.d
Angstrom sudo cp /etc/init.d/pndnotifyd-init /media/mmcblk0p1/etc/init.d

Users and Permissions

You may be wondering why Users haven't been done till the very end.. we've edited the /etc/skel setup which will be used to create your user details.

If you have already jumped the gun and created a user previously, all changes we've done to /etc/skel will need to be mirrored in your home folder!

Reboot and Troubleshooting

auto/boot.txt

We need either an autoboot.txt or a boot.txt now or we won't be able to boot up Debian.
There's no difference between either, other than autoboot will cause the Pandora to automatically boot from SD if it finds it, whereas boot requires holding the right shoulder button as usual.
Debian nano /autoboot.txt - again, you could use boot.txt instead and press the right shoulder button during boot.

setenv bootargs debug root=/dev/mmcblk0p1 rw rootdelay=2 console=ttyS0,115200n8 vram=6272K omapfb.vram=0:3000K
ex2load mmc 0:1 0x80300000 /boot/uImage
bootm 0x80300000

All that's really left now is to reboot and catch any issues that may crop up!

Cleanup

Potential clean-ups that should occur is packaging up the Pandora specific libraries and scripts into .deb files for maintenance purposes if nothing else. We can then either try and get them fed back into Debian, or provide our own Debian repo for Pandora.

Maintenance and Upgrades

Maintenance on Debian is very easy.. it's just a case of running sudo apt-get update && sudo apt-get upgrade from a console, or using Synaptic.

Common/Fun Things To Do

There's a wealth of power at your fingertips with Debian, so place your fun things to do here!