From patchwork Tue Aug 21 11:06:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Corbin X-Patchwork-Id: 960204 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.b="ObNbV7gl"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vnvT16Rxz9s4v for ; Tue, 21 Aug 2018 21:07:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0BE4D857BD; Tue, 21 Aug 2018 11:07:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TSeReH33rVyT; Tue, 21 Aug 2018 11:07:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 64E6D85ED4; Tue, 21 Aug 2018 11:07:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7E6F21CE765 for ; Tue, 21 Aug 2018 11:07:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 78A6187056 for ; Tue, 21 Aug 2018 11:07:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Lp287VlAioAx for ; Tue, 21 Aug 2018 11:07:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id 181228700E for ; Tue, 21 Aug 2018 11:07:25 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id c14-v6so2505262wmb.4 for ; Tue, 21 Aug 2018 04:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id; bh=psqbIVTbAUIT/1GPXxF7lsRNB7iRO4s5fy49yg7GDkU=; b=ObNbV7glhRf1mnQw0Rt8kKkXXZB056KXeOzqgurvyv7fBXvWRk0Yl99ML2OVeR9SgW Mi0ZCZPyur9bb1LpnvgcP2rMihPJnHha6Kj3/q1cc0Z2UYOVBasai+6eCYwHaxj3sAdi Yjd3dxyPxuJ0pbNR9eyOaVsxdRUM3eBX0i46uYRfDfdOhQLveKdXN7U4MSeDaSAmrI72 rXOrBqA6WhMs98f96AdxlAgRuR/fVojLGKcvB9ZToZaN/37UrRF3qBDu61Oe7Ms0LHvN wLU4r+WP92gjAeELx/lCEw4+UUqy4PgPXLAUl3sOzFZG6XQItH97Y5MU7LUSr1U++Qzf Veng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=psqbIVTbAUIT/1GPXxF7lsRNB7iRO4s5fy49yg7GDkU=; b=rTIgG9CrHJwzA3PQtV3kCtY/AokWKrteeG+5lOOb27TUTM0uEDkGew3mjU42GsgGxJ kf37rQsSMMlJ/kbf7VHyUD2yidEpdKjBqTnnFXOcX9l932t8pnM1pWxYtwjYlVdBTYQn ilwG8VxURPgHRbdyStSjPGW5u1p4uGSiPNEL6+f8VkT78hcjSFCFhvC6qJcfct6YfeIJ rg7JqTrCylM9nb+9b4B+4hQcIIN4tCn26Idrm71FTc1GNcMx0fnx5OVsnFWryh35zVpj qP/RznCPHqDeXJ5v0WgHQ3O2Zjeaqzwt8muMt2eN3jCEL4Zg7RbNRSgWLE1Iyx4nv+61 dtAg== X-Gm-Message-State: APzg51CSDyG2z8bfzHSqECKM7V3l79el43MWb/ty167N6fR2UgJVsKQ8 j/Xomvq5ukV+VSiy2Pv2WNg4TQ2gXhM= X-Google-Smtp-Source: AA+uWPzn/bnS3PCG3tI9vod/U+GjWzzo2GbOAExZDXLNncnsj6klBpK485TFTpQLGnSscm/dEs4hTw== X-Received: by 2002:a1c:8c49:: with SMTP id o70-v6mr3350333wmd.11.1534849643401; Tue, 21 Aug 2018 04:07:23 -0700 (PDT) Received: from localhost.localdomain (cust64-dsl91-135-5.idnet.net. [91.135.5.64]) by smtp.gmail.com with ESMTPSA id x16-v6sm9375869wro.84.2018.08.21.04.07.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 04:07:22 -0700 (PDT) From: Mark Corbin To: buildroot@buildroot.org Date: Tue, 21 Aug 2018 12:06:46 +0100 Message-Id: <20180821110646.5671-1-mark.corbin@embecosm.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH 1/1] Add support for building toolchains against custom kernel headers. X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Corbin MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Allows the selection of a manual version, custom tarball or custom git repository for the toolchain kernel headers. This enables toolchains to be built against custom kernel headers without having to build a full kernel. Signed-off-by: Mark Corbin --- package/linux-headers/Config.in.host | 48 +++++++++++++++++++++++++- package/linux-headers/linux-headers.mk | 18 +++++++--- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/package/linux-headers/Config.in.host b/package/linux-headers/Config.in.host index 783cc7ea3a..df2e2263c4 100644 --- a/package/linux-headers/Config.in.host +++ b/package/linux-headers/Config.in.host @@ -77,6 +77,31 @@ config BR2_KERNEL_HEADERS_4_17 config BR2_KERNEL_HEADERS_VERSION bool "Manually specified Linux version" + help + This option allows you to use a specific official version from + kernel.org, like 2.6.x, 2.6.x.y, 3.x.y, ... + + Note: you cannot use this option to select a _longterm_ 2.6 + kernel, because these kernels are not located at the standard + URL at kernel.org. Instead, select "Custom tarball" and + specify the right URL directly. + +config BR2_KERNEL_HEADERS_CUSTOM_TARBALL + bool "Custom tarball" + help + This option allows you to specify a URL pointing to a kernel + source tarball. This URL can use any protocol recognized by + Buildroot, like http://, ftp://, file:// or scp://. + + When pointing to a local tarball using file://, you may want + to use a make variable like $(TOPDIR) to reference the root of + the Buildroot tree. + +config BR2_KERNEL_HEADERS_CUSTOM_GIT + bool "Custom Git repository" + help + This option allows Buildroot to get the Linux kernel source + code from a Git repository. endchoice @@ -87,9 +112,27 @@ config BR2_DEFAULT_KERNEL_VERSION Specify the version you want to use. E.G.: 3.6.10 +config BR2_KERNEL_HEADERS_CUSTOM_TARBALL_LOCATION + string "URL of custom kernel tarball" + depends on BR2_KERNEL_HEADERS_CUSTOM_TARBALL + +if BR2_KERNEL_HEADERS_CUSTOM_GIT + +config BR2_KERNEL_HEADERS_CUSTOM_REPO_URL + string "URL of custom repository" + +config BR2_KERNEL_HEADERS_CUSTOM_REPO_VERSION + string "Custom repository version" + help + Revision to use in the typical format used by + Git/Mercurial/Subversion E.G. a sha id, a tag, branch, .. + +endif + choice bool "Custom kernel headers series" - depends on BR2_KERNEL_HEADERS_VERSION || BR2_KERNEL_HEADERS_AS_KERNEL + depends on BR2_KERNEL_HEADERS_VERSION || BR2_KERNEL_HEADERS_AS_KERNEL || \ + BR2_KERNEL_HEADERS_CUSTOM_TARBALL || BR2_KERNEL_HEADERS_CUSTOM_GIT help Specify the kernel headers series you manually selected, above. @@ -269,3 +312,6 @@ config BR2_DEFAULT_KERNEL_HEADERS default "4.16.18" if BR2_KERNEL_HEADERS_4_16 default "4.17.17" if BR2_KERNEL_HEADERS_4_17 default BR2_DEFAULT_KERNEL_VERSION if BR2_KERNEL_HEADERS_VERSION + default "custom" if BR2_KERNEL_HEADERS_CUSTOM_TARBALL + default BR2_KERNEL_HEADERS_CUSTOM_REPO_VERSION \ + if BR2_KERNEL_HEADERS_CUSTOM_GIT diff --git a/package/linux-headers/linux-headers.mk b/package/linux-headers/linux-headers.mk index 954c6b7978..3c2509e249 100644 --- a/package/linux-headers/linux-headers.mk +++ b/package/linux-headers/linux-headers.mk @@ -64,8 +64,18 @@ endef LINUX_HEADERS_POST_PATCH_HOOKS += LINUX_HEADERS_APPLY_LOCAL_PATCHES -else # ! BR2_KERNEL_HEADERS_AS_KERNEL - +else ifeq ($(BR2_KERNEL_HEADERS_CUSTOM_TARBALL),y) +LINUX_HEADERS_TARBALL = $(call qstrip,$(BR2_KERNEL_HEADERS_CUSTOM_TARBALL_LOCATION)) +LINUX_HEADERS_SITE = $(patsubst %/,%,$(dir $(LINUX_HEADERS_TARBALL))) +LINUX_HEADERS_SOURCE = $(notdir $(LINUX_HEADERS_TARBALL)) +BR_NO_CHECK_HASH_FOR += $(LINUX_HEADERS_SOURCE) +else ifeq ($(BR2_KERNEL_HEADERS_CUSTOM_GIT),y) +LINUX_HEADERS_VERSION = $(call qstrip,$(BR2_DEFAULT_KERNEL_HEADERS)) +LINUX_HEADERS_SITE = $(call qstrip,$(BR2_KERNEL_HEADERS_CUSTOM_REPO_URL)) +LINUX_HEADERS_SITE_METHOD = git +LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.gz +BR_NO_CHECK_HASH_FOR += $(LINUX_HEADERS_SOURCE) +else LINUX_HEADERS_VERSION = $(call qstrip,$(BR2_DEFAULT_KERNEL_HEADERS)) ifeq ($(findstring x2.6.,x$(LINUX_HEADERS_VERSION)),x2.6.) LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v2.6 @@ -80,7 +90,7 @@ ifeq ($(BR2_KERNEL_HEADERS_VERSION),y) BR_NO_CHECK_HASH_FOR += $(LINUX_HEADERS_SOURCE) endif -endif # ! BR2_KERNEL_HEADERS_AS_KERNEL +endif # linux-headers really is the same as the linux package LINUX_HEADERS_DL_SUBDIR = linux @@ -125,7 +135,7 @@ define LINUX_HEADERS_INSTALL_STAGING_CMDS headers_install) endef -ifeq ($(BR2_KERNEL_HEADERS_VERSION)$(BR2_KERNEL_HEADERS_AS_KERNEL),y) +ifeq ($(BR2_KERNEL_HEADERS_VERSION)$(BR2_KERNEL_HEADERS_AS_KERNEL)$(BR2_KERNEL_HEADERS_CUSTOM_TARBALL)$(BR2_KERNEL_HEADERS_CUSTOM_GIT),y) define LINUX_HEADERS_CHECK_VERSION $(call check_kernel_headers_version,\ $(STAGING_DIR),\