|Version 50 (modified by dkg, 6 years ago) (diff)|
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.
debirf has a module architecture that allows users to easily customize the images that they build, using simple shell scripts, to do basically anything the Debian can do. Some included examples "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.
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.
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.
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
- 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.
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 clone http://finestructure.net/debirf
You can also download pre-built a debirf kernel and initramfs (or the same system packaged in an ISO) for amd64-compatible computers.
Question? Comments? join us #debirf on the irc.oftc.net network.
We recommend reporting problems with debirf via the Debian BTS. If you run debian, you can probably do that most easily with:
We have a set of legacy bugs reported here:
- make profile for super-light-weight system
- make debirf ssh module
- benchmark ram consumption of nest post boot
- allow specification of subarch for kernel
- consider discarding the linux-patch-inittmpfs
- do not install aptitude by default
- bootlogd failing to stop (bootlog module)
- canceling debirf with "ctrl-C" breaks fakeroot
- fake ldconfig remains in debirf
- do we really need root "overwrite" option?
- debirf fails to build etch image
- motd link not created properly on systems build in chroot
- debirf should pull the kernel package from /var/cache/apt/archives on the host if it exists
- fuse-utils fails during debirf make
- debirf should be able to use kernel parameters to preconfigure network
- debirf fails to build lenny image on squeeze
- x11-common fails to install in debirf root
- debirf fails to build on systems running nscd