Developing Embedded Network Device on FreeBSD
Matthew Seaman
m.seaman at infracaninophile.co.uk
Sat Feb 19 15:10:14 UTC 2011
On 19/02/2011 14:04, David wrote:
> I am new to FreeBSD development (I've done some work on NetBSD, but mostly
> on Linux).
>
> I am developing a COTS-based network appliance. After doing my research, I've decided to
> use FreeBSD as my development platform. I would like to get my development environment
> to the point where I can build a single ISO image that will contain OS and application
> ready to install. After reading through the handbook, porter's guide, and googling, I think I have
> a rough idea of how to do this, but I still have some gaps in how I set this up.
Cool. There's pretty good support for building custom install media in
FreeBSD -- see release(7) for starters.
> My current understanding is that all of the application specific, user land software should
> reside in the ports tree. I have two questions with respect to this:
They don't *have* to reside in the ports -- it's just that the
advantages of using ports are such that you'ld need a really compelling
reason not to.
Also, "using the ports" and "using packages" come to pretty much the
same thing in the end. Ports are just a structure for building packages
-- and packages can be in two states: installed into your filesystem, or
collected together as a pkg tarball.
> 1. If I don't want to publish my software, how do I manage the source (do I just generate a tarball
> on my build machine and place it in DISTDIR?).
You can create private ports that you can manage yourself and that
integrate with the regular ports tree pretty easily. In that case, you
should be able to build pre-compiled packages for your software which
you can include on your custom media. It's trickier if you need several
custom ports with dependencies between them, but still doable.
For a simple custom port, you can create a directory containing a port
Makefile, pkg-descr, pkg-plist etc. etc. anywhere in your filesystem.
Follow the Porter's Handbook for creating your port
(http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/) --
the structure you need is identical to what you'ld write for a port
intended to be committed to the public ports tree.
> 2. How do I integrate a ports-based application with a "make release" so that I can have my
> application binaries and dependancies included on the ISO ready for installation?
This is a standard feature when building install media using 'make
release' -- you should even be able to set up a scripted sysinstall that
will do practically everything automatically, including installing your
custom packages. Or check out the new bsdinstall stuff going into
current right about now.
> I'd greatly appreciate any pointers. I'm really looking forward to developing
> under FreeBSD, but just need a few pointers to get me started.
You'll find that FreeBSD documentation is rather more comprehensive than
is typical under Linux. Just about everything has a man page, and the
Handbook and various other online publications are generally rated as
excellent. Anything else, the FreeBSD mailing lists or forums can
usually be relied upon to provide answers about. There are specialised
lists for most interesting topics.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matthew at infracaninophile.co.uk Kent, CT11 9PW
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20110219/b5bd5a51/signature.pgp
More information about the freebsd-questions
mailing list