github.com/jspc/eggos@v0.5.1-0.20221028160421-556c75c878a5/fs/etc.go (about) 1 package fs 2 3 import "github.com/spf13/afero" 4 5 var builtinFiles = map[string]string{ 6 "/etc/resolv.conf": `nameserver 114.114.114.114`, 7 "/proc/sys/kernel/hostname": `eggos`, 8 } 9 10 func etcInit() { 11 for name, content := range builtinFiles { 12 err := afero.WriteFile(Root, name, []byte(content), 0644) 13 if err != nil { 14 panic(err) 15 } 16 } 17 }