wiki:debirf

debirf

debirf is a system that will create diskless, all-in-ram images (kernel and initramfs) that boot entirely into ram and leave the user in a fully functional Debian system, disks untouched.

debirf has a module architecture that allows users to easily customize the images they build, using simple shell scripts, to do basically anything that Debian can do. Some included example "profiles" are:

  • minimal: very minimal system with no extras
  • rescue: includes a full complement of system repair utilities, including mdadm, lvm2, testdisk, foremost, etc
  • xkiosk: run a simple clean GUI web browser for public-access web browsing

Debirf is made publicly available under the GNU General Public License.

limitations

At the moment, stock debirf installs require the host machine to have ~256MB of RAM. We'd like to make at least some of the debirf images capable of running in much less than that. Installing a custom kernel could cut that down completely (at the cost of specializing the image to specific hardware), as could pruning much of the documentation. Systems with no documentation suck, but if you've got an embedded target (for example) there may be no other options.

history

debirf was inspired by RIP. CMRG has used RIP frequently. However, we have occasionally found ourselves booted into RIP, not having a package that we needed, and wishing we could just 'apt-get' it. We realized that if we could make an all-in-ram version of Debian, we would have everything we need.

We began by using the kernel patch that Kent Robotti (RIP developer) uses to allow for overmounting a tmpfs on the initial rootfs, before the initramfs is unpacked. The drawback of this was that it required re-compiling the kernel, which is probably a significant barrier to widespread adoption. We ultimately wanted to be able to use stock Debian kernels. The kernel patch (which we're no longer using) appears to have been initially authored by Chris Wedgwood.

As of kernel 2.6, debirf would boot entirely with a stock, un-patched Debian kernel into the rootfs. This has a couple of limitations due to the fact that the rootfs is a heavily simplified filesystem that doesn't handle everything that you might expect.

The benefit of running from the rootfs, though, is that it's "stupid simple". The initrd is nothing more than a gzip'd cpio (initramfs) of the desired filesystem, with a couple of simple tweaks. The initial executed script is just /sbin/init. We feel that this is really how it should be. No crazy init gymnastics to get a root filesystem mounted. The initrd is the root filesystem.

But the drawbacks of running from a rootfs were frustrating. We should document the specific failures/difficulties we've seen with a straight rootfs

So currently, we wrap the root filesystem cpio archive in another very simple cpio archive nest with a couple of other functions to allow mounting the desired cpio archive on a tmpfs, instead of the rootfs. This creates a fully usable system with just a tiny bit of extra bloat. We're still working on how to pair that down as much as possible.

qemu

Debirf works great with qemu. It's also a great way to test your debirf builds before deployment. See the "qemu" package in Debian.

Here's an example command to run a Debirf iso under qemu:

qemu -m 256 -serial stdio -net nic -net user -cdrom /path/to/debirf-minimal_squeeze_2.6.30-1-686.iso

xen

dkg did some experimentation with debirf under xen, and seemed to have some success with it.

similar projects

  • emdebian - very ambitious project to make Debian suitable for embedded systems
  • Recovery Is Possible - a GNU/Linux distro (slackware-based) designed to run from read-only media loaded initially into RAM.
  • Debian Router - by Vadim Berkgaut is another debian-based system designed to run only from RAM.

download

Debirf is of course available in Debian. We recommend installing debirf via apt-get:

apt-get install debirf

The source is available via git:

git://finestructure.net/debirf
git://lair.fifthhorseman.net/~dkg/debirf

You can also download pre-built a debirf kernel and initramfs (or the same system packaged in an ISO) for amd64-compatible computers.

mailing list

There is a mailing list at debirf@lists.mayfirst.org if you'd like to discuss debirf via e-mail.

irc

Question? Comments? join us #debirf on the irc.oftc.net network.

bugs

We recommend reporting problems with debirf via the Debian BTS. If you run debian, you can probably do that most easily with:

reportbug debirf

We have a set of legacy bugs reported here:

#15
make profile for super-light-weight system
#20
make debirf ssh module
#56
benchmark ram consumption of nest post boot
#57
allow specification of subarch for kernel
#66
consider discarding the linux-patch-inittmpfs
#68
do not install aptitude by default
#69
bootlogd failing to stop (bootlog module)
#79
canceling debirf with "ctrl-C" breaks fakeroot
#80
fake ldconfig remains in debirf
#82
do we really need root "overwrite" option?
#93
debirf fails to build etch image
#94
motd link not created properly on systems build in chroot
#101
debirf should pull the kernel package from /var/cache/apt/archives on the host if it exists
#102
fuse-utils fails during debirf make
#103
debirf should be able to use kernel parameters to preconfigure network
#105
debirf fails to build lenny image on squeeze
#106
x11-common fails to install in debirf root
#107
debirf fails to build on systems running nscd

Last modified 11 months ago Last modified on May 9, 2013 1:22:25 PM