This is a cookbook recipe for creating a tarball of a basic installation of Debian 3.0 for installation onto a compactflash card for linux on a Psion 5MX (or other) computer. This makes a fresh, clean basic state of Woody, from which any desired *.deb packages may be installed, e.g., X windows. This base installation is rather primitive, and considerable work is required to develop this system into a fully functioning "distribution". Nevertheless, this is a perfectly fine place to start a custom installation. The packages installed to this base state are meant to be the "stable" distribution of Debian.
The basic procedure is to unpack a minimal collection of the base *.deb files to a directory on a PC/notebook computer using debootstrap. This filesystem is then transferred to the compactflash disk (preferrably 128 MB or larger), PsiLinux is booted to it, and then the essential *.deb packages are reinstalled using dpkg. The reinstallation is required since dpkg is unaware that anything has been installed. A few minor configurations later, and we're done.
This installation procedure was gleaned from the Debian ARM Installation Manual.
(1) Obtain the "basedebs.tar" initial installation file from debian.org. This tarball contains the basic set of *.deb files for starting the installation. HERE is a list of what this tarball contains.
(2) Obtain the debootstrapxxxxxx.deb file from debian.org for the architecture of your PC or notebook, probably i386. I used debootstrap_0.1.17.13_i386.deb. This can be obtained from "stable", and click on Administration Utilities.
(3) Unpack the debootstrap_0.1.17.13_i386.deb file, or install it on your computer. I manually unpacked it with ar x debootstrap_0.1.17.13_i386.deb, and then manually unpacked the data.tar.gz file to my root directory.
(4) One of the things that running debootstrap will do is try to mount the /proc filesystem. This is already mounted on your PC of course. Edit the file "/usr/lib/debootstrap/functions" to comment out the umount and mount of the proc filesystem.
(5) Make a suitable directory for the new ARM files. I used
/home/armdebian. If the basedebs.tar file is in the directory /home/dir1/dir2/basedebs.tar,
then execute the command:
/usr/sbin/debootstrap --arch arm --unpack-tarball /home/dir1/dir2/basedebs.tar woody /home/armdebian/
This will unpack the necessary *.deb files to /home/armdebian. After completion (you may ignore the ld.config
error), if you cd to /home/armdebian
you will see the embryo of a Debian 3.0 installation.
(6) So cd to /home/armdebian (which we will refer to as the root "/" directory now - CAREFUL don't do anything to your PC's root directory!!!) and do the following:
(7) Tar this new filesystem over to /dev/hda2 on the compactflash. Be sure
/dev/hda2 is empty. From /home/armdebian:
tar cf - * | (cd /flash2 ; tar xf - )
If /dev/hda2 is mounted to /flash2.
Don't copy (cp -r) the tree because you will lose the space-saving links that way. tar is preferred.
(8) You can now boot up PsiLinux on your palmtop (see the PsiLinux on the Psion 5MX HOWTO if you don't know how to do that) to this new root filesystem. (At boot up you may get complaints about mounting an unchecked filesystem. The problem is that the disk is mounted read-write, so running e2fsck is not meant to be advised. To fix this include the boot option "ro" in the ArLo configuration file, or execute "mount -n -o remount,ro /" to remount the root partition read only, before executing e2fsck.) No password is required to log in as root. At boot up you might:
(9) Now comes the hard part. You have a new system, but according to dpkg, nothing at all is installed. You need to go through the base *.deb files and formally install the necessary ones (which ones are necessary?). The *.deb files are located (archived) in /var/cache/apt/archives (these are all the debfiles from basedebs.tar, put here conveniently by debootstrap). So cd to /var/cache/apt/archives, and begin installing the necessary and desired *.deb files. The order of installation might be: libc6, libncurses, libstdc++, perl-base, fileutils, adduser, info, base-files, base-config, base-passwd, apt, etc. Commands worth knowing at this point are (1) dpkg -i --force-depends package.deb (which forces the installation, regardless of dependencies), (2) dpkg --pending --configure (which reconfigures any packages that previously failed to configure correctly; you can run this repeatedly to try to work out problems), and (3) dpkg --list (which lists all the installed packages). The idea is to keep installing things, avoiding the use of the --force option where possible, until there are no more complaints about dependencies or unconfigured packages. Presumably there is some nifty Debian script that does this automatically (deselect?), but this is what I came up with - it works, ok?
(10) You then might want to install some of the more optional packages such as nvi (a simple vi editor) and ppp. Until you install an editor, you will not have one, which can be rather awkward... :)
(11) Clean up. The installation contains a load of excessive baggage that wastes considerable disk space - this is why the *.ipk version of PsiLinux is nice. When the dust has settled above you will find that your system takes up about 70 MB of space. You can delete much of the dpkg baggage, however. Once you are happy that all of the required *.deb files are installed, you can delete them from /var/cache/apt/archive; this will clear 21 MB of space. Places for other deletions or gzip-tions are: /usr/lib/gconv, /var/lib/apt/lists-files, /var/lib/dpkg/info files, /usr/share/locale, /usr/share/zoneinfo, /usr/man/* (foreign languages). Some libraries or files are duplicated, e.g., /usr/share/unidata/Unicode* files and /sbin/fsck* files - you can make links to avoid this. Other places to look are the /usr/share/doc files - you will find a lot of README, TODO, etc. files that can be deleted. I should think in all some 30+ MB of space can be cleared up.
(12) You probably want to shutdown PsiLinux when you are happy with its state, transfer the compactflash back to the PC/notebook and make a backup tarball of it. Indeed, you can make successive such backups at key junctures. If you should run into trouble at some point, you will have a quick way of getting back to the point before you wandered off track. A little like playing the DOS game "Leisure Suit Larry", eh?