github.com/icexin/eggos@v0.4.2-0.20220216025428-78b167e4f349/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  }