Copyright © 2008, 2009, 2010 Marc Balmer. All rights reserved.
embed-it/bsd is a stripped down and slightly modified version of OpenBSD targeted at use in i386-based embedded devices like the PC-Engines ALIX boards. The most important design goals were
Ideally there are not much user visible differences to a standard OpenBSD installation, but since the whole system can be installed on CF cards as small as 16 MB, some tradeoffs have been made in the selection of binaries available.
Nothing speaks against installing a plain OpenBSD system on an embedded device, a 1 GB compact flash card can fit the whole system including X11R6 without any problem. Of course upgrading then means to follow the recommended procedure, it can not be done with replacing a single "firmware" file. And then you can not fit a standard OpenBSD install on the soldered 64 MB flash disk of some devices that don't even have a CF socket.
A single firmware file means, that the kernel and the userland tools plus any custom software are fit into a so-called ramdisk kernel, a kernel that has it's root filesystem in the ramdisk which contains also the needed software. With this setup, replacing the ramdisk kernel not only replaces the OpenBSD kernel, but also all of the software. That is what makes system updates so easy and painless. scp or ftp a new image is all that is needed. The compact flash memory is used to boot the ramdisk kernel and for storage of the configuration files in /etc. Optionally the contents of the /var filesystem or any other, user defined filesystems can be placed of CF storage as well.
There are also commercial "firmware" solutions available, like e.g. my own embed-it™ product, which comes with a powerful commandline interface, but has not much in common with how an OpenBSD system is administered. embed-it/bsd on the other hand can be seen as a something in between. It's not a full OpenBSD install, but it is also not a proprietary solution that is administered with it's own command language.
The installation procedure of embed-it/bsd is similar to the standard installation, with two major exceptions: embed-it/bsd is not booted from an installation medium like CD-ROM, floppy disk or tape, but the installer is booted over the network using PXE-boot and during the installation no sets are loaded. All needed software (the "firmware" image) is included in the installer.
The stand-alone installer is carrying all needed software with itself, however, a DHCP server and a TFTP boot server must be setup.
The installation process will go through the usual disk initialization steps and then copy the OS to the disk. The disk initialization is a bit different from a standard OpenBSD install: The partition that is designated as the root partition will hold the ramdisk kernel, but at runtime it will be mounted to /etc to hold the configuration files. Only one partition needs to be created and it must be big enough to hold the embed-it/bsd ramdisk kernel plus the configuration files. If a second partition is created and the mount point set to /var, it will later be used to hold the contents of the /var filesystem, which otherwise will just reside in the ramdisk (and in consequence, the contents are lost after a reboot).
The installation will let you configure the network and terminates with the usual questions and drops into a shell. The system can now be rebooted or halted.
embed-it/bsd can be operated like a standard OpenBSD installation. After booting up, login is possible on the console using the root account and the password supplied during system install.
The configuration files are available in the /etc directory as expected and can be edited using the vi editor. One might consider mounting the /etc partition read-only to prevent from possible data loss in case of sudden power loss (a user pulling the power cord...).
To upgrade the system to a new embed-it/bsd image, one has to keep in mind that the partition holding the /etc directory is also the bootable partition (and it was the root partition during system installation.) In consequence, a new image must be placed in /etc/bsd, not in /bsd (which would be in the ramdisk where the image probably would not fit anyway). The way the boot partition is used for /etc is also the reason why the boot configuration file that is usally found in /etc/boot.conf is located in /etc/etc/boot.conf in embed-it/bsd. The OpenBSD boot loader of course sees this file in /etc/boot.conf of the boot partition.
embed-it/bsd is close to OpenBSD but it is not OpenBSD. I choose not to use the word "OpenBSD" in it's name since that is a trademark owned by Theo de Raadt. embed-it is a trade mark owned by myself. /bsd is a suffix to hint at the fact its based on OpenBSD. The following sections will explain the most important differences and also how the image creation process differs from the way the OpenBSD ramdisk kernels (bsd.rd) are made.
/sbin/init is the first program that gets executed by the kernel after system start. The role of /sbin/init is to execute a system wide startup script usually located in /etc/rc and setting up the ttys so that users can login. As the /etc filesystem resides on a partition that is not available at boot time when /sbin/init is started, /sbin/init has no access to the /etc/rc script. The /etc/rc script has thus been placed in a different location, /setc/rc, and /sbin/init has been modified to use the file from there. You will not have a /etc/rc file once the system is running and there is no possibility to change that file either. It is considered part of the kernel here but there is of course /etc/rc.local for local additions.
The /setc/rc file will first mount the a partition of the boot disk to the /etc mountpoint and then progress like the default /etc/rc script.
The root filesystem resides in a ramdisk and it's content can not be modified. The boot partition is mounted at /etc and any other partitions are mounted at the mountpoints designated during system installation. The directory /etc/etc exists for the boot loader only, a boot.conf file can be placed there.
One of the main reason why OpenBSD does not fit on small CF cards anymore is that the libraries are linked with full debug information. This is generally a very good idea, but it requires more space than we might have available on embedded devices.
In embed-it/bsd, all binaries and libraries are stripped off the debugging symbols which makes them much smaller. The scripts that read in the list of files to be installed in the ramdisk have been extended to support a STRIPL keyword to copy a library and stripping off the debug symbols.