Manual browser: newbtconf(8)
|NEWBTCONF(8)||System Manager's Manual||NEWBTCONF(8)|
NAMEnewbtconf — multiple boot-up configurations
DESCRIPTIONnewbtconf is used to set up the system in such a way that the user is offered a selection of environments in which to boot the system up into. The most obvious application being for laptops to provide a network and non-network environment after a successful boot into multi-user mode.
BackgroundIn order to accomplish this task, the files usually associated with establishing the current system's running configuration are replaced with symbolic links which are adjusted with each boot to point to the appropriate file for the desired run-time environment. This is accomplished by directing all of the symbolic links through a directory which itself is a symbolic link (/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.
Getting StartedBy default, NetBSD only has one boot-up configuration - that set in the file /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.
Multiple ConfigurationsOnce an initial configuration has been set up, we can proceed to set up further run time environments. This is done by invoking newbtconf with the name of the new configuration to be created. By default, this step will use the current configuration files as the basis for this setup unless a second parameter is given - that of the configuration to use as the basis for the new one. Upon completion, a new directory, /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] ?
No NetworkAssuming that we performed the above command successfully, in order to successfully configure NetBSD to not configure interfaces (or generate no errors from attempting to do so), the following settings (at least) should be used in /etc/etc.nonet/rc.conf:
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.
Reverting multiple boot configurationsMultiple boot configurations can be deactivated by running newbtconf with an argument of revert. All the symlinks mentioned above are then removed and the files they point to are copied to their default place. This effectively makes the currently selected configuration the only one active. The symbolic links /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.
- Symbolic link to current config directory.
Symbolic link to default config directory.
- These files all become symbolic links.
SEE ALSOrc.conf(5), rc(8)
HISTORYThe newbtconf program first appeared in NetBSD 1.5.
AUTHORSThis shell script was written by <darrenr@NetBSD.org> with initial input from <mrg@NetBSD.org> on how to approach this problem.
BUGSIt presently does not display a count down timer whilst waiting for input to select which configuration and nor does it abort said timer when a key is first pressed.
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.
|September 30, 2005||NetBSD 7.0|