From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6646634757804261376 X-Received: by 2002:a05:6000:100d:: with SMTP id a13mr146859wrx.2.1547542525567; Tue, 15 Jan 2019 00:55:25 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:280a:: with SMTP id o10ls300827wmo.11.gmail; Tue, 15 Jan 2019 00:55:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN5dNQ5s5oE5vSXp42dkzWBhknDISHSdFQbOG+yk9F+jZvCUfJeZVdMUCDUOdcqJ6rwxw/2G X-Received: by 2002:a7b:c414:: with SMTP id k20mr239599wmi.8.1547542525048; Tue, 15 Jan 2019 00:55:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547542525; cv=none; d=google.com; s=arc-20160816; b=MGBKg4pfH2VwiVIa65FkL5bhWg8QsrcxwTjk+qskj2TF9eo9j/BXv7yqAfnOHdEPnR Ld7zJcPGRAxqOviUgWEsqW/Lc1z/gFV7RJs0u58Ij5j+hq0iitlsKqKcE1JjymIeGhf6 rsYNZ0oCoLEHcinXeGnaDyG3GN658ZrYcJKQHLq8TVmbnvKY9elfz8fbMYc+d2SeW1w5 ck/b9spDTPiyvIj2kYGuaxZkDp/3Qg4jIUH0hAs78I9jV/+IbJo87riTykeulPC2EaVJ bK/hpUu5TptPO9I043+tuiAT0t5F67rfDb347ojxg2/RCizSTtFKeM/6asUUJJ+Fery8 uWGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:subject; bh=qnseecLPk9Kp+puJi3Sv2SjDJnimxkUFg8sQo2OpR98=; b=sQkmJ9lN7kC8xcpWXOVoASGGGDMw5k6DR6jtnr0jCYfO6k7CEAekXJ2cb7CjFOKb/o NWPeDWmG25LFfaG8LVL/W/l0NeA61siKVfXEDuaqdsff1K8kcNUfBicvY8r6itNJfk4b 8jcFgqRJ/Aw/9F8JZFUpWzFonLffjL2C/SlQvaDbsLNGLWB8KNC1pYaXUiuUZa+tq58F cbEnxty204IIdYzcnXB5DEL35n/Aui/PI7MttpI+BHnpJdkSfN8k+gWIa+LC0qvmWWOG to2aChZi1RVv2UDoh4b30NI6S9hvQNupX7YKJnXdyqpMoHrCxcNrlEm41gOvkcG2sb8D zhVA== 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 t23si444771wmt.1.2019.01.15.00.55.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 00:55:25 -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 mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id x0F8tONo011705 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 15 Jan 2019 09:55:24 +0100 Received: from [139.22.114.70] ([139.22.114.70]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x0F8tNAw005972 for ; Tue, 15 Jan 2019 09:55:24 +0100 Subject: [PATCH v2] linux-module: Simplify interface to module makefiles From: Jan Kiszka To: isar-users References: <0106a163-055a-2917-4388-35bd337ef64b@siemens.com> Message-ID: Date: Tue, 15 Jan 2019 09:55:23 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <0106a163-055a-2917-4388-35bd337ef64b@siemens.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: 767aqASr7+Zi 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 --- Changes in v2: - update RECIPE-API-CHANGELOG 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 06a01e3..832f0ed 100644 --- a/RECIPE-API-CHANGELOG.md +++ b/RECIPE-API-CHANGELOG.md @@ -124,3 +124,8 @@ updated hence recipes using them shouldn't be impacted per se. These packages depend on a specific kernel. Its identification is now appended to the binary package names in the form "-${KERNEL_NAME}". + +### 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