Debian installed in Flash instead of uSD

Eli retracile at
Fri Aug 22 06:05:27 CEST 2008


I got the Debian install to fit in flash, even with several extra things (like 
vim-gtk) installed, and it's currently showing 53M free.  Here are (somewhat 
cleaned up) instructions:

Using the, installed Debian on my 4GB uSD card.
Booted into Debian, did my apt-get stuff to add packages.  In particular, I 
apt-get install subversion python-crypto python-gdbm python-gtk2 xauth x2x 
python-pysqlite2 vim-gtk gpaint tangogps gpsd apmd patch patchutils

You probably will want to "apt-get clean" at this point.

mkdir /var/tmp/root
mount /dev/root /var/tmp/root

On my workstation:
ssh root at "mkfs.jffs2 -d /var/tmp/root -e 
128 --pad --no-cleanmarkers" | pv -W > debian-rootfs.jffs2
(The "| pv -W" is optional, it just gives you something to watch as the bytes 
fly by.)

Copy the /boot/uImage.bin to the workstation.  (Or wget the one the 
Use dfu-util to flash the kernel image and the rootfs.

Boot into Debian from the uSD again.
mount /mnt/flash
vim /mnt/flash/etc/fstab
1) Change the filesystem type for the rootfs line to jffs2
2) Comment out the mmcblk0p1 and mtdblock6 lines
3) Add a line:
tmpfs   /var/cache/apt  tmpfs   defaults,noatime                        0 0
... and save your changes.

rm -rf /mnt/flash/var/cache/apt/*

umount /mnt/flash

Reboot, and let the FR boot from its internal flash.  It will take a while, 
but debian should boot.

If you want to run apt-get, you will need to
mkdir -p /var/cache/apt/archives/partial
may be a better solution, but I haven't tried it.)

apt-get update took 5 minutes for me, and used a dozen MB in the rootfs 
temporarily, but I'm not anticipating apt-get to be a daily task on this once 
I get the basics worked out.
The tmpfs for /var/cache/apt is necessary because apt uses mmap for some stuff 
in /var/cache/apt, and that doesn't appear to play well with jffs2.

Comments, suggestions, etc, welcome.

------------------. "If it ain't broke now,
Eli Carter         \                  it will be soon." -- crypto-gram
retracile at `-------------------------------------------------

More information about the community mailing list