|
Removed
Link Here
|
| 1 |
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ |
| 2 |
<!ENTITY % articles.ent PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Articles Entity Set//EN"> |
| 3 |
%articles.ent; |
| 4 |
]> |
| 5 |
|
| 6 |
<article> |
| 7 |
<articleinfo> |
| 8 |
<title>FreeBSD Jumpstart Guide</title> |
| 9 |
|
| 10 |
<authorgroup> |
| 11 |
<author> |
| 12 |
<firstname>Alfred</firstname> |
| 13 |
<surname>Perlstein</surname> |
| 14 |
|
| 15 |
<affiliation> |
| 16 |
<address><email>alfred@FreeBSD.org</email></address> |
| 17 |
</affiliation> |
| 18 |
</author> |
| 19 |
</authorgroup> |
| 20 |
|
| 21 |
<pubdate>$FreeBSD: doc/en_US.ISO8859-1/articles/pxe/article.sgml,v 1.27 2006/08/29 19:45:44 blackend Exp $</pubdate> |
| 22 |
|
| 23 |
<legalnotice id="trademarks" role="trademarks"> |
| 24 |
&tm-attrib.freebsd; |
| 25 |
&tm-attrib.intel; |
| 26 |
&tm-attrib.general; |
| 27 |
</legalnotice> |
| 28 |
|
| 29 |
<abstract> |
| 30 |
<para>This article details the method used to allow machines to install |
| 31 |
FreeBSD using the &intel; PXE method of booting a machine over a network. |
| 32 |
</para> |
| 33 |
</abstract> |
| 34 |
</articleinfo> |
| 35 |
|
| 36 |
<sect1 id="introduction"> |
| 37 |
<title>Introduction</title> |
| 38 |
|
| 39 |
<warning> |
| 40 |
<para>This procedure will make the <quote>Server</quote> both insecure and dangerous, |
| 41 |
it is best to just keep the <quote>Server</quote> on its own hub and not in any way |
| 42 |
accessible by any machines other than the <quote>Clients</quote>.</para> |
| 43 |
</warning> |
| 44 |
|
| 45 |
<para>Terminology:</para> |
| 46 |
|
| 47 |
<informaltable frame="none" pgwide="1"> |
| 48 |
<tgroup cols="2"> |
| 49 |
|
| 50 |
<tbody> |
| 51 |
<row> |
| 52 |
<entry>Server</entry> |
| 53 |
<entry>The machine offering netboot and install options.</entry> |
| 54 |
</row> |
| 55 |
|
| 56 |
<row> |
| 57 |
<entry>Client</entry> |
| 58 |
<entry>The machine that will have FreeBSD installed on it.</entry> |
| 59 |
</row> |
| 60 |
</tbody> |
| 61 |
</tgroup> |
| 62 |
</informaltable> |
| 63 |
|
| 64 |
<para>Requires: |
| 65 |
Clients supporting the &intel; PXE netboot option, an Ethernet connection. |
| 66 |
</para> |
| 67 |
|
| 68 |
<para>Please let me know if you come across anything you have problems with |
| 69 |
or suggestions for additional documentation.</para> |
| 70 |
|
| 71 |
<para>If you would like someone to train/implement a specific netinstall system |
| 72 |
for you, please send email so that we can discuss terms.</para> |
| 73 |
|
| 74 |
<para>I would also like to thank &a.ps; and &a.jhb; for doing most of the |
| 75 |
programming work on pxeboot, the interface to the &intel; PXE (netboot) |
| 76 |
system.</para> |
| 77 |
</sect1> |
| 78 |
|
| 79 |
<sect1 id="server-config"> |
| 80 |
<title>Server Configuration</title> |
| 81 |
|
| 82 |
<procedure> |
| 83 |
<step> |
| 84 |
<para>Install DHCP: Install <filename role="package">net/isc-dhcp3-server</filename> you can use this config file |
| 85 |
<ulink url="dhcpd.conf"> |
| 86 |
<filename>dhcpd.conf</filename></ulink>, stick it in <filename>/usr/local/etc/</filename>.</para> |
| 87 |
</step> |
| 88 |
|
| 89 |
<step> |
| 90 |
<para>Enable tftp:</para> |
| 91 |
|
| 92 |
<procedure> |
| 93 |
<step> |
| 94 |
<para>Make a directory <filename>/usr/tftpboot</filename></para> |
| 95 |
</step> |
| 96 |
|
| 97 |
<step> |
| 98 |
<para>Add this line to your |
| 99 |
<filename>/etc/inetd.conf</filename>:</para> |
| 100 |
|
| 101 |
<programlisting>tftp dgram udp wait nobody /usr/libexec/tftpd tftpd /usr/tftpboot</programlisting> |
| 102 |
</step> |
| 103 |
</procedure> |
| 104 |
|
| 105 |
</step> |
| 106 |
|
| 107 |
<step> |
| 108 |
<para>Enable NFS:</para> |
| 109 |
|
| 110 |
<procedure> |
| 111 |
<step> |
| 112 |
<para>Add this to <filename>/etc/rc.conf</filename>:</para> |
| 113 |
|
| 114 |
<programlisting>nfs_server_enable="YES"</programlisting> |
| 115 |
</step> |
| 116 |
|
| 117 |
<step> |
| 118 |
<para>Add this to <filename>/etc/exports</filename>:</para> |
| 119 |
|
| 120 |
<programlisting>/usr -alldirs -ro</programlisting> |
| 121 |
</step> |
| 122 |
</procedure> |
| 123 |
</step> |
| 124 |
|
| 125 |
<step> |
| 126 |
<para>Reboot to enable the new services or start them |
| 127 |
manually.</para> |
| 128 |
</step> |
| 129 |
</procedure> |
| 130 |
</sect1> |
| 131 |
|
| 132 |
<sect1 id="bootstrap-config"> |
| 133 |
<title>Bootstrap Setup</title> |
| 134 |
|
| 135 |
<procedure> |
| 136 |
<step> |
| 137 |
<para>Download bootfiles: Download the |
| 138 |
<ulink |
| 139 |
url="&snapshots.stable;/floppies/kern.flp"> |
| 140 |
kern.flp</ulink> and |
| 141 |
<ulink |
| 142 |
url="&snapshots.stable;/floppies/mfsroot.flp"> |
| 143 |
mfsroot.flp</ulink> floppy images.</para> |
| 144 |
</step> |
| 145 |
|
| 146 |
<step> |
| 147 |
<para>Set up tftp/pxe-boot directory:</para> |
| 148 |
|
| 149 |
<procedure> |
| 150 |
<step> |
| 151 |
<para>Put pxeboot in the boot directory:</para> |
| 152 |
|
| 153 |
<screen>&prompt.root; <userinput>rm -rf /usr/obj/*</userinput> |
| 154 |
&prompt.root; <userinput>cd /usr/src/sys/boot</userinput> |
| 155 |
&prompt.root; <userinput>make</userinput> |
| 156 |
&prompt.root; <userinput>cp /usr/src/sys/boot/i386/pxeldr/pxeboot /usr/tftpboot</userinput></screen> |
| 157 |
</step> |
| 158 |
|
| 159 |
<step> |
| 160 |
<para>Using the vndevice mount the <filename>kern.flp</filename> |
| 161 |
file and copy its contents to |
| 162 |
<filename>/usr/tftpboot</filename>:</para> |
| 163 |
|
| 164 |
<screen>&prompt.root; <userinput>mdconfig -a -t vnode -f kern.flp -u 0</userinput> # (vnconfig vn0 kern.flp) associate a vndevice with the file |
| 165 |
&prompt.root; <userinput>mount /dev/md0 /mnt</userinput> # (mount /dev/vn0 /mnt) mount it |
| 166 |
&prompt.root; <userinput>cp -R /mnt /usr/tftpboot</userinput> # copy the contents to /usr/tftpboot |
| 167 |
&prompt.root; <userinput>umount /mnt</userinput> # unmount it |
| 168 |
&prompt.root; <userinput>vnconfig -u vn0</userinput> # disassociate the vndevice from the file</screen> |
| 169 |
</step> |
| 170 |
</procedure> |
| 171 |
</step> |
| 172 |
|
| 173 |
<step> |
| 174 |
<para>Compile a custom kernel for the clients (particularly to avoid |
| 175 |
the device config screen at boot) and stick it in |
| 176 |
<filename>/usr/tftpboot</filename>.</para> |
| 177 |
</step> |
| 178 |
|
| 179 |
<step> |
| 180 |
<para>Make a special <filename>loader.rc</filename> to and install it |
| 181 |
in <filename>/usr/tftpboot/boot/loader.rc</filename> so that it |
| 182 |
does not prompt for the second disk, here is |
| 183 |
<ulink url="loader.rc">mine</ulink>.</para> |
| 184 |
</step> |
| 185 |
|
| 186 |
<step> |
| 187 |
<para>Extract the installer and helper utilities from the mfsroot disk |
| 188 |
and uncompress them, put them in <filename>/usr/tftpboot</filename> |
| 189 |
as well:</para> |
| 190 |
|
| 191 |
<screen>&prompt.root; <userinput>vnconfig vn0 mfsroot.flp</userinput> # associate a vndevice with the file |
| 192 |
&prompt.root; <userinput>mount /dev/vn0 /mnt</userinput> # mount it |
| 193 |
&prompt.root; <userinput>cp /mnt/mfsroot.gz /usr/tftpboot</userinput> # copy the contents to /usr/tftpboot |
| 194 |
&prompt.root; <userinput>umount /mnt</userinput> # unmount it |
| 195 |
&prompt.root; <userinput>vnconfig -u vn0</userinput> # disassociate the vndevice from the file |
| 196 |
&prompt.root; <userinput>cd /usr/tftpboot</userinput> # get into the pxeboot directory |
| 197 |
&prompt.root; <userinput>gunzip mfsroot.gz</userinput> # uncompress the mfsroot</screen> |
| 198 |
</step> |
| 199 |
|
| 200 |
<step> |
| 201 |
<para>Make your sysinstall script <filename>install.cfg</filename>, you |
| 202 |
can use |
| 203 |
<ulink url="install.cfg">mine</ulink> |
| 204 |
as a template, but you must edit it.</para> |
| 205 |
</step> |
| 206 |
|
| 207 |
<step> |
| 208 |
<para>Copy the sysinstall script into the extracted and uncompressed |
| 209 |
mfsroot image:</para> |
| 210 |
|
| 211 |
<screen>&prompt.root; <userinput>cd /usr/tftpboot</userinput> |
| 212 |
&prompt.root; <userinput>vnconfig vn0 mfsroot</userinput> |
| 213 |
&prompt.root; <userinput>mount /dev/vn0 /mnt</userinput> |
| 214 |
&prompt.root; <userinput>cp install.cfg /mnt</userinput> |
| 215 |
&prompt.root; <userinput>umount /mnt</userinput> |
| 216 |
&prompt.root; <userinput>vnconfig -u vn0</userinput></screen> |
| 217 |
</step> |
| 218 |
</procedure> |
| 219 |
</sect1> |
| 220 |
|
| 221 |
<sect1 id="install-setup"> |
| 222 |
<title>Install Setup</title> |
| 223 |
|
| 224 |
<procedure> |
| 225 |
<step> |
| 226 |
<para>Put the install files in an NFS accessible location on the |
| 227 |
Server. Make a directory corresponding the 'nfs' directive in the |
| 228 |
<filename> install.cfg</filename> file and mirror the FreeBSD |
| 229 |
install files there, you will want it to look somewhat like |
| 230 |
this:</para> |
| 231 |
|
| 232 |
<screen>ABOUT.TXT TROUBLE.TXT compat20 floppies ports |
| 233 |
ERRATA.TXT UPGRADE.TXT compat21 games proflibs |
| 234 |
HARDWARE.TXT XF86336 compat22 info src |
| 235 |
INSTALL.TXT bin compat3x kern.flp |
| 236 |
LAYOUT.TXT catpages crypto manpages |
| 237 |
README.TXT cdrom.inf dict mfsroot.flp |
| 238 |
RELNOTES.TXT compat1x doc packages</screen> |
| 239 |
</step> |
| 240 |
|
| 241 |
<step> |
| 242 |
<para>Copy the compressed packages into the packages/All directory |
| 243 |
under <filename>nfs</filename>.</para> |
| 244 |
</step> |
| 245 |
|
| 246 |
<step> |
| 247 |
<para>Make sure you have an <filename>INDEX</filename> file prepared |
| 248 |
in the packages directory. You can make your own |
| 249 |
<filename>INDEX</filename> entries like so:</para> |
| 250 |
|
| 251 |
<programlisting>alfred-1.0||/|Alfred install bootstrap||alfred@FreeBSD.org||||</programlisting> |
| 252 |
|
| 253 |
<para>Then you can install custom packages, particularly your own |
| 254 |
custom post-install package.</para> |
| 255 |
</step> |
| 256 |
</procedure> |
| 257 |
</sect1> |
| 258 |
|
| 259 |
<sect1 id="custom-postinst-package"> |
| 260 |
<title>Custom Post-Install Package</title> |
| 261 |
|
| 262 |
<para>You can use the script <ulink url="pkgmaker.sh"><filename>pkgmaker.sh |
| 263 |
</filename></ulink> to create a |
| 264 |
custom package for post install, the idea is to have it install and |
| 265 |
configure any special things you may need done. |
| 266 |
<filename>pkgmaker</filename> is run in the directory above the package |
| 267 |
you wish to create with the single argument of the package (i.e., mypkg) |
| 268 |
which will then create a mypkg.tgz for you to include in your sysinstall |
| 269 |
package.</para> |
| 270 |
|
| 271 |
<para>Inside your custom package dir you will want a file called |
| 272 |
<filename>PLIST</filename> which contains all the files that you wish to |
| 273 |
install and be incorporated into your package.</para> |
| 274 |
|
| 275 |
<para>You will also want files called |
| 276 |
<ulink url="pre"><filename>pre</filename></ulink> and |
| 277 |
<ulink url="post"><filename>post</filename></ulink> |
| 278 |
in the directory, these are shell scripts |
| 279 |
that you want to execute before and after your package is |
| 280 |
installed.</para> |
| 281 |
|
| 282 |
<para>Since this package is in your <filename>install.cfg</filename> file |
| 283 |
it should be run and do the final configuration for you.</para> |
| 284 |
</sect1> |
| 285 |
</article> |