mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
Add support for Luckfox PicoKVM
Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
18
hw.go
18
hw.go
@@ -53,12 +53,22 @@ func GetDeviceID() string {
|
||||
}
|
||||
|
||||
func GetDefaultHostname() string {
|
||||
deviceId := GetDeviceID()
|
||||
if deviceId == "unknown_device_id" {
|
||||
return "jetkvm"
|
||||
//deviceId := GetDeviceID()
|
||||
//if deviceId == "unknown_device_id" {
|
||||
// return "kvm"
|
||||
//}
|
||||
|
||||
//return fmt.Sprintf("kvm-%s", strings.ToLower(deviceId))
|
||||
return "picokvm"
|
||||
}
|
||||
|
||||
func GetHostname() string {
|
||||
content, err := os.ReadFile("/etc/hostname")
|
||||
if err != nil {
|
||||
return GetDefaultHostname()
|
||||
}
|
||||
|
||||
return fmt.Sprintf("jetkvm-%s", strings.ToLower(deviceId))
|
||||
return strings.TrimSpace(string(content))
|
||||
}
|
||||
|
||||
func runWatchdog() {
|
||||
|
||||
Reference in New Issue
Block a user