Update App version to 0.1.2

Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
luckfox-eng29
2026-03-16 21:49:37 +08:00
parent 9a4e604c61
commit d5bfaffd86
32 changed files with 4064 additions and 229 deletions

20
network_mac.go Normal file
View File

@@ -0,0 +1,20 @@
package kvm
import (
"fmt"
"os"
)
const ethernetMacAddressPath = "/userdata/ethaddr.txt"
func rpcSetEthernetMacAddress(macAddress string) (interface{}, error) {
normalized, err := networkState.SetMACAddress(macAddress)
if err != nil {
return nil, err
}
if err := os.WriteFile(ethernetMacAddressPath, []byte(normalized+"\n"), 0644); err != nil {
return nil, fmt.Errorf("failed to write %s: %w", ethernetMacAddressPath, err)
}
return networkState.RpcGetNetworkState(), nil
}