flash-install

Summary

This is a first pass at running Edgy off of a 256MB Compact Flash module, attached via an CF->IDE adapter. Most of the removals were based on this small amount of disk space, and the minimal requirements of the system (a digital picture frame, pulling images off of an NFS server). The directory structure was created in a chroot on an ext3 FS on my desktop system, and then copied to the flash.

Rationale

The concepts here should allow for a fast booting, reliable OS, with fewer moving parts. It is somewhat similar to what MS is doing in Vista, but rather than caching an image of the common OS files to flash, this just runs the whole OS off of flash.

Given that CF->IDE adapters can be had for $9.99 on NewEgg and various other sites, this might make a great way to run a full fledged Ubuntu system. Hard drives would have more opportunity to spin down. Important files could be mirrored to the flash for a quick, portable backup.

Use cases

Candice wants a to reduce boot times on her system. Installing Ubuntu onto the flash allows Candice's system to boot in X seconds.

Scope

Design

Implementation

apt-get install debootstrap
mkdir <install target dir>
debootstrap edgy <install target dir>
mount -o bind /proc <install target dir>/proc
mount -o bind /dev <install target dir>/dev
chroot <install target dir>
vi /etc/apt/sources.list (add universe for feh)
apt-get update
apt-get install linux-image-generic (Answer no to aborting)
apt-get install xserver-xorg-core xinit feh language-pack-en
apt-get install lilo (say "OK" to the message that you need to run liloconfig)
apt-get remove ubuntu-minimal netcat xserver-xorg-input-all xserver-xorg-input-elographics xserver-xorg-input-synaptics xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-apm xserver-xorg-video-ark xserver-xorg-video-ati xserver-xorg-video-chips xserver-xorg-video-cirrus xserver xorg-video-cyrix xserver-xorg-video-dummy xserver-xorg-video-glint xserver-xorg-video-i128 xserver-xorg-video-i740 xserver-xorg-video-i810 xserver xorg video-imstt xserver-xorg-video-mga xserver-xorg-video-neomagic xserver-xorg-video-newport xserver-xorg-video-nsc xserver-xorg-video-nv xserver-xorg video-rendition xserver-xorg-video-s3virge xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sis xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-tga xserver-xorg-video-trident xserver-xorg-video-tseng xserver-xorg-video-v4l xserver-xorg-video-via xserver-xorg-video-vmware xserver-xorg-video-voodoo
rm -rf /etc/cron.*
rm -rf /usr/share/doc
rm /var/cache/apt/archives/*
rm -rf /usr/share/sounds (unless you want the test tones for determining sound channels)
rm -rf /usr/share/man (unless you want man pages and have the space)
rm /etc/mtab
ln -s /proc/mount /etc/mtab

update /etc/fstab to ensure root fs is mounted with noatime option
update /etc/init.d/mountkernfs
These lines ensure that these directories are mounted in a tmpfs rather than letting the system write them to flash. As a result, the system can run with the rootfs mounted as readonly

  • Add these lines after /var/lock gets mounted:

    domount tmpfs /var/lib/nfs "-o mode=0755"
    domount tmpfs /var/lib/dhcp3 "-o mode=0755"
    domount tmpfs /tmp "-o mode=1777"
    domount tmpfs /var/log "-o mode=1777"
    domount tmpfs /var/lib/urandom "-o mode=0755"
    #only needed if you are running nfs...
    mkdir /var/lib/nfs/rpc_pipefs/
    mkdir /var/lib/nfs/sm
    mkdir /var/lib/nfs/sm.bak


setup network interfaces in /etc/network/interfaces
/usr/bin/Xorg --configure - generate (or copy in) /etc/X11/xorg.conf
remove syslog from rc.d dirs. (or set to log remotely)
add following to /etc/inittab:

  • #8:23:respawn:/usr/bin/xinit /usr/local/bin/slideshow

copy in /usr/local/bin/slideshow
change filesystem to mount with option ro in fstab
clear out /var/cache/apt/archive
install mbr for lilo

flash-install (last edited 2008-08-06 16:26:58 by localhost)