Skip to contentSkip to conversation

meta:kernel-uboot: Support lzma compressed algorithm

PATCH New Jamin Lin 1 participant 1 message Nov 20, 2024

lore
Share & tools
lore

Jamin Lin

author
#0 lore raw

PATCH 1/1 meta:kernel-uboot: Support lzma compressed algorithm

Linux kernel supports to compress its output binary with lzma algorithm and U-Boot support to decompress lzma compressed image.

Both xz and lzma algorithms are identical and users can use xz utility with format parameter to compress Image which supports lzma algorithm.

Add the following command to support lzma. This command is refer to Linux kernel, https://github.com/torvalds/linux/blob/master/arch/powerpc/boot/wrapper

"xz --format=lzma -f -6 linux.bin"

---
 meta/classes-recipe/kernel-uboot.bbclass | 2 ++
 1 file changed, 2 insertions(+)
meta/classes-recipe/kernel-uboot.bbclass +2 -0
index 30a85ccc28..6d4aff6b11 100644
@@ -41,6 +41,8 @@ uboot_prep_kimage() {
 			gzip -9 linux.bin
 		elif [ "${linux_comp}" = "lzo" ] ; then
 			lzop -9 linux.bin
+		elif [ "${linux_comp}" = "lzma" ] ; then
+			xz --format=lzma -f -6 linux.bin
 		fi
 		mv -f "linux.bin${linux_suffix}" linux.bin
 	fi
Signature · 1 line
2.25.1