From patchwork Thu May 11 21:33:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 761365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 3wP5yF0Qq5z9s7j for ; Fri, 12 May 2017 07:36:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="p+y7iPMI"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="umRwNcfF"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AQgw3RkkEirnLAtWZFqghyyIIwbEsgr8WD2sm1uo8no=; b=p+y7iPMIre8auj xnw5kqszus2ghNAPmyG+ObnqX3YDpi467rcdfmKEEZIhriXpEpmHw4AthYNZbivqHP4yy/P9OW+Z1 mks3kP/SC7ATwzcASDosAuS2Lb1B9FPtkZCzmEKHiDVqxOUOY/96n7jeabdL0lZDR45Uyu/HFdf9J y6aIE6Uww/aGQ/aUICjJtU/VpkfmMmTTg2Le2uRsb13saGigoGqyvqSIn4cRXXFQ5zcpgguvaKw1O XApEbnQJeHVqc99U8lXMiWsSqmbZtKn6F87Az4looYKuvcYdoGzcWjdKyH2K5g5E2O0FwvxcieSXk pZyVKOezyI2CVGrh88Hg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d8vke-0005UC-K9; Thu, 11 May 2017 21:36:00 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d8vkP-00057o-UC for lede-dev@lists.infradead.org; Thu, 11 May 2017 21:35:47 +0000 Received: by mail-pg0-x242.google.com with SMTP id u187so4973484pgb.1 for ; Thu, 11 May 2017 14:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y1mFHgcSLsXWLAX9vcykmTnQJq/L40dzWCqSz0IROPE=; b=umRwNcfFzu/vsIYPY7t+fLDbLengxU/w6m+UoGlke6y5gUruhUrVW43ruo/efyZRga +TIPF7iFZBJ5LGJgpb1561agtTcaB5oaSewRZqstyHpqADdbqOfJOXJaPtMk3LFQ6b7H TeD2y1bU2tcr6wlAxmTHdzwz40xPDPiv4Eg2gpi0/krUQNyFKoguF3lc3ZOihjrCqzil X+4Y5T7WPGTn9fpwAPV52i8IDaJfBKd4usmLIBbxEvrlQxMlGA/0boWwzHfIUwgi+h45 4BqJKjF8VvCOr9jybway3T52AjNdt21iQ2urfuFlawZCMT4MO6oBNI3/jokBxbtmbsvK tY6A== 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:in-reply-to :references; bh=Y1mFHgcSLsXWLAX9vcykmTnQJq/L40dzWCqSz0IROPE=; b=T2vbg5QPRejPsyGjuQd15Fl3FrNhjAbBA8g3ua02e4ZswOtgJXPm/nUdwYNiGtnbPZ Ilj0GoaEuQY+d1z+Ni955aXAb4TvT2OibHPW6iO8unIU5zWU7p2EhKMmK++HFLOvYYRb f2LubIwrgzvv5uaNJiOJoWQggqVChBoT1Kx4C04td718xKLwle1/XycC1/fB2K1cNw+A l40oVj8X8PzFEj2yweT+aODMMhEBzAhgJFAYUGRE6eAPXIwkScoYRC6J33P118KkP5fj bBm14URAOAtSx44JEpHGaot8CIE7xC6/4N9Jdht8qHlZP/Zups9Q+cf5nEB0xPhK5OGG R3xQ== X-Gm-Message-State: AODbwcCtFEQNdiV/wjs5ih99KkCHycV5N9ooiVvvuFNWwGfg6rWsT3vT 1z0kJb8y2fejlQ== X-Received: by 10.84.238.206 with SMTP id l14mr744787pln.189.1494538529117; Thu, 11 May 2017 14:35:29 -0700 (PDT) Received: from stb-bld-03.irv.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id m24sm1696008pfi.129.2017.05.11.14.35.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 14:35:28 -0700 (PDT) From: Florian Fainelli To: lede-dev@lists.infradead.org Date: Thu, 11 May 2017 14:33:43 -0700 Message-Id: <20170511213343.7332-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170511213343.7332-1-f.fainelli@gmail.com> References: <20170511213343.7332-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170511_143545_995626_FDBE00DE X-CRM114-Status: UNSURE ( 7.85 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [LEDE-DEV] [PATCH 3/3] include: Determine MODULES_DIR correctly for external/git kernels X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , Josua Mayer , nbd@nbd.name MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When using external or git cloned kernels, any kind of modifications will alter KERNELRELEASE. LEDE still tries to stage modules in lib/modules/$(LINUX_UNAME_VERSION) and LINUX_UNAME_VERSION is based on KERNEL_PATCHVER (indirectly) so this does not work, and we lose all kinds of automatic modules loading. To remedy that, just cat $(LINUX_DIR)/include/config/kernel.release which is late enough the kernel has prepared this file, and is correctly tracking changes done throughout the kernel. Signed-off-by: Florian Fainelli --- include/kernel.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/kernel.mk b/include/kernel.mk index 2314ec73aa1f..7effca3832d6 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -51,17 +51,19 @@ else LINUX_UNAME_VERSION:=$(LINUX_UNAME_VERSION)-$(strip $(lastword $(subst -, ,$(LINUX_VERSION)))) endif - MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION) - TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR) - LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz TESTING:=$(if $(findstring -rc,$(LINUX_VERSION)),/testing,) ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),) LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x$(TESTING) + else + LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release)) endif + MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION) + TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR) + ifneq ($(TARGET_BUILD),1) PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION)) endif