From: Romain Naour <romain.naour@gmail.com>
To: buildroot@buildroot.org
Cc: "Romain Naour" <romain.naour@gmail.com>,
"José Luis Salvador Rufo" <salvador.joseluis@gmail.com>
Subject: [Buildroot] [PATCHv2] package/zfs: Fix cross-platform-compilations
Date: Fri, 27 Aug 2021 11:17:43 +0200 [thread overview]
Message-ID: <20210827091743.2516027-1-romain.naour@gmail.com> (raw)
From: José Luis Salvador Rufo <salvador.joseluis@gmail.com>
This patch fixes the `make` executed from the `kernel.m4` in
cross-platform-compilations environments:
https://github.com/openzfs/zfs/blob/zfs-2.0.5/config/kernel.m4#L588
Fixes:
https://gitlab.com/kubu93/buildroot/-/jobs/1522848483
Signed-off-by: José Luis Salvador Rufo <salvador.joseluis@gmail.com>
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
v2: add a patch to remove DESTDIR used with INSTALL_MOD_PATH
Use LINUX_MAKE_FLAGS for ZFS_MAKE_ENV and ZFS_CONF_ENV
http://lists.busybox.net/pipermail/buildroot/2021-August/621350.html
---
...in-don-t-use-DESTDIR-and-INSTALL_MOD.patch | 44 +++++++++++++++++++
package/zfs/zfs.mk | 5 +++
2 files changed, 49 insertions(+)
create mode 100644 package/zfs/0001-module-Makefile.in-don-t-use-DESTDIR-and-INSTALL_MOD.patch
diff --git a/package/zfs/0001-module-Makefile.in-don-t-use-DESTDIR-and-INSTALL_MOD.patch b/package/zfs/0001-module-Makefile.in-don-t-use-DESTDIR-and-INSTALL_MOD.patch
new file mode 100644
index 0000000000..e1d0f91533
--- /dev/null
+++ b/package/zfs/0001-module-Makefile.in-don-t-use-DESTDIR-and-INSTALL_MOD.patch
@@ -0,0 +1,44 @@
+From 12851a8dbc0aeb8e48f21f1e0cb7b3123029594e Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Thu, 26 Aug 2021 23:12:31 +0200
+Subject: [PATCH] module/Makefile.in: don't use DESTDIR and INSTALL_MOD_PATH
+ together
+
+DESTDIR and INSTALL_MOD_PATH are usually set with absolute path
+by build system (Buildroot), so when used together it concatenates
+two absolute path.
+
+Keep INSTALL_MOD_PATH since it's set when building an out of tree
+kernel module.
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ module/Makefile.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/module/Makefile.in b/module/Makefile.in
+index 69caf4857..043f2bdea 100644
+--- a/module/Makefile.in
++++ b/module/Makefile.in
+@@ -76,15 +76,15 @@ clean: clean-@ac_system@
+ modules_install-Linux:
+ @# Install the kernel modules
+ $(MAKE) -C @LINUX_OBJ@ M=`pwd` modules_install \
+- INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
++ INSTALL_MOD_PATH=$(INSTALL_MOD_PATH) \
+ INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
+ KERNELRELEASE=@LINUX_VERSION@
+ @# Remove extraneous build products when packaging
+- kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
++ kmoddir=$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
+ if [ -n "$(DESTDIR)" ]; then \
+ find $$kmoddir -name 'modules.*' | xargs $(RM); \
+ fi
+- sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
++ sysmap=$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
+ if [ -f $$sysmap ]; then \
+ depmod -ae -F $$sysmap @LINUX_VERSION@; \
+ fi
+--
+2.31.1
+
diff --git a/package/zfs/zfs.mk b/package/zfs/zfs.mk
index 3b1afb419a..537d4ece15 100644
--- a/package/zfs/zfs.mk
+++ b/package/zfs/zfs.mk
@@ -13,6 +13,11 @@ ZFS_CPE_ID_PRODUCT = openzfs
ZFS_AUTORECONF = YES
+# cross compile environment for linux kernel module
+ZFS_MAKE_ENV = $(LINUX_MAKE_FLAGS)
+# `./configure` will execute a `make modules` test case
+ZFS_CONF_ENV = $(LINUX_MAKE_FLAGS)
+
ZFS_DEPENDENCIES = libaio openssl udev util-linux zlib
# sysvinit installs only a commented-out modules-load.d/ config file
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
next reply other threads:[~2021-08-27 9:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-27 9:17 Romain Naour [this message]
2021-08-27 20:48 ` [Buildroot] [PATCHv2] package/zfs: Fix cross-platform-compilations Yann E. MORIN
2021-08-27 21:27 ` Romain Naour
2021-08-28 11:27 ` Arnout Vandecappelle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210827091743.2516027-1-romain.naour@gmail.com \
--to=romain.naour@gmail.com \
--cc=buildroot@buildroot.org \
--cc=salvador.joseluis@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox