aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-28 00:58:34 +0900
committerOphestra <cat@gensokyo.uk>2026-01-28 00:58:34 +0900
commit823ba08dbcb0bb5c5c5e012198a511f57bf53240 (patch)
tree6922987dfd1cf28d402040d959b3f5a77b482736
parent660835151ed7f918bf0a66e851362650cac19340 (diff)
internal/rosa: use patch helper
This is significantly cleaner and runs somewhat faster. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/rosa/busybox.go29
1 files changed, 12 insertions, 17 deletions
diff --git a/internal/rosa/busybox.go b/internal/rosa/busybox.go
index 0f9210f6..8ea881cd 100644
--- a/internal/rosa/busybox.go
+++ b/internal/rosa/busybox.go
@@ -317,10 +317,6 @@ exec clang \
EOF
chmod +x /bin/gcc
-cd /usr/src/busybox
-chmod +w editors editors/awk.c
-patch -p 1 < /usr/src/patches/awk-fix-literal-backslash.patch
-
cd "$(mktemp -d)"
make \
KBUILD_SRC=/usr/src/busybox \
@@ -345,17 +341,16 @@ cp -v busybox /work/system/bin/
ln -vs ../system/bin/hush /work/bin/sh
mkdir -vp /work/usr/bin/
ln -vs ../../system/bin/busybox /work/usr/bin/env
-`, pkg.Path(AbsUsrSrc.Append("busybox"), true, pkg.NewHTTPGetTar(
- &http.Client{Transport: &http.Transport{
- // busybox website is really slow to respond
- TLSHandshakeTimeout: 2 * time.Minute,
- }},
- "https://busybox.net/downloads/busybox-"+version+".tar.bz2",
- mustDecode(checksum),
- pkg.TarBzip2,
- )), pkg.Path(
- AbsUsrSrc.Append("patches", "awk-fix-literal-backslash.patch"), false,
- pkg.NewFile("awk-fix-literal-backslash.patch", []byte(`diff --git a/editors/awk.c b/editors/awk.c
+`, pkg.Path(AbsUsrSrc.Append("busybox"), true, t.NewPatchedSource(
+ "busybox", version, pkg.NewHTTPGetTar(
+ &http.Client{Transport: &http.Transport{
+ // busybox website is really slow to respond
+ TLSHandshakeTimeout: 2 * time.Minute,
+ }},
+ "https://busybox.net/downloads/busybox-"+version+".tar.bz2",
+ mustDecode(checksum),
+ pkg.TarBzip2,
+ ), true, [2]string{"awk-fix-literal-backslash", `diff --git a/editors/awk.c b/editors/awk.c
index 64e752f4b..40f5ba7f7 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -373,7 +368,7 @@ index 64e752f4b..40f5ba7f7 100644
+ }
bslash = 0;
}
- }`)),
- ))
+ }`},
+ )))
}
func init() { artifactsF[Busybox] = Toolchain.newBusybox }