如何为arm添加新的内核压缩模式

问题描述 投票:0回答:1

我目前使用的是4.9内核,不支持zstd压缩方式。但是,我想为其添加 zstd 压缩支持,但我不知道该怎么做。

尝试遵循在6.7内核的x86架构中添加zstd的方法,但似乎失败了。这可能是由于没有修改关键部分造成的。目前,我有: 1、在arch/arm/boot/compressed/decompress.c中添加以下代码:

#ifdef CONFIG_KERNEL_ZSTD
#include "../../../../lib/decompress_unzstd.c"
#endif

2、在 arch/arm/boot/compressed/Makefile 中添加以下行:

compress-$(CONFIG_KERNEL_ZSTD) = zstd

我还对 Makefile 进行了一些修改,以确保我可以在 kernel_menuconfig 中选择 zstd。但是,我不确定如何确定我是否有zstd的相关解压代码。我认为 decompress_unzstd.c 是相关代码。编译后,我收到以下错误:

/bin/sh: 1: Syntax error: ";" unexpected
make[7]: *** [arch/arm/boot/compressed/Makefile:187: arch/arm/boot/compressed/piggy_data] Error 2
make[6]: *** [arch/arm/boot/Makefile:62: arch/arm/boot/compressed/vmlinux] Error 2
make[5]: *** [arch/arm/Makefile:331: zImage] Error 2
linux linux-kernel arm kernel zstd
1个回答
0
投票

您应该在配置文件中添加以下配置,然后再次重新编译

CONFIG_CRYPTO_ZSTD=y
CONFIG_ZSTD_COMPRESS=y
CONFIG_ZSTD_DECOMPRESS=y
© www.soinside.com 2019 - 2024. All rights reserved.