[nycbug-talk] rc.conf / rc'ng hacking

Mark Saad mark.saad at ymail.com
Thu Oct 13 11:32:55 EDT 2011

 I am working on a system to reinstall some of my remote freebsd
servers . I can not PXE boot them so here is the idea.

1. Ship a newer kernel to the remote box , which is running
6.x-RELEASE . In my case I have tarballs of 7.x-RELEASE, and
8.x-RELEASE made from
the install media's kernel/generic.?? files
2. Ship a custom mfsroot to the remote box, based in part on the one I
use for local jumpstarts
3. Ship a loader.conf and loader.rc that instructs the remote box to
boot kernel=GENERIC and load the mfsroot and use it as its rootfs

So in this state if I reboot the remote server it will boot up and
follow the install.cfg I have in the mfsroot and I will have wiped out
the remote server,
changed the disk layout, which is important to me here, and upgraded
it to 7.x-RELEASE or 8.x-RELEASE depending on what I ship to that box.

So here is my question, I want to preserve the original rc.conf from
the old install. Here is an example.

ifconfig_bge0="inet netmask media 100baseTX
mediaopt full-duplex"

So my idea here was to have the script that creates and ships the
custom mfsroot fetch the rc.conf from the server I am going to
and then grab some info from the rc.conf .

So following how I use install.cfg I need to grab the NIC type and and
well I could search for the first line that do not start with # and
look at the line with ifconfig then take the text after _ to the = and
set that as my NIC type.

So I was tired,lazy yesterday and I was wondering how does rc'ng
handle this , surely there has to be a rc'ng function to suck in from
rc.subr that I can call to get my nic type etc . I cant find anything,
can someone shed some light on how this handled ? Is there an easier
way to this ?

Mark Saad | mark.saad at ymail.com

More information about the talk mailing list