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
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
116 To test that this has been performed correctly, reboot your system into
118 After the kernel has autoconfigured and tty flags have been set,
119 a prompt should appear, preceded by the following like, looking like this:
122 Which configuration [network] ?
125 The []'s are used to indicate the default configuration, which can be
126 selected by just pressing return.
127 If there were other configurations available at this stage, you would
128 have 30 seconds to enter that name and press
130 .Ss Multiple Configurations
131 Once an initial configuration has been set up, we can proceed to set up further
132 run time environments.
133 This is done by invoking
135 with the name of the new configuration to be created.
136 By default, this step
137 will use the current configuration files as the basis for this setup unless
138 a second parameter is given - that of the configuration to use as the basis
140 Upon completion, a new directory,
141 .Pa /etc/etc.\*[Lt]newname\*[Gt] ,
142 will have been created,
143 priming the directory with the appropriate files for editing.
144 For example, if we do
147 it would create a directory named
149 and copy all the files from
152 Upon rebooting, we should see:
155 Which configuration [network] ?
158 To set up the system for booting into the
160 configuration, the files in
164 If you wanted to make
166 the default configuration when booting, you
167 would need delete the symbolic link
169 and create a new symbolic link (with the same name) to
171 Booting up after having made such a change would
172 result in the following being displayed:
175 Which configuration [nonet] ?
178 Assuming that we performed the above command successfully, in order to
179 successfully configure
181 to not configure interfaces (or generate no
182 errors from attempting to do so), the following settings (at least) should
184 .Pa /etc/etc.nonet/rc.conf :
190 Of course other networking services, such as NTP, routed, etc, are all
193 In general, the only setting that should be
195 is syslogd, and perhaps cron (if your cron scripts don't
196 need the network) or screenblank/wscons (if applicable).
197 Other actions such as deleting any NFS mounts from
198 .Pa /etc/etc.nonet/fstab
199 would also need to be undertaken.
200 .Ss Reverting multiple boot configurations
201 Multiple boot configurations can be deactivated by running
205 All the symlinks mentioned above are then removed and the files they point to
206 are copied to their default place.
207 This effectively makes the currently selected
208 configuration the only one active.
213 are also removed so upon rebooting no configuration selection menu is
215 Note that the previously created configurations (in
216 .Pa /etc/etc.\*[Lt]name\*[Gt] )
219 .Bl -tag -width ".Pa /etc/nsswitch.conf" -compact
220 .It Pa /etc/etc.current
221 Symbolic link to current config directory.
222 .It Pa /etc/etc.default
223 Symbolic link to default config directory.
225 .It Pa /etc/defaultdomain
226 These files all become symbolic links.
227 .It Pa /etc/dntpd.conf
229 .It Pa /etc/ifconfig.*
230 .It Pa /etc/inetd.conf
234 .It Pa /etc/nsswitch.conf
236 .It Pa /etc/rc.conf.d
237 .It Pa /etc/resolv.conf
245 program first appeared in
249 This shell script was written by
250 .An Darren Reed Aq Mt darrenr@NetBSD.org
251 with initial input from
252 .An Matthew Green Aq Mt mrg@NetBSD.org
253 on how to approach this problem.
255 It presently does not display a count down timer whilst waiting for input
256 to select which configuration and nor does it abort said timer when a key
259 The management of the overall collection of multiple configurations is much
260 more manual than it ought to be.
261 A general system configuration tool needs to be written to ease their