From 5303efe96d89d18563063b532b323270055818e9 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 25 Dec 2019 10:12:37 +0800 Subject: [PATCH] hostman: fsdriver: fix hostname deployment for openwrt We will need to add native uci support later --- pkg/hostman/guestfs/fsdriver/linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/hostman/guestfs/fsdriver/linux.go b/pkg/hostman/guestfs/fsdriver/linux.go index e9fd3d569a..565a2fcf35 100644 --- a/pkg/hostman/guestfs/fsdriver/linux.go +++ b/pkg/hostman/guestfs/fsdriver/linux.go @@ -1367,6 +1367,9 @@ func (d *SOpenWrtRootFs) RootSignatures() []string { func (d *SOpenWrtRootFs) DeployHostname(rootFs IDiskPartition, hn, domain string) error { spath := "/etc/config/system" + if !rootFs.Exists(spath, false) { + return nil + } bcont, err := rootFs.FileGetContents(spath, false) if err != nil { return err