configuration-templates – Blame information for rev 52

Subversion Repositories:
Rev:
Rev Author Line No. Line
51 office 1 ###########################################################################
2 ## Copyright (C) Wizardry and Steamworks 2017 - License: GNU GPLv3 ##
3 ## Please see: http://www.gnu.org/licenses/gpl.html for legal details, ##
4 ## rights of fair usage, the disclaimer and warranty conditions. ##
5 ###########################################################################
6 ## A class declaration for Apple NetBoot clients. ##
7 ## original by Bennett Perkin & Brandon (aka Sedorox) ##
8 ## ##
9 ## You will have to change this file in order to change some addresses ##
10 ## and settings that cannot be parametrized. ##
11 ## ##
12 ## Current configuration that needs to be changed: ##
13 ## * The server dishes out OSX image files and is located at: ##
14 ## 192.168.0.1 (hex: C0:A8:00:01) ##
15 ## * This file serves netboot images for El Capitan and Snow Leopard ##
16 ## * The images are served through TFTP (boot) and NFS (image) ##
17 ###########################################################################
18  
19 class "Apple-Intel-NetBoot" {
20 # Limit this class to only Intel Apple machines
21 match if substring (option vendor-class-identifier, 0, 14) = "AAPLBSDPC/i386";
22  
23 # From: http://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xml
24 # 1 - Subnet Mask
25 # 3 - Router
26 # 17 - Root Path
27 # 43 - Vendor Specific
28 # 60 - Class ID
29 # Send these options to the client (possibly forcing it, if the client didn't request it)
30 option dhcp-parameter-request-list 1,3,17,43,60;
31  
32 if (option dhcp-message-type = 8) {
33 # on DHCPInform Messages, Us/Our (Server), Them (Client)
34 # Let Them know we're responding with Apple BSDP Information
35 option vendor-class-identifier "AAPLBSDPC";
36 if (substring(option vendor-encapsulated-options, 0, 3) = 01:01:01) {
37 log(info, "BSDP_LIST");
38 # BSDP List
39 # Let Them know this is the let, what server, the server's priority, what our default image is, and provide the image list.
40 option vendor-encapsulated-options
41 # Start BSDP Inform/List Option 1 (01:), Length 1 (01:), Message Type List(1) (01:)
42 01:01:01:
43 # BSDP option code 3 (length 04) -- Server Identifier
44 03:04:
45 # Server IP (192.168.0.1), Dec->Hex
46 C0:A8:00:01:
47 # BSDP option code 4 (length 02) -- Server Priority
48 04:02:
49 # Priority (32768) Dec -> Hex
50 80:00:
51 # BSDP option code 7 (length 04) -- Default Image ID
52 07:04:
53 # This is what is picked as Default when you only hold down N on the client
54 #
55 # 01 breaks into: 0 or 8 for Non-Install (NetBoot) set or Install (NetInstal) set,
56 # Then 0 for Mac OS 9, 1 for Mac OS X (Client) 2 for OS X Server, and 3 for Hardware Diagnostics
57 #
58 # 4 through 127 (x4:00-xf:ff) reversed for future use
59 #
60 # And the last two are for the Image ID (Dec->Hex)
61 #
62 # IDs 1-4095 (00:01-0F:FF) are for Server-Specific Images (You will probably want an ID in this range)
63 # IDs 4096-65535 (10:00-FF:FF) Are "Globally-Unique", Multiple servers can present this same ID
64 # and the client will only see one image, and pick a random(?) server to talk to.
65 #
66 # Image ID - (137) Dec->Hex
67 01:00:00:89:
68 # BSDP option code 9 -- Boot image list
69 09:
70 # Length = 5 * <number of images> + <sum of the number of characters in the image name>
71 # For this case: 5 * (2 images) + (20 characters + 23 characters) = 53 = 35 in hexadecimal
72 50:
73 # This only appears once in the package, no matter how many images you have below
74 # Image ID (137) -- dec->hex, see above (Default Image ID) for how to formulate the full ID
75 01:00:00:89:
76 # Format: <sum of characters in image name>:<the name of the image in Hex>
77 # For this example: 20 characters so 14 hex:N:e:t:B:o:o:t: :(:E:l: :C:a:p:i:t:a:n:):
78 14:4e:65:74:42:6f:6f:74:20:28:45:6c:20:43:61:70:69:74:61:6e:29:
79 # Image ID -- 138
80 81:00:00:8A:
81 # Note that since no other images follow, this is ended by the semi-colon (;) - otherwise
82 # this segment would end with colon (:) after which the other images would follow.
83 #
84 # 23 characters so 17 hex:N:e:t:I:n:s:t:a:l:l: :(:E:l: :C:a:p:i:t:a:n:):
85 17:4e:65:74:49:6e:73:74:61:6c:6c:20:28:45:6c:20:43:61:70:69:74:61:6e:29:
86 # Image ID -- 139
87 01:00:00:8B:
88 # 22 characters so 16 hex:N:e:t:B:o:o:t: :(:S:n:o:w: :L:e:o:p:a:r:d:):
89 16:4e:65:74:42:6f:6f:74:20:28:53:6e:6f:77:20:4c:65:6f:70:61:72:64:29;
90 } elsif (substring(option vendor-encapsulated-options, 0, 3) = 01:01:02) {
91 log(info, "BSDP_SELECT");
92 # This is BSDP Option 3 (Length 04)
93 #
94 # BSDP Select, This is the client selecting which image they want to boot from
95 # Here we basically do if statements to catch what image is referenced
96 # Since we MIGHT be clustered, Check to see if we're the server being asked.
97 #
98 # In this example "AC:10:01:01" is the hex representation of "192.168.0.1" which
99 # is the IP address of the server dishing out the image files for net booting.
100 if (substring(option vendor-encapsulated-options, 9, 4) = C0:A8:00:01) {
101 log(info, "BSDP_SELECT-Responding, Client is talking to us.");
102 # Catch Image ID 01:00:00:89 defined above (NetBoot)
103 if (substring(option vendor-encapsulated-options, 15, 4) = 01:00:00:89) {
104 log(info, "BSDP_SELECT-Image: NetBoot (El Capitan)");
105  
106 # This file is retrieved from System Image Utility on OS X when it creates a NetBoot image.
107 # The "booter" file along with all the other files are created by the System Image Utility
108 # on OS X and placed where the .NBI folder is created under i386/. The files must be then
109 # be copied from OSX and then served by the server through tftpd (Trivial FTP) by this server.
110 #
111 # Tree structure is:
112 # /srv
113 # +
114 # |
115 # +- /tftp
116 # +
117 # |
118 # + /Apple
119 # +
120 # |
121 # + /NetBoot
122 # +
123 # |
124 # +- /macnbi-i386
125 # +
126 # |
127 # +- booter
128 # +- PlatformSupport.plist
129 # +- x86_64
130 # +
131 # |
132 # +- kernelcache
133 #
134 filename "/srv/tftp/pxe/Mac/NetBoot/El\ Capitan/macnbi-i386/booter";
135  
136 # In this example HTTP is used to serve the image.
137 #
138 # Tree structure is:
139 # Web Server Root
140 # +
141 # |
142 # +- /Apple
143 # +
144 # |
145 # +- /Netboot
146 # +
147 # |
148 # +- El Capitan (space encoded with %20)
149 # +
150 # |
151 # +- NetBoot.dmg
152 # +- NBImageInfo.plist
153 #
154  
155 ## Serve images either through HTTP...
156 ## option root-path "http://192.168.0.1/Apple/NetBoot/El%20Capitan/NetBoot.dmg";
157 ## ... or NFS.
158 option root-path "nfs:192.168.0.1:/srv/nfs/pxe/Mac/NetBoot/El\ Capitan:NetBoot.dmg";
159  
160 # Catch Image ID 81:00:00:8A defined above (NetBoot)
161 } elsif(substring(option vendor-encapsulated-options, 15, 4) = 81:00:00:8A) {
162 log(info, "BSDP_SELECT-Image: NetInstall (El Capitan)");
163 filename "/srv/tftp/pxe/Mac/NetInstall/El\ Capitan/macnbi-i386/booter";
164 ## Serve images either through HTTP...
165 ## option root-path "http://192.168.0.1/Apple/NetInstall/El%20Capitan/NetInstall.dmg";
166 ## ... or NFS.
167 option root-path "nfs:192.168.0.1:/srv/nfs/pxe/Mac/NetInstall/El\ Capitan:NetInstall.dmg";
168 ##
169 } elsif(substring(option vendor-encapsulated-options, 15, 4) = 01:00:00:8B) {
170 log(info, "BSDP_SELECT-Image: NetBoot (Snow Leopard)");
171 filename "/srv/tftp/pxe/Mac/NetBoot/Snow\ Leopard/macnbi-i386/booter";
172 ## Serve images either through HTTP...
173 ## option root-path "http://192.168.0.1/Apple/NetBoot/Snow%20Leopard/NetBoot.dmg";
174 ## ... or NFS.
175 option root-path "nfs:192.168.0.1:/srv/nfs/pxe/Mac/NetBoot/Snow\ Leopard:NetBoot.dmg";
176 ###
177 } else {
178 log(info,"BSDP_SELECT-ERROR: Client responded with an image we don't have a match for! -- (Image added to list, but not in select catch?)");
179 }
180 } else {
181 # Client is talking to a different machine.
182 log(info,"BSDP_SELECT-Ignoring, Client is talking to another server!");
183 }
184 }
185 }
186 }