aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-02-06 21:04:59 +0900
committerOphestra <cat@gensokyo.uk>2026-02-06 21:04:59 +0900
commitfa94155f42912f68ea1709f432be6d3d552739ca (patch)
treef30625271d9a520f1a0a6d6b7963846f670ac4bd
parent233bd163fb0b82812cf4e20e596a58992c33ad66 (diff)
internal/rosa/etc: resolv.conf
Required by programs that download from the internet in measured execArtifact. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/rosa/etc.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/rosa/etc.go b/internal/rosa/etc.go
index f94e63c0..a998ac03 100644
--- a/internal/rosa/etc.go
+++ b/internal/rosa/etc.go
@@ -4,8 +4,10 @@ import (
"errors"
"io"
"os"
+ "sync"
"syscall"
+ "hakurei.app/container/fhs"
"hakurei.app/internal/pkg"
)
@@ -140,3 +142,22 @@ func newIANAEtc() pkg.Artifact {
pkg.TarGzip,
)
}
+
+var (
+ resolvconfPath pkg.ExecPath
+ resolvconfOnce sync.Once
+)
+
+// resolvconf returns a hardcoded /etc/resolv.conf file.
+func resolvconf() pkg.ExecPath {
+ resolvconfOnce.Do(func() {
+ resolvconfPath = pkg.Path(
+ fhs.AbsEtc.Append("resolv.conf"), false,
+ pkg.NewFile("resolv.conf", []byte(`
+nameserver 1.1.1.1
+nameserver 1.0.0.1
+`)),
+ )
+ })
+ return resolvconfPath
+}