internal/rosa: consistent stage0 paths
All checks were successful
Test / Create distribution (push) Successful in 2m2s
Test / Hakurei (push) Successful in 6m35s
Test / ShareFS (push) Successful in 6m33s
Test / Sandbox (race detector) (push) Successful in 6m52s
Test / Hpkg (push) Successful in 7m20s
Test / Hakurei (race detector) (push) Successful in 7m46s
Test / Sandbox (push) Successful in 1m37s
Test / Flake checks (push) Successful in 1m50s
All checks were successful
Test / Create distribution (push) Successful in 2m2s
Test / Hakurei (push) Successful in 6m35s
Test / ShareFS (push) Successful in 6m33s
Test / Sandbox (race detector) (push) Successful in 6m52s
Test / Hpkg (push) Successful in 7m20s
Test / Hakurei (race detector) (push) Successful in 7m46s
Test / Sandbox (push) Successful in 1m37s
Test / Flake checks (push) Successful in 1m50s
This makes using the gentoo stage3 as our stage0 compatible with Rosa OS stage0 tarballs. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -173,7 +173,7 @@ func fixupEnviron(env, extras []string, paths ...string) []string {
|
|||||||
|
|
||||||
// absCureScript is the absolute pathname [Toolchain.New] places the fixed-up
|
// absCureScript is the absolute pathname [Toolchain.New] places the fixed-up
|
||||||
// build script under.
|
// build script under.
|
||||||
var absCureScript = fhs.AbsUsrBin.Append(".cure-script")
|
var absCureScript = AbsSystem.Append("bin", ".cure-script")
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// TExclusive denotes an exclusive [pkg.Artifact].
|
// TExclusive denotes an exclusive [pkg.Artifact].
|
||||||
@@ -187,7 +187,7 @@ func (t Toolchain) New(
|
|||||||
name string,
|
name string,
|
||||||
flag int,
|
flag int,
|
||||||
extra []pkg.Artifact,
|
extra []pkg.Artifact,
|
||||||
checksum *pkg.Checksum,
|
knownChecksum *pkg.Checksum,
|
||||||
env []string,
|
env []string,
|
||||||
script string,
|
script string,
|
||||||
|
|
||||||
@@ -195,17 +195,11 @@ func (t Toolchain) New(
|
|||||||
) pkg.Artifact {
|
) pkg.Artifact {
|
||||||
const lcMessages = "LC_MESSAGES=C.UTF-8"
|
const lcMessages = "LC_MESSAGES=C.UTF-8"
|
||||||
|
|
||||||
var (
|
var support []pkg.Artifact
|
||||||
path = AbsSystem.Append("bin", "sh")
|
|
||||||
args = []string{"sh", absCureScript.String()}
|
|
||||||
support []pkg.Artifact
|
|
||||||
)
|
|
||||||
switch t {
|
switch t {
|
||||||
case toolchainBusybox:
|
case toolchainBusybox:
|
||||||
name += "-early"
|
name += "-early"
|
||||||
support = slices.Concat([]pkg.Artifact{newBusyboxBin()}, extra)
|
support = slices.Concat([]pkg.Artifact{newBusyboxBin()}, extra)
|
||||||
path = AbsSystem.Append("bin", "busybox")
|
|
||||||
args[0] = "hush"
|
|
||||||
env = fixupEnviron(env, nil, "/system/bin")
|
env = fixupEnviron(env, nil, "/system/bin")
|
||||||
|
|
||||||
case toolchainStage0:
|
case toolchainStage0:
|
||||||
@@ -220,14 +214,14 @@ func (t Toolchain) New(
|
|||||||
default:
|
default:
|
||||||
panic("unsupported target " + runtime.GOARCH)
|
panic("unsupported target " + runtime.GOARCH)
|
||||||
}
|
}
|
||||||
path = fhs.AbsRoot.Append("bin", "bash")
|
|
||||||
args[0] = "bash"
|
|
||||||
support = slices.Concat([]pkg.Artifact{
|
support = slices.Concat([]pkg.Artifact{
|
||||||
cureEtc{},
|
cureEtc{},
|
||||||
toolchainBusybox.New("stage0", 0, nil, nil, nil, `
|
toolchainBusybox.New("stage0", 0, nil, nil, nil, `
|
||||||
tar -C /work -xf /usr/src/stage0.tar.xz
|
tar -C /work -xf /usr/src/stage0.tar.xz
|
||||||
rm -rf /work/dev/ /work/proc/
|
rm -rf /work/dev/ /work/proc/
|
||||||
ln -vs ../usr/bin /work/bin
|
ln -vs ../usr/bin /work/bin
|
||||||
|
mkdir -vp /work/system/bin
|
||||||
|
ln -vs ../../bin/sh /work/system/bin
|
||||||
`, pkg.Path(AbsUsrSrc.Append("stage0.tar.xz"), false,
|
`, pkg.Path(AbsUsrSrc.Append("stage0.tar.xz"), false,
|
||||||
pkg.NewHTTPGet(
|
pkg.NewHTTPGet(
|
||||||
nil, "https://basement.gensokyo.uk/seed/"+seed,
|
nil, "https://basement.gensokyo.uk/seed/"+seed,
|
||||||
@@ -279,9 +273,10 @@ ln -vs ../usr/bin /work/bin
|
|||||||
}
|
}
|
||||||
|
|
||||||
return pkg.NewExec(
|
return pkg.NewExec(
|
||||||
name, checksum, pkg.ExecTimeoutMax, flag&TExclusive != 0,
|
name, knownChecksum, pkg.ExecTimeoutMax, flag&TExclusive != 0,
|
||||||
fhs.AbsRoot, env,
|
fhs.AbsRoot, env,
|
||||||
path, args,
|
AbsSystem.Append("bin", "sh"),
|
||||||
|
[]string{"sh", absCureScript.String()},
|
||||||
|
|
||||||
slices.Concat([]pkg.ExecPath{pkg.Path(
|
slices.Concat([]pkg.ExecPath{pkg.Path(
|
||||||
fhs.AbsRoot, true,
|
fhs.AbsRoot, true,
|
||||||
|
|||||||
Reference in New Issue
Block a user