1 # dhcpd.conf include file for Etherboot
3 # Include this file from your /etc/dhcpd.conf
6 # Definition of Etherboot options
7 # (taken from vendortags.html)
9 # We use an encapsulated option space to avoid polluting the site-local DHCP option space
11 option space etherboot;
12 option etherboot-encapsulated-options code 150 = encapsulate etherboot;
14 # Definition of option codes within the etherboot-encapsulated-options space
16 option etherboot.extensions-path code 18 = string;
17 option etherboot.magic code 128 = string;
18 option etherboot.kernel-cmdline code 129 = string;
19 option etherboot.menu-opts code 160 = string;
20 option etherboot.nic-dev-id code 175 = string;
21 option etherboot.menu-selection code 176 = unsigned integer 8;
22 option etherboot.motd-1 code 184 = string;
23 option etherboot.motd-2 code 185 = string;
24 option etherboot.motd-3 code 186 = string;
25 option etherboot.motd-4 code 187 = string;
26 option etherboot.motd-5 code 188 = string;
27 option etherboot.motd-6 code 189 = string;
28 option etherboot.motd-7 code 190 = string;
29 option etherboot.motd-8 code 191 = string;
30 option etherboot.image-1 code 192 = string;
31 option etherboot.image-2 code 193 = string;
32 option etherboot.image-3 code 194 = string;
33 option etherboot.image-4 code 195 = string;
34 option etherboot.image-5 code 196 = string;
35 option etherboot.image-6 code 197 = string;
36 option etherboot.image-7 code 198 = string;
37 option etherboot.image-8 code 199 = string;
38 option etherboot.image-9 code 200 = string;
39 option etherboot.image-10 code 201 = string;
40 option etherboot.image-11 code 202 = string;
41 option etherboot.image-12 code 203 = string;
42 option etherboot.image-13 code 204 = string;
43 option etherboot.image-14 code 205 = string;
44 option etherboot.image-15 code 206 = string;
45 option etherboot.image-16 code 207 = string;
46 option etherboot.kmod code 254 = string;
48 # Legacy support for Etherboot options as site-local options (i.e. non-encapsulated)
49 # Note: options defined after the switch to encapsulated options should not be defined here
51 option legacy-etherboot-magic code 128 = string;
52 option legacy-etherboot-kernel-cmdline code 129 = string;
53 option legacy-etherboot-menu-opts code 160 = string;
54 option legacy-etherboot-menu-selection code 176 = unsigned integer 8;
55 option legacy-etherboot-motd-1 code 184 = string;
56 option legacy-etherboot-motd-2 code 185 = string;
57 option legacy-etherboot-motd-3 code 186 = string;
58 option legacy-etherboot-motd-4 code 187 = string;
59 option legacy-etherboot-motd-5 code 188 = string;
60 option legacy-etherboot-motd-6 code 189 = string;
61 option legacy-etherboot-motd-7 code 190 = string;
62 option legacy-etherboot-motd-8 code 191 = string;
63 option legacy-etherboot-image-1 code 192 = string;
64 option legacy-etherboot-image-2 code 193 = string;
65 option legacy-etherboot-image-3 code 194 = string;
66 option legacy-etherboot-image-4 code 195 = string;
67 option legacy-etherboot-image-5 code 196 = string;
68 option legacy-etherboot-image-6 code 197 = string;
69 option legacy-etherboot-image-7 code 198 = string;
70 option legacy-etherboot-image-8 code 199 = string;
71 option legacy-etherboot-image-9 code 200 = string;
72 option legacy-etherboot-image-10 code 201 = string;
73 option legacy-etherboot-image-11 code 202 = string;
74 option legacy-etherboot-image-12 code 203 = string;
75 option legacy-etherboot-image-13 code 204 = string;
76 option legacy-etherboot-image-14 code 205 = string;
77 option legacy-etherboot-image-15 code 206 = string;
78 option legacy-etherboot-image-16 code 207 = string;
80 # Apply Etherboot options only for Etherboot clients
82 if substring ( option vendor-class-identifier, 0, 9 ) = "Etherboot" {
84 # We must specify this value for etherboot-magic, or Etherboot will
85 # ignore all other options.
87 option etherboot.magic E4:45:74:68:00:00;
89 # Bootfile name: derive from etherboot.kmod (calculated below)
90 # Use boot.nbi if no NIC_DEV_ID option present
91 # (i.e. if etherboot.kmod doesn't get set)
92 # Also pass filename back in filename field
94 option bootfile-name = pick-first-value ( concat ( "boot-",
95 config-option etherboot.kmod,
98 filename = config-option bootfile-name;
100 # "Sensible" default values for some options
102 # Mount devfs (will probably be needed for a network-boot)
103 option etherboot.kernel-cmdline " devfs=mount";
105 # Info message (includes client IP address, MAC address, hardware ID string,
106 # server IP address and name of boot file)
107 option etherboot.motd-4 = concat ( "Using Etherboot to boot ",
108 binary-to-ascii ( 10, 8, ".", leased-address ),
110 binary-to-ascii ( 16, 8, ":", suffix ( hardware, 6 ) ),
112 pick-first-value ( option etherboot.nic-dev-id, "unknown card" ),
113 "]", 0d:0a, " from ",
114 binary-to-ascii ( 10, 8, ".", option dhcp-server-identifier ),
116 config-option tftp-server-name,
118 config-option bootfile-name,
120 pick-first-value ( config-option etherboot.kmod, "unknown module" ),
123 # Legacy site-local option support
124 # If client does not include an etherboot-encapsulated-options field in its DHCPREQUEST, then
125 # it will not understand etherboot-encapsulated-options in the DHCPACK and so we must send
126 # back the options as site-local options (i.e. not encapsulated).
127 # Note: we need do this only for options that existed prior to the switch to encapsulation.
129 if not exists etherboot-encapsulated-options {
130 option legacy-etherboot-magic = config-option etherboot.magic;
131 option legacy-etherboot-kernel-cmdline = config-option etherboot.kernel-cmdline;
132 option legacy-etherboot-menu-opts = config-option etherboot.menu-opts;
133 option legacy-etherboot-menu-selection = config-option etherboot.menu-selection;
134 option legacy-etherboot-motd-1 = config-option etherboot.motd-1;
135 option legacy-etherboot-motd-2 = config-option etherboot.motd-2;
136 option legacy-etherboot-motd-3 = config-option etherboot.motd-3;
137 option legacy-etherboot-motd-4 = config-option etherboot.motd-4;
138 option legacy-etherboot-motd-5 = config-option etherboot.motd-5;
139 option legacy-etherboot-motd-6 = config-option etherboot.motd-6;
140 option legacy-etherboot-motd-7 = config-option etherboot.motd-7;
141 option legacy-etherboot-motd-8 = config-option etherboot.motd-8;
142 option legacy-etherboot-image-1 = config-option etherboot.image-1;
143 option legacy-etherboot-image-2 = config-option etherboot.image-2;
144 option legacy-etherboot-image-3 = config-option etherboot.image-3;
145 option legacy-etherboot-image-4 = config-option etherboot.image-4;
146 option legacy-etherboot-image-5 = config-option etherboot.image-5;
147 option legacy-etherboot-image-6 = config-option etherboot.image-6;
148 option legacy-etherboot-image-7 = config-option etherboot.image-7;
149 option legacy-etherboot-image-8 = config-option etherboot.image-8;
150 option legacy-etherboot-image-9 = config-option etherboot.image-9;
151 option legacy-etherboot-image-10 = config-option etherboot.image-10;
152 option legacy-etherboot-image-11 = config-option etherboot.image-11;
153 option legacy-etherboot-image-12 = config-option etherboot.image-12;
154 option legacy-etherboot-image-13 = config-option etherboot.image-13;
155 option legacy-etherboot-image-14 = config-option etherboot.image-14;
156 option legacy-etherboot-image-15 = config-option etherboot.image-15;
157 option legacy-etherboot-image-16 = config-option etherboot.image-16;
161 # Some options should be set for both Etherboot and the udhcpc client
163 if ( ( substring ( option vendor-class-identifier, 0, 9 ) = "Etherboot" )
164 or ( substring ( option vendor-class-identifier, 0, 5 ) = "udhcp" ) ) {
166 # TFTP server defaults to DHCP server and is specified in both
167 # next-server field and tftp-server-name option field
169 option tftp-server-name = binary-to-ascii ( 10, 8, ".", config-option dhcp-server-identifier );
170 server-name = config-option tftp-server-name;
171 next-server = config-option dhcp-server-identifier;
173 # Root path defaults to root of TFTP server
174 option root-path = concat ( config-option tftp-server-name, ":/" );
176 # A fallback hostname, generated from the IP address
177 option host-name = concat ( "client_", binary-to-ascii ( 10, 8, "_", leased-address ) );
180 # Force some items onto parameter request list for udhcp
182 if substring ( option vendor-class-identifier, 0, 5 ) = "udhcp" {
183 # Forcibly add root-path to list
184 option dhcp-parameter-request-list = concat ( option dhcp-parameter-request-list, 11 );
187 # Etherboot sends a string to identify the NIC in etherboot.nic-dev-id.
188 # For PCI NICs, this string is of the form "PCI:vvvv:dddd" where vvvv is the
189 # vendor identifier and dddd the device identifier, in lower-case ASCII hex.
190 # For ISA NICs, the format of the string is "ISA:..." where ... is not yet
193 # We use the identifier to select the NBI image that will be specified via
194 # the "bootfile-name" option.
196 # PCI NICs - use PCI vendor and device IDs
197 # Listed in file generated by mknbi-set
199 include "/etc/dhcpd.conf.etherboot-pcimap.include";
203 if substring ( option vendor-class-identifier, 0, 9 ) = "Etherboot" {
204 if exists etherboot.nic-dev-id {