aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-01 10:02:36 +0900
committerOphestra <cat@gensokyo.uk>2026-03-01 10:02:36 +0900
commit6159c74e961853b293ec1a40eed3a4476e418054 (patch)
tree2fd8cb92403d286794d8826b1a26e54eea6d6f09 /internal
parent2a34a269d0828b75e4cbbdae2d316a011ff00326 (diff)
internal/rosa/toybox: migrate to make helper
A previous change caused world rebuild, so it is a good time to do this. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
-rw-r--r--internal/rosa/toybox.go51
1 files changed, 30 insertions, 21 deletions
diff --git a/internal/rosa/toybox.go b/internal/rosa/toybox.go
index 1bd118d6..aa646db6 100644
--- a/internal/rosa/toybox.go
+++ b/internal/rosa/toybox.go
@@ -7,19 +7,24 @@ func (t Toolchain) newToybox(suffix, script string) pkg.Artifact {
version = "0.8.13"
checksum = "rZ1V1ATDte2WeQZanxLVoiRGdfPXhMlEo5-exX-e-ml8cGn9qOv0ABEUVZpX3wTI"
)
- return t.New("toybox-"+version+suffix, TEarly, stage0Concat(t, []pkg.Artifact{},
- t.Load(Make),
- t.Load(Bash),
- t.Load(Gzip),
+ return t.NewViaMake("toybox"+suffix, version, pkg.NewHTTPGetTar(
+ nil,
+ "https://landley.net/toybox/downloads/toybox-"+version+".tar.gz",
+ mustDecode(checksum),
+ pkg.TarGzip,
+ ), &MakeAttr{
+ Writable: true,
+ OmitDefaults: true,
+ InPlace: true,
+ SkipConfigure: true,
+
+ ScriptEarly: `
+LDFLAGS="${LDFLAGS} -static"
- t.Load(KernelHeaders),
- ), nil, stage0Concat(t, []string{},
- "ROSA_CHECK=make USER=cure tests",
- ), `
chmod +w /bin/
ln -rs "$(which bash)" /bin/ || true
-cd /usr/src/toybox
+cd /usr/src/toybox` + suffix + `
chmod +w kconfig tests
rm \
tests/du.test \
@@ -32,21 +37,25 @@ make defconfig
sed -i \
's/^CONFIG_TOYBOX_ZHELP=y$/CONFIG_TOYBOX_ZHELP=0/' \
.config
-`+script+`
-make \
- "-j$(nproc)" \
- LDFLAGS="${LDFLAGS} -static"
-${ROSA_CHECK}
-PREFIX=/work/system/bin make install_flat
+make "-j$(nproc)"
+`,
+ ScriptConfigured: script,
+ CheckName: "USER=cure tests",
+ SkipCheck: t.isStage0(),
+ ScriptInstall: "PREFIX=/work/system/bin make install_flat",
+ Script: `
mkdir -p /work/usr/bin
ln -s ../../system/bin/env /work/usr/bin
-`, pkg.Path(AbsUsrSrc.Append("toybox"), true, pkg.NewHTTPGetTar(
- nil,
- "https://landley.net/toybox/downloads/toybox-"+version+".tar.gz",
- mustDecode(checksum),
- pkg.TarGzip,
- )))
+`,
+
+ Flag: TEarly,
+ },
+ t.Load(Bash),
+ t.Load(Gzip),
+
+ t.Load(KernelHeaders),
+ )
}
func init() {
artifactsF[Toybox] = func(t Toolchain) pkg.Artifact {