mirror of
https://github.com/siderolabs/talos.git
synced 2025-10-10 15:11:15 +02:00
The URL to fetch the configuration for a talos node is given by the talos.config kernel parameter. We add support for 4 variables ${uuid}, ${serial}, ${mac} and ${hostname} which substitute the device UUID, DMI-sourced serial number, MAC address of the first network interface to be up and the hostname respectively. Fixes #3272 Signed-off-by: Philipp Sauter <philipp.sauter@siderolabs.com>
27 lines
550 B
Go
27 lines
550 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package smbios
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/talos-systems/go-smbios/smbios"
|
|
)
|
|
|
|
var (
|
|
syncSMBIOS sync.Once
|
|
connSMBIOS *smbios.SMBIOS
|
|
errSMBIOS error
|
|
)
|
|
|
|
// GetSMBIOSInfo returns the SMBIOS info.
|
|
func GetSMBIOSInfo() (*smbios.SMBIOS, error) {
|
|
syncSMBIOS.Do(func() {
|
|
connSMBIOS, errSMBIOS = smbios.New()
|
|
})
|
|
|
|
return connSMBIOS, errSMBIOS
|
|
}
|