nanobsd boot sequence problem

Nick Hibma nick at van-laarhoven.org
Tue Jan 15 08:39:39 UTC 2013


>> hi everyone,
>> 
>> i'm new in nanobsd field, trying to well-config my first nanobsd server for
>> a while..
>> 
>> here's my base question: which script is responsible for creating /etc and
>> /var as md drives?
>> 
>> i wanna know this cause early in my startup sequence, i've got  a some-how
>> myinit script which is in need of modifying /etc files; but it seems that
>> when myinit script is running, there is no such rw /etc there.. it's
>> confusing.. so i thought if i knew the creator script, i can have the right
>> sequence via REQUIRE and BEFORE and alike..
>> 
>> thank you for all your ideas and tips, and specially, your time :)
> 
> /etc/rc.initdiskless does that, called early from /etc/rc, before the rc.d scripts. So I'm surprised you are having issues...

We use the script below to modify the configuration based on a file stored on /cfg.

It modifies 0 or more files on /etc/ (that includes the symlinked /usr/local/etc/) before the system starts. Those are the files modified on the memory disk, not the underlying partition or /conf/etc/ dir.

Hope this helps.

Nick


#!/bin/sh
#
# PROVIDE: unit_localise
# BEFORE: hostid
#
# This script needs to be run as one of the first ones. It modifies any
# configuration files that contain @@AW<id>@@ awparams. It replaces all those
# awparams with the values read in from /etc/unit_localise{.default,}.
#
# Note: 'hostid' has been chosen as `rcorder /etc/rc.d/* /usr/local/etc/rc.d/*'
# shows that one as the first one.

. /etc/rc.subr

name='unit_localise'
rcvar=$(set_rcvar)

load_rc_config $name

: ${unit_localise_enable:='YES'}

unit_localise_start () {
...
}

start_cmd='unit_localise_start'
stop_cmd=':'

run_rc_command "$1"


More information about the freebsd-embedded mailing list