internal/rosa/etc: resolv.conf
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m47s
Test / Hakurei (push) Successful in 3m50s
Test / ShareFS (push) Successful in 4m4s
Test / Hpkg (push) Successful in 4m35s
Test / Sandbox (race detector) (push) Successful in 5m3s
Test / Hakurei (race detector) (push) Successful in 3m22s
Test / Flake checks (push) Successful in 1m50s
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m47s
Test / Hakurei (push) Successful in 3m50s
Test / ShareFS (push) Successful in 4m4s
Test / Hpkg (push) Successful in 4m35s
Test / Sandbox (race detector) (push) Successful in 5m3s
Test / Hakurei (race detector) (push) Successful in 3m22s
Test / Flake checks (push) Successful in 1m50s
Required by programs that download from the internet in measured execArtifact. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -4,8 +4,10 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
"hakurei.app/container/fhs"
|
||||||
"hakurei.app/internal/pkg"
|
"hakurei.app/internal/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -140,3 +142,22 @@ func newIANAEtc() pkg.Artifact {
|
|||||||
pkg.TarGzip,
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user