1 .\" $NetBSD: newbtconf.8,v 1.18 2004/08/31 17:08:06 uwe Exp $
3 .\" Copyright (c) 1999 Darren Reed. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of the author nor the names of its contributors
14 .\" may be used to endorse or promote products derived from this software
15 .\" without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .Dd September 30, 2005
34 .Nd multiple boot-up configurations
45 is used to set up the system in such a way that the user is offered a
46 selection of environments in which to boot the system up into.
47 The most obvious application being for laptops to provide a network
48 and non-network environment after a successful boot into multi-user mode.
50 In order to accomplish this task, the files usually associated with
51 establishing the current system's running configuration are replaced with
52 symbolic links which are adjusted with each boot to point to the appropriate
53 file for the desired run-time environment.
54 This is accomplished by directing all of the symbolic links through a
55 directory which itself is a symbolic link
56 .Pq Pa /etc/etc.current ,
57 to the destination files.
58 At each bootup, the selection made changes which directory
62 Through doing this and reloading
67 been established, the resulting run-time configuration is effectively
68 controlled without the need to directly edit any files.
69 The default boot-up environment is selected by manually directing which
70 configuration directory
78 is not automatically updated.
82 only has one boot-up configuration - that set in the
85 In order to initialize the system for operating in a
86 manner which supports multiple boot configurations,
88 must be run with an argument of
90 This will create two symbolic links
95 .Pa /etc/etc.network .
96 The following files are all moved into
97 that directory and symbolic links put in their place, in
100 .Pa /etc/etc.current/\*[Lt]filename\*[Gt] :
101 .Bd -literal -offset indent
117 To test that this has been performed correctly, reboot your system into
119 After the kernel has autoconfigured and tty flags have been set,
120 a prompt should appear, preceded by the following like, looking like this:
123 Which configuration [network] ?
126 The []'s are used to indicate the default configuration, which can be
127 selected by just pressing return.
128 If there were other configurations available at this stage, you would
129 have 30 seconds to enter that name and press
131 .Ss Multiple Configurations
132 Once an initial configuration has been set up, we can proceed to set up further
133 run time environments.
134 This is done by invoking
136 with the name of the new configuration to be created.
137 By default, this step
138 will use the current configuration files as the basis for this setup unless
139 a second parameter is given - that of the configuration to use as the basis
141 Upon completion, a new directory,
142 .Pa /etc/etc.\*[Lt]newname\*[Gt] ,
143 will have been created,
144 priming the directory with the appropriate files for editing.
145 For example, if we do
148 it would create a directory named
150 and copy all the files from
153 Upon rebooting, we should see:
156 Which configuration [network] ?
159 To set up the system for booting into the
161 configuration, the files in
165 If you wanted to make
167 the default configuration when booting, you
168 would need delete the symbolic link
170 and create a new symbolic link (with the same name) to
172 Booting up after having made such a change would
173 result in the following being displayed:
176 Which configuration [nonet] ?
179 Assuming that we performed the above command successfully, in order to
180 successfully configure
182 to not configure interfaces (or generate no
183 errors from attempting to do so), the following settings (at least) should
185 .Pa /etc/etc.nonet/rc.conf :
191 Of course other networking services, such as NTP, routed, etc, are all
194 In general, the only setting that should be
196 is syslogd, and perhaps cron (if your cron scripts don't
197 need the network) or screenblank/wscons (if applicable).
198 Other actions such as deleting any NFS mounts from
199 .Pa /etc/etc.nonet/fstab
200 would also need to be undertaken.
201 .Ss Reverting multiple boot configurations
202 Multiple boot configurations can be deactivated by running
206 All the symlinks mentioned above are then removed and the files they point to
207 are copied to their default place.
208 This effectively makes the currently selected
209 configuration the only one active.
214 are also removed so upon rebooting no configuration selection menu is
216 Note that the previously created configurations (in
217 .Pa /etc/etc.\*[Lt]name\*[Gt] )
220 .Bl -tag -width /etc/mrouted.current -compact
221 .It Pa /etc/etc.current
222 Symbolic link to current config directory.
223 .It Pa /etc/etc.default
224 Symbolic link to default config directory.
226 .It Pa /etc/defaultdomain
227 These files all become symbolic links.
229 .It Pa /etc/ifconfig.*
230 .It Pa /etc/inetd.conf
231 .It Pa /etc/mrouted.conf
235 .It Pa /etc/nsswitch.conf
238 .It Pa /etc/rc.conf.d
239 .It Pa /etc/resolv.conf
247 program first appeared in
251 This shell script was written by
253 .Aq darrenr@NetBSD.org
254 with initial input from
257 on how to approach this problem.
259 It presently does not display a count down timer whilst waiting for input
260 to select which configuration and nor does it abort said timer when a key
263 The management of the overall collection of multiple configurations is much
264 more manual than it ought to be.
265 A general system configuration tool needs to be written to ease their