initrd_compression_for_image

Function initrd_compression_for_image 

Source
pub fn initrd_compression_for_image(image: &Path) -> InitrdCompression
Expand description

Initrd compression the kernel behind image can unpack, discovered from the config file that sits beside the image in its cache entry (<entry>/bzImage + <entry>/config). No config (built kernels pin CONFIG_RD_LZ4=y via ktstr.kconfig; raw images carry no sidecar) defaults to LZ4 — today’s behavior. With a config, the first of RD_LZ4 / RD_ZSTD / RD_GZIP the kernel enables wins, falling back to uncompressed cpio (which needs no CONFIG_RD_*) when it enables none. Callers pass the result to KtstrVmBuilder::initrd_compression (crate-private) unconditionally.