aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/articles/pxe/article.sgml
blob: 2b613debad4da5e5b57f9f3c06d9c1d88c095030 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN">
%man

<!ENTITY % authors PUBLIC "-//FreeBSD//ENTITIES DocBook Author Entities//EN">
%authors;

]>

<article>
  <articleinfo>
    <title>FreeBSD Jumpstart Guide</title>
    
    <authorgroup>
      <author>
        <firstname>Alfred</firstname>
        <surname>Perlstein</surname>
        
        <affiliation>
          <address><email>alfred@FreeBSD.org</email></address>
        </affiliation>
      </author>
    </authorgroup>
    
    <pubdate>$FreeBSD$</pubdate>
    
    <abstract>
      <para>This article details the method used to allow machines to install
        FreeBSD using the Intel PXE method of booting a machine over a network.
        </para>
    </abstract>
  </articleinfo>
  
  <sect1 id="introduction">
    <title>Introduction</title>

    <warning>
      <para>This procedure will make the <quote>Server</quote> both insecure and dangerous,
        it is best to just keep the <quote>Server</quote> on its own hub and not in any way
        accessible by any machines other than the <quote>Clients</quote>.</para>
    </warning>

    <para>Terminology:</para>
    
    <informaltable frame="none">
      <tgroup cols="2">
      
        <tbody>
          <row>
            <entry>Server</entry>
            <entry>The machine offering netboot and install options.</entry>
          </row>
          
          <row>
            <entry>Client</entry>
            <entry>The machine that will have FreeBSD installed on it.</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>

    <para>Requires:
      Clients supporting the Intel PXE netboot option, an Ethernet connection.
      </para>
    
    <para>Please let me know if you come across anything you have problems with 
      or suggestions for additional documentation.</para>

    <para>If you would like someone to train/implement a specific netinstall system
      for you, please send email so that we can discuss terms.</para>

    <para>I would also like to thank &a.ps; and &a.jhb; for doing most of the
      programming work on pxeboot, the interface to Intel's PXE (netboot)
      system.</para>
  </sect1>

  <sect1 id="server-config">
    <title>Server Configuration</title>

    <procedure>
      <step>
        <para>Install DHCP: Install <filename role="package">net/isc-dhcp3</filename> you can use this config file 
          <ulink url="http://people.FreeBSD.org/~alfred/pxe/dhcpd.conf">
          dhcpd.conf</ulink>, stick it in /usr/local/etc/</para>
      </step>
      
      <step>
        <para>Enable tftp:</para>
	
        <procedure>
          <step>
            <para>Make a directory <filename>/usr/tftpboot</filename></para>
          </step>
            
          <step>
            <para>Add this line to your 
              <filename>/etc/inetd.conf</filename>:</para>
	    
