Add target in Makefile to compress the module with XZ  after it's
installed. kmod can handle modules compressed with xz and it's replacing
module-init-tools.

Signed-off-by: Lucas De Marchi <[email protected]>
---
 Makefile                 |    6 +++++-
 scripts/Makefile.modinst |    7 +++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index baddcfe..f06f886 100644
--- a/Makefile
+++ b/Makefile
@@ -1104,9 +1104,10 @@ PHONY += modules_prepare
 modules_prepare: prepare scripts
 
 # Target to install modules
-PHONY += modules_install modules_install_gz
+PHONY += modules_install modules_install_gz modules_install_xz
 modules_install: _modinst_bare _modinst_post
 modules_install_gz: _modinst_gz _modinst_post
+modules_install_xz: _modinst_xz _modinst_post
 
 PHONY += _modinst_
 _modinst_:
@@ -1127,6 +1128,9 @@ _modinst_bare: _modinst_
 _modinst_gz: _modinst_
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst compression=gz
 
+_modinst_xz: _modinst_
+       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst compression=xz
+
 # This depmod is only for convenience to give the initial
 # boot a modules.dep even before / is mounted read-write.  However the
 # boot script depmod is the master version.
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 442f953..297c546 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -24,6 +24,9 @@ quiet_cmd_modules_install = INSTALL $@
 quiet_cmd_modules_compress_gz = GZ      [email protected]
       cmd_modules_compress_gz = gzip $(2)/$(notdir $@)
 
+quiet_cmd_modules_compress_xz = XZ      [email protected]
+      cmd_modules_compress_xz = xz $(2)/$(notdir $@)
+
 # Modules built outside the kernel source tree go into extra by default
 INSTALL_MOD_DIR ?= extra
 ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst 
%/,%,$(KBUILD_EXTMOD)),,$(@D))
@@ -34,6 +37,10 @@ $(modules):
        $(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
 ifeq ($(compression),gz)
        $(call cmd,modules_compress_gz,$(MODLIB)/$(modinst_dir))
+else
+ifeq ($(compression),xz)
+       $(call cmd,modules_compress_xz,$(MODLIB)/$(modinst_dir))
+endif
 endif
 
 
-- 
1.7.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to