busybox: compile with installed Linux UAPI headers
@@ -5,12 +5,12 @@ target-cc := "CC=gcc --sysroot=../vinix-sysroot -specs=../vinix-sysroot/usr/lib/
5defpkgbuild(busybox,
16 #:pkgname, "busybox",
27 #:pkgver, "1.38.0",
3- #:pkgrel, 2,
8+ #:pkgrel, 3,
49 #:pkgdesc, "Static musl shell and bootstrap utilities for Vinix",
510 #:arch, [#:x86-64],
611 #:url, "https://busybox.net/",
712 #:license, "GPL-2.0-only",
8- #:makedepends, ["musl=1.2.6-1"],
13+ #:makedepends, ["musl=1.2.6-1", "linux-headers"],
914 #:source, ["https://busybox.net/downloads/busybox-1.38.0.tar.bz2", "bootstrap.config"],
1015 #:sha256sums, ["34f9ea6ff8636f2c9241153b9114eefa9e65674a45318ae1ef95bb5f31c53bb2",
1116 "9d8c4fb8ebad6ddbf058e151d807a90ce7687643626e0e4b5357e587718dec00"],
@@ -35,20 +35,10 @@ defpkgbuild(busybox,
3535 run("sed", "-i", "-f", "enable.sed", "busybox-1.38.0/vinix.defconfig")
3636 run("make", "-C", "busybox-1.38.0", "KBUILD_DEFCONFIG=vinix.defconfig", "defconfig")
3737
38- ; musl supplies libc headers. Import only the Linux kernel UAPI from
39- ; the x86-64 builder until those headers have their own Vinix package.
40- run("mkdir", "uapi")
41- run("ln", "-s", "/usr/include/linux", "uapi/linux")
42- run("ln", "-s", "/usr/include/asm-generic", "uapi/asm-generic")
43- if file-exists?("/usr/include/asm") {
44- run("ln", "-s", "/usr/include/asm", "uapi/asm")
45- } else {
46- run("ln", "-s", "/usr/include/x86_64-linux-gnu/asm", "uapi/asm")
47- }
4838 },
4939 #:build, fn() {
5040 run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH",
51- "make", "-C", "busybox-1.38.0", target-cc, "EXTRA_CFLAGS=-I../uapi", "busybox")
41+ "make", "-C", "busybox-1.38.0", target-cc, "busybox")
5242 },
5343 #:check, fn() {
5444 ; Check what the final executable actually linked, and the dependencies
@@ -58,12 +48,13 @@ defpkgbuild(busybox,
5848 "busybox-1.38.0/busybox_unstripped.map")
5949 }, list("Scrt1.o", "crti.o", "libc.a", "crtn.o"))
6050 run("grep", "-F", "../vinix-sysroot/usr/include/stdio.h", "busybox-1.38.0/shell/.ash.o.cmd")
51+ run("grep", "-F", "../vinix-sysroot/usr/include/linux/vt.h", "busybox-1.38.0/init/.init.o.cmd")
6152 run("busybox-1.38.0/busybox", "ash", "-n", "/dev/null")
6253 run("busybox-1.38.0/busybox", "true")
6354 },
6455 #:package, fn() {
6556 run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH",
66- "make", "-C", "busybox-1.38.0", target-cc, "EXTRA_CFLAGS=-I../uapi",
57+ "make", "-C", "busybox-1.38.0", target-cc,
6758 string-append("CONFIG_PREFIX=", pkgdir()), "install")
6859 run("install", "-Dm644", "busybox-1.38.0/LICENSE",
6960 string-append(pkgdir(), "/usr/share/licenses/busybox/LICENSE"))