Difference between revisions of "Debian On SD"

From Pandora Wiki
Jump to: navigation, search
(beautify (typography, etc.))
(Updated to 1.0.2 process.. apologies to Xiloynaha for obliterating changes, I had too many of my own to try and sort out.)
Line 1: Line 1:
 
= Debian On SD =
 
= Debian On SD =
 
This is split into three main sections - Building from Scratch, Maintenance and Upgrades, Common Things To Do.
 
This is split into three main sections - Building from Scratch, Maintenance and Upgrades, Common Things To Do.
 +
 +
''''' This might be a bit iffy just now, I need to go through this and recheck some details.. use at your own risk... '''''
  
 
* 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.
 
* 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!
+
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.
 
* 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.
+
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.  
 
* Common/Fun Things To Do will give you ideas on what to try in your new Debian installation.  
Line 12: Line 14:
  
 
If you don't want to build from scratch, you have two choices;
 
If you don't want to build from scratch, you have two choices;
* Grab a Minimal Install and continue from ''[[#Desktop_Environment|Desktop Environment]]''
+
* Grab a Minimal Install and continue from [http://pandorawiki.org/index.php?title=Debian_On_SD#Desktop_Environment Desktop Environment]
 
* Grab a full build.
 
* Grab a full build.
  
The latest minimal is available here: http://www.stuckiegamez.co.uk/apps/pandora/Debian/pandora-squeeze-minimal-1.0.1.tar.gz <br />
+
The latest minimal is available here: http://www.stuckiegamez.co.uk/apps/pandora/Debian/pandora-squeeze-minimal-1.0.2.tar.bz2 <br />
The latest full build is available here: http://www.stuckiegamez.co.uk/apps/pandora/Debian/pandora-squeeze-1.0.1.tar.bz2
+
The latest full build is available here: http://www.stuckiegamez.co.uk/apps/pandora/Debian/pandora-squeeze-1.0.2.tar.bz2
  
Remember to untar with permissions (include '''p''' in your arguments to tar) on to your ext2 formatted SD card.
+
Remember to untar with permissions ( include '''p''' in your arguments to tar ) on to your ext2 formatted SD card.
  
Default user details for the full build are:
+
Default User details are:<br />
* username: '''pandora'''
+
username: '''pandora'''<br />
* password: '''debian'''
+
password: '''debian'''
 +
 
 +
== Little Note to Wiki Editors ==
 +
I change this a lot offline and then plaster the changes on during a new release.<br />
 +
If you're going to go changing this page, please contact me first so I don't accidentally obliterate your changes, or that you do changes to the style I've set out that I don't agree with!<br />
 +
This may well be against the "wiki spirit" .. but I spend days/weeks typing up these changes and testing them.. so a little consideration please :)
  
 
== Changelog ==
 
== Changelog ==
* 1.0 - First release; libts issues, libpnd issues, overly fat with stuff.
+
=== Release 1.0 ===
* 1.0.1 - Documented release; libts issues persist, libpnd issues fixed, slimmed down to ~830mb.
+
* First release
 +
* libts issues
 +
* libpnd issues
 +
* Overly fat with stuff
 +
* Wifi issues for some people
 +
 
 +
=== Release 1.0.1 ===
 +
* First documented release
 +
* libts issues persist
 +
* Most libpnd issues fixed
 +
* Slimmed down to ~830mb
 +
* Made Wifi issues worse and accidentally stripped out more than needed
 +
 
 +
=== Release 1.0.2 ===
 +
* Replaced libts with evdev... doesn't cause X choking.
 +
* libpnd should behave now, though the pnd services don't seem to get kicked till a terminal is opened, and even then they turn zombie.. eh?
 +
* Added full dev setup.. so it's fat.. it's 1.2gig extracted.
 +
* Replaced GDM with SLIM.
 +
 
 +
== Release 1.1 Proposed ==
 +
* libts using OpenPandora patched version.
 +
* Pandora specifics wrapped as Debian archives.
 +
* Pandora specifics repo to deal with updates to drivers from mainline.
  
 
= Building From Scratch =
 
= 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 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.
+
This is split into many parts.. it's advised to go through this in order.
  
 
* Getting a Minimal Install from Scratch
 
* Getting a Minimal Install from Scratch
 
* Desktop Environment
 
* Desktop Environment
 
* Device Drivers and PNDs
 
* Device Drivers and PNDs
* Users and Permissions
+
* Users, First Boot Scripts and Permissions
 
* Reboot and Troubleshooting
 
* Reboot and Troubleshooting
  
Line 46: Line 75:
  
 
=== Linux PC ===
 
=== Linux PC ===
 
+
On a Linux PC, run debootstrap to grab the version you want. We shall be using Squeeze today:<br />
* 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'''''
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.<br />
* 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.<br />
* Copy all the files from <tt>/tmp/pandora-debian</tt> over to your new SD card partition.
+
Put it in your Pandora.<br />
* Put it in your Pandora:
+
'''''sudo chroot /media/mmcblk0p1''''' -- assuming it's in your first slot.<br />
sudo chroot /media/mmcblk0p1 # Assuming it's in your first slot.
+
'''''/debootstrap/deboostrap --second-stage'''''<br />
/debootstrap/deboostrap --second-stage
+
... this takes a while...
... this takes a while...
 
  
 
=== Pandora ===
 
=== Pandora ===
 
+
Alternatively, you can run cdebootstrap on the Pandora itself... this bypasses the need of doing the second-stage madness.<br />
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.<br />
 
+
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<br />
Grab it from here: http://packages.debian.org/sid/cdebootstrap-static and select the armel package.
+
'''''cd /tmp'''''  -- Again, if you downloaded elsewhere, change to that directory instead.<br />
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.
+
'''''ar xv cdebootstrap*.deb''''' -- We're using the archive tool to extract with verbosity our cdebootstrap package. <br />
cd /tmp # Again, if you downloaded elsewhere, change to that directory instead.
+
'''''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.<br />
ar xv cdebootstrap*.deb # We're using the archive tool to extract with verbosity our cdebootstrap package.
+
Now we just run cdebootstrap-static with a few parameters, and wait.<br />
sudo tar -zxvf data.tar.gz -C / # Extract data to /.
+
'''''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! <br />
Last command explanation: 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.
+
This takes a while... perhaps longer than doing the first stage on the PC and second-stage on Pandora.
 
 
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 ==
 
== 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...
  
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.
+
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..<br />
 
+
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:<br />
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. Here is a rough guide from heavy to light:
 
 
* KDE
 
* KDE
 
* GNOME
 
* GNOME
Line 88: Line 108:
 
* Fluxbox
 
* 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!
+
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.
 
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.
Line 95: Line 115:
 
You should already be root, so we'll get on with the installing.
 
You should already be root, so we'll get on with the installing.
  
apt-get install lxde
+
'''''apt-get install lxde'''''
  
This may well take an age, so go do something else in the meantime.
+
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.
  
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.
+
Additional:<br />
 +
Installing LXDE via the above command pulls in GDM by default.. if you use ''lxde-core'' instead, it removes a lot of the stuff that pulls in random things, and if you additionally use '''''aptitude install --without-recommends lxde-core''''' it should strip out even more. You will need to manually install ''less'', ''zenity'', and ''xterm'' for example. Zenity is especially needed for all the Pandora config scripts.
  
Once it's done, we'll start tackling the drivers.
+
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 118: Line 139:
  
 
=== X Display Driver ===
 
=== X Display Driver ===
 
 
Debian has a NEON-optimised omapfb driver. We shall use this, and pinch some configuration gubbins from Angstrom.
 
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
+
'''''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
 
  
 +
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"
 
  Section "Module"
 
  Load "extmod"
 
  Load "extmod"
Line 165: Line 184:
  
 
=== SGX Drivers ===
 
=== SGX Drivers ===
 
+
Most of this has been pinched from http://elinux.org/BeagleBoardDebian#SGX_Video_Acceleration - why rewrite the wheel?<br />
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.
 
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.
+
You can either follow the above guide - substituting the BeagleBoard for the Pandora, or use the following preconfigured packages.<br />
cd /tmp
+
'''''cd /tmp'''''<br />
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_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.
+
'''''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.
+
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…
+
I'll cover installing both anyway...
  
 
==== Libraries ====
 
==== Libraries ====
tar -zxvf GFX_4_00_00_01_libs.tar.gz
+
'''''tar -zxvf GFX_4_00_00_01_libs.tar.gz'''''<br />
chmod +x ./install-SGX.sh
+
'''''chmod +x ./install-SGX.sh'''''<br />
./install-SGX.sh
+
'''''./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!
+
'''''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:
+
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
+
'''''cd /usr/lib'''''<br />
ln -s ES2.0/* .
+
'''''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!
+
Not hugely clean, but it works. For the brave, you could try ES3 or ES5 but.. you're on your own!
  
 
==== Demos/SDK ====
 
==== Demos/SDK ====
cd /tmp
+
'''''cd /tmp'''''<br />
tar -zxvf OGLES.tar.gz
+
'''''tar -zxvf OGLES.tar.gz'''''<br />
tar -zxvf OGLES2.tar.gz
+
'''''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.
+
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 ===
 
=== Keymap ===
 
+
The keymap is fun and comes in two parts - the mapping extension, and an xmodmap script.<br />
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.<br />
 
 
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.
 
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
+
''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 />
                                                                    # mounted in slot one, and with one ext2
+
''Angstrom'' '''''sudo cp /etc/skel/.pndXmodmap /media/mmcblk0p1/etc/skel''''' - as above.<br />
                                                                    # partition… adjust as necessary.
 
''Angstrom'' sudo cp /etc/skel/.pndXmodmap /media/mmcblk0p1/etc/skel # As above.
 
 
 
''Debian'' nano /etc/skel/.profile
 
  
Add the following to the bottom
+
After some fiddling, if you stick the following into ''.xsession'' it'll actually get called...
 
  xmodmap ~/.pndXmodmap
 
  xmodmap ~/.pndXmodmap
 
  whoami > /tmp/currentuser
 
  whoami > /tmp/currentuser
 
  killall -1 pndnotifyd &
 
  killall -1 pndnotifyd &
 +
exec startlxde
  
Should probably copy more over but, this'll do for now.
+
Of course, this is a bit hacky and hard-coded in that if you've chosen something other than lxde, you'll probably want to change that startlxde to something else!
Need to figure out why .xinitrc isn't even being looked at for some reason… this works for now though.
 
  
=== Nubs ===
+
1.0.2 does something really hacky and actually starts pndnotifyd and pndevmapperd as daemons directly.<br />
 +
It also starts up the xfce4-power-manager for a battery meter.
  
The nubs just require some more config stuff to be copied over, and a few rc scripts to be setup right.
+
Should probably copy more over but, this'll do for now.<br />
  
''Angstrom'' sudo cp -R /etc/pandora /media/mmcblk0p1/etc
+
=== 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.
 
This also copies over configurations for the LCD backlight, some pmenu and mmenu stuff, and some PND configuration bits.
  
Pandora-state restores nubs and backlight settings, as well as saves them on exit:
+
''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.
''Angstrom'' sudo cp /etc/init.d/pandora-state /media/mmcblk0p1/etc/init.d
 
  
 
Configuration utils come in with the PND installation below.
 
Configuration utils come in with the PND installation below.
  
 
=== Touchscreen ===
 
=== Touchscreen ===
 +
==== Current 1.0.2 Release ====
 +
1.0.2 uses evdev instead of libts for the touchscreen. This doesn't really require any configuration for the most part, but does need to be calibrated.<br />
 +
You'll need a full dev setup on the Pandora for this, as you'll need to compile the xinput_calibrator - http://www.freedesktop.org/wiki/Software/xinput_calibrator however it's fairly trivial once all the libraries are installed.
  
Currently, there's a few issues with the touchscreen − it'll cause X to go mad and chew through 100% CPU as soon as you touch it.
+
==== libts for other releases ====
However, it's still usable so we'll add in the libraries and configure it anyway.
+
''Debian'' '''''apt-get install libxcb-dri2-0 xserver-xorg-input-tslib libts-bin'''''<br />
''Debian'' apt-get install libxcb-dri2-0 xserver-xorg-input-tslib libts-bin
+
''Debian'' '''''nano /etc/profile.d/tslib.sh'''''
''Debian'' nano /etc/profile.d/tslib.sh
 
 
 
 
  #!/bin/sh
 
  #!/bin/sh
 
  TSLIB_TSDEVICE=/dev/input/event5
 
  TSLIB_TSDEVICE=/dev/input/event5
Line 243: Line 257:
 
  export TSLIB_TSDEVICE TSLIB_CONFFILE
 
  export TSLIB_TSDEVICE TSLIB_CONFFILE
  
Some programs may look for /dev/input/touchscreen0… so we'll set that up too.
+
We'll do the rest of it on First Boot.<br />
 +
This will be fixed properly when WiFi issues settle, so I can finalize a build system and re-do everything as packages - including libts with the OpenPandora-specific patches from the git.
  
We'll do the rest of it on First Boot.
+
=== Wifi ===
There's an evtouch library… haven't looked at that yet but it may work better?
+
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'''''
  
=== Wi-Fi ===
+
The wl1251-init script uses busybox. While you could edit the script and remove the dependency on busybox, it's probably better to just install busybox so that there are less changes to deal with - seeing as it's only about 600kB.<br />
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!
+
''Debian'' '''''apt-get install busybox'''''
''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 wl1251-init script uses busybox. While you could edit the script and remove the dependency on busybox, it's probably better to just install busybox so that there are less changes to deal with - seeing as it's only about 600kB.
+
While we don't necessarily need Network Manager, it's a damn sight more easier to use than battering iwconfig et al from the Terminal:<br />
''Debian'' apt-get install busybox
+
''Debian'' '''''apt-get install network-manager-gnome'''''<br />
 
+
This'll take a long time as it pulls in quite a lot of stuff...
While we don't necessarily need Network Manager, it's a damn sight more easier to use than battering iwconfig et al from the Terminal:
 
''Debian'' apt-get install network-manager-gnome
 
This'll take a long time as it pulls in quite a lot of stuff…
 
  
 
=== Bluetooth ===
 
=== Bluetooth ===
Don't really have any bluetooth devices to test… though I could try tethering my phone by bluetooth…
+
Debian's bluetooth setup seems to kick in and work without issue.<br />
 +
Probably need to get a clean way to toggle it on and off - as it defaults to being on.
  
 
=== Kernel and Misc Bits and Pieces ===
 
=== Kernel and Misc Bits and Pieces ===
The kernel ''should'' be easy… grabbing a fresh set would've been advisable, but this doesn't seem to come with everything so we'll steal from our running system again.
+
The kernel *should* be easy... grabbing a fresh set would've been advisable, but this doesn't seem to come with everything so we'll steal from our running system again.
  
''Angstrom'' sudo cp -R /lib/modules/2.6.27.46-omap1 /media/mmcblk0p1/lib/modules
+
''Angstrom'' '''''sudo cp -R /lib/modules/2.6.27.46-omap1 /media/mmcblk0p1/lib/modules'''''<br />
''Angstrom'' sudo cp -R /lib/firmware /media/mmcblk0p1/lib/firmare
+
''Angstrom'' '''''sudo cp -R /lib/firmware /media/mmcblk0p1/lib/firmare'''''<br />
''Angstrom'' sudo cp /boot/uImage /media/mmcblk0p1/boot/uImage
+
''Angstrom'' '''''sudo cp /boot/uImage /media/mmcblk0p1/boot/uImage'''''
  
That's essentially the kernel setup… we'll cover the boot script later.
+
=== Battery Monitor ===
 +
You'll likely want to know how much battery power you have!<br />
 +
''Debian'' '''''apt-get install apmd'''''<br />
 +
''Debian'' '''''apt-get install xfce4-power-manager'''''<br />
 +
Somewhat cheeky perhaps, but it does work! [http://www.gp32x.com/board/index.php?/topic/57653-a-guide-to-installing-lxde/page__view__findpost__p__928896 see this post]
  
==== RC Scripts ====
+
If you add '''''xfce4-power-manager &''''' before '''''exec startlxde''''' in your .xsession, it'll start up automatically for you.
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 =====
+
=== Misc Init Scripts and Things ===
sudo cp /etc/rc0.d/K05led-config /media/mmcblk0p1/etc/rc0.d/
+
There are a few random init scripts we need for things:<br />
sudo cp /etc/rc0.d/K31pandora-state /media/mmcblk0p1/etc/rc0.d/
+
''Angstrom'' '''''sudo cp /etc/init.d/led-config /media/mmcblk0p1/etc/init.d''''' - configure the LEDs properly.<br />
sudo cp /etc/rc0.d/K40pndevmapperd-init /media/mmcblk0p1/etc/rc0.d/
+
''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 />
sudo cp /etc/rc0.d/K40pndnotifyd-init /media/mmcblk0p1/etc/rc0.d/
+
''Angstrom'' '''''sudo cp /usr/bin/usb-gadget /media/mmcblk0p1/usr/bin'''''<br />
 +
''Angstrom'' '''''sudo cp /etc/profile.d/op_env.sh /media/mmcblk0p1/etc/profile.d''''' - effectively just tells SDL to use tslib driver<br />
 +
''Angstrom'' '''''sudo cp /etc/default/leds /media/mmcblk0p1/etc/default'''''<br />
 +
''Angstrom'' '''''sudo cp /etc/default/usb-gadget /media/mmcblk0p1/etc/default'''''<br />
  
===== rc1.d =====
+
And some more stuff to install in Debian:<br />
sudo cp /etc/rc1.d/K05led-config /media/mmcblk0p1/etc/rc1.d/
+
''Debian'' '''''apt-get install libnotify-bin'''''
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 =====
+
=== PNDs ===
sudo cp /etc/rc2.d/S05led-config /media/mmcblk0p1/etc/rc2.d/
+
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 />
oprun-init scripts live here too, but you're probably not going to want them!
+
''Angstrom'' '''''sudo cp /etc/init.d/pndnotifyd-init /media/mmcblk0p1/etc/init.d'''''<br />
 +
''Angstrom'' '''''sudo cp /usr/bin/pnd* /media/mmcblk0p1/usr/bin''''' - there are a few pnd binaries, these include pnd_info, pnd_run, pndevmapperd and pndnotifyd.<br />
 +
''Angstrom'' '''''sudo cp /usr/lib/libpnd.so.1.0.1 /media/mmcblk0p1/usr/lib''''' - obviously nothing'll work without the pnd libraries!<br />
  
===== rc3.d =====
+
There are a bunch of scripts and PNDs hiding in /usr/pandora.. we may as well grab them over as well.<br />
sudo cp /etc/rc3.d/S05led-config /media/mmcblk0p1/etc/rc3.d/
+
''Angstrom'' '''''sudo cp -R /usr/pandora /media/mmcblk0p1/usr'''''<br />
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!
+
We need to do a symlink to the library properly now, and clean up some stuff.<br />
 +
''Debian'' '''''ln -s /usr/lib/libpnd.so.1.0.1 /usr/lib/libpnd.so.1'''''
 +
''Debian'' '''''rm -rf /usr/pandora/mmenu''''' - these are just PNDs that call the programs installed in Angstrom from MiniMenu. We don't have these programs installed on Debian so, they're useless to us.<br />
  
===== rc4.d =====
+
=== RC Scripts ===
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!
+
We also need to disable some things from running.. the first run script specifies the following:<br />
 +
update-rc.d -f samba remove
 +
update-rc.d -f xinetd remove
 +
update-rc.d -f avahi-daemon remove
 +
update-rc.d -f apmd remove
 +
update-rc.d -f usb-gadget remove
 +
update-rc.d -f banner remove
 +
update-rc.d -f portmap remove
 +
update-rc.d -f mountnfs remove
 +
update-rc.d -f blueprobe remove
 +
update-rc.d -f dropbear remove
 +
update-rc.d -f wl1251-init remove
  
===== rc5.d =====
+
We'll also need to add some bits to the rc.d script set:
  sudo cp /etc/rc5.d/S05led-config /media/mmcblk0p1/etc/rc5.d/
+
==== rc0.d ====
  sudo cp /etc/rc5.d/S30pndevmapperd-init /media/mmcblk0p1/etc/rc5.d/
+
  ln -s ../init.d/led-config K05led-config
  sudo cp /etc/rc5.d/S30pndnotifyd-init /media/mmcblk0p1/etc/rc5.d/
+
ln -s ../init.d/pandora-state K31pandora-state
 +
  ln -s ../init.d/pndevmapperd-init K40pndevmapperd-init
 +
  ln -s ../init.d/pndnotifyd-init K40pndnotify-init  
  
oprun-init scripts live here too, but you're probably not going to want them!
+
==== rc1.d ====
 +
ln -s ../init.d/led-config K05led-config
 +
ln -s ../init.d/pandora-state K31pandora-state
 +
ln -s ../init.d/pndevmapperd-init K40pndevmapperd-init
 +
ln -s ../init.d/pndnotifyd-init K40pndnotify-init  
  
===== rc6.d =====
+
==== rc2.d ====
  sudo cp /etc/rc6.d/K05led-config /media/mmcblk0p1/etc/rc6.d/
+
  ln -s ../init.d/led-config S05led-config
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 =====
+
==== rc3.d ====
  sudo cp /etc/rcS.d/S39pandora-state /media/mmcblk0p1/etc/rcS.d/
+
  ln -s ../init.d/led-config S05led-config
 +
ln -s ../init.d/pndevmapperd-init S30pndevmapperd-init
 +
ln -s ../init.d/pndnotifyd-init S30pndnotify-init
  
You were expecting led-config again, weren't you!
+
==== rc4.d ====
 +
ln -s ../init.d/led-config S05led-config
  
==== Battery Monitor ====
+
==== rc5.d ====
You'll likely want to know how much battery power you have!
+
ln -s ../init.d/led-config S05led-config
  ''Debian'' apt-get install apmd
+
  ln -s ../init.d/pndevmapperd-init S30pndevmapperd-init
 +
ln -s ../init.d/pndnotifyd-init S30pndnotify-init
  
==== Misc Init Scripts and Things====
+
==== rc6.d ====
There are a few random init scripts we need for things:
+
  ln -s ../init.d/led-config K05led-config
  ''Angstrom'' sudo cp /etc/init.d/led-config /media/mmcblk0p1/etc/init.d # Configure the LEDs properly.
+
ln -s ../init.d/pandora-state K31pandora-state
  ''Angstrom'' sudo cp /etc/init.d/usb-gadget /media/mmcblk0p1/etc/init.d # For initializing the usb gadget device
+
  ln -s ../init.d/pndevmapperd-init K40pndevmapperd-init
                                                                    # (g_cdc for USB networking, for instance).
+
  ln -s ../init.d/pndnotifyd-init K40pndnotify-init
  ''Angstrom'' sudo cp /usr/bin/usb-gadget /media/mmcblk0p1/usr/bin
 
''Angstrom'' sudo cp /etc/profile.d/op_env.sh /media/mmcblk0p1/etc/profile.d # Effectively just tells SDL to use tslib driver.
 
''Angstrom'' sudo cp /etc/default/leds /media/mmcblk0p1/etc/default
 
''Angstrom'' sudo cp /etc/default/usb-gadget /media/mmcblk0p1/etc/default
 
  
And some more stuff to install in Debian:
+
==== rcS.d ====
  ''Debian'' apt-get install libnotify-bin
+
  ln -s ../init.d/pandora-state S39pandora-state
  
=== PNDs ===
+
We also need to fiddle with a few of the scripts - specifically led-config to add the dummy LSB information ( just rip it out of another script, and leave Required-Start, Required-Stop, Default-Start and Default-Stop empty, ) and pandora-state where you need to blank out the #adjust marker as it causes Debian to have fits.
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
 
''Angstrom'' sudo cp /usr/bin/pnd* /media/mmcblk0p1/usr/bin # There are a few pnd binaries, these include
 
                                                        # pnd_info, pnd_run, pndevmapperd and pndnotifyd.
 
''Angstrom'' sudo cp /usr/lib/libpnd.so.1.0.1 /media/mmcblk0p1/usr/lib # Obviously nothing'll work without the pnd libraries!
 
 
 
There are a bunch of scripts and PNDs hiding in /usr/pandora… we may as well grab them over as well.
 
''Angstrom'' sudo cp -R /usr/pandora /media/mmcblk0p1/usr
 
 
 
We need to do a symlink to the library properly now…
 
''Debian'' ln -s /usr/lib/libpnd.so.1.0.1 /usr/lib/libpnd.so.1
 
''Debian'' rm -rf /usr/pandora/mmenu
 
The files in <tt>/usr/pandora/mmenu</tt> are just PNDs that call the programs installed in Angstrom from MiniMenu. We don't have these programs installed on Debian so, they're useless to us.
 
  
 
== 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.
 
  
 
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!
 
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!
  
''Debian'' adduser <username> # Oviously, replace <username> with what you want; for example ''adduser pandora''.
+
''Debian'' ''''''adduser <username>''''' - obviously, replace <username> with what you want; for example ''adduser pandora''.
 
 
One interesting thing I've noticed happens, is sometimes it'll happily create your user… then not give you full permissions to your own folder… so let's beat it a bit.
 
''Debian'' chown -R <username>:<username> /home/<username> # Replacing <username> with your actual username;
 
                                                        # for example ''chown pandora:pandora /home/pandora''
 
  
You'll probably want to use sudo, which will require you to be in the wheel group, which we are about to create:
+
One interesting thing I've noticed happens, is sometimes it'll happily create your user... then not give you full permissions to your own folder.. so let's beat it a bit.<br />
''Debian'' groupadd wheel
+
''Debian'' '''''chown -R <username>:<username> /home/<username>''''' - replacing <username> with your actual username; for example ''chown pandora:pandora /home/pandora''<br />
  
There's also few groups you'd want to be in, so we'll do that now.
+
You'll probably want to use sudo, which will require you to be in the wheel group, which we are about to create:<br />
''Debian'' usermod -a -G wheel <username> # You know the drill now… example; ''usermod -a -G wheel pandora''
+
''Debian'' '''''groupadd wheel'''''<br />
''Debian'' usermod -a -G adm <username>
+
There's also few groups you'd want to be in, so we'll do that now.<br />
''Debian'' usermod -a -G audio <username>
+
''Debian'' '''''usermod -a -G wheel <username>''''' - you know the drill now... example; ''usermod -a -G wheel pandora''<br />
''Debian'' usermod -a -G video <username>
+
''Debian'' '''''usermod -a -G adm <username>'''''<br />
''Debian'' usermod -a -G plugdev <username>
+
''Debian'' '''''usermod -a -G audio <username>'''''<br />
''Debian'' usermod -a -G users <username>
+
''Debian'' '''''usermod -a -G video <username>'''''<br />
 +
''Debian'' '''''usermod -a -G plugdev <username>'''''<br />
 +
''Debian'' '''''usermod -a -G users <username>'''''<br />
 +
''Debian'' '''''usermod -a -G netdev <username>'''''<br />
  
 
Technically, you could've done all this in the one line with adduser, but I'd rather keep it all separate so that if we end up with extra groups, we all know how to add them.
 
Technically, you could've done all this in the one line with adduser, but I'd rather keep it all separate so that if we end up with extra groups, we all know how to add them.
  
Angstrom also uses a netdev group… not sure what creates that or what it's for… ignoring for now as it doesn't exist on stock Debian.
+
There's a bunch of sudoers rules that are hidden as well that we need to steal ( I completely missed these twice - my thanks to sebt3 and DJWillis for pointing me to them! I thought the #includedir line was commented out due to the # ... *facepalm* )<br />
 +
''Angstrom'' '''''sudo cp /etc/sudoers.d/* /media/mmcblk0p1/etc/sudoers.d/'''''
  
There's a bunch of sudoers rules that are hidden as well that we need to steal (I completely missed these twice − my thanks to sebt3 and DJWillis for pointing me to them! I thought the #includedir line was commented out due to the # … *facepalm*)
+
Finally, /tmp can sometimes go mad so we shall fix that just now too.<br />
''Angstrom'' sudo cp /etc/sudoers.d/* /media/mmcblk0p1/etc/sudoers.d/
+
''Debian'' '''''chmod a+w /tmp'''''
 
 
Finally, /tmp can sometimes go mad so we shall fix that just now too.
 
''Debian'' chmod a+w /tmp
 
  
 
== Reboot and Troubleshooting ==
 
== Reboot and Troubleshooting ==
  
 
=== auto/boot.txt ===
 
=== 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 />
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.<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.
+
''Debian'' '''''nano /autoboot.txt''''' - again, you could use boot.txt instead and press the right shoulder button during boot.<br />
''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
 
  setenv bootargs debug root=/dev/mmcblk0p1 rw rootdelay=2 console=ttyS0,115200n8 vram=6272K omapfb.vram=0:3000K
 
  ext2load mmc 0:1 0x80300000 /boot/uImage
 
  ext2load mmc 0:1 0x80300000 /boot/uImage
Line 405: Line 416:
 
=== First Boot ===
 
=== First Boot ===
  
First Boot should bring you up to GDM in all it's splendour. But Wait! The touchscreen! IT IS MADNESS!
+
==== tslib calibration ====
 
+
First Boot should bring you up to GDM in all it's splendour. But Wait! The touchscreen! IT IS MADNESS!<br />
 
If you've a USB keyboard, you can be one step ahead and do CTRL+ALT+F1 to jump to a terminal, but we're going to assume just the Pandora so we'll carry on and login.
 
If you've a USB keyboard, you can be one step ahead and do CTRL+ALT+F1 to jump to a terminal, but we're going to assume just the Pandora so we'll carry on and login.
  
Once LXDE has finished loading up, press FN+ALT+F2 and type "lxterminal"
+
Once LXDE has finished loading up, press FN+ALT+F2 and type "lxterminal"<br />
sudo su # Or ''sudo -s''
+
'''''sudo su'''''<br />
export  TSLIB_TSDEVICE=/dev/input/event5
+
'''''export  TSLIB_TSDEVICE=/dev/input/event5'''''<br />
export TSLIB_CONFFILE=/etc/ts.conf
+
'''''export TSLIB_CONFFILE=/etc/ts.conf'''''<br />
ts_calibrate
+
'''''ts_calibrate'''''
  
Touchscreen should behave itself now.
+
Touchscreen should behave itself now.<br />
  
While root (that's what sudo su does) we shall finish setting up anything that didn't take during our chroot session in Angstrom (bluetooth usually):
+
==== Finish up installing any left overs ====
apt-get -f install
+
While root ( that's what sudo su does ) we shall finish setting up anything that didn't take during our chroot session in Angstrom ( bluetooth usually )<br/>
exit # Jump back to our user so we don't accidentally mess things up.
+
'''''apt-get -f install'''''<br />
 +
'''''exit''''' - jump back to our user so we don't accidentally mess things up<br />
  
 
=== Cleanup ===
 
=== 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.
 
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.
  
The following should probably be stuffed into deb files for easier maintainability:
+
The following should probably be stuffed into deb files for easier maintainability:<br />
 
* libpnd
 
* libpnd
 
* pandora specific scripts
 
* pandora specific scripts
Line 433: Line 444:
  
 
= 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 ( see below on how to install! )
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 (see below on how to install!).
 
  
 
= 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!
  
 
== Networking ==
 
== Networking ==
 
 
Networking should work effectively the same as on Angstrom, but here's a run down of what to do anyway:
 
Networking should work effectively the same as on Angstrom, but here's a run down of what to do anyway:
 
* Click the LXDE menu up.
 
* Click the LXDE menu up.
 
* Click System Tools -> Toggle Wifi
 
* Click System Tools -> Toggle Wifi
 
* Click the Network Manager app between the process bar and the clock.
 
* Click the Network Manager app between the process bar and the clock.
* Click your network or select "Connect to Hidden Wireless Network" if it's not there and fill out the details.
+
* Click your network - or select "Connect to Hidden Wireless Network" if it's not there and fill out the details.
* Fill out the keyring for your passwords to go into so you only need to remember the one ;)
+
* Fill out the keyring for your passwords to go into - so you only need to remember the one ;)
 
* The Network Manager icon should spin and then give you a strength bar as normal once connected.
 
* The Network Manager icon should spin and then give you a strength bar as normal once connected.
  
 
== Synaptic ==
 
== Synaptic ==
 
+
The 1.0.1 release did not include Synaptic.. it's back in 1.0.2<br />
The original 1.0 release included Synaptic… but it's a heavy bugger and perhaps not everyone really feels the need for it, so I didn't keep it for 1.0.1
+
To get it back for the 1.0.1 release, it's simply a case of doing:<br />
To get it back, it's simply a case of doing:
+
'''''sudo apt-get update''''' - if you haven't done so for a while ( as in, days, not hours )<br />
sudo apt-get update # If you haven't done so for a while (as in, days, not hours).
+
'''''sudo apt-get install synaptic'''''<br />
sudo apt-get install synaptic
 
 
Then wait for a while as it downloads and installs.
 
Then wait for a while as it downloads and installs.
  
Line 461: Line 468:
  
 
== My PND don't work, why?! ==
 
== My PND don't work, why?! ==
 +
Generally, it'll be because of library differences.. I'm still trying to figure out the best way to deal with this, but you've got the Debian armel repository at your disposal, so you should be fine for a while!
  
Generally, it'll be because of library differences… I'm still trying to figure out the best way to deal with this, but you've got the Debian armel repository at your disposal, so you should be fine for a while!
+
1.0.2 has some library compatibility with Pandora Angstrom but it's not complete. The PNDs of Wesnoth and BattleJewels will work for example, whereas SuperTux and GravityForce do not.
  
== My PNDs don't automatically display on menu/desktop, why?! ==
+
Library compatibility was achieved by pulling packages manually from older revisions, symlinking some libraries and pulling stuff from experimental.. it was trial and error so, is a tad iffy.
Not sure about this… kicking pndnotifyd seems to trigger it properly, but why it's not doing it automatically, I'm not so sure…
 
  
 
[[Category:Documentation]] [[Category:Operating Systems]]
 
[[Category:Documentation]] [[Category:Operating Systems]]

Revision as of 10:07, 23 March 2011

Debian On SD

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

This might be a bit iffy just now, I need to go through this and recheck some details.. use at your own risk...

  • 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-squeeze-minimal-1.0.2.tar.bz2
The latest full build is available here: http://www.stuckiegamez.co.uk/apps/pandora/Debian/pandora-squeeze-1.0.2.tar.bz2

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

Default User details are:
username: pandora
password: debian

Little Note to Wiki Editors

I change this a lot offline and then plaster the changes on during a new release.
If you're going to go changing this page, please contact me first so I don't accidentally obliterate your changes, or that you do changes to the style I've set out that I don't agree with!
This may well be against the "wiki spirit" .. but I spend days/weeks typing up these changes and testing them.. so a little consideration please :)

Changelog

Release 1.0

  • First release
  • libts issues
  • libpnd issues
  • Overly fat with stuff
  • Wifi issues for some people

Release 1.0.1

  • First documented release
  • libts issues persist
  • Most libpnd issues fixed
  • Slimmed down to ~830mb
  • Made Wifi issues worse and accidentally stripped out more than needed

Release 1.0.2

  • Replaced libts with evdev... doesn't cause X choking.
  • libpnd should behave now, though the pnd services don't seem to get kicked till a terminal is opened, and even then they turn zombie.. eh?
  • Added full dev setup.. so it's fat.. it's 1.2gig extracted.
  • Replaced GDM with SLIM.

Release 1.1 Proposed

  • libts using OpenPandora patched version.
  • Pandora specifics wrapped as Debian archives.
  • Pandora specifics repo to deal with updates to drivers from mainline.

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, First Boot Scripts 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.

Additional:
Installing LXDE via the above command pulls in GDM by default.. if you use lxde-core instead, it removes a lot of the stuff that pulls in random things, and if you additionally use aptitude install --without-recommends lxde-core it should strip out even more. You will need to manually install less, zenity, and xterm for example. Zenity is especially needed for all the Pandora config scripts.

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.

After some fiddling, if you stick the following into .xsession it'll actually get called...

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

Of course, this is a bit hacky and hard-coded in that if you've chosen something other than lxde, you'll probably want to change that startlxde to something else!

1.0.2 does something really hacky and actually starts pndnotifyd and pndevmapperd as daemons directly.
It also starts up the xfce4-power-manager for a battery meter.

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

Current 1.0.2 Release

1.0.2 uses evdev instead of libts for the touchscreen. This doesn't really require any configuration for the most part, but does need to be calibrated.
You'll need a full dev setup on the Pandora for this, as you'll need to compile the xinput_calibrator - http://www.freedesktop.org/wiki/Software/xinput_calibrator however it's fairly trivial once all the libraries are installed.

libts for other releases

Debian apt-get install libxcb-dri2-0 xserver-xorg-input-tslib libts-bin
Debian nano /etc/profile.d/tslib.sh

#!/bin/sh
TSLIB_TSDEVICE=/dev/input/event5
TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_TSDEVICE TSLIB_CONFFILE

We'll do the rest of it on First Boot.
This will be fixed properly when WiFi issues settle, so I can finalize a build system and re-do everything as packages - including libts with the OpenPandora-specific patches from the git.

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 wl1251-init script uses busybox. While you could edit the script and remove the dependency on busybox, it's probably better to just install busybox so that there are less changes to deal with - seeing as it's only about 600kB.
Debian apt-get install busybox

While we don't necessarily need Network Manager, it's a damn sight more easier to use than battering iwconfig et al from the Terminal:
Debian apt-get install network-manager-gnome
This'll take a long time as it pulls in quite a lot of stuff...

Bluetooth

Debian's bluetooth setup seems to kick in and work without issue.
Probably need to get a clean way to toggle it on and off - as it defaults to being on.

Kernel and Misc Bits and Pieces

The kernel *should* be easy... grabbing a fresh set would've been advisable, but this doesn't seem to come with everything so we'll steal from our running system again.

Angstrom sudo cp -R /lib/modules/2.6.27.46-omap1 /media/mmcblk0p1/lib/modules
Angstrom sudo cp -R /lib/firmware /media/mmcblk0p1/lib/firmare
Angstrom sudo cp /boot/uImage /media/mmcblk0p1/boot/uImage

Battery Monitor

You'll likely want to know how much battery power you have!
Debian apt-get install apmd
Debian apt-get install xfce4-power-manager
Somewhat cheeky perhaps, but it does work! see this post

If you add xfce4-power-manager & before exec startlxde in your .xsession, it'll start up automatically for you.

Misc Init Scripts and Things

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.
Angstrom sudo cp /usr/bin/usb-gadget /media/mmcblk0p1/usr/bin
Angstrom sudo cp /etc/profile.d/op_env.sh /media/mmcblk0p1/etc/profile.d - effectively just tells SDL to use tslib driver
Angstrom sudo cp /etc/default/leds /media/mmcblk0p1/etc/default
Angstrom sudo cp /etc/default/usb-gadget /media/mmcblk0p1/etc/default

And some more stuff to install in Debian:
Debian apt-get install libnotify-bin

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
Angstrom sudo cp /usr/bin/pnd* /media/mmcblk0p1/usr/bin - there are a few pnd binaries, these include pnd_info, pnd_run, pndevmapperd and pndnotifyd.
Angstrom sudo cp /usr/lib/libpnd.so.1.0.1 /media/mmcblk0p1/usr/lib - obviously nothing'll work without the pnd libraries!

There are a bunch of scripts and PNDs hiding in /usr/pandora.. we may as well grab them over as well.
Angstrom sudo cp -R /usr/pandora /media/mmcblk0p1/usr

We need to do a symlink to the library properly now, and clean up some stuff.
Debian ln -s /usr/lib/libpnd.so.1.0.1 /usr/lib/libpnd.so.1 Debian rm -rf /usr/pandora/mmenu - these are just PNDs that call the programs installed in Angstrom from MiniMenu. We don't have these programs installed on Debian so, they're useless to us.

RC Scripts

We also need to disable some things from running.. the first run script specifies the following:

update-rc.d -f samba remove
update-rc.d -f xinetd remove
update-rc.d -f avahi-daemon remove
update-rc.d -f apmd remove
update-rc.d -f usb-gadget remove
update-rc.d -f banner remove
update-rc.d -f portmap remove
update-rc.d -f mountnfs remove
update-rc.d -f blueprobe remove
update-rc.d -f dropbear remove
update-rc.d -f wl1251-init remove

We'll also need to add some bits to the rc.d script set:

rc0.d

ln -s ../init.d/led-config K05led-config
ln -s ../init.d/pandora-state K31pandora-state
ln -s ../init.d/pndevmapperd-init K40pndevmapperd-init
ln -s ../init.d/pndnotifyd-init K40pndnotify-init 

rc1.d

ln -s ../init.d/led-config K05led-config
ln -s ../init.d/pandora-state K31pandora-state
ln -s ../init.d/pndevmapperd-init K40pndevmapperd-init
ln -s ../init.d/pndnotifyd-init K40pndnotify-init 

rc2.d

ln -s ../init.d/led-config S05led-config

rc3.d

ln -s ../init.d/led-config S05led-config
ln -s ../init.d/pndevmapperd-init S30pndevmapperd-init
ln -s ../init.d/pndnotifyd-init S30pndnotify-init 

rc4.d

ln -s ../init.d/led-config S05led-config

rc5.d

ln -s ../init.d/led-config S05led-config
ln -s ../init.d/pndevmapperd-init S30pndevmapperd-init
ln -s ../init.d/pndnotifyd-init S30pndnotify-init 

rc6.d

ln -s ../init.d/led-config K05led-config
ln -s ../init.d/pandora-state K31pandora-state
ln -s ../init.d/pndevmapperd-init K40pndevmapperd-init
ln -s ../init.d/pndnotifyd-init K40pndnotify-init 

rcS.d

ln -s ../init.d/pandora-state S39pandora-state

We also need to fiddle with a few of the scripts - specifically led-config to add the dummy LSB information ( just rip it out of another script, and leave Required-Start, Required-Stop, Default-Start and Default-Stop empty, ) and pandora-state where you need to blank out the #adjust marker as it causes Debian to have fits.

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!

Debian 'adduser <username> - obviously, replace <username> with what you want; for example adduser pandora.

One interesting thing I've noticed happens, is sometimes it'll happily create your user... then not give you full permissions to your own folder.. so let's beat it a bit.
Debian chown -R <username>:<username> /home/<username> - replacing <username> with your actual username; for example chown pandora:pandora /home/pandora

You'll probably want to use sudo, which will require you to be in the wheel group, which we are about to create:
Debian groupadd wheel
There's also few groups you'd want to be in, so we'll do that now.
Debian usermod -a -G wheel <username> - you know the drill now... example; usermod -a -G wheel pandora
Debian usermod -a -G adm <username>
Debian usermod -a -G audio <username>
Debian usermod -a -G video <username>
Debian usermod -a -G plugdev <username>
Debian usermod -a -G users <username>
Debian usermod -a -G netdev <username>

Technically, you could've done all this in the one line with adduser, but I'd rather keep it all separate so that if we end up with extra groups, we all know how to add them.

There's a bunch of sudoers rules that are hidden as well that we need to steal ( I completely missed these twice - my thanks to sebt3 and DJWillis for pointing me to them! I thought the #includedir line was commented out due to the # ... *facepalm* )
Angstrom sudo cp /etc/sudoers.d/* /media/mmcblk0p1/etc/sudoers.d/

Finally, /tmp can sometimes go mad so we shall fix that just now too.
Debian chmod a+w /tmp

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
ext2load 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!

First Boot

tslib calibration

First Boot should bring you up to GDM in all it's splendour. But Wait! The touchscreen! IT IS MADNESS!
If you've a USB keyboard, you can be one step ahead and do CTRL+ALT+F1 to jump to a terminal, but we're going to assume just the Pandora so we'll carry on and login.

Once LXDE has finished loading up, press FN+ALT+F2 and type "lxterminal"
sudo su
export TSLIB_TSDEVICE=/dev/input/event5
export TSLIB_CONFFILE=/etc/ts.conf
ts_calibrate

Touchscreen should behave itself now.

Finish up installing any left overs

While root ( that's what sudo su does ) we shall finish setting up anything that didn't take during our chroot session in Angstrom ( bluetooth usually )
apt-get -f install
exit - jump back to our user so we don't accidentally mess things 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.

The following should probably be stuffed into deb files for easier maintainability:

  • libpnd
  • pandora specific scripts
  • SGX drivers
  • kernel
  • modules and firmware

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 ( see below on how to install! )

Common/Fun Things To Do

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

Networking

Networking should work effectively the same as on Angstrom, but here's a run down of what to do anyway:

  • Click the LXDE menu up.
  • Click System Tools -> Toggle Wifi
  • Click the Network Manager app between the process bar and the clock.
  • Click your network - or select "Connect to Hidden Wireless Network" if it's not there and fill out the details.
  • Fill out the keyring for your passwords to go into - so you only need to remember the one ;)
  • The Network Manager icon should spin and then give you a strength bar as normal once connected.

Synaptic

The 1.0.1 release did not include Synaptic.. it's back in 1.0.2
To get it back for the 1.0.1 release, it's simply a case of doing:
sudo apt-get update - if you haven't done so for a while ( as in, days, not hours )
sudo apt-get install synaptic
Then wait for a while as it downloads and installs.

You'll find Synaptic under System Tools once it's done.

My PND don't work, why?!

Generally, it'll be because of library differences.. I'm still trying to figure out the best way to deal with this, but you've got the Debian armel repository at your disposal, so you should be fine for a while!

1.0.2 has some library compatibility with Pandora Angstrom but it's not complete. The PNDs of Wesnoth and BattleJewels will work for example, whereas SuperTux and GravityForce do not.

Library compatibility was achieved by pulling packages manually from older revisions, symlinking some libraries and pulling stuff from experimental.. it was trial and error so, is a tad iffy.