From cab3ed46e5f12120997a7bea8dfb31a47dac9923 Mon Sep 17 00:00:00 2001 From: diviocity Date: Sun, 29 Nov 2026 23:21:08 +0100 Subject: [PATCH] busybox: compile with installed Linux UAPI headers --- busybox/PKGBUILD.vile | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/busybox/PKGBUILD.vile b/busybox/PKGBUILD.vile index 28ef9d2..87957ab 100644 --- a/busybox/PKGBUILD.vile +++ b/busybox/PKGBUILD.vile @@ -5,12 +5,12 @@ target-cc := "CC=gcc --sysroot=../vinix-sysroot -specs=../vinix-sysroot/usr/lib/ defpkgbuild(busybox, #:pkgname, "busybox", #:pkgver, "1.38.0", - #:pkgrel, 2, + #:pkgrel, 3, #:pkgdesc, "Static musl shell and bootstrap utilities for Vinix", #:arch, [#:x86-64], #:url, "https://busybox.net/", #:license, "GPL-2.0-only", - #:makedepends, ["musl=1.2.6-1"], + #:makedepends, ["musl=1.2.6-1", "linux-headers"], #:source, ["https://busybox.net/downloads/busybox-1.38.0.tar.bz2", "bootstrap.config"], #:sha256sums, ["34f9ea6ff8636f2c9241153b9114eefa9e65674a45318ae1ef95bb5f31c53bb2", "9d8c4fb8ebad6ddbf058e151d807a90ce7687643626e0e4b5357e587718dec00"], @@ -35,20 +35,10 @@ defpkgbuild(busybox, run("sed", "-i", "-f", "enable.sed", "busybox-1.38.0/vinix.defconfig") run("make", "-C", "busybox-1.38.0", "KBUILD_DEFCONFIG=vinix.defconfig", "defconfig") - ; musl supplies libc headers. Import only the Linux kernel UAPI from - ; the x86-64 builder until those headers have their own Vinix package. - run("mkdir", "uapi") - run("ln", "-s", "/usr/include/linux", "uapi/linux") - run("ln", "-s", "/usr/include/asm-generic", "uapi/asm-generic") - if file-exists?("/usr/include/asm") { - run("ln", "-s", "/usr/include/asm", "uapi/asm") - } else { - run("ln", "-s", "/usr/include/x86_64-linux-gnu/asm", "uapi/asm") - } }, #:build, fn() { run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", - "make", "-C", "busybox-1.38.0", target-cc, "EXTRA_CFLAGS=-I../uapi", "busybox") + "make", "-C", "busybox-1.38.0", target-cc, "busybox") }, #:check, fn() { ; Check what the final executable actually linked, and the dependencies @@ -58,12 +48,13 @@ defpkgbuild(busybox, "busybox-1.38.0/busybox_unstripped.map") }, list("Scrt1.o", "crti.o", "libc.a", "crtn.o")) run("grep", "-F", "../vinix-sysroot/usr/include/stdio.h", "busybox-1.38.0/shell/.ash.o.cmd") + run("grep", "-F", "../vinix-sysroot/usr/include/linux/vt.h", "busybox-1.38.0/init/.init.o.cmd") run("busybox-1.38.0/busybox", "ash", "-n", "/dev/null") run("busybox-1.38.0/busybox", "true") }, #:package, fn() { run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", - "make", "-C", "busybox-1.38.0", target-cc, "EXTRA_CFLAGS=-I../uapi", + "make", "-C", "busybox-1.38.0", target-cc, string-append("CONFIG_PREFIX=", pkgdir()), "install") run("install", "-Dm644", "busybox-1.38.0/LICENSE", string-append(pkgdir(), "/usr/share/licenses/busybox/LICENSE")) -- 2.56.1