From 964b967c9e07c7108d785b168304ef6e3b1e5715 Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Sun, 16 Apr 2017 14:18:46 -0400 Subject: [PATCH] Use kernel headers from our Linux kernel tree (issue #188) --- modules/kernel-headers | 18 ------------------ modules/linux | 6 +++--- modules/musl | 12 +++++++++++- 3 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 modules/kernel-headers diff --git a/modules/kernel-headers b/modules/kernel-headers deleted file mode 100644 index 44f6853e..00000000 --- a/modules/kernel-headers +++ /dev/null @@ -1,18 +0,0 @@ -modules-y += kernel-headers - -# we install kernel-headers from sabotage linux, a musl-libc based -# distribution, that works well with busybox and other tools. - -kernel-headers_version := 3.12.6-5 -kernel-headers_dir := kernel-headers-$(kernel-headers_version) -kernel-headers_tar := kernel-headers-$(kernel-headers_version).tar.gz -kernel-headers_url := https://github.com/sabotage-linux/kernel-headers/archive/v$(kernel-headers_version).tar.gz -kernel-headers_hash := ecf4db8781dc50a21cbc4cb17b039f96aede53f9da13435a3201373abb49b96b - -kernel-headers_configure := - -kernel-headers_target := \ - ARCH=x86_64 \ - prefix="$(INSTALL)" \ - install - diff --git a/modules/linux b/modules/linux index 9522f984..b622ed70 100644 --- a/modules/linux +++ b/modules/linux @@ -12,7 +12,7 @@ linux_hash := $(linux-$(linux_version)_hash) linux_configure := \ $(MAKE) \ - CROSS_COMPILE=$(pwd)/crossgcc/x86_64-linux-musl/bin/x86_64-linux-musl- \ + CROSS_COMPILE="$(CROSS)" \ oldconfig \ linux_output := arch/x86/boot/bzImage @@ -33,7 +33,7 @@ linux_modules-$(CONFIG_LINUX_USB) += drivers/usb/storage/usb-storage.ko EXTRA_FLAGS := -fdebug-prefix-map=$(pwd)=heads -gno-record-gcc-switches linux_target := \ - CROSS_COMPILE=$(pwd)/crossgcc/x86_64-linux-musl/bin/x86_64-linux-musl- \ + CROSS_COMPILE="$(CROSS)" \ AFLAGS_KERNEL="$(EXTRA_FLAGS)" \ CFLAGS_KERNEL="$(EXTRA_FLAGS)" \ CFLAGS_MODULE="$(EXTRA_FLAGS)" \ @@ -41,7 +41,7 @@ linux_target := \ KBUILD_BUILD_HOST=heads-build \ KBUILD_BUILD_TIMESTAMP="1970-00-00" \ KBUILD_BUILD_VERSION=0 \ - -j $(MAKE_JOBS) \ + $(MAKE_JOBS) \ # We cross compile linux now linux_depends := musl-cross diff --git a/modules/musl b/modules/musl index a9680815..3cca3970 100644 --- a/modules/musl +++ b/modules/musl @@ -33,4 +33,14 @@ musl_libraries := \ lib/libc.so \ -musl_depends := kernel-headers musl-cross +musl_depends := musl-cross + +# Fake a target so that musl will force a header install by the +# Linux kernel sources. +musl.intermediate: $(INSTALL)/include/linux/limits.h +$(INSTALL)/include/linux/limits.h: $(build)/$(linux_dir)/.canary + $(MAKE) \ + -C "$(build)/$(linux_dir)" \ + INSTALL_HDR_PATH="$(INSTALL)" \ + headers_install +