feat: support ZSTD-compressed kernel modules
Modern Linux kernels support zstd-compressed modules, which was added by commit 73f3d1b48f50 ("lib: Add zstd modules"). Commit c3d7ef377eb ("kbuild: add support for zstd compressed modules") added support of compressing modules with zstd to kernel Makefiles. libkmod >= 28 built with libzstd is also required.master
parent
4a76c187d0
commit
ce9af251af
|
@ -625,6 +625,7 @@ get_decompress_cmd() {
|
||||||
*.gz) echo 'gzip -f -d' ;;
|
*.gz) echo 'gzip -f -d' ;;
|
||||||
*.bz2) echo 'bzip2 -d' ;;
|
*.bz2) echo 'bzip2 -d' ;;
|
||||||
*.xz) echo 'xz -f -d' ;;
|
*.xz) echo 'xz -f -d' ;;
|
||||||
|
*.zst) echo 'zstd -f -d ' ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1271,6 +1271,7 @@ if [[ $no_kernel != yes ]] && [[ -d $srcmods ]]; then
|
||||||
case "$_mod" in
|
case "$_mod" in
|
||||||
*.ko.gz) kcompress=gzip ;;
|
*.ko.gz) kcompress=gzip ;;
|
||||||
*.ko.xz) kcompress=xz ;;
|
*.ko.xz) kcompress=xz ;;
|
||||||
|
*.ko.zst) kcompress=zstd ;;
|
||||||
esac
|
esac
|
||||||
if [[ $kcompress ]]; then
|
if [[ $kcompress ]]; then
|
||||||
if ! command -v "$kcompress" &> /dev/null; then
|
if ! command -v "$kcompress" &> /dev/null; then
|
||||||
|
|
|
@ -1937,6 +1937,10 @@ static int install_modules(int argc, char **argv)
|
||||||
int len = strlen(modname);
|
int len = strlen(modname);
|
||||||
modname[len - 6] = 0;
|
modname[len - 6] = 0;
|
||||||
}
|
}
|
||||||
|
if (endswith(modname, ".ko.zst")) {
|
||||||
|
int len = strlen(modname);
|
||||||
|
modname[len - 7] = 0;
|
||||||
|
}
|
||||||
r = kmod_module_new_from_lookup(ctx, modname, &modlist);
|
r = kmod_module_new_from_lookup(ctx, modname, &modlist);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
if (!arg_optional) {
|
if (!arg_optional) {
|
||||||
|
|
Loading…
Reference in New Issue