code: func writeResolvConf(cfg *RunConfig, rootfs string) {
  	if cfg.DNSConfMode.Resolv != "stage0" {
  		return
  	}
  
  	if err := os.Mkdir(filepath.Join(rootfs, "etc"), common.DefaultRegularDirPerm); err != nil {
  		if !os.IsExist(err) {
  			log.Fatalf("error creating dir %q: %v\n", "/etc", err)
  		}
  	}
  	resolvPath := filepath.Join(rootfs, "etc/rkt-resolv.conf")
  	f, err := os.Create(resolvPath)
  	if err != nil {
  		log.Fatalf("error writing etc/rkt-resolv.conf: %v\n", err)
  	}
  	defer f.Close()
  
  	_, err = f.WriteString(common.MakeResolvConf(cfg.DNSConfig, "Generated by rkt run"))
  	if err != nil {
  		log.Fatalf("error writing etc/rkt-resolv.conf: %v\n", err)
  	}
  }
docs: // writeResolvConf will generate <stage1>/etc/rkt-resolv.conf if needed