<programlisting>tftp    dgram   udp     wait    nobody  /usr/libexec/tftpd    tftpd /usr/tftpboot</programlisting>
          </step>
        </procedure>
          
      </step>
        
      <step>
        <para>Enable NFS:</para>
	
        <procedure>
          <step>
            <para>Add this to <filename>/etc/rc.conf</filename>:</para>

	    <programlisting>nfs_server_enable="YES"</programlisting>
          </step>
            
          <step>
            <para>Add this to <filename>/etc/exports</filename>:</para>

	    <programlisting>/usr -alldirs -ro</programlisting>
          </step>
        </procedure>
      </step>
        
      <step>
        <para>Reboot to enable the new services or start them 
          manually.</para>
      </step>
    </procedure>
  </sect1>
  
  <sect1 id="bootstrap-config">
    <title>Bootstrap Setup</title>

    <procedure>
      <step>
        <para>Download bootfiles: Download the 
          <ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/snapshots/i386/kern.flp">
          kern.flp</ulink> and 
          <ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/snapshots/i386/mfsroot.flp"> 
          mfsroot.flp</ulink> floppy images.</para>
      </step>
      
      <step>
        <para>Setup tftp/pxe-boot directory:</para>
	
        <procedure>
          <step>
            <para>Put pxeboot in the boot directory:</para>
	    
	    <screen>&prompt.root; <userinput>rm -rf /usr/obj/*</userinput>
&prompt.root; <userinput>cd /usr/src/sys/boot</userinput>
&prompt.root; <userinput>make</userinput>
&prompt.root; <userinput>cp /usr/src/sys/boot/i386/pxeldr/pxeboot /usr/tftpboot</userinput></screen>
          </step>
          
          <step>
            <para>Using the vndevice mount the <filename>kern.flp</filename>
	      file and copy its contents to
	      <filename>/usr/tftpboot</filename>:</para>
            
	    <screen>&prompt.root; <userinput>vnconfig vn0 kern.flp</userinput>    # associate a vndevice with the file
&prompt.root; <userinput>mount /dev/vn0 /mnt</userinput>      # mount it
&prompt.root; <userinput>cp -R /mnt /usr/tftpboot</userinput> # copy the contents to /usr/tftpboot
&prompt.root; <userinput>umount /mnt</userinput>              # unmount it
&prompt.root; <userinput>vnconfig -u vn0</userinput>          # disassociate the vndevice from the file</screen>
          </step>
        </procedure>
      </step>
      
      <step>
        <para>Compile a custom kernel for the clients (particularly to avoid 
          the device config screen at boot) and stick it in 
          <filename>/usr/tftpboot</filename>.</para>
      </step>
      
      <step>
        <para>Make a special <filename>loader.rc</filename> to and install it 
          in <filename>/usr/tftpboot/boot/loader.rc</filename> so that it 
          does not prompt for the second disk, here is 
          <ulink url="http://people.FreeBSD.org/~alfred/pxe/loader.rc">
          mine</ulink>.</para>
      </step>
      
      <step>
        <para>Extract the installer and helper utilities from the mfsroot disk
          and uncompress them, put them in <filename>/usr/tftpboot</filename>
          as well:</para>

	<screen>&prompt.root; <userinput>vnconfig vn0 mfsroot.flp</userinput>         # associate a vndevice with the file
&prompt.root; <userinput>mount /dev/vn0 /mnt</userinput>              # mount it
&prompt.root; <userinput>cp /mnt/mfsroot.gz /usr/tftpboot</userinput> # copy the contents to /usr/tftpboot
&prompt.root; <userinput>umount /mnt</userinput>                      # unmount it
&prompt.root; <userinput>vnconfig -u vn0</userinput>                  # disassociate the vndevice from the file
&prompt.root; <userinput>cd /usr/tftpboot</userinput>                 # get into the pxeboot directory
&prompt.root; <userinput>gunzip mfsroot.gz</userinput>                # uncompress the mfsroot</screen>
      </step>
      
      <step>
        <para>Make your sysinstall script <filename>install.cfg</filename>, you
          can use 
          <ulink url="http://people.FreeBSD.org/~alfred/pxe/install.cfg">
          mine</ulink> as a template, but you must edit it.</para>
      </step>
      
      <step> 
        <para>Copy the sysinstall script into the extracted and uncompressed 
          mfsroot image:</para>
          
	<screen>&prompt.root; <userinput>cd /usr/tftpboot</userinput>
&prompt.root; <userinput>vnconfig vn0 mfsroot</userinput>
&prompt.root; <userinput>mount /dev/vn0 /mnt</userinput>
&prompt.root; <userinput>cp install.cfg /mnt</userinput>
&prompt.root; <userinput>umount /mnt</userinput>
&prompt.root; <userinput>vnconfig -u vn0</userinput></screen>
      </step>
    </procedure>
  </sect1>
  
  <sect1 id="install-setup">
    <title>Install Setup</title>
     
    <procedure>
      <step>
        <para>Put the install files in an NFS accessible location on the
	  Server. Make a directory corresponding the 'nfs' directive in the
	  <filename> install.cfg</filename> file and mirror the FreeBSD
	  install files there, you will want it to look somewhat like
	  this:</para>

	<screen>ABOUT.TXT       TROUBLE.TXT     compat20        floppies        ports
ERRATA.TXT      UPGRADE.TXT     compat21        games           proflibs
HARDWARE.TXT    XF86336         compat22        info            src
INSTALL.TXT     bin             compat3x        kern.flp
LAYOUT.TXT      catpages        crypto          manpages
README.TXT      cdrom.inf       dict            mfsroot.flp
RELNOTES.TXT    compat1x        doc             packages</screen>
      </step>
      
      <step>
        <para>Copy the compressed packages into the packages/All directory 
          under <filename>nfs</filename>.</para>
      </step>
      
      <step>
        <para>Make sure you have an <filename>INDEX</filename> file prepared
	  in the packages directory. You can make your own
	  <filename>INDEX</filename> entries like so:</para>

	<programlisting>alfred-1.0||/|Alfred install bootstrap||alfred@FreeBSD.org||||</programlisting>
      
        <para>Then you can install custom packages, particularly your own
	  custom post-install package.</para>
      </step>
    </procedure>
  </sect1>
  
  <sect1 id="custom-postinst-package">
    <title>Custom Post-Install Package</title>

    <para>You can use the script <filename>pkgmaker.sh</filename> to create a 
      custom package for post install, the idea is to have it install and 
      configure any special things you may need done. 
      <filename>pkgmaker</filename> is run in the directory above the package 
      you wish to create with the single argument of the package (ie mypkg) 
      which will then create a mypkg.tgz for you to include in your sysinstall 
      package.</para>

    <para>Inside your custom package dir you will want a file called 
      <filename>PLIST</filename> which contains all the files that you wish to 
      install and be incorporated into your package.</para>
      
    <para>You will also want files called <filename>pre</filename> and 
      <filename>post</filename> in the directory, these are shell scripts 
      that you want to execute before and after your package is 
      installed.</para>
      
    <para>Since this package is in your <filename>install.cfg</filename> file 
      it should be run and do the final configuration for you.</para>
  </sect1>
</article>