Creating one's own installer/mfsroot
Matthew Dillon
dillon at apollo.backplane.com
Thu May 10 00:16:34 UTC 2007
:> You could also look at the INSTALL guides for (early versions of?)
:> Dragonfly, it taught me how to install a BSD system from
:> scratch, using
:> only what's in base of liveCD :)
:...
:
:We have set up a boot CD (or pxeboot/nfs environment) where we can run a
:Ruby script that will take directives from a configuration file, configure
:the disks, slices and partitions, align the partitions to start on a block
:...
I came up with a neat little script-driven remote configurator called
rconfig (/usr/src/sbin/rconfig in the DragonFly codebase) as an
alternative to the standard features in our installer. I recommend
checking it out.
http://www.dragonflybsd.org/cvsweb/src/sbin/rconfig/
rconfig is really easy to use. Basically its just a client/server pair
with socket broadcast capabilities. All it does is negotiate a
shell script download from the server to the client (server on the
same subnet), then runs the script on the client. That's it.
I wanted to be able to boot a CD, login as root, dhclient the network
up, and then just go 'rconfig -a' and have my script do the rest. It
takes a bit of time to write the shell script to do a full install
from fdisk to completion, but if you have a fully working CD based
environment (all the binaries in /, /usr, a writable /tmp, /etc, and
so forth)... then shell scripts are just as easy to write as they are
on fully installed machines.
I use rconfig to do fresh installs of my test boxes from CD, with all the
customization, my ssh keys, fstab entries, NFS mounts, etc that I need
to be able to ssh into the box and start using it immediately.
NFS booting is 'ok', but requires a lot of infrastructure and gets
out of date easily. Often you also have to mess with the BIOS settings,
which is very annoying because you have to change them back after you
finish the install. I used NFS booting for a while, but just couldn't
depend on it always being operational. With rconfig I just leave the
rconfig server running on one of my boxes and the worst I have to do
is tweak my script a bit. And adding smarts to the script is easy
whereas you just can't add much smarts to a NFS boot without a lot of
messing around with the RC sequence.
In anycase, check it out. My assumption is that rconfig would compile
nearly without modification on a FreeBSD box.
-Matt
Matthew Dillon
<dillon at backplane.com>
More information about the freebsd-stable
mailing list