xref: /freebsd/share/man/man8/diskless.8 (revision 738d91ba760b5be7ea4719a19bf4f503ee0045a5)
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.\"
29738d91baSRobert Watson.Dd January 10, 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
127c2095e2bSMatthew Dilloncd /usr/src/sys/i386/boot
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.
135738d91baSRobert WatsonIf the phase 2 loader supporst 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
149c2095e2bSMatthew Dillon.Pa /etc/rc.d/initdiskless
150c2095e2bSMatthew Dillonand
151c2095e2bSMatthew Dillon.Pa /etc/rc.d/diskless .
152ace5be68SRuslan ErmilovOn older systems, the scripts are located in
1534f329666SBrian S. Dean.Pa /etc/rc.diskless1
1544f329666SBrian S. Deanand
155c2095e2bSMatthew Dillon.Pa /etc/rc.diskless2 .
156247ca3deSSteve Price.Sh CONFIGURATION
157ace5be68SRuslan ErmilovIn order to run a
158ace5be68SRuslan Ermilov.Nm
159ace5be68SRuslan Ermilovclient, you need the following:
1604f329666SBrian S. Dean.Bl -bullet
1613136363fSRuslan Ermilov.It
162ace5be68SRuslan ErmilovAn
163ace5be68SRuslan Ermilov.Tn NFS
164ace5be68SRuslan Ermilovserver which exports a root and
165ace5be68SRuslan Ermilov.Pa /usr
166ace5be68SRuslan Ermilovpartitions with appropriate permissions.
167ace5be68SRuslan ErmilovThe
168ace5be68SRuslan Ermilov.Nm
169ace5be68SRuslan Ermilovscripts work with read-only partitions, as long as root is exported with
1704f329666SBrian S. Dean.Fl maproot Ns =0
1714f329666SBrian S. Deanso that some system files can be accessed.
1724f329666SBrian S. DeanAs an example,
173247ca3deSSteve Price.Pa /etc/exports
1744f329666SBrian S. Deancan contain the following lines:
1754f329666SBrian S. Dean.Bd -literal -offset indent
17699253b64SDima Dorfman<ROOT> -ro -maproot=0 -alldirs <list of diskless clients>
17799253b64SDima Dorfman/usr -ro -alldirs <list of diskless clients>
178247ca3deSSteve Price.Ed
179247ca3deSSteve Price.Pp
1804f329666SBrian S. Deanwhere
1814f329666SBrian S. Dean.Aq ROOT
1824f329666SBrian S. Deanis the mount point on the server of the root partition.
1834f329666SBrian S. DeanThe script
1844f329666SBrian S. Dean.Pa /usr/share/examples/diskless/clone_root
185ace5be68SRuslan Ermilovcan be used to create a shared read-only root partition,
186c2095e2bSMatthew Dillonbut in many cases you may decide to export
187ace5be68SRuslan Ermilov(again as read-only) the root directory used by
1884f329666SBrian S. Deanthe server itself.
1893136363fSRuslan Ermilov.It
190ace5be68SRuslan ErmilovA
1914f329666SBrian S. Dean.Tn BOOTP
1924f329666SBrian S. Deanor
1934f329666SBrian S. Dean.Tn DHCP
1944f329666SBrian S. Deanserver.
1954f329666SBrian S. Dean.Xr bootpd 8
1964f329666SBrian S. Deancan be enabled by
1974f329666SBrian S. Deanuncommenting the
198ace5be68SRuslan Ermilov.Dq Li bootps
1994f329666SBrian S. Deanline in
2004f329666SBrian S. Dean.Pa /etc/inetd.conf .
2014f329666SBrian S. DeanA sample
2024f329666SBrian S. Dean.Pa /etc/bootptab
2034f329666SBrian S. Deancan be the following:
2044f329666SBrian S. Dean.Bd -literal -offset indent
2054f329666SBrian S. Dean .default:\\
2064f329666SBrian S. Dean    hn:ht=1:vm=rfc1048:\\
2074f329666SBrian S. Dean    :sm=255.255.255.0:\\
2084f329666SBrian S. Dean    :sa=<SERVER>:\\
2094f329666SBrian S. Dean    :gw=<GATEWAY>:\\
2104f329666SBrian S. Dean    :rp="<SERVER>:<ROOT>":
2114f329666SBrian S. Dean
2124f329666SBrian S. Dean<CLIENT>:ha=0123456789ab:tc=.default
213247ca3deSSteve Price.Ed
214247ca3deSSteve Price.Pp
2154f329666SBrian S. Deanwhere
2164f329666SBrian S. Dean.Aq SERVER ,
2174f329666SBrian S. Dean.Aq GATEWAY
2184f329666SBrian S. Deanand
2194f329666SBrian S. Dean.Aq ROOT
2204f329666SBrian S. Deanhave the obvious meanings.
2214f329666SBrian S. Dean.It
222c2095e2bSMatthew DillonA properly initialized root partition.
223c2095e2bSMatthew DillonThe script
224c2095e2bSMatthew Dillon.Pa /usr/share/examples/diskless/clone_root
225c2095e2bSMatthew Dilloncan help in creating it, using the server's root partition
226ace5be68SRuslan Ermilovas a reference.
227ace5be68SRuslan ErmilovIf you are just starting out, you should
228c2095e2bSMatthew Dillonsimply use the server's own root directory,
229c2095e2bSMatthew Dillon.Pa / ,
230c2095e2bSMatthew Dillonand not try to clone it.
2314f329666SBrian S. Dean.Pp
232c2095e2bSMatthew DillonYou often do not want to use the same
233c2095e2bSMatthew Dillon.Pa rc.conf
234c2095e2bSMatthew Dillonor
235c2095e2bSMatthew Dillon.Pa rc.local
236ace5be68SRuslan Ermilovfiles for the
237ace5be68SRuslan Ermilov.Nm
238ace5be68SRuslan Ermilovboot as you do on the server.
239ace5be68SRuslan ErmilovThe
240ace5be68SRuslan Ermilov.Nm
241ace5be68SRuslan Ermilovboot
242c2095e2bSMatthew Dillonscripts provide a mechanism through which you can override various files
243c2095e2bSMatthew Dillonin
2444f329666SBrian S. Dean.Pa /etc
245ace5be68SRuslan Ermilov(as well as other subdirectories of root).
246ace5be68SRuslan ErmilovThe scripts provide four
247c2095e2bSMatthew Dillonoverriding directories situated in
248c2095e2bSMatthew Dillon.Pa /conf/base ,
249c2095e2bSMatthew Dillon.Pa /conf/default ,
250c2095e2bSMatthew Dillon.Pa /conf/<broadcast-ip> ,
251c2095e2bSMatthew Dillonand
252c2095e2bSMatthew Dillon.Pa /conf/<machine-ip> .
253c2095e2bSMatthew DillonYou should always create
254c2095e2bSMatthew Dillon.Pa /conf/base/etc ,
255c2095e2bSMatthew Dillonwhich will entirely replace the server's
256c2095e2bSMatthew Dillon.Pa /etc
257ace5be68SRuslan Ermilovon the
258ace5be68SRuslan Ermilov.Nm
259ace5be68SRuslan Ermilovmachine.
260c2095e2bSMatthew DillonYou can clone the server's
261c2095e2bSMatthew Dillon.Pa /etc
262ace5be68SRuslan Ermilovhere or you can create a special file which tells the
263ace5be68SRuslan Ermilov.Nm
264ace5be68SRuslan Ermilovboot scripts
265c2095e2bSMatthew Dillonto remount the server's
266c2095e2bSMatthew Dillon.Pa /etc
267c2095e2bSMatthew Dillononto
268c2095e2bSMatthew Dillon.Pa /conf/base/etc .
269c2095e2bSMatthew DillonYou do this by creating the file
270c2095e2bSMatthew Dillon.Pa /conf/base/etc/diskless_remount
271ace5be68SRuslan Ermilovcontaining the mount point to use as a basis of the
272ace5be68SRuslan Ermilov.Nm
273ace5be68SRuslan Ermilovmachine's
274c2095e2bSMatthew Dillon.Pa /etc .
275c2095e2bSMatthew DillonFor example, the file might contain:
276c2095e2bSMatthew Dillon.Pp
277ace5be68SRuslan Ermilov.Dl 10.0.0.1:/etc
278ace5be68SRuslan Ermilov.Pp
279a8365995SBrooks DavisAlternativly, if the server contains several independent roots, the file
280a8365995SBrooks Davismight contain:
281a8365995SBrooks Davis.Pp
282a8365995SBrooks Davis.Dl 10.0.0.1:/usr/diskless/4.7-RELEASE/etc
283a8365995SBrooks Davis.Pp
284a8365995SBrooks DavisThis would work, but if you copied
285a8365995SBrooks Davis.Pa /usr/diskless/4.7-RELEASE
286a8365995SBrooks Davisto
287a8365995SBrooks Davis.Pa /usr/diskless/4.8-RELEASE
288a8365995SBrooks Davisand upgraded the installation, you would need to modify the
289a8365995SBrooks Davis.Pa diskless_remount
290a8365995SBrooks Davisfiles to reflect that move.
291a8365995SBrooks DavisTo avoid that, paths in
292a8365995SBrooks Davis.Pa diskless_remount
293a8365995SBrooks Davisfiles begining with
294a8365995SBrooks Davis.Pa /
295a8365995SBrooks Davishave the actual path of the client's root prepended to them so the file
296a8365995SBrooks Daviscould instead contain:
297a8365995SBrooks Davis.Pp
298a8365995SBrooks Davis.Dl /etc
299a8365995SBrooks Davis.Pp
300ace5be68SRuslan ErmilovThe
301ace5be68SRuslan Ermilov.Nm
302ace5be68SRuslan Ermilovscripts create memory file systems to hold the overriden
303ace5be68SRuslan Ermilovdirectories.
304ace5be68SRuslan ErmilovOnly a 2MB partition is created by default, which may not
305ace5be68SRuslan Ermilovbe sufficient for your purposes.
306ace5be68SRuslan ErmilovTo override this, you can create the
307c2095e2bSMatthew Dillonfile
308c2095e2bSMatthew Dillon.Pa /conf/base/etc/md_size
309c2095e2bSMatthew Dilloncontaining the size, in 512 byte sectors, of the memory disk to create
310c2095e2bSMatthew Dillonfor that directory.
311c2095e2bSMatthew Dillon.Pp
312c2095e2bSMatthew DillonYou then typically provide file-by-file overrides in the
313c2095e2bSMatthew Dillon.Pa /conf/default/etc
314ace5be68SRuslan Ermilovdirectory.
315ace5be68SRuslan ErmilovAt a minimum, you must provide overrides for
316ace5be68SRuslan Ermilov.Pa /etc/fstab , /etc/rc.conf ,
317c2095e2bSMatthew Dillonand
318c2095e2bSMatthew Dillon.Pa /etc/rc.local
319c2095e2bSMatthew Dillonvia
320ace5be68SRuslan Ermilov.Pa /conf/default/etc/fstab , /conf/default/etc/rc.conf ,
321c2095e2bSMatthew Dillonand
322c2095e2bSMatthew Dillon.Pa /conf/default/etc/rc.local .
323c2095e2bSMatthew Dillon.Pp
324ace5be68SRuslan ErmilovOverrides are hierarchical.
325ace5be68SRuslan ErmilovYou can supply network-specific defaults
326c2095e2bSMatthew Dillonin the
327ace5be68SRuslan Ermilov.Pa /conf/ Ns Ao Ar BROADCASTIP Ac Ns Pa /etc
328ace5be68SRuslan Ermilovdirectory, where
329ace5be68SRuslan Ermilov.Aq Ar BROADCASTIP
330ace5be68SRuslan Ermilovrepresents the broadcast IP address of
331ace5be68SRuslan Ermilovthe
332ace5be68SRuslan Ermilov.Nm
333ace5be68SRuslan Ermilovsystem as given to it via
334c2095e2bSMatthew Dillon.Tn BOOTP .
335c2095e2bSMatthew DillonThe
336c2095e2bSMatthew Dillon.Pa diskless_remount
337c2095e2bSMatthew Dillonand
338c2095e2bSMatthew Dillon.Pa md_size
339c2095e2bSMatthew Dillonfeatures work in any of these directories.
340c2095e2bSMatthew DillonThe configuration feature works on directories other then
341c2095e2bSMatthew Dillon.Pa /etc ,
342c2095e2bSMatthew Dillonyou simply create the directory you wish to replace or override in
343c2095e2bSMatthew Dillon.Pa /conf/{base,default,<broadcast>,<ip>}/*
344c2095e2bSMatthew Dillonand work it in the same way that you work
345c2095e2bSMatthew Dillon.Pa /etc .
346c2095e2bSMatthew Dillon.Pp
347c2095e2bSMatthew DillonSince you normally clone the server's
348c2095e2bSMatthew Dillon.Pa /etc
349c2095e2bSMatthew Dillonusing the
350c2095e2bSMatthew Dillon.Pa /conf/base/etc/diskless_remount ,
351ace5be68SRuslan Ermilovyou might wish to remove unneeded files from the memory file system.
352ace5be68SRuslan ErmilovFor example,
353ace5be68SRuslan Ermilovif the server has a firewall but you do not, you might wish
354c2095e2bSMatthew Dillonto remove
355c2095e2bSMatthew Dillon.Pa /etc/ipfw.conf .
356c2095e2bSMatthew DillonYou can do this by creating a
357ace5be68SRuslan Ermilov.Pa /conf/base/ Ns Ao Ar DIRECTORY Ac Ns Pa .remove
358ace5be68SRuslan Ermilovfile.
359ace5be68SRuslan ErmilovFor example,
360c2095e2bSMatthew Dillon.Pa /conf/base/etc.remove ,
361c2095e2bSMatthew Dillonwhich contains a list of relative paths that the boot scripts should remove
362c2095e2bSMatthew Dillonfrom the memory file systems.
3634f329666SBrian S. Dean.Pp
3644f329666SBrian S. DeanAs a minimum, you normally need to have the following in
3654f329666SBrian S. Dean.Pa /conf/default/etc/fstab
3664f329666SBrian S. Dean.Bd -literal -offset indent
3674f329666SBrian S. Dean<SERVER>:<ROOT> /     nfs    ro 0 0
3684f329666SBrian S. Dean<SERVER>:/usr   /usr  nfs    ro 0 0
3694f329666SBrian S. Deanproc            /proc procfs rw 0 0
3704f329666SBrian S. Dean.Ed
3714f329666SBrian S. Dean.Pp
372c2095e2bSMatthew DillonYou also need to create a customized version of
3734f329666SBrian S. Dean.Pa /conf/default/etc/rc.conf
3744f329666SBrian S. Deanwhich should contain
375ace5be68SRuslan Ermilovthe startup options for the
376ace5be68SRuslan Ermilov.Nm
377ace5be68SRuslan Ermilovclient, and
378c2095e2bSMatthew Dillon.Pa /conf/default/etc/rc.local
379c2095e2bSMatthew Dillonwhich could be empty but prevents the server's own
380c2095e2bSMatthew Dillon.Pa /etc/rc.local
381ace5be68SRuslan Ermilovfrom leaking onto the
382ace5be68SRuslan Ermilov.Nm
383ace5be68SRuslan Ermilovsystem.
3844f329666SBrian S. Dean.Pp
385c2095e2bSMatthew DillonIn
386c2095e2bSMatthew Dillon.Pa rc.conf ,
387c2095e2bSMatthew Dillonmost likely
3884f329666SBrian S. Deanyou will not need to set
3894f329666SBrian S. Dean.Va hostname
3904f329666SBrian S. Deanand
3914f329666SBrian S. Dean.Va ifconfig_*
3924f329666SBrian S. Deanbecause these will be already set by the startup code.
3934f329666SBrian S. DeanFinally, it might be convenient to use a
3944f329666SBrian S. Dean.Ic case
3954f329666SBrian S. Deanstatement using
3964f329666SBrian S. Dean.Li `hostname`
3974f329666SBrian S. Deanas the switch variable to do machine-specific configuration
398ace5be68SRuslan Ermilovin case a number of
399ace5be68SRuslan Ermilov.Nm
400ace5be68SRuslan Ermilovclients share the same configuration
4014f329666SBrian S. Deanfiles.
4024f329666SBrian S. Dean.It
403ace5be68SRuslan ErmilovThe kernel for the
404ace5be68SRuslan Ermilov.Nm
405ace5be68SRuslan Ermilovclients, which will be loaded using
406ace5be68SRuslan Ermilov.Tn NFS
407ace5be68SRuslan Ermilovor
408ace5be68SRuslan Ermilov.Tn TFTP ,
409738d91baSRobert Watsonmust include support for the NFS client:
410738d91baSRobert Watson.Pp
411738d91baSRobert Watson.D1 Cd "options NFSCLIENT"
412738d91baSRobert Watson.D1 Cd "options NFS_ROOT"
413738d91baSRobert Watson.Pp
414738d91baSRobert WatsonIf you are using a boot mechanism that does not pass network configuration
415738d91baSRobert Watsonto the kernel using the kernel environment, you will also need to include
416738d91baSRobert Watsonthe following options:
417ace5be68SRuslan Ermilov.Pp
418ace5be68SRuslan Ermilov.D1 Cd "options BOOTP"
419ace5be68SRuslan Ermilov.D1 Cd "options BOOTP_NFSROOT"
420ace5be68SRuslan Ermilov.D1 Cd "options BOOTP_COMPAT"
4214f329666SBrian S. Dean.Pp
422738d91baSRobert WatsonNOTE: The PXE environment does not require these uptions.
423738d91baSRobert Watson.Pp
424738d91baSRobert WatsonThe diskless booting environment relies on memory-backed file systems to
425738d91baSRobert Watsonsupport temporary local storage in the event that the root file system
426738d91baSRobert Watsonis mounted read-only; as such, it is necessary to add the following
427738d91baSRobert Watsonto the device section of the kernel configuration:
428c2095e2bSMatthew Dillon.Pp
429ace5be68SRuslan Ermilov.D1 Cd "device md"
430ace5be68SRuslan Ermilov.Pp
431ace5be68SRuslan ErmilovIf you use the firewall, remember to default to
432ace5be68SRuslan Ermilov.Dq open ,
433ace5be68SRuslan Ermilovor your kernel
434ace5be68SRuslan Ermilovwill not be able to send/receive the
435ace5be68SRuslan Ermilov.Tn BOOTP
436ace5be68SRuslan Ermilovpackets.
437247ca3deSSteve Price.El
4384f329666SBrian S. Dean.Sh SECURITY ISSUES
439ace5be68SRuslan ErmilovBe warned that using unencrypted
440ace5be68SRuslan Ermilov.Tn NFS
441ace5be68SRuslan Ermilovto mount root and user
4424f329666SBrian S. Deanpartitions may expose information such as
4434f329666SBrian S. Deanencryption keys.
4444f329666SBrian S. Dean.Sh BUGS
4454f329666SBrian S. DeanThis manpage is probably incomplete.
4464f329666SBrian S. Dean.Pp
4474f329666SBrian S. Dean.Fx
4484f329666SBrian S. Deansometimes requires to write onto
449c2095e2bSMatthew Dillonthe root partition, so the startup scripts mount MFS
4504f329666SBrian S. Deanfile systems on some locations (e.g.\&
4514f329666SBrian S. Dean.Pa /etc
4524f329666SBrian S. Deanand
4534f329666SBrian S. Dean.Pa /var ) ,
4544f329666SBrian S. Deanwhile
4554f329666SBrian S. Deantrying to preserve the original content.
4564f329666SBrian S. DeanThe process might not handle all cases.
457950c15fcSAlexey Zelkin.Sh SEE ALSO
458bceb8aedSWolfram Schneider.Xr ethers 5 ,
459247ca3deSSteve Price.Xr exports 5 ,
4604f329666SBrian S. Dean.Xr bootpd 8 ,
461bceb8aedSWolfram Schneider.Xr mountd 8 ,
462247ca3deSSteve Price.Xr nfsd 8 ,
4634f329666SBrian S. Dean.Xr pxeboot 8 ,
464bceb8aedSWolfram Schneider.Xr reboot 8 ,
465ace5be68SRuslan Ermilov.Xr tftpd 8
466ace5be68SRuslan Ermilov.Pp
467ace5be68SRuslan Ermilov.Pa ports/net/etherboot
468