From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6646963333394071552 X-Received: by 2002:a1c:ac87:: with SMTP id v129mr605733wme.20.1547616755698; Tue, 15 Jan 2019 21:32:35 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:8f06:: with SMTP id r6ls131248wmd.0.gmail; Tue, 15 Jan 2019 21:32:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Tj0z4CQCPevrpVRGFdl8z3sI7zhymfArvpIg9M57icxMFzp/Jv5zjb0ytHa709cZm0lMn X-Received: by 2002:a1c:aac9:: with SMTP id t192mr558436wme.23.1547616755115; Tue, 15 Jan 2019 21:32:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547616755; cv=none; d=google.com; s=arc-20160816; b=XxqshNVFUWu/per3wJO9SXny4IFWwhQDmjcjffiDszwUpdUaSjcc8oby51BL6AjYBF F7um7mctwvD7con0Xfs9Q5MPE7d94W3lSv5cR4nFm4iXfb7urf8ijdRr7nbIDX01xb1g 82rnHCsgILgVBbrHYpWkZqowFZwvr5R3aF6H9xrsJN9+EEw5HQJH2rFyEuT62qQgs1nM 8zGHKeO0JcqH8TBC04jEL1B1Cy4vbJO6Y2JTIACE1utEJF9gJ5K8dMQAEMSkP39L5nzK Kac7mpt49yZzOmz4gkQ5CucgpusukZWtGtqXkb8Um5WshDaMks315VG+xmP00l75H58y WhHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:to:from; bh=s9FWAkUsqV6U8KAZPsPRZQBuzcDXAx1K3KgPk5MgnZc=; b=CiB6eZYGd+Xu7Liowx8gTK9WlJaHlHgloITd5yo9NLowRMYtL6n6r9rWReOkVmy7AV qpFP9ukr6peoywobgdaDgi3CK9lZ3CUdc5Bc6rN+J2HaLEsSjtIpy0geg484BYIn0CDc ZUikmG5XYajPPFSqFK+lkd5KYdweItUdJLA7p7pDGXqjeP7NluwI11KQiAEb3O8IUYPO 0hWqrOyncWSZDpEZSB9wGlScZ3TSXDt0DomoAsv3ZCgQsxCRrD/TTKqBOsycJlSXEBrz jCyihy70xIY9PhyCNmPLk8xacGkPUwqUhc6+0RrJQAK9f59PB4ayM2poavP+ihiqfGA1 y+6A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id 69si2535236wrb.1.2019.01.15.21.32.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 21:32:35 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id x0G5WYGC031983 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 16 Jan 2019 06:32:34 +0100 Received: from md1f2u6c.ad001.siemens.net ([167.87.33.125]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x0G5WRoV011496 for ; Wed, 16 Jan 2019 06:32:34 +0100 From: Jan Kiszka To: isar-users Subject: [PATCH v3 13/14] linux-module: Simplify interface to module makefiles Date: Wed, 16 Jan 2019 06:32:26 +0100 Message-Id: <17f025da2591ba0c776f8a525841326650d489ea.1547616747.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: References: In-Reply-To: References: X-TUID: wkkeJHq+fs1O From: Jan Kiszka Not all module makefile respect DESTDIR nor even have build targets which take KDIR as input. So call the kernel makefile ourselves, just requiring the module makefile to provide Kbuild rules. Signed-off-by: Jan Kiszka --- RECIPE-API-CHANGELOG.md | 5 +++++ meta/recipes-kernel/linux-module/files/debian/rules | 6 ++++++ meta/recipes-kernel/linux-module/module.inc | 1 + 3 files changed, 12 insertions(+) diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md index 2bc1585..dcfbbee 100644 --- a/RECIPE-API-CHANGELOG.md +++ b/RECIPE-API-CHANGELOG.md @@ -131,3 +131,8 @@ In order to use the same file permissions for an input file to a dpkg-raw package on the build machine as well as on the target, its absolute target path needs to be listed in the PRESERVE_PERMS variable (space-separated list of files). Otherwise, default permissions are used. + +### Reduce requirements on custom module makefiles + +It's now sufficient to provide only kbuild rules. Makefile targets like modules +or modules_install as well as KDIR and DESTDIR evaluation are no longer needed. diff --git a/meta/recipes-kernel/linux-module/files/debian/rules b/meta/recipes-kernel/linux-module/files/debian/rules index 5c1d8be..7a89e41 100755 --- a/meta/recipes-kernel/linux-module/files/debian/rules +++ b/meta/recipes-kernel/linux-module/files/debian/rules @@ -21,5 +21,11 @@ ifneq (,$(findstring 86,$(DEB_HOST_GNU_CPU))) export ARCH=x86 endif +override_dh_auto_build: + $(MAKE) -C $(KDIR) M=$(PWD) modules + +override_dh_auto_install: + $(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_PATH=$(PWD)/debian/$(PN) modules_install + %: CFLAGS= LDFLAGS= dh $@ --parallel diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc index 5d85200..cb7b8ad 100644 --- a/meta/recipes-kernel/linux-module/module.inc +++ b/meta/recipes-kernel/linux-module/module.inc @@ -43,4 +43,5 @@ dpkg_runbuild_prepend() { export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_DEP} | \ grep "/lib/modules/.*/build") fi + export PN=${PN} } -- 2.16.4