| 1 | selected := get-environment-variable("VPAC_TARGET_ARCH") |
| 2 | host := if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" } |
| 3 | arch := if string?(selected) { selected } else { host } |
| 4 | runner := if string=?(host, arch) { list() } else { list(string-append("qemu-", arch)) } |
| 5 | |
| 6 | defpkgbuild(busybox-init, |
| 7 | #:pkgname, "busybox-init", |
| 8 | #:pkgver, "1.38.0", |
| 9 | #:pkgrel, 1, |
| 10 | #:pkgdesc, "BusyBox PID 1 for Vinix bootstrap images", |
| 11 | #:arch, [#:any], |
| 12 | #:license, "GPL-2.0-only", |
| 13 | #:url, "https://busybox.net/", |
| 14 | #:depends, ["busybox=1.38.0-5"], |
| 15 | #:check, fn() { |
| 16 | binary := string-append(get-environment-variable("VPAC_MAKEPKG_ROOT"), "/bin/busybox") |
| 17 | apply(run, append(runner, list(binary, "--help", "init"))) |
| 18 | }, |
| 19 | #:package, fn() { |
| 20 | run("install", "-d", string-append(pkgdir(), "/sbin")) |
| 21 | run("ln", "-s", "../bin/busybox", string-append(pkgdir(), "/sbin/init")) |
| 22 | }) |
| 23 | |