/etc/etc.current
),
to the destination files.
At each bootup, the selection made changes which directory
/etc/etc.current
points to.
Through doing this and reloading
/etc/rc.conf
in
/etc/rc
after the link has
been established, the resulting run-time configuration is effectively
controlled without the need to directly edit any files.
The default boot-up environment is selected by manually directing which
configuration directory
/etc/etc.default
points to.
As opposed to
/etc/etc.current
(which is updated
with every boot),
/etc/etc.default
is not automatically updated.
/etc/rc.conf
.
In order to initialize the system for operating in a
manner which supports multiple boot configurations,
newbtconf
must be run with an argument of
`init'.
This will create two symbolic links
/etc/etc.current
and
/etc/etc.default
to the directory
/etc/etc.network
.
The following files are all moved into
that directory and symbolic links put in their place, in
/etc
,
pointing to
/etc/etc.current/<filename>
:
/etc/defaultdomain
/etc/fstab
/etc/ifconfig.*
/etc/inetd.conf
/etc/mrouted.conf
/etc/mygate
/etc/myname
/etc/netstart
/etc/nsswitch.conf
/etc/ntp.conf
/etc/rc.conf
/etc/rc.conf.d
/etc/resolv.conf
To test that this has been performed correctly, reboot your system into
NetBSD.
After the kernel has autoconfigured and tty flags have been set,
a prompt should appear, preceded by the following like, looking like this:
[network]
Which configuration [network] ?
The []'s are used to indicate the default configuration, which can be selected by just pressing return. If there were other configurations available at this stage, you would have 30 seconds to enter that name and press RETURN.
/etc/etc.<newname>
,
will have been created,
priming the directory with the appropriate files for editing.
For example, if we do
newbtconf
nonet network
it would create a directory named
/etc/etc.nonet
and copy all the files from
/etc/etc.network
into that directory.
Upon rebooting, we should see:
[network] nonet
Which configuration [network] ?
To set up the system for booting into the
``nonet''
configuration, the files in
/etc/etc.nonet
need be edited.
If you wanted to make
``nonet''
the default configuration when booting, you
would need delete the symbolic link
/etc/etc.default
and create a new symbolic link (with the same name) to
/etc/etc.nonet
.
Booting up after having made such a change would
result in the following being displayed:
network [nonet]
Which configuration [nonet] ?
/etc/etc.nonet/rc.conf
:
auto_ifconfig=NO
net_interfaces=NO
Of course other networking services, such as NTP, routed, etc, are all
expected to be
``NO''.
In general, the only setting that should be
``YES''
is syslogd, and perhaps cron (if your cron scripts don't
need the network) or screenblank/wscons (if applicable).
Other actions such as deleting any NFS mounts from
/etc/etc.nonet/fstab
would also need to be undertaken.
/etc/etc.current
and
/etc/etc.default
are also removed so upon rebooting no configuration selection menu is
displayed.
Note that the previously created configurations (in
/etc/etc.<name>
)
are not removed.
/etc/etc.current
/etc/etc.default
/etc/defaultdomain
/etc/fstab
/etc/ifconfig.*
/etc/inetd.conf
/etc/mrouted.conf
/etc/mygate
/etc/myname
/etc/netstart
/etc/nsswitch.conf
/etc/ntp.conf
/etc/rc.conf
/etc/rc.conf.d
/etc/resolv.conf
This shell script was written by Darren Reed <darrenr@NetBSD.org> with initial input from Matthew Green <mrg@NetBSD.org> on how to approach this problem.
The management of the overall collection of multiple configurations is much more manual than it ought to be. A general system configuration tool needs to be written to ease their management.