Merge pull request #1270 from jeburks2/wwclient_dmidecode
Asset-tag fixes in dhcpd.conf.ww and wwclient
This commit is contained in:
@@ -38,6 +38,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Replace slice in templates with sprig substr. #1093
|
||||
- Fix an invalid format issue for the GitHub nightly build action. #1258
|
||||
- Fix broken `/etc/warewulf/excludes` handling #1266
|
||||
- Fix wwclient not reading asset-tag. #1110
|
||||
- Fix iPXE script not including asset-tag #1110
|
||||
|
||||
## v4.5.4, 2024-06-12
|
||||
|
||||
|
||||
@@ -126,6 +126,15 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
localUUID, _ = sysinfoDump.UUID()
|
||||
x := smbiosDump.SystemEnclosure()
|
||||
tag = strings.ReplaceAll(x.AssetTagNumber(), " ", "_")
|
||||
if tag == "Unknown" {
|
||||
dmiOut, err := exec.Command("dmidecode", "-s", "chassis-asset-tag").Output()
|
||||
if err == nil {
|
||||
chassisAssetTag := strings.TrimSpace(string(dmiOut))
|
||||
if chassisAssetTag != "" {
|
||||
tag = chassisAssetTag
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Raspberry Pi serial and DUID locations
|
||||
// /sys/firmware/devicetree/base/serial-number
|
||||
|
||||
@@ -39,7 +39,7 @@ if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
|
||||
}
|
||||
{{- else }}
|
||||
if exists user-class and option user-class = "iPXE" {
|
||||
filename "http://{{$.Ipaddr}}:{{$.Warewulf.Port}}/ipxe/${mac:hexhyp}";
|
||||
filename "http://{{$.Ipaddr}}:{{$.Warewulf.Port}}/ipxe/${mac:hexhyp}?assetkey=${asset}&uuid=${uuid}";
|
||||
} else {
|
||||
{{range $type,$name := $.Tftp.IpxeBinaries }}
|
||||
if option architecture-type = {{ $type }} {
|
||||
|
||||
@@ -26,7 +26,7 @@ dhcp-boot=tag:aarch64,"/warewulf/{{ index $.Tftp.IpxeBinaries "00:0B" }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
# iPXE binary will get the following configuration file
|
||||
dhcp-boot=tag:iPXE,"http://{{$.Ipaddr}}:{{$.Warewulf.Port}}/ipxe/${mac:hexhyp}"
|
||||
dhcp-boot=tag:iPXE,"http://{{$.Ipaddr}}:{{$.Warewulf.Port}}/ipxe/${mac:hexhyp}?assetkey=${asset}&uuid=${uuid}"
|
||||
dhcp-no-override
|
||||
{{- if $.Tftp.Enabled }}
|
||||
# also act as tftp server
|
||||
|
||||
Reference in New Issue
Block a user