From patchwork Sun Oct 12 16:49:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 398976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id A82B6140140 for ; Mon, 13 Oct 2014 03:49:15 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E3D10A191B; Sun, 12 Oct 2014 16:49:14 +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 nYnNEzFPK4gm; Sun, 12 Oct 2014 16:49:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id AC356A1788; Sun, 12 Oct 2014 16:49:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 68B6D1C2D3C for ; Sun, 12 Oct 2014 16:49:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 63CB591CA2 for ; Sun, 12 Oct 2014 16:49:11 +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 FmGGO2KhM2QY for ; Sun, 12 Oct 2014 16:49:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by whitealder.osuosl.org (Postfix) with ESMTPS id DB07691CA0 for ; Sun, 12 Oct 2014 16:49:09 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id m15so7051966wgh.28 for ; Sun, 12 Oct 2014 09:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=murhTtgzclPR32P3xwi8/fnVnH8ys1zDr2/5PNyPz60=; b=WGfvqP8byASAns3ldi7NFAO5aDakSNHG2rpFcXjYBSet72QkyamlumRiYU2ZFFcNT0 +UWFawNklxTj0zPn1oPiuXH38LdOu2isOn0+zX74y3eWL+hpXjkig6h4Q5lWSorrrPYU 5x3kxrbU3N9Q6FSVV7nWFwH/tszo3ERBFSCoozbHq3OBh7DWaviAaJEocQhqXRGgrfZO RjjSwSLLE57if/lAckN58/Y4OYigFl3LkFhoTB54n7ng80aur8A+teAqRlc47biSpolk LIoeNCMf/M8h8TSw7EhO92sApEScCWVrJ+QIljBsa7oLU5SD5FWywPK1iIcOQQE6MnIh wMUw== X-Received: by 10.180.101.39 with SMTP id fd7mr6043958wib.53.1413132548420; Sun, 12 Oct 2014 09:49:08 -0700 (PDT) Received: from abrodkin-8560l.lan (dsdf-4d0a7c97.pool.mediaWays.net. [77.10.124.151]) by mx.google.com with ESMTPSA id pc6sm13781854wjb.43.2014.10.12.09.49.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Oct 2014 09:49:07 -0700 (PDT) From: Alexey Brodkin X-Google-Original-From: Alexey Brodkin To: buildroot@buildroot.org Date: Sun, 12 Oct 2014 18:49:03 +0200 Message-Id: <1413132543-7148-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 1.9.3 Cc: Alexey Brodkin Subject: [Buildroot] [PATCH v2] linux-headers: allow use of headers from kernel "package" selected X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Karoly Kasza This is a re-work of http://patchwork.ozlabs.org/patch/346823/ In buildroot kernel headers used for building toolchain come from upstream kernel sources (even though user may specify version, but not origin). This change makes it possible to use exactly the same sources for both headers during toolchain building and for kernel building itself. Moreover if "kernel" is selected to be built by defaut its sources will be used for kernel headers on toolchain build. That way user might be sure that ABI mismatch won't happen between toolchain and kernel. Signed-off-by: Alexey Brodkin Signed-off-by: Karoly Kasza Cc: Peter Korsgaard --- Changes v1 -> v2: * Make sure "Custom kernel headers series" is selected so BR2_TOOLCHAIN_HEADERS_AT_LEAST is properly set. --- package/linux-headers/Config.in.host | 14 ++++++++++++-- package/linux-headers/linux-headers.mk | 7 +++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/package/linux-headers/Config.in.host b/package/linux-headers/Config.in.host index 101136a..4551daf 100644 --- a/package/linux-headers/Config.in.host +++ b/package/linux-headers/Config.in.host @@ -5,6 +5,7 @@ comment "Kernel Header Options" choice prompt "Kernel Headers" + default BR2_KERNEL_HEADERS_SAME_AS_KERNEL if BR2_LINUX_KERNEL default BR2_KERNEL_HEADERS_3_17 help Select the version of kernel header files you wish to use. @@ -69,6 +70,13 @@ choice config BR2_KERNEL_HEADERS_VERSION bool "Manually specified Linux version" + + config BR2_KERNEL_HEADERS_SAME_AS_KERNEL + bool "Use Linux kernel specified for target" + depends on BR2_LINUX_KERNEL + help + Use the Linux kernel specified for the target in + the Kernel menu. endchoice config BR2_DEFAULT_KERNEL_VERSION @@ -80,10 +88,12 @@ config BR2_DEFAULT_KERNEL_VERSION choice bool "Custom kernel headers series" - depends on BR2_KERNEL_HEADERS_VERSION + depends on BR2_KERNEL_HEADERS_VERSION || BR2_KERNEL_HEADERS_SAME_AS_KERNEL default BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_REALLY_OLD help - Set to the kernel headers series you manually set above. + Set to the kernel headers series you manually entered in + "linux version" field or matching version of specific kernel selected + for building in "kernel" section. This is used to hide/show some packages that have strict requirements on the version of kernel headers. diff --git a/package/linux-headers/linux-headers.mk b/package/linux-headers/linux-headers.mk index d770927..29a9b38 100644 --- a/package/linux-headers/linux-headers.mk +++ b/package/linux-headers/linux-headers.mk @@ -7,6 +7,12 @@ # This package is used to provide Linux kernel headers for the # internal toolchain backend. +ifeq ($(BR2_KERNEL_HEADERS_SAME_AS_KERNEL),y) +LINUX_HEADERS_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION)) +LINUX_HEADERS_SOURCE = $(LINUX_SOURCE) +LINUX_HEADERS_SITE = $(LINUX_SITE) +LINUX_HEADERS_SITE_METHOD = $(LINUX_SITE_METHOD) +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 @@ -14,6 +20,7 @@ else LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v3.x endif LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.xz +endif LINUX_HEADERS_INSTALL_STAGING = YES