Re: [PATCH] Compress kernel modules on installation.




On Sunday 2009-01-18 22:04, Sam Ravnborg wrote:

Can I ask you to redo this patch.
I want a way to swith off compression, but it should default be enable.
So if KBUILD_MODULE_NOCOMPRESS is undefined we will compress the modules
when we install them.

And add documentation to Documentation/kbuild/kbuild.txt too...

changes to previous:
- added choice for compress (none, -1, -2, ..., -9)
- documentation

parent ad2507ab58aa5a3e50b0482889882ff3adf6ef33 (v2.6.29-rc2-24-gad2507a)
commit 3fc20a79496c3c5c8d4b906ea7e2496de448002d
Author: Jan Engelhardt <jengelh@xxxxxxxxxx>
Date: Mon Jan 19 21:18:39 2009 +0100

kbuild: install modules gzipped

This saves lots of disk space. Yes we had discussions about gzip -6
having a better compression-per-time ratio, but the point is that
people doing the compression in the first place often do not care
about the amount of compression time as long as the final filesize
will be smaller (that's what LZMA does over bzip2, and what bzip2
does over gzip). The KBUILD_MODULES_COMPRESS make variable can be set
over the command line to tune the compression level to your need,
including disabling it entirely.

Signed-off-by: Jan Engelhardt <jengelh@xxxxxxxxxx>
---
Documentation/kbuild/kbuild.txt | 11 +++++++++++
scripts/Makefile.modinst | 6 +++++-
2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index 923f9dd..453ba6c 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -125,6 +125,17 @@ KBUILD_EXTRA_SYMBOLS
For modules use symbols from another modules.
See more details in modules.txt.

+KBUILD_MODULES_COMPRESS
+--------------------------------------------------
+By default, kbuild will compress modules with gzip -9 compression to
+reduce disk space. The KBUILD_MODULES_COMPRESS make parameter can be
+used to set an alternate compression level or disable compression
+entirely.
+Example for using the standard gzip compression level:
+ make KBUILD_MODULES_COMPRESS="-6"
+Disabling compression:
+ make KBUILD_MODULES_COMPRESS=""
+
ALLSOURCE_ARCHS
--------------------------------------------------
For tags/TAGS/cscope targets, you can specify more than one archs
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 18b4bf8..e0708b1 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -16,9 +16,13 @@ PHONY += $(modules)
__modinst: $(modules)
@:

+KBUILD_MODULES_COMPRESS ?= -9
quiet_cmd_modules_install = INSTALL $@
cmd_modules_install = mkdir -p $(2); \
- $(mod_strip_cmd) $@ $(2)/$(notdir $@) || cp $@ $(2)
+ $(mod_strip_cmd) $@ $(2)/$(notdir $@) || cp $@ $(2); \
+ $(if ${KBUILD_MODULES_COMPRESS}, \
+ gzip -f ${KBUILD_MODULES_COMPRESS} \
+ $(2)/$(notdir $@), )

# Modules built outside the kernel source tree go into extra by default
INSTALL_MOD_DIR ?= extra
--
# Created with git-export-patch
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [bzip2/lzma] fix for built-in initramfs issue
    ... architectures which don't do this style of kernel compression. ... available (bzip2 or lzma) or left uncompressed if none is available. ... Support loading of a gzip encoded initial ramdisk or cpio buffer. ... arch/$/Makefile to see the flags used before .incbin was introduced. ...
    (Linux-Kernel)
  • www.CeBeans.com - new program listings - Sep 21 2009
    ... Zipped file with maximum compression. ... The GZip compression/decompression is from ... when a new picture is detected in the folder the program GZips the JPEG ... Free man every round after five. ...
    (microsoft.public.pocketpc)
  • correction (Re: RFC, an ugly parser hack (and a bin-xml variant))
    ... > it is, well, signifigantly faster than my textual parser, largely because ... or maybe exceed that of gzip. ... and then rebuild the trees, which is faster than a pure-adaptive variant, ... but typically helps compression). ...
    (comp.text.xml)
  • RE: gzip compression for compact framework
    ... GzIp header and for the GetwebResponse methods i decompress it. ... I have implemented compression in my desktop application but cannot do it ... GetWebRequest and GetwebResponse did not exist before the SP3 and so had ...
    (microsoft.public.windowsce.app.development)
  • Re: gzip compression for compact framework
    ... i overridden the webservice's GetWebRequest method and add the ... GzIp header and for the GetwebResponse methods i decompress it. ... I have implemented compression in my desktop application but cannot do it ... install SP3 but even after this, VS2003 is not able to handle overriding ...
    (microsoft.public.windowsce.app.development)