xz kernel modules (Re: [packages/kernel] - updated config)

Elan Ruusamäe glen at pld-linux.org
Mon Jan 26 21:14:50 CET 2015


On 26.01.2015 22:06, Elan Ruusamäe wrote:
> On 26.01.2015 22:02, Elan Ruusamäe wrote:
>> i checked build logs and no match for "Stripping kernel modules" [1]:
>> http://buildlogs.pld-linux.org//index.php?dist=th&arch=x86_64&ok=1&ns=&cnt=50&off=0&name=kernel&id=87e395d9-22b0-4451-9554-774e0d2b1444 
>>
>> [1] 
>> https://github.com/pld-linux/rpm-build-macros/blob/auto/th/rpm-build-macros-1.706-1/rpm.macros#L578
>>
>> apparently kernel compresses themselves and our build automation just 
>> searches for "*o" only:
>> https://github.com/pld-linux/rpm-build-macros/blob/auto/th/rpm-build-macros-1.706-1/rpm.macros#L574-L583 
>>
>>
>
> our build automation does only *.o -> .gz:
>
> https://github.com/pld-linux/rpm-build-macros/blob/auto/th/rpm-build-macros-1.706-1/rpm.macros.kernel#L96-L115 
>
>
> so, where should this be continued? make kernel.spec not to compress 
> and update rpm-build-macros to use .xz?
> or vice versa?
>
> as stripping is done by rpm, and creating -debuginfo, would be 
> wasteful to decompress, strip, compress again... (we do so with man 
> pages btw)
>

i've done little bit of research and MODULE_COMPRESS does nothing else 
than invoke "gzip -n" after make install:

[~/rpm/packages/BUILD.x86_64-linux/kernel-3.18.3/linux-3.18] ➔ grep -r 
MODULE_COMPRESS_XZ .
./Makefile:# or CONFIG_MODULE_COMPRESS_XZ.
./Makefile:  ifdef CONFIG_MODULE_COMPRESS_XZ
./Makefile:  endif # CONFIG_MODULE_COMPRESS_XZ
./init/Kconfig:config MODULE_COMPRESS_XZ

so, i think we should turn it off and adjust rpm-build-macros to do xz 
compression.

ps: kernel /Makefile uses "gzip -n" and "xz":

# CONFIG_MODULE_COMPRESS, if defined, will cause module to be compressed
# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP
# or CONFIG_MODULE_COMPRESS_XZ.

mod_compress_cmd = true
ifdef CONFIG_MODULE_COMPRESS
   ifdef CONFIG_MODULE_COMPRESS_GZIP
     mod_compress_cmd = gzip -n
   endif # CONFIG_MODULE_COMPRESS_GZIP
   ifdef CONFIG_MODULE_COMPRESS_XZ
     mod_compress_cmd = xz
   endif # CONFIG_MODULE_COMPRESS_XZ
endif # CONFIG_MODULE_COMPRESS
export mod_compress_cmd

ps2: init/Kconfig says confirms that the CONFIG_MODULE_COMPRESS does 
nothing else than i already found (.c code is not affected by the option 
value):

config MODULE_COMPRESS
     bool "Compress modules on installation"
     depends on MODULES
     help
       This option compresses the kernel modules when 'make
       modules_install' is run.

       The modules will be compressed either using gzip or xz depend on the
       choice made in "Compression algorithm".

       module-init-tools has support for gzip format while kmod handle gzip
       and xz compressed modules.

       When a kernel module is installed from outside of the main kernel
       source and uses the Kbuild system for installing modules then that
       kernel module will also be compressed when it is installed.

       This option provides little benefit when the modules are to be 
used inside
       an initrd or initramfs, it generally is more efficient to 
compress the whole
       initrd or initramfs instead.

       This is fully compatible with signed modules while the signed 
module is
       compressed. module-init-tools or kmod handles decompression and 
provide to
       other layer the uncompressed but signed payload.

so we need to update run time kmod dependency as baggins updated only 
compile time dependency:
http://git.pld-linux.org/?p=packages/kernel.git;a=commitdiff;h=2910a805af715417c35d6061f5b56f8362158e89

-- 
glen



More information about the pld-devel-en mailing list