xref: /freebsd/share/man/man8/diskless.8 (revision 7cfd02d97319cecf16f5e2c302ef69ce0411800f)
1247ca3deSSteve Price.\" Copyright (c) 1994 Gordon W. Ross, Theo de Raadt
2738d91baSRobert Watson.\" Updated by Luigi Rizzo, Robert Watson
3247ca3deSSteve Price.\" All rights reserved.
4247ca3deSSteve Price.\"
5247ca3deSSteve Price.\" Redistribution and use in source and binary forms, with or without
6247ca3deSSteve Price.\" modification, are permitted provided that the following conditions
7247ca3deSSteve Price.\" are met:
8247ca3deSSteve Price.\" 1. Redistributions of source code must retain the above copyright
9247ca3deSSteve Price.\"    notice, this list of conditions and the following disclaimer.
10247ca3deSSteve Price.\" 2. Redistributions in binary form must reproduce the above copyright
11247ca3deSSteve Price.\"    notice, this list of conditions and the following disclaimer in the
12247ca3deSSteve Price.\"    documentation and/or other materials provided with the distribution.
13247ca3deSSteve Price.\" 3. The name of the author may not be used to endorse or promote products
14247ca3deSSteve Price.\"    derived from this software without specific prior written permission.
15247ca3deSSteve Price.\"
16247ca3deSSteve Price.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17247ca3deSSteve Price.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18247ca3deSSteve Price.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19247ca3deSSteve Price.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20247ca3deSSteve Price.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21247ca3deSSteve Price.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22247ca3deSSteve Price.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23247ca3deSSteve Price.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24247ca3deSSteve Price.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25247ca3deSSteve Price.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26950c15fcSAlexey Zelkin.\"
277f3dea24SPeter Wemm.\" $FreeBSD$
28247ca3deSSteve Price.\"
297cfd02d9SBrooks Davis.Dd September 28, 2004
30247ca3deSSteve Price.Dt DISKLESS 8
31247ca3deSSteve Price.Os
32247ca3deSSteve Price.Sh NAME
33247ca3deSSteve Price.Nm diskless
34247ca3deSSteve Price.Nd booting a system over the network
35247ca3deSSteve Price.Sh DESCRIPTION
36247ca3deSSteve PriceThe ability to boot a machine over the network is useful for
37950c15fcSAlexey Zelkin.Em diskless
38247ca3deSSteve Priceor
39950c15fcSAlexey Zelkin.Em dataless
40247ca3deSSteve Pricemachines, or as a temporary measure while repairing or
41247ca3deSSteve Pricere-installing file systems on a local disk.
42247ca3deSSteve PriceThis file provides a general description of the interactions between
43247ca3deSSteve Pricea client and its server when a client is booting over the network.
44247ca3deSSteve Price.Sh OPERATION
45247ca3deSSteve PriceWhen booting a system over the network, there are three
46247ca3deSSteve Pricephases of interaction between client and server:
47ace5be68SRuslan Ermilov.Bl -enum
483136363fSRuslan Ermilov.It
49ace5be68SRuslan ErmilovThe stage-1 bootstrap, typically PXE built into your Ethernet
50c2095e2bSMatthew Dilloncard, loads a second-stage boot program.
513136363fSRuslan Ermilov.It
52ace5be68SRuslan ErmilovThe second-stage boot program, typically
53ace5be68SRuslan Ermilov.Xr pxeboot 8 ,
54ace5be68SRuslan Ermilovloads modules and
55ace5be68SRuslan Ermilovthe kernel, and boots the kernel.
563136363fSRuslan Ermilov.It
57ace5be68SRuslan ErmilovThe kernel
58ace5be68SRuslan Ermilov.Tn NFS
59ace5be68SRuslan Ermilovmounts the root directory and continues from there.
60247ca3deSSteve Price.El
61247ca3deSSteve Price.Pp
62247ca3deSSteve PriceEach of these phases are described in further detail below.
63247ca3deSSteve Price.Pp
64ace5be68SRuslan ErmilovFirst, the stage-1 bootstrap loads the stage-2 boot program over
65ace5be68SRuslan Ermilovthe network.
66ace5be68SRuslan ErmilovThe stage-1 bootstrap typically uses
67ace5be68SRuslan Ermilov.Tn BOOTP
68ace5be68SRuslan Ermilovor
69ace5be68SRuslan Ermilov.Tn DHCP
70ace5be68SRuslan Ermilovto obtain the filename to load, then uses
71ace5be68SRuslan Ermilov.Tn TFTP
72ace5be68SRuslan Ermilovto load the file.
73ace5be68SRuslan ErmilovThis file is typically called
74ace5be68SRuslan Ermilov.Pa pxeboot ,
75ace5be68SRuslan Ermilovand should be copied from
76c2095e2bSMatthew Dillon.Pa /boot/pxeboot
77ace5be68SRuslan Ermilovinto the
78ace5be68SRuslan Ermilov.Tn TFTP
79ace5be68SRuslan Ermilovdirectory on the server, which is typically
80c2095e2bSMatthew Dillon.Pa /tftpdir .
81247ca3deSSteve Price.Pp
82c2095e2bSMatthew DillonThe stage-2 boot program then loads additional modules and the kernel.
83ace5be68SRuslan ErmilovThese files may not exist on the
84ace5be68SRuslan Ermilov.Tn DHCP
85ace5be68SRuslan Ermilovor
86ace5be68SRuslan Ermilov.Tn BOOTP
87ace5be68SRuslan Ermilovserver.
88ace5be68SRuslan ErmilovYou can use the
89ace5be68SRuslan Ermilov.Ic next-server
90ace5be68SRuslan Ermilovoption available in
91ace5be68SRuslan Ermilov.Tn DHCP
92ace5be68SRuslan Ermilovconfigurations to specify the server holding
93ace5be68SRuslan Ermilovthe second stage boot files and kernel.
94ace5be68SRuslan ErmilovThe stage-2 program uses
95ace5be68SRuslan Ermilov.Tn NFS
96ace5be68SRuslan Ermilovor
97ace5be68SRuslan Ermilov.Tn TFTP
98ace5be68SRuslan Ermilovto obtain these files.
99ace5be68SRuslan ErmilovBy default,
100ace5be68SRuslan Ermilov.Tn NFS
101ace5be68SRuslan Ermilovis used.
102ace5be68SRuslan ErmilovIf you are using
103ace5be68SRuslan Ermilov.Xr pxeboot 8 ,
104ace5be68SRuslan Ermilovyou can install a version that uses
105ace5be68SRuslan Ermilov.Tn TFTP
106ace5be68SRuslan Ermilovby setting
107ace5be68SRuslan Ermilov.Li LOADER_TFTP_SUPPORT=YES
108c2095e2bSMatthew Dillonin your
109c2095e2bSMatthew Dillon.Pa /etc/make.conf ,
110ace5be68SRuslan Ermilovthen recompiling and reinstalling
111ace5be68SRuslan Ermilov.Xr pxeboot 8
112ace5be68SRuslan Ermilovvia the command listed below.
113ace5be68SRuslan ErmilovIt is often necessary to use
114ace5be68SRuslan Ermilov.Tn TFTP
115ace5be68SRuslan Ermilovhere so you can place a custom kernel
116ace5be68SRuslan Ermilovin
117ace5be68SRuslan Ermilov.Pa /tftpdir/ .
118ace5be68SRuslan ErmilovIf you use
119ace5be68SRuslan Ermilov.Tn NFS
120ace5be68SRuslan Ermilovand do not have a custom root file system for the
121ace5be68SRuslan Ermilov.Nm
122c2095e2bSMatthew Dillonclient, the stage-2 boot will load your server's kernel as the kernel for
123ace5be68SRuslan Ermilovthe
124ace5be68SRuslan Ermilov.Nm
125ace5be68SRuslan Ermilovmachine, which may not be what you want to have happen.
126c2095e2bSMatthew Dillon.Bd -literal -offset indent
1276babc58bSPawel Jakub Dawidekcd /usr/src/sys/boot/i386
128c2095e2bSMatthew Dillonmake clean; make; make install
129c2095e2bSMatthew Dilloncp /boot/pxeboot /tftpdir/
130c2095e2bSMatthew Dillon.Ed
131247ca3deSSteve Price.Pp
132738d91baSRobert WatsonIn phase 3, the kernel acquires IP networking configuration in one
133738d91baSRobert Watsonof two ways, and then proceeds to mount the root file system and start
134738d91baSRobert Watsonoperation.
135bf7f20c2SRuslan ErmilovIf the phase 2 loader supports passing network configuration to the
136738d91baSRobert Watsonkernel using the kernel environment, then the kernel will configure
137738d91baSRobert Watsonthe network interface using that information.
138738d91baSRobert WatsonOtherwise, it must use
139ace5be68SRuslan Ermilov.Tn DHCP
140ace5be68SRuslan Ermilovor
141ace5be68SRuslan Ermilov.Tn BOOTP
142ace5be68SRuslan Ermilovto acquire
143738d91baSRobert Watsonconfiguration information.
144ace5be68SRuslan ErmilovThe boot
145ace5be68SRuslan Ermilovscripts recognize a
146ace5be68SRuslan Ermilov.Nm
147ace5be68SRuslan Ermilovstartup and perform
148c2095e2bSMatthew Dillonthe actions found in
1497cfd02d9SBrooks Davis.Pa /etc/rc.d/initdiskless ,
1507cfd02d9SBrooks Davis.Pa /etc/rc.d/resolv ,
1517cfd02d9SBrooks Davis.Pa /etc/rc.d/tmp ,
152c2095e2bSMatthew Dillonand
1537cfd02d9SBrooks Davis.Pa /etc/rc.d/var .
1547cfd02d9SBrooks DavisOn early 5.x releases, the functions of latter three scripts where
1557cfd02d9SBrooks Davisimplemented in
156c2095e2bSMatthew Dillon.Pa /etc/rc.d/diskless .
157ace5be68SRuslan ErmilovOn older systems, the scripts are located in
1584f329666SBrian S. Dean.Pa /etc/rc.diskless1
1594f329666SBrian S. Deanand
160c2095e2bSMatthew Dillon.Pa /etc/rc.diskless2 .
161247ca3deSSteve Price.Sh CONFIGURATION
162ace5be68SRuslan ErmilovIn order to run a
163ace5be68SRuslan Ermilov.Nm
164ace5be68SRuslan Ermilovclient, you need the following:
1654f329666SBrian S. Dean.Bl -bullet
1663136363fSRuslan Ermilov.It
167ace5be68SRuslan ErmilovAn
168ace5be68SRuslan Ermilov.Tn NFS
169ace5be68SRuslan Ermilovserver which exports a root and
170ace5be68SRuslan Ermilov.Pa /usr
171ace5be68SRuslan Ermilovpartitions with appropriate permissions.
172ace5be68SRuslan ErmilovThe
173ace5be68SRuslan Ermilov.Nm
174ace5be68SRuslan Ermilovscripts work with read-only partitions, as long as root is exported with
1754f329666SBrian S. Dean.Fl maproot Ns =0
1764f329666SBrian S. Deanso that some system files can be accessed.
1774f329666SBrian S. DeanAs an example,
178247ca3deSSteve Price.Pa /etc/exports
1794f329666SBrian S. Deancan contain the following lines:
1804f329666SBrian S. Dean.Bd -literal -offset indent
18199253b64SDima Dorfman<ROOT> -ro -maproot=0 -alldirs <list of diskless clients>
18299253b64SDima Dorfman/usr -ro -alldirs <list of diskless clients>
183247ca3deSSteve Price.Ed
184247ca3deSSteve Price.Pp
1854f329666SBrian S. Deanwhere
1864f329666SBrian S. Dean.Aq ROOT
1874f329666SBrian S. Deanis the mount point on the server of the root partition.
1884f329666SBrian S. DeanThe script
1894f329666SBrian S. Dean.Pa /usr/share/examples/diskless/clone_root
190ace5be68SRuslan Ermilovcan be used to create a shared read-only root partition,
191c2095e2bSMatthew Dillonbut in many cases you may decide to export
192ace5be68SRuslan Ermilov(again as read-only) the root directory used by
1934f329666SBrian S. Deanthe server itself.
1943136363fSRuslan Ermilov.It
195ace5be68SRuslan ErmilovA
1964f329666SBrian S. Dean.Tn BOOTP
1974f329666SBrian S. Deanor
1984f329666SBrian S. Dean.Tn DHCP
1994f329666SBrian S. Deanserver.
2004f329666SBrian S. Dean.Xr bootpd 8
2014f329666SBrian S. Deancan be enabled by
2024f329666SBrian S. Deanuncommenting the
203ace5be68SRuslan Ermilov.Dq Li bootps
2044f329666SBrian S. Deanline in
2054f329666SBrian S. Dean.Pa /etc/inetd.conf .
2064f329666SBrian S. DeanA sample
2074f329666SBrian S. Dean.Pa /etc/bootptab
2084f329666SBrian S. Deancan be the following:
2094f329666SBrian S. Dean.Bd -literal -offset indent
2104f329666SBrian S. Dean .default:\\
2114f329666SBrian S. Dean    hn:ht=1:vm=rfc1048:\\
2124f329666SBrian S. Dean    :sm=255.255.255.0:\\
2134f329666SBrian S. Dean    :sa=<SERVER>:\\
2144f329666SBrian S. Dean    :gw=<GATEWAY>:\\
2154f329666SBrian S. Dean    :rp="<SERVER>:<ROOT>":
2164f329666SBrian S. Dean
2174f329666SBrian S. Dean<CLIENT>:ha=0123456789ab:tc=.default
218247ca3deSSteve Price.Ed
219247ca3deSSteve Price.Pp
2204f329666SBrian S. Deanwhere
2214f329666SBrian S. Dean.Aq SERVER ,
2224f329666SBrian S. Dean.Aq GATEWAY
2234f329666SBrian S. Deanand
2244f329666SBrian S. Dean.Aq ROOT
2254f329666SBrian S. Deanhave the obvious meanings.
2264f329666SBrian S. Dean.It
227c2095e2bSMatthew DillonA properly initialized root partition.
228c2095e2bSMatthew DillonThe script
229c2095e2bSMatthew Dillon.Pa /usr/share/examples/diskless/clone_root
230c2095e2bSMatthew Dilloncan help in creating it, using the server's root partition
231ace5be68SRuslan Ermilovas a reference.
232ace5be68SRuslan ErmilovIf you are just starting out, you should
233c2095e2bSMatthew Dillonsimply use the server's own root directory,
234c2095e2bSMatthew Dillon.Pa / ,
235c2095e2bSMatthew Dillonand not try to clone it.
2364f329666SBrian S. Dean.Pp
237c2095e2bSMatthew DillonYou often do not want to use the same
238c2095e2bSMatthew Dillon.Pa rc.conf
239c2095e2bSMatthew Dillonor
240c2095e2bSMatthew Dillon.Pa rc.local
241ace5be68SRuslan Ermilovfiles for the
242ace5be68SRuslan Ermilov.Nm
243ace5be68SRuslan Ermilovboot as you do on the server.
244ace5be68SRuslan ErmilovThe
245ace5be68SRuslan Ermilov.Nm
246ace5be68SRuslan Ermilovboot
247c2095e2bSMatthew Dillonscripts provide a mechanism through which you can override various files
248c2095e2bSMatthew Dillonin
2494f329666SBrian S. Dean.Pa /etc
250ace5be68SRuslan Ermilov(as well as other subdirectories of root).
251ace5be68SRuslan ErmilovThe scripts provide four
252c2095e2bSMatthew Dillonoverriding directories situated in
253c2095e2bSMatthew Dillon.Pa /conf/base ,
254c2095e2bSMatthew Dillon.Pa /conf/default ,
255c2095e2bSMatthew Dillon.Pa /conf/<broadcast-ip> ,
256c2095e2bSMatthew Dillonand
257c2095e2bSMatthew Dillon.Pa /conf/<machine-ip> .
258c2095e2bSMatthew DillonYou should always create
259c2095e2bSMatthew Dillon.Pa /conf/base/etc ,
260c2095e2bSMatthew Dillonwhich will entirely replace the server's
261c2095e2bSMatthew Dillon.Pa /etc
262ace5be68SRuslan Ermilovon the
263ace5be68SRuslan Ermilov.Nm
264ace5be68SRuslan Ermilovmachine.
265c2095e2bSMatthew DillonYou can clone the server's
266c2095e2bSMatthew Dillon.Pa /etc
267ace5be68SRuslan Ermilovhere or you can create a special file which tells the
268ace5be68SRuslan Ermilov.Nm
269ace5be68SRuslan Ermilovboot scripts
270c2095e2bSMatthew Dillonto remount the server's
271c2095e2bSMatthew Dillon.Pa /etc
272c2095e2bSMatthew Dillononto
273c2095e2bSMatthew Dillon.Pa /conf/base/etc .
274c2095e2bSMatthew DillonYou do this by creating the file
275c2095e2bSMatthew Dillon.Pa /conf/base/etc/diskless_remount
276ace5be68SRuslan Ermilovcontaining the mount point to use as a basis of the
277ace5be68SRuslan Ermilov.Nm
278ace5be68SRuslan Ermilovmachine's
279c2095e2bSMatthew Dillon.Pa /etc .
280c2095e2bSMatthew DillonFor example, the file might contain:
281c2095e2bSMatthew Dillon.Pp
282ace5be68SRuslan Ermilov.Dl 10.0.0.1:/etc
283ace5be68SRuslan Ermilov.Pp
28461fffde1SMike PritchardAlternatively, if the server contains several independent roots, the file
285a8365995SBrooks Davismight contain:
286a8365995SBrooks Davis.Pp
287a8365995SBrooks Davis.Dl 10.0.0.1:/usr/diskless/4.7-RELEASE/etc
288a8365995SBrooks Davis.Pp
289a8365995SBrooks DavisThis would work, but if you copied
290a8365995SBrooks Davis.Pa /usr/diskless/4.7-RELEASE
291a8365995SBrooks Davisto
292a8365995SBrooks Davis.Pa /usr/diskless/4.8-RELEASE
293a8365995SBrooks Davisand upgraded the installation, you would need to modify the
294a8365995SBrooks Davis.Pa diskless_remount
295a8365995SBrooks Davisfiles to reflect that move.
296a8365995SBrooks DavisTo avoid that, paths in
297a8365995SBrooks Davis.Pa diskless_remount
29861fffde1SMike Pritchardfiles beginning with
299a8365995SBrooks Davis.Pa /
300a8365995SBrooks Davishave the actual path of the client's root prepended to them so the file
301a8365995SBrooks Daviscould instead contain:
302a8365995SBrooks Davis.Pp
303a8365995SBrooks Davis.Dl /etc
304a8365995SBrooks Davis.Pp
305ace5be68SRuslan ErmilovThe
306ace5be68SRuslan Ermilov.Nm
30761fffde1SMike Pritchardscripts create memory file systems to hold the overridden
308ace5be68SRuslan Ermilovdirectories.
309ace5be68SRuslan ErmilovOnly a 2MB partition is created by default, which may not
310ace5be68SRuslan Ermilovbe sufficient for your purposes.
311ace5be68SRuslan ErmilovTo override this, you can create the
312c2095e2bSMatthew Dillonfile
313c2095e2bSMatthew Dillon.Pa /conf/base/etc/md_size
314c2095e2bSMatthew Dilloncontaining the size, in 512 byte sectors, of the memory disk to create
315c2095e2bSMatthew Dillonfor that directory.
316c2095e2bSMatthew Dillon.Pp
317c2095e2bSMatthew DillonYou then typically provide file-by-file overrides in the
318c2095e2bSMatthew Dillon.Pa /conf/default/etc
319ace5be68SRuslan Ermilovdirectory.
320ace5be68SRuslan ErmilovAt a minimum, you must provide overrides for
321ace5be68SRuslan Ermilov.Pa /etc/fstab , /etc/rc.conf ,
322c2095e2bSMatthew Dillonand
323c2095e2bSMatthew Dillon.Pa /etc/rc.local
324c2095e2bSMatthew Dillonvia
325ace5be68SRuslan Ermilov.Pa /conf/default/etc/fstab , /conf/default/etc/rc.conf ,
326c2095e2bSMatthew Dillonand
327c2095e2bSMatthew Dillon.Pa /conf/default/etc/rc.local .
328c2095e2bSMatthew Dillon.Pp
329ace5be68SRuslan ErmilovOverrides are hierarchical.
330ace5be68SRuslan ErmilovYou can supply network-specific defaults
331c2095e2bSMatthew Dillonin the
332ace5be68SRuslan Ermilov.Pa /conf/ Ns Ao Ar BROADCASTIP Ac Ns Pa /etc
333ace5be68SRuslan Ermilovdirectory, where
334ace5be68SRuslan Ermilov.Aq Ar BROADCASTIP
335ace5be68SRuslan Ermilovrepresents the broadcast IP address of
336ace5be68SRuslan Ermilovthe
337ace5be68SRuslan Ermilov.Nm
338ace5be68SRuslan Ermilovsystem as given to it via
339c2095e2bSMatthew Dillon.Tn BOOTP .
340c2095e2bSMatthew DillonThe
341c2095e2bSMatthew Dillon.Pa diskless_remount
342c2095e2bSMatthew Dillonand
343c2095e2bSMatthew Dillon.Pa md_size
344c2095e2bSMatthew Dillonfeatures work in any of these directories.
345c2095e2bSMatthew DillonThe configuration feature works on directories other then
346c2095e2bSMatthew Dillon.Pa /etc ,
347c2095e2bSMatthew Dillonyou simply create the directory you wish to replace or override in
348c2095e2bSMatthew Dillon.Pa /conf/{base,default,<broadcast>,<ip>}/*
349c2095e2bSMatthew Dillonand work it in the same way that you work
350c2095e2bSMatthew Dillon.Pa /etc .
351c2095e2bSMatthew Dillon.Pp
352c2095e2bSMatthew DillonSince you normally clone the server's
353c2095e2bSMatthew Dillon.Pa /etc
354c2095e2bSMatthew Dillonusing the
355c2095e2bSMatthew Dillon.Pa /conf/base/etc/diskless_remount ,
356ace5be68SRuslan Ermilovyou might wish to remove unneeded files from the memory file system.
357ace5be68SRuslan ErmilovFor example,
358ace5be68SRuslan Ermilovif the server has a firewall but you do not, you might wish
359c2095e2bSMatthew Dillonto remove
360c2095e2bSMatthew Dillon.Pa /etc/ipfw.conf .
361c2095e2bSMatthew DillonYou can do this by creating a
362ace5be68SRuslan Ermilov.Pa /conf/base/ Ns Ao Ar DIRECTORY Ac Ns Pa .remove
363ace5be68SRuslan Ermilovfile.
364ace5be68SRuslan ErmilovFor example,
365c2095e2bSMatthew Dillon.Pa /conf/base/etc.remove ,
366c2095e2bSMatthew Dillonwhich contains a list of relative paths that the boot scripts should remove
367c2095e2bSMatthew Dillonfrom the memory file systems.
3684f329666SBrian S. Dean.Pp
3694f329666SBrian S. DeanAs a minimum, you normally need to have the following in
3704f329666SBrian S. Dean.Pa /conf/default/etc/fstab
3714f329666SBrian S. Dean.Bd -literal -offset indent
3724f329666SBrian S. Dean<SERVER>:<ROOT> /     nfs    ro 0 0
3734f329666SBrian S. Dean<SERVER>:/usr   /usr  nfs    ro 0 0
3744f329666SBrian S. Deanproc            /proc procfs rw 0 0
3754f329666SBrian S. Dean.Ed
3764f329666SBrian S. Dean.Pp
377c2095e2bSMatthew DillonYou also need to create a customized version of
3784f329666SBrian S. Dean.Pa /conf/default/etc/rc.conf
3794f329666SBrian S. Deanwhich should contain
380ace5be68SRuslan Ermilovthe startup options for the
381ace5be68SRuslan Ermilov.Nm
382ace5be68SRuslan Ermilovclient, and
383c2095e2bSMatthew Dillon.Pa /conf/default/etc/rc.local
384c2095e2bSMatthew Dillonwhich could be empty but prevents the server's own
385c2095e2bSMatthew Dillon.Pa /etc/rc.local
386ace5be68SRuslan Ermilovfrom leaking onto the
387ace5be68SRuslan Ermilov.Nm
388ace5be68SRuslan Ermilovsystem.
3894f329666SBrian S. Dean.Pp
390c2095e2bSMatthew DillonIn
391c2095e2bSMatthew Dillon.Pa rc.conf ,
392c2095e2bSMatthew Dillonmost likely
3934f329666SBrian S. Deanyou will not need to set
3944f329666SBrian S. Dean.Va hostname
3954f329666SBrian S. Deanand
3964f329666SBrian S. Dean.Va ifconfig_*
3974f329666SBrian S. Deanbecause these will be already set by the startup code.
3984f329666SBrian S. DeanFinally, it might be convenient to use a
3994f329666SBrian S. Dean.Ic case
4004f329666SBrian S. Deanstatement using
4014f329666SBrian S. Dean.Li `hostname`
4024f329666SBrian S. Deanas the switch variable to do machine-specific configuration
403ace5be68SRuslan Ermilovin case a number of
404ace5be68SRuslan Ermilov.Nm
405ace5be68SRuslan Ermilovclients share the same configuration
4064f329666SBrian S. Deanfiles.
4074f329666SBrian S. Dean.It
408ace5be68SRuslan ErmilovThe kernel for the
409ace5be68SRuslan Ermilov.Nm
410ace5be68SRuslan Ermilovclients, which will be loaded using
411ace5be68SRuslan Ermilov.Tn NFS
412ace5be68SRuslan Ermilovor
413ace5be68SRuslan Ermilov.Tn TFTP ,
414738d91baSRobert Watsonmust include support for the NFS client:
415738d91baSRobert Watson.Pp
416738d91baSRobert Watson.D1 Cd "options NFSCLIENT"
417738d91baSRobert Watson.D1 Cd "options NFS_ROOT"
418738d91baSRobert Watson.Pp
419738d91baSRobert WatsonIf you are using a boot mechanism that does not pass network configuration
420738d91baSRobert Watsonto the kernel using the kernel environment, you will also need to include
421738d91baSRobert Watsonthe following options:
422ace5be68SRuslan Ermilov.Pp
423ace5be68SRuslan Ermilov.D1 Cd "options BOOTP"
424ace5be68SRuslan Ermilov.D1 Cd "options BOOTP_NFSROOT"
425ace5be68SRuslan Ermilov.D1 Cd "options BOOTP_COMPAT"
4264f329666SBrian S. Dean.Pp
427bf7f20c2SRuslan Ermilov.Em Note :
428bf7f20c2SRuslan Ermilovthe PXE environment does not require these options.
429738d91baSRobert Watson.Pp
430bf7f20c2SRuslan ErmilovThe
431bf7f20c2SRuslan Ermilov.Nm
432bf7f20c2SRuslan Ermilovbooting environment relies on memory-backed file systems to
433738d91baSRobert Watsonsupport temporary local storage in the event that the root file system
434738d91baSRobert Watsonis mounted read-only; as such, it is necessary to add the following
435738d91baSRobert Watsonto the device section of the kernel configuration:
436c2095e2bSMatthew Dillon.Pp
437ace5be68SRuslan Ermilov.D1 Cd "device md"
438ace5be68SRuslan Ermilov.Pp
439ace5be68SRuslan ErmilovIf you use the firewall, remember to default to
440ace5be68SRuslan Ermilov.Dq open ,
441ace5be68SRuslan Ermilovor your kernel
442ace5be68SRuslan Ermilovwill not be able to send/receive the
443ace5be68SRuslan Ermilov.Tn BOOTP
444ace5be68SRuslan Ermilovpackets.
445247ca3deSSteve Price.El
4464f329666SBrian S. Dean.Sh SECURITY ISSUES
447ace5be68SRuslan ErmilovBe warned that using unencrypted
448ace5be68SRuslan Ermilov.Tn NFS
449ace5be68SRuslan Ermilovto mount root and user
4504f329666SBrian S. Deanpartitions may expose information such as
4514f329666SBrian S. Deanencryption keys.
4524f329666SBrian S. Dean.Sh BUGS
4534f329666SBrian S. DeanThis manpage is probably incomplete.
4544f329666SBrian S. Dean.Pp
4554f329666SBrian S. Dean.Fx
4564f329666SBrian S. Deansometimes requires to write onto
457c2095e2bSMatthew Dillonthe root partition, so the startup scripts mount MFS
4584f329666SBrian S. Deanfile systems on some locations (e.g.\&
4594f329666SBrian S. Dean.Pa /etc
4604f329666SBrian S. Deanand
4614f329666SBrian S. Dean.Pa /var ) ,
4624f329666SBrian S. Deanwhile
4634f329666SBrian S. Deantrying to preserve the original content.
4644f329666SBrian S. DeanThe process might not handle all cases.
465950c15fcSAlexey Zelkin.Sh SEE ALSO
466bceb8aedSWolfram Schneider.Xr ethers 5 ,
467247ca3deSSteve Price.Xr exports 5 ,
4684f329666SBrian S. Dean.Xr bootpd 8 ,
469bceb8aedSWolfram Schneider.Xr mountd 8 ,
470247ca3deSSteve Price.Xr nfsd 8 ,
4714f329666SBrian S. Dean.Xr pxeboot 8 ,
472bceb8aedSWolfram Schneider.Xr reboot 8 ,
473ace5be68SRuslan Ermilov.Xr tftpd 8
474ace5be68SRuslan Ermilov.Pp
475ace5be68SRuslan Ermilov.Pa ports/net/etherboot
476