In the process of work, it is systematically necessary to replenish the fleet of thin clients and each time customers may differ in configuration from previous ones and from one manufacturer. Well, if the differences are small and the client works on the previous build of Thinstation, in practice it turns out that the working assembly is not compatible with new computers.
By itself, the first thought is to assemble a universal boot image, but this is not always the case - either the image is very large, or the modules or packages are incompatible. Exit - to collect several images and give them to the right customers at boot. There are
several ways, here I will describe my favorite.
For example, I have two different types of thin clients: a long-standing batch of
HP Compaq t5135 and a batch of newer
USN BQ 656 , iron is all different, I had to make two boot images - TS-2.2.2i and TS-5.3. I will not write about how to
set up a PXE boot , but how to give the necessary images using DHCP.
')
We create two folders on the TFTP server for the images sent via PXE,
hp and
usn , respectively, and
store our loaders in them. Distribution will be carried out on MAC-addresses, or rather on their first half, because each vendor has its own identifier and in one batch usually the first half of the MAC is the same.
As expected, all my
HP MAC clients start at
00: 1E: 0B and are reserved for the Hewlett-Packard Company, and for the
USN , from
38:60:77 and reserved for the PEGATRON CORPORATION.
We add the conditions in the
dhcpd.conf server configuration file to the
subnet description:
if (binary-to-ascii (16,8,":",substring(hardware, 0, 4)) = "1:0:1E:B") { filename "/hp/pxelinux.0"; } elsif (binary-to-ascii (16,8,":",substring(hardware, 0, 4)) = "1:38:60:77") { filename "/usn/pxelinux.0"; } else { filename "pxelinux.0"; }
Here, initial, identical for a certain manufacturer, MAC-address values ​​are written and if the condition coincides with the client's poppy start, then it is assigned the bootstrap file defined in the condition from the corresponding TFTP server folder.
It is important to note that in the “variable” hardware for network cards there is a leading block: “01:”, so you have to take it into account. It is also important that if a part of the MAC address starts from zero, it is discarded during translation. Thus, the MAC address with the beginning “00: 1E: 0B” is converted to “1: 0: 1E: B”.
As always,
dnsmasq is even simpler:
dhcp-mac=hp,00:1E:0B:*:*:* dhcp-boot=net:hp,hp/pxelinux.0,boothost,192.168.111.254 dhcp-mac=usn,38:60:77:*:*:* dhcp-boot=net:usn,usn/pxelinux.0,boothost,192.168.111.254 dhcp-boot=pxelinux.0,boothost,192.168.111.254
There is nothing to clarify, assign an identifier by mas and give the loader by identifier, if nothing matched - we give the default image, I have it in the assembly version with the -
allmodules option to get the client parameters.