From patchwork Mon Nov 9 16:58:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1396924 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=W/Gi8vgL; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CVHHp06s1z9sRK for ; Tue, 10 Nov 2020 03:58:14 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5970F872F5; Mon, 9 Nov 2020 16:58:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id laQ1CUhalXts; Mon, 9 Nov 2020 16:58:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id DDC7D87270; Mon, 9 Nov 2020 16:58:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 838511BF867 for ; Mon, 9 Nov 2020 16:58:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 801C387270 for ; Mon, 9 Nov 2020 16:58:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sao7b1dQbt5D for ; Mon, 9 Nov 2020 16:58:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id 5D4AD87254 for ; Mon, 9 Nov 2020 16:58:08 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id w24so58931wmi.0 for ; Mon, 09 Nov 2020 08:58:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CqyEtCWaW71vqVgOp1UI6AEgOyfOsJ5Yp3WYHF1MrOk=; b=W/Gi8vgL8hYUC2XpKp/ek/Swr0jv9GOxK7e3t3CI8OuC0mkaqmt5Rxtja6N4/4abZ4 fROVxSZqgmLql8rUUl8nDd9RkYCd0Sknmxragkrg7D7EULyafQck9ZkfMJXC44jkNrUK NH8Av5yVQAmGHfKV+bM/EnrQ8Zm/LBixYxz1k= 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:mime-version :content-transfer-encoding; bh=CqyEtCWaW71vqVgOp1UI6AEgOyfOsJ5Yp3WYHF1MrOk=; b=XpG8TKJBs+DUlgVrVhdQv5HLDW2brmnWgxTFc1aPx2fjsCHjmdMIccKIgH7y3YO+vC Jx13rJSMgmb8ipZffDX9GbVz96seu6sXdxsST40lDWI4CVayxrB1b+uiU9BJTzVfPLp2 xGEyqADwmb20lg3RCr8GdMp//I5PoEVoo5u4UQ4xOOdWV8WcoABOKCklgxW6MxnJtkvR Xn/5Cs+MaTathLcSsp94twuKtGBk9+3MdjdrCgFE/17gkc6mdiOlZEAurXBM6lUnYf+B JBpw/2ISL8vkTavvlLAlPmV0trcyXl5+Z6+92bwdCXGarj2skLqCoM7RrvDvNW5EVUER pbDg== X-Gm-Message-State: AOAM530XsoZr7ePPgsa+dCV6pIu1X3Nlk7rgvj0WX7jrK+yR8AnpmIxg BGOOpnHtDAK2NFhW8mJEwzhBZqclZyQ2iw== X-Google-Smtp-Source: ABdhPJyhzfrvvS421vellIlYLOcIIbVS9anNzOMLgEEEpmSpvm0QIZ08SerbvCEh8ItntTdIVt0OyQ== X-Received: by 2002:a05:600c:2cb4:: with SMTP id h20mr49270wmc.119.1604941086679; Mon, 09 Nov 2020 08:58:06 -0800 (PST) Received: from localhost.localdomain (host194055151094.static.fidoka.tech. [194.55.151.94]) by smtp.gmail.com with ESMTPSA id t12sm14013648wrm.25.2020.11.09.08.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 08:58:06 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Mon, 9 Nov 2020 17:58:03 +0100 Message-Id: <20201109165803.2415518-1-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/environment-setup: add better kernel handling 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: Angelo Compagnucci Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Exporting ARCH and KERNELDIR makes easier to compile an external kernel or out of tree kernel modules. Signed-off-by: Angelo Compagnucci Reviewed-by: Matt Weber --- package/environment-setup/environment-setup | 1 + package/environment-setup/environment-setup.mk | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/package/environment-setup/environment-setup b/package/environment-setup/environment-setup index 813aa01c7a..e9bc36fdd0 100644 --- a/package/environment-setup/environment-setup +++ b/package/environment-setup/environment-setup @@ -10,6 +10,7 @@ cat <<'EOF' Some tips: * PATH now contains the SDK utilities * Standard autotools variables (CC, LD, CFLAGS) are exported +* Kernel compilation variables (ARCH, CROSS_COMPILE, KERNELDIR) are exported * To configure do "./configure $CONFIGURE_FLAGS" or use the "configure" alias * To build CMake-based projects, use the "cmake" alias diff --git a/package/environment-setup/environment-setup.mk b/package/environment-setup/environment-setup.mk index fb87c6f0b7..fcad013f0d 100644 --- a/package/environment-setup/environment-setup.mk +++ b/package/environment-setup/environment-setup.mk @@ -11,6 +11,7 @@ define HOST_ENVIRONMENT_SETUP_INSTALL_CMDS for var in $(TARGET_CONFIGURE_OPTS); do \ printf "export \"$$var\"\n" >> $(ENVIRONMENT_SETUP_FILE); \ done + printf "export \"ARCH=$(KERNEL_ARCH)\"\n" >> $(ENVIRONMENT_SETUP_FILE) printf "export \"CROSS_COMPILE=$(TARGET_CROSS)\"\n" >> $(ENVIRONMENT_SETUP_FILE) printf "export \"CONFIGURE_FLAGS=--target=$(GNU_TARGET_NAME) \ --host=$(GNU_TARGET_NAME) \ @@ -31,6 +32,10 @@ define HOST_ENVIRONMENT_SETUP_INSTALL_CMDS $(ENVIRONMENT_SETUP_FILE) printf "export \"PATH=\$$SDK_PATH/bin:\$$SDK_PATH/sbin:\$$PATH\"\n" \ >> $(ENVIRONMENT_SETUP_FILE) + + $(if $(BR2_LINUX_KERNEL),\ + printf "export \"KERNELDIR=$(LINUX_BUILDDIR)\"\n" \ + >> $(ENVIRONMENT_SETUP_FILE),) endef $(eval $(host-generic-package))