Repository navigation
meta-aspeed: Compress raw arm64 kernels in the FIT - #316
louis-nexthop wants to merge 1 commit into
Conversation
71932e9 to
08a963c
Compare
|
Did you look at zstd compression? Usually we prefer that over lzma because it is significantly faster at decompression. |
|
Thanks for the pointer, @williamspatrick! I measured zstd on our AST2720 board. Three images, each the average of 3 reboots:
You were right about the decompression speed: with a zstd initramfs the kernel unpacks it 11x faster (24.6 → 2.2 s), and the BMC reaches The kernel turned out differently. It is small enough that U-Boot unpacks the lzma one in under 2 s, and with zstd it came out 1.1 MiB larger and slightly slower (1.93 vs 1.84 s), with no gain in time to login. So for this PR I'd keep the existing |
kernel_fitimage.bbclass always puts the kernel in the FIT uncompressed. That suits the AST2400-AST2600 zImage, which decompresses itself, but AST2700 machines boot a raw arm64 Image of about 23 MiB. Compress a raw Image with FIT_KERNEL_COMP_ALG (default "none"; "lzma" from ast2700.inc; "gzip" also accepted), as oe-core's kernel-fitimage does, and let U-Boot decompress it. Self-decompressing kernels are unchanged. Signed-off-by: Louis Maliyam <louis@nexthop.ai>
08a963c to
fbc1d84
Compare
|
SGTM |
Description
kernel_fitimage.bbclassalways puts the kernel in the FIT uncompressed. That suits the AST2400-AST2600 zImage, which decompresses itself, but AST2700 machines boot a raw arm64 Image of about 23 MiB.A raw Image is now compressed with
FIT_KERNEL_COMP_ALG(defaultnone;lzmaandgzipaccepted), as oe-core's kernel-fitimage does, and U-Boot decompresses it. Self-decompressing kernels are unchanged.Motivation
ast2700.incalready setsFIT_KERNEL_COMP_ALG ?= "lzma", but the class never reads it, so AST2700 FITs carry the kernel uncompressed. Honoring it shrinks the FIT by 15.6 MiB. Boot time stays about the same: U-Boot unpacks the lzma kernel in about 1.6 s, roughly what reading the saved 15.6 MiB from SPI costs.lzma stays the AST2700 default: a zstd kernel was 1.1 MiB larger and no faster to boot (measurements).
Test Plan
The same tree built for the AST2720 variant of Nexthop's BMC without and with this change (only
kernel_fitimage.bbclassdiffers):os-fit)FIT headers read from the two flash images:
U-Boot booting the compressed kernel on the board (ramdisk and fdt sections elided):