From f7fda4ec9a87f59d97d0b5952f4899942d57dd7c Mon Sep 17 00:00:00 2001 From: forever2k38 Date: Mon, 28 Sep 2026 19:13:12 +0200 Subject: package busybox --- sys-apps/busybox/build.lua | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sys-apps/busybox/build.lua diff --git a/sys-apps/busybox/build.lua b/sys-apps/busybox/build.lua new file mode 100644 index 0000000..62c63e8 --- /dev/null +++ b/sys-apps/busybox/build.lua @@ -0,0 +1,67 @@ +local package = {} + +local lfs = require("lfs") + +package.name = "busybox" +package.version = "1.38.0" +package.description = "tiny single binary coreutils" +package.arch = { "x86_64" } +package.license = { "GPLv2" } + +package.deps = { + build = { + { provides = "cc" }, + { provides = "make" }, + }, +} + +package.sources = { + { + path = "https://busybox.net/downloads/busybox-1.38.0.tar.bz2", + hash = "71d1f0992bc99813e4e32d718004fadbd8315b300508094e37713555a2e394ca77f16874ec8be55961c0aa4141365dba27728e203895aadb2c112a84764a28d9", + out = "source.tar.gz", + }, +} + +local function fix_config(path) + path = path or ".config" + + local f = io.open(path, "r") + + if not f then + return nil, "cannot open" + end + + local s = f:read("*all") + + f:close() + + s = s:gsub("CONFIG_TC=y", "CONFIG_TC=n") + + f = io.open(path, "w") + + f:write(s) + + f:close() + + return true +end -- tiny hack, disables TC to fix builds on kernel 6.8+ + +package.build = function() + pow.extract("source.tar.gz", "source") + + lfs.chdir("source/busybox-1.38.0") + + os.execute("make defconfig") + fix_config() + + local make_command = string.format("make %s", pow.config.makeopts) + + os.execute(make_command) +end + +package.install = function() + pow.install("busybox", "/bin/busybox") +end + +return package -- cgit v1.3