~2012

Running Debian from RAM

Since about a year I'm investigating more appliance/embedded-like systems. Through all this research I stumbled upon debirf. This simple tool let's you create a full debian os in an initial ramdisk. This is especially handy for fully customised systems aimed at performance and not using harddrives or flash disks.

Firs install the tool and create a directory where you can place your images.

sudo apt-get install debirf
mkdir debirf
cd debirf/

To start simply we need to extract a profile. This profile is a set of scripts to setup a system. We'll try the 'minimal' profile first which is a simple minimal os.

tar xzf /usr/share/doc/debirf/example-profiles/minimal.tgz

Debirf by default refers to some old distros so we'll first need to edit the debirf.conf in the profile dir.

nano minimal/debirf.conf

Have a look around in the config to see what you can set. Change the following two vars to the distro/suite you are running:

DEBIRF_SUITE=lucid
DEBIRF_DISTRO=ubuntu

Next we can just create an image by issuing:

debirf make minimal

This will take a while! The output is quite verbose so if anything fails look at the exact failure message.

I've tried this on Ubuntu Lucid X86_64 which worked for me. However Oneiric failed which might be caused by some outstanding bugs.

Don't try working around this by using sudo. I don't know how but it completely ruined my system :(

After the build

You're left with two files: * debirf-minimal_lucid_2.6.32-21-generic.cgz : The ramdisk image * vmlinuz-2.6.32-21-generic : The linux kernel

Just run qemu to test the kernel, ie.:

qemu -m 256 -serial stdio -net nic -net user -kernel vmlinuz-2.6.32-21-generic -initrd debirf-minimal_lucid_2.6.32-21-generic.cgz

Thoughts