Add support for Luckfox PicoKVM

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
luckfox-eng29
2025-08-07 14:26:01 +08:00
parent 3e7d8fb0f5
commit 8fbd6bcf0d
114 changed files with 4676 additions and 3270 deletions

18
hw.go
View File

@@ -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() {