FreeBSD embedded: TinyBSD
Jean Milanez Melo
jmelo at FreeBSDBrasil.COM.BR
Thu Jul 15 12:14:30 PDT 2004
Please allow me to introduce myself, I'm one of the coordinators of
the Brazilian FreeBSD Users group, coordinator of the official
FreeBSD documentation's translation group and have been working with
embedded FreeBSD systems since year 2000.
I've been studying NanoBSD ever since Poul-Henning posted about it on one of
the mailling lists, and I have been following this project closely. It
really is a great project.
However, I think it sometimes creates unnecessary partitions, takes
too long to build the system due to make world and it copies lots of
unneeded binaries, taking a lot of precious space.
So me and Patrick Tracanelli (another active member of the Brazilian
FreeBSD community) decided to write a new set of scripts to build
embedded systems. We've named it TinyBSD, and its goal is to be faster
at building-time, occupy less space on the target device and to ease
customization like PicoBSD does.
Untar/gzip the tinybsd.tar.gz file under /usr/src/release.
TINYBSD tinybsd.basefiles tinybsd.sh
We first take the file TINYBSD, which like in PicoBSD we can use to
define or remove all kernel options to the new system.
Then we have tinybsd.basefiles, where we define all binaries necessary
to get the system running and anyone can edit it as they will.
Finally we have the script itself, tinybsd.sh. It's a simple script,
yet functional. We based it on NanoBSD's and its idea is to create a
temporary work directory where the new system's directory tree will be
created. Then it'll copy all files listed on tinybsd.basefiles to this
tree. This copying process is essential to the speed of the building
process, as we eliminate the recompiling phase. The reason for this is
FreeBSD 5.1' dynamically-linked base system, which take much less
space than the old statically-linked ones. This way we can also do the
copying without affecting the production system in any way.
After all this, we compile the kernel using the TINYBSD file and then
we install the necessary libs using the dependencies' output from the
binaries. We populate the /etc directory on the temp work directory
and put in a few important default settings in /etc/rc.conf, like:
Lastly, we create the empty image according to the specifications for
the device passed in as a parameter and copy the entire temp directory
to the new image. After that, the user can use dd to write the final
image to the target device.
Booting the system works as embedded systems do, mounting /var and
/tmp as MFS filesystems.
The most interesting point is the space used by default, only 20MB.
As you can see, it's pretty simple. But since PicoBSD is practically
unusable with the 5.x series, TinyBSD could be an interesting
alternative along with NanoBSD to be put on the base system in future
Patrick and I have been thinking of enhancing the script and adding
end-user helping tools such dialog-based menus and the likes. In case
the FreeBSD project has any interest in our project, we can perfectly
maintain TinyBSD as an embedded option for FreeBSD users.
Thank you for your attention
Jean Milanez Melo
ps: please reply to jmelo at freebsdbrasil.com.br
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6131 bytes
Url : http://lists.freebsd.org/pipermail/freebsd-small/attachments/20040715/f7bb1f91/tinybsd.obj
More information about the freebsd-small