From patchwork Sat Aug 17 21:23:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert McCabe X-Patchwork-Id: 1148806 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=rockwellcollins.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 469tTz0HWyz9sDQ for ; Sun, 18 Aug 2019 07:23:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 80EEE85797; Sat, 17 Aug 2019 21:23:48 +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 0PccA8JoCUq2; Sat, 17 Aug 2019 21:23:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C426385784; Sat, 17 Aug 2019 21:23:47 +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 8AF631BF5A2 for ; Sat, 17 Aug 2019 21:23:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 87B0585BC9 for ; Sat, 17 Aug 2019 21:23:46 +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 ytrRVTeK+ehq for ; Sat, 17 Aug 2019 21:23:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs03.rockwellcollins.com (ch3vs03.rockwellcollins.com [205.175.226.47]) by whitealder.osuosl.org (Postfix) with ESMTPS id 38CBA85BBA for ; Sat, 17 Aug 2019 21:23:46 +0000 (UTC) Received: from ofwch3n02.rockwellcollins.com (HELO dtulimr02.rockwellcollins.com) ([205.175.226.14]) by ch3vs03.rockwellcollins.com with ESMTP; 17 Aug 2019 16:23:45 -0500 X-Received: from CRM18509.rockwellcollins.com (crm18509.rockwellcollins.com [10.142.9.154]) by dtulimr02.rockwellcollins.com (Postfix) with ESMTP id 0374820086; Sat, 17 Aug 2019 16:23:44 -0500 (CDT) From: robert.mccabe@rockwellcollins.com To: buildroot@buildroot.org Date: Sat, 17 Aug 2019 16:23:46 -0500 Message-Id: <20190817212346.2768-1-robert.mccabe@rockwellcollins.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH v4 1/1] br2-ext linux-kernel-extensions support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yann.morin.1998@free.fr MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: "McCabe, Robert J" Signed-off-by: McCabe, Robert J --- docs/manual/customize-outside-br.txt | 14 ++++++++++++++ linux/linux.mk | 13 +++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/docs/manual/customize-outside-br.txt b/docs/manual/customize-outside-br.txt index 6ab01bcb1f..0588c478e7 100644 --- a/docs/manual/customize-outside-br.txt +++ b/docs/manual/customize-outside-br.txt @@ -219,6 +219,12 @@ BR2_ROOTFS_OVERLAY=$(BR2_EXTERNAL_BAR_42_PATH)/board//overlay/ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=$(BR2_EXTERNAL_BAR_42_PATH)/board//kernel.config ---- +===== Custom linux-kernel-extensions + +Custom code may be added to the Linux kernel tree as discussed in +xref:linux-kernel-ext[] by adding +linux/linux-ext-*.mk+ to the +br2-external tree. + ===== Example layout Here is an example layout using all features of br2-external (the sample @@ -314,6 +320,14 @@ illustration, of course): | |$(eval $(toolchain-external-package)) | `---- | + |- linux/Config.ext.in + | |config BR2_LINUX_KERNEL_EXT_EXAMPLE_DRIVER + | | bool "example-external-driver" + | | help + | | Example external driver + | |--- + |- linux/linux-ext-example-driver.mk + | |- configs/my-board_defconfig | |BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_BAR_42_PATH)/patches/" | |BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_BAR_42_PATH)/board/my-board/overlay/" diff --git a/linux/linux.mk b/linux/linux.mk index 29d2f0ee69..921558eeb2 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -513,14 +513,19 @@ endef # # Note: our package infrastructure uses the full-path of the last-scanned # Makefile to determine what package we're currently defining, using the -# last directory component in the path. As such, including other Makefile, -# like below, before we call one of the *-package macro is usally not -# working. +# last directory component in the path. As such, including other Makefiles, +# like below, before we call one of the *-package macros usually doesn't +# work. # However, since the files we include here are in the same directory as # the current Makefile, we are OK. But this is a hard requirement: files -# included here *must* be in the same directory! +# included here *must* either be in this same directory OR within a +# another directory with the name "linux" (in the BR2_EXTERNAL case). include $(sort $(wildcard linux/linux-ext-*.mk)) +#Import linux-kernel-extensions from externals +include $(sort $(wildcard $(foreach ext,$(BR2_EXTERNAL_DIRS), \ + $(ext)/linux/linux-ext-*.mk))) + LINUX_PATCH_DEPENDENCIES += $(foreach ext,$(LINUX_EXTENSIONS),\ $(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),$(ext)))