1 .\" $NetBSD: netboot,v 1.33 2008/04/30 13:10:48 martin Exp $
3 .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 .\" POSSIBILITY OF SUCH DAMAGE.
31 To netboot a \*M, you must configure one or more servers to provide
32 information and files to your \*M (the
36 (any architecture) on your netboot server(s), the information
37 provided here should be sufficient to configure everything.
38 Additionally, you may wish to look at the
40 manual page and the manual pages for each daemon you'll be configuring.
41 If the server(s) are another operating system, you should consult the
42 NetBSD Diskless HOW-TO, which will walk you through the steps necessary to
43 configure the netboot services on a variety of platforms.
44 .Lk http://www.NetBSD.org/docs/network/netboot/
45 .if !\n[hp700]:\n[next68k] \{\
47 You may either netboot the installer so you can install onto a locally
48 attached disk, or you may run your system entirely over the network.
53 process involves discovery, kernel and file system stages.
54 In the first stage, the client discovers information
55 about where to find the kernel image.
56 Once the kernel is loaded, it starts executing.
60 process involves discovery, bootstrap, kernel and file system stages.
61 In the first stage, the client discovers information
62 about where to find the bootstrap program.
63 Next, it downloads and executes the bootstrap program.
65 The server contains one large file (a LIF file system) with the bootloader
66 and the kernel. The bootstrap program simply loads the kernel from the
70 The bootstrap program goes through another discovery phase to determine
71 where the kernel is located.
72 The bootstrap program tries to mount the NFS share containing the kernel.
74 Once the kernel is loaded, it starts executing.
76 .ie !\n[hp700]:\n[next68k] \{\
77 For RAM disk kernels, it mounts the RAM disk file system and begins
78 executing the installer from the RAM disk.
79 For normal (non-RAM disk) kernels, the
82 kernel tries to mount the NFS share that had the kernel and starts
84 .if !\n[hp700]:\n[next68k] the installation tools or
87 All supported \*M systems use HP's proprietary RMP (the
89 daemon) for the first discovery stage and bootstrap download stages.
90 The bootstrap program uses DHCP for its discovery stage.
93 Early \*M systems use HP's proprietary RMP (the
95 daemon) for the discovery stage, bootstrap download, and kernel download
96 stages. Later \*M systems use BOOTP for the discovery stage and TFTP for
97 the bootstrap and kernel download.
99 .if \n[evbppc]:\n[macppc]:\n[next68k] \{\
100 All \*M systems use BOOTP for the discovery stage.
103 All \*M systems except JavaStations with OpenFirmware PROM
104 use a combination of RARP and BOOTP for the discovery stage.
105 In the past, these systems used RARP and BOOTPARAMS. JavaStations
106 booting from OpenFirmware use DHCP.
109 All \*M systems use a combination of RARP and DHCP for the discovery stage.
111 .if !\n[hp300]:\n[hp700] \{\
112 TFTP is used in the bootstrap phase to download
114 the bootstrap program,
118 the bootstrap program,
122 the bootstrap program,
124 which has been linked to a file name appropriate to the client's
125 architecture and IP address as described in the TFTP section below.
126 JavaStations with OpenFirmware need a special bootstrap program,
128 which is a version of boot.net in ELF format.
129 It is not linked to the IP address.
132 the bootstrap program,
134 which has been linked to a file name appropriate to the client's
135 IP address as described in the TFTP section below.
138 the kernel via the on-board Ethernet card by the firmware.
141 support for the on-board card is not needed in this step.
142 For NFS mounting a file system on the other hand,
144 support for the Ethernet card is needed, and the on-board one
145 will not suffice; you have to provide a second Ethernet card
149 .\} \" ! !\n[hp300]:\n[hp700]
150 .if !\n[evbppc]:\n[hp700] \{\
151 NFS is used in both the kernel and file system stages to download the
152 kernel, and to access files on the file server.
156 .Sq Li "CC:CC:CC:CC:CC:CC"
157 as the MAC address (ethernet hardware address) of your netboot client
159 You should have determined this address in an earlier stage.
160 In this example, we will use
162 as the IP address of your client and
163 .Sq Li client.test.net
165 We will assume you're providing all of your netboot services
166 on one machine called
167 .Sq Li server.test.net
168 with the client's files exported from the directory
169 .Pa /export/client/root .
170 You should, of course, replace all of these with the names, addresses,
171 and paths appropriate to your environment.
173 You should set up each netboot stage in order (i.e., discovery,
174 bootstrap, kernel, and then file system) so that you can test them as you
178 If your system uses RMP to netboot, you must set up
184 If your system uses BOOTP to netboot, then you must set up
193 .if \n[hp300]:\n[hp700] \{\
197 .if \n[hp300] .Pa SYS_UBOOT
198 .if \n[hp700] .Pa SYSNBSD
200 .if \n[hp300] .Pa installation/misc
201 .if \n[hp700] .Pa installation
202 directory of the distribution.
205 .No # Ic "mkdir -p /usr/mdec/rbootd"
206 .if \n[hp300] .No # Ic "cp SYS_UBOOT /usr/mdec/rbootd"
207 .if \n[hp700] .No # Ic "cp SYSNBSD /usr/mdec/rbootd"
208 .No # Ic "chmod -R a+rX /usr/mdec/rbootd"
213 with the following line:
215 .if \n[hp300] CC:CC:CC:CC:CC:CC SYS_UBOOT
216 .if \n[hp700] CC:CC:CC:CC:CC:CC SYSNBSD
219 You will need to start the
221 If it's already running, you will need to
222 restart it to force it to re-read its configuration file.
223 If the server is running
225 you can achieve this with:
228 .No # Ic "/etc/rc.d/rbootd restart"
231 If your netboot server is not running
233 but other OSs (like Linux, Solaris etc.), you have to use
236 package instead of native
238 Please refer the "Setting up the rbootd server" section
239 in the NetBSD Diskless HOW-TO
240 .Lk http://www.NetBSD.org/docs/network/netboot/rbootd/
244 .\} \" ! \n[hp300]:\n[hp700]
245 .if \n[evbppc]:\n[hp300]:\n[hp700]:\n[macppc]:\n[next68k]:\n[sparc]:\n[sparc64] \{\
256 The bootstrap program uses DHCP to discover the location of the kernel.
258 Put the following lines in your
264 for more information):
266 ddns-update-style none;
267 # Do not use any dynamic DNS features
269 allow bootp; # Allow bootp requests, thus the dhcp server
270 # will act as a bootp server.
272 authoritative; # master DHCP server for this subnet
274 subnet 192.168.1.0 netmask 255.255.255.0 {
275 # Which network interface to listen on.
276 # The zeros indicate the range of addresses
277 # that are allowed to connect.
280 # Set of parameters common to all clients
283 option broadcast-address 192.168.1.255;
284 option domain-name "test.net";
285 option domain-name-servers dns.test.net;
286 option routers router.test.net;
287 option subnet-mask 255.255.255.0;
289 # An individual client.
291 host client.test.net {
292 hardware ethernet CC:CC:CC:CC:CC:CC;
293 fixed-address 192.168.1.10;
295 # Name of the host (if the fixed address
296 # doesn't resolve to a simple name).
298 option host-name "client";
303 # Name of the kernel image to download via tftp.
304 # Note: Plain (ELF) kernels won't work, you
305 # have to use the corresponding *.img file.
307 filename "netbsd-INSTALL_WALNUT.img"
310 # Name of the bootloader or kernel
311 # to download via tftp.
315 # Only needed for JavaStations with OpenFirmware!
317 filename "bootjs.net";
325 filename "ofwboot.xcf";
336 # The path on the NFS server.
338 option root-path "/export/client/root";
342 #next68k machines require non-RFC1048 BOOTP
344 always-reply-rfc1048 false;
348 # If your DHCP server is not your NFS server, supply the
349 # address of the NFS server. Since we assume you run everything
350 # on one server, this is not needed.
353 # macppc machines will look for their bootloader,
354 # ofwboot.xcf, on the next-server as well.
357 # next-server server.test.net;
359 #you may paste another "host" entry here for additional
360 #clients on this network
364 Note that for JavaStations booting from OpenFirmware you do not need
369 statement, since this machines use real DHCP.
372 You will need to make sure that the
377 .No # Ic "touch /var/db/dhcpd.leases"
380 You will need to start the
382 If it's already running, you will need to
383 restart it to force it to re-read its configuration file.
384 If the server is running
386 you can achieve this with:
389 .No # Ic "/etc/rc.d/dhcpd restart"
392 .\} \" ! \n[evbppc]:\n[hp300]:\n[hp700]:\n[macppc]:\n[next68k]:\n[sparc]:\n[sparc64]
393 .if \n[sparc]:\n[sparc64] \{\
401 is needed to boot OpenFirmware based JavaStations.
406 file with the following line:
409 CC:CC:CC:CC:CC:CC client
412 Add your client to the server's
420 You will need to start the
422 If it's already running, you will need to
423 restart it to force it to re-read its configuration file.
424 If the server is running
426 you can achieve this with:
429 .No # Ic "/etc/rc.d/rarpd restart"
432 .\} \" ! \n[sparc]:\n[sparc64]
438 The default configuration of the TFTP server is to run in a
443 Thus, the first order of business is to create this directory:
445 .No # Ic "mkdir -p /tftpboot"
450 and uncomment the line with the TFTP daemon:
452 tftp dgram udp wait root /usr/libexec/tftpd tftpd -l -s /tftpboot
457 If the server is running
459 you can achieve this with:
462 .No # Ic "/etc/rc.d/inetd restart"
465 Now, you need to copy the
466 .ie \n[evbppc] kernel
468 for your \*M machine to
475 directory of the distribution.
477 .No # Ic "cp SYSNBSD /tftpboot"
485 directory of the distribution.
487 .No # Ic "cp ofwboot.xcf /tftpboot"
495 directory of the distribution.
497 .No # Ic "cp boot /tftpboot"
500 .if \n[sparc]:\n[sparc64] \{\
502 .if \n[sparc] .Pa boot.net
503 .if \n[sparc64] .Pa ofwboot.net
505 .Pa installation/netboot
506 directory of the distribution.
508 .if \n[sparc] .No # Ic "cp boot.net /tftpboot"
509 .if \n[sparc64] .No # Ic "cp ofwboot.net /tftpboot"
512 Now, you need to link
513 .if \n[sparc] .Pa boot.net
514 .if \n[sparc64] .Pa ofwboot.net
515 to the filename that your \*M will look for.
516 It will look for a filename composed of the machine's IP address
518 (in hexadecimal) followed by the machine's architecture,
519 separated by a period.
520 For example, a sun4c machine which has been assigned IP address
521 192.168.1.10, will make a TFTP request for
526 For example, a machine which has been assigned IP address
527 192.168.1.10, will make a TFTP request for
533 to help calculate the filename:
546 .No # Ic "cd /tftpboot"
547 .if \n[sparc] .No # Ic "ln -s boot.net C0A8010A.SUN4C"
548 .if \n[sparc64] .No # Ic "ln -s ofwboot.net C0A8010A"
551 .\} \" \n[sparc]:\n[sparc64]
553 For OpenFirmware based JavaStations you use the file
555 and do not create a symlink for the IP address. This machines do full
556 DHCP autoconfiguration, so the bootstrap filename is provided by the
560 Just to be sure, let's make everything readable.
562 .No # Ic "chmod -R a+rX /tftpboot"
567 table gets messed up, and the TFTP server can't communicate with the
569 In this case, it will write a log message (via
572 .Pa /var/log/messages
574 .Sq Li "tftpd: write: Host is down" .
575 If this is the case, you may need to force the server to map your client's
576 ethernet address to its IP address:
578 .No # Ic "arp -s client CC:CC:CC:CC:CC:CC"
589 Now your system should be able to load the bootstrap program and start
590 looking for the kernel.
594 You can either boot a kernel, or the RAM disk-based installer
595 .Pa binary/kernel/netbsd-INSTALL.img.gz .
596 In the first case you'll also need an NFS-mounted userland.
598 Let's set up the NFS server.
599 Create the directory you are exporting for the netboot client:
602 .No # Ic "mkdir -p /export/client/root"
605 Put the following line in
607 to enable NFS sharing:
610 .No "/export/client/root -maproot=root client.test.net"
613 If your server is currently running an NFS server, you only need to
616 Otherwise, you need to start
620 If the server is running
622 you can achieve this with:
625 .No # Ic "/etc/rc.d/rpcbind start"
626 .No # Ic "/etc/rc.d/nfsd start"
627 .No # Ic "/etc/rc.d/mountd restart"
633 .if !\n[next68k]:\n[hp700] and installation tools
635 .if !\n[evbppc]:\n[hp700] \{\
636 Now, if you place a kernel named
639 .Pa /export/client/root
640 your client should boot the kernel.
641 .\} \" !\n[evbppc]:\n[hp700]
643 If you are netbooting the installer, you can use either
644 the traditional miniroot-based installer
645 .Pa installation/miniroot/miniroot.fs.gz
646 or the experimental RAM disk-based installer
647 .Pa binary/kernel/netbsd-RAMDISK.gz .
649 To use the miniroot-based installer, mount the miniroot file system on your
653 work on any operating system other than
655 You'll also need to either set up a new NFS share point or an FTP server
656 for the distribution files, as they won't fit inside the miniroot
660 .No # Ic "gunzip miniroot.fs.gz"
661 .No # Ic "vnconfig -c /dev/vnd0c /path/to/miniroot.fs"
662 .No # Ic "mount -o ro /dev/vnd0c /export/client/root"
663 .No # Ic "ls /export/client/root"
664 .profile dist/ install.md mnt/ sbin/ usr/
665 bin/ etc/ install.sub mnt2/ tmp/ var/
666 dev/ install* kern/ netbsd* upgrade*
669 If there are no files present in your exported directory, then
672 To use the RAM disk-based installer, uncompress and rename the kernel.
673 Also, copy the distribution files to the client's root directory.
676 .No # Ic "cp *tgz /export/client/root"
677 .No # Ic "gunzip netbsd-RAMDISK.gz"
678 .No # Ic "mv netbsd-RAMDISK /export/client/root/netbsd"
681 If you are running your \*M diskless, simply use
682 .Pa binary/kernel/netbsd-GENERIC.gz .
685 You do not need to place a kernel in
686 .Pa /export/client/root
687 since the kernel is contained inside
691 If you are netbooting the installer, use
692 .Pa binary/kernel/netbsd-GENERIC_MD.gz
693 (this has the installation tools in a RAM disk).
694 Also, copy the distribution files to the client's root directory.
697 Some combinations of Open Firmware version and
699 version have trouble loading compressed kernels. If you have trouble loading
700 a kernel, try uncompressing it with
705 .No # Ic "cp *tgz /export/client/root"
706 .No # Ic "gunzip netbsd-GENERIC_MD.gz"
707 .No # Ic "mv netbsd-GENERIC_MD /export/client/root/netbsd"
710 If you are running your \*M diskless, simply use
711 .Pa binary/kernel/netbsd-GENERIC.gz .
715 .Pa binary/kernel/netbsd-GENERIC.gz .
718 .No # Ic "gunzip netbsd-GENERIC.gz"
719 .No # Ic "mv netbsd-GENERIC /export/client/root/netbsd"
722 .if \n[sparc]:\n[sparc64] \{\
724 .Pa binary/kernel/netbsd-GENERIC.gz .
727 .No # Ic "gunzip netbsd-GENERIC.gz"
728 .No # Ic "mv netbsd-GENERIC /export/client/root/netbsd"
731 If you are netbooting the installer, copy the distribution files to
732 the client's root directory and extract the tools from
733 .if \n[sparc] .Pa installation/netboot/rootfs.tgz .
734 .if \n[sparc64] .Pa installation/misc/instfs.tgz .
737 .No # Ic "cp *tgz /export/client/root"
738 .No # Ic "cd /export/client/root"
739 .if \n[sparc] .No # Ic "tar -xpzf rootfs.tgz"
740 .if \n[sparc64] .No # Ic "tar -xpzf instfs.tgz"
744 If you are netbooting the installer, use
745 .Pa binary/kernel/netbsd-INSTALL_WALNUT.img.gz
746 (this has the installation tools in a RAM disk).
747 Also, copy the distribution files to the client's root directory.
750 .No # Ic "cp *tgz /export/client/root"
751 .No # Ic "gunzip netbsd-INSTALL.img.gz"
752 .No # Ic "mv netbsd-INSTALL.img /export/client/root/netbsd"
755 If you are running your \*M diskless, simply use
756 .Pa binary/kernel/netbsd.img-WALNUT.gz .
761 .ie !\n[hp700]:\n[next68k] \{\
762 You can skip this step if you do not plan to run your client
763 diskless after installation.
767 need to extract and set up the client's installation of
769 The Diskless HOW-TO describes how to provide better security and save
770 space on the NFS server over the procedure listed here.
772 .Lk http://www.NetBSD.org/docs/network/netboot/nfs.html
775 Extracting distribution sets
778 .No # Ic "cd /export/client/root"
779 .No # Ic "tar -xpzf /path/to/files/base.tgz"
780 .No # Ic "tar -xpzf /path/to/files/etc.tgz"
783 Continue with the other non-essential distribution sets if desired.
789 .No # Ic "mkdir /export/client/root/swap"
790 .No # Ic "dd if=/dev/zero of=/export/client/swap bs=4k count=4k"
791 .No # Ic "echo '/export/client/swap -maproot=root:wheel client.test.net' | cat \*[Gt]\*[Gt] /etc/exports"
792 .No # Ic "/etc/rc.d/mountd restart"
794 This creates a 16 MB swap file and exports it to the client.
800 .No # Ic "cd /export/client/root/dev"
801 .No # Ic "./MAKEDEV all"
804 This procedure only works on
813 .Pa /export/client/root/etc/fstab
814 with the following lines:
817 server:/export/client/swap none swap sw,nfsmntpt=/swap
818 server:/export/client/root / nfs rw 0 0
826 .Pa /export/client/root/etc/rc.conf
830 defaultroute="192.168.1.1"
836 Make sure rc does not reconfigure the network device since it will lose
837 its connection to the NFS server with your root file system.
845 .Pa /export/client/root/etc/hosts
850 192.168.1.10 client.test.net client
851 192.168.1.5 server.test.net server
856 Setting up the server daemons
858 .ie !\n[hp700]:\n[next68k] If you want
860 these services to start up every time you boot
861 your server, make sure the following lines are present in your
864 .if \n[hp300]:\n[hp700] \{\
865 rbootd=YES rbootd_flags=""
867 .if \n[hp300]:\n[hp700]:\n[macppc]:\n[next68k]:\n[sparc]:\n[sparc64] \{\
868 dhcpd=YES dhcpd_flags="-q"
870 .if \n[sparc]:\n[sparc64] \{\
871 rarpd=YES rarpd_flags="-a"
873 nfs_server=YES # enable server daemons
875 rpcbind=YES rpcbind_flags="-l" # -l logs libwrap
879 Also, you'll need to make sure the