![](https://devsecops.edu.vn/wp-content/uploads/2024/03/he-thong-nen-khi-cua-tau-vu-tru.jpg)
Linux kernel module có thể được nén thành dạng gzip, xz, zstd khi biên dịch nhân Linux.
Linux kernel module được nén lại sẽ tiết kiệm được dung lượng lưu trữ, khi tải từ đĩa cứng lên RAM sẽ nhanh hơn bình thường và được tự giải nén trên RAM sẽ rất nhanh vì RAM là bộ nhớ tốc độ cao.
![](https://devsecops.edu.vn/wp-content/uploads/2024/03/linux-kernel-module-compression-mode-1024x867.png)
Module compression mode
This option allows you to choose the algorithm which will be used to
compress modules when 'make modules_install' is run. (or, you can
choose to not compress modules at all.)
External modules will also be compressed in the same way during the
installation.
For modules inside an initrd or initramfs, it's more efficient to
compress the whole initrd or initramfs instead.
This is fully compatible with signed modules.
Please note that the tool used to load modules needs to support the
corresponding algorithm. module-init-tools MAY support gzip, and kmod
MAY support gzip, xz and zstd.
Your build system needs to provide the appropriate compression tool
to compress the modules.
If in doubt, select 'None'.
Defined at kernel/module/Kconfig:270
Prompt: Module compression mode
Depends on: MODULES [=y]
Location:
-> Enable loadable module support (MODULES [=y])
-> Module compression mode (<choice> [=y])
Selected by [m]:
- MODULES [=y] && m
![](https://devsecops.edu.vn/wp-content/uploads/2024/03/linux-kernel-module-compression-mode-none-1024x602.png)
None
CONFIG_MODULE_COMPRESS_NONE:
Do not compress modules. The installed modules are suffixed
with .ko.
Symbol: MODULE_COMPRESS_NONE [=y]
Type : bool
Defined at kernel/module/Kconfig:294
Prompt: None
Depends on: <choice>
Location:
-> Enable loadable module support (MODULES [=y])
-> Module compression mode (<choice> [=y])
-> None (MODULE_COMPRESS_NONE [=y])
![](https://devsecops.edu.vn/wp-content/uploads/2024/03/linux-kernel-module-compression-mode-gzip-1024x603.png)
GZIP
CONFIG_MODULE_COMPRESS_GZIP:
Compress modules with GZIP. The installed modules are suffixed
with .ko.gz.
Symbol: MODULE_COMPRESS_GZIP [=n]
Type : bool
Defined at kernel/module/Kconfig:300
Prompt: GZIP
Depends on: <choice>
Location:
-> Enable loadable module support (MODULES [=y])
-> Module compression mode (<choice> [=y])
-> GZIP (MODULE_COMPRESS_GZIP [=n])
![](https://devsecops.edu.vn/wp-content/uploads/2024/03/linux-kernel-module-compression-mode-xz-1024x603.png)
XZ
CONFIG_MODULE_COMPRESS_XZ:
Compress modules with XZ. The installed modules are suffixed
with .ko.xz.
Symbol: MODULE_COMPRESS_XZ [=n]
Type : bool
Defined at kernel/module/Kconfig:306
Prompt: XZ
Depends on: <choice>
Location:
-> Enable loadable module support (MODULES [=y])
-> Module compression mode (<choice> [=y])
-> XZ (MODULE_COMPRESS_XZ [=n])
![](https://devsecops.edu.vn/wp-content/uploads/2024/03/linux-kernel-module-compression-mode-zstd-1024x605.png)
ZSTD
CONFIG_MODULE_COMPRESS_ZSTD:
Compress modules with ZSTD. The installed modules are suffixed
with .ko.zst.
Symbol: MODULE_COMPRESS_ZSTD [=n]
Type : bool
Defined at kernel/module/Kconfig:312
Prompt: ZSTD
Depends on: <choice>
Location:
-> Enable loadable module support (MODULES [=y])
-> Module compression mode (<choice> [=y])
-> ZSTD (MODULE_COMPRESS_ZSTD [=n])