Skip to contentSkip to conversation

kernel.bbclass: add lz4 dependency and fix the call to lz4

PATCH Superseded T. Ulrich 2 participants 3 messages Jul 3, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

T. Ulrich

author
#0 lore raw

PATCH 1/1 kernel.bbclass: add lz4 dependency and fix the call to lz4

From: Timon Ulrich <[email protected]>

If the initramfs image is type lz4, then a native lz4 is needed.

Additionally an output filename needs to be specified when calling lz4, otherwise STDOUT will be used implicitly.

---
 meta/classes/kernel.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/kernel.bbclass +2 -2
index 6d07b29e2d..add0b13bcb 100644
@@ -4,7 +4,7 @@ KERNEL_PACKAGE_NAME ??= "kernel"
 KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
 
 PROVIDES += "${@ "virtual/kernel" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else "" }"
-DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native lzop-native bison-native"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native lzop-native lz4-native bison-native"
 PACKAGE_WRITE_DEPS += "depmodwrapper-cross"
 
 do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot"
@@ -210,7 +210,7 @@ copy_initramfs() {
 				;;
 			*lz4)
 				echo "lz4 decompressing image"
-				lz4 -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
+				lz4 -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
 				break
 				;;
 			*lzo)
Signature · 1 line
2.17.1
#1 lore raw
Quoted 11 lines · T. Ulrich

From: Timon Ulrich <[email protected]>

If the initramfs image is type lz4, then a native lz4 is needed.

Additionally an output filename needs to be specified when calling lz4, otherwise STDOUT will be used implicitly.

---
 meta/classes/kernel.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I really don't like building tools just because we might need them. Is there a way we can tell which compression format is being used for the initramfs and make the dependencies conditional?

Cheers,

Richard

author
#2 lore raw

Re: [OE-core] [PATCH] kernel.bbclass: add lz4 dependency and fixthe call to lz4

Quoted 2 lines

Is there a way we can tell which compression format is being used for the initramfs and make the dependencies conditional?

Checking whether INITRAMFS_FSTYPES contains 'cpio.lz4' might do the trick. I'll see into it and prepare a V2.
 Von: Richard Purdie <[email protected]> Gesendet:03.07.2020 12:42
An:T. Ulrich <[email protected]>,<[email protected]> Kopie:Timon Ulrich <[email protected]>

Quoted 11 lines · T. Ulrich

From: Timon Ulrich <[email protected]>

If the initramfs image is type lz4, then a native lz4 is needed.

Additionally an output filename needs to be specified when calling lz4, otherwise STDOUT will be used implicitly.

---
meta/classes/kernel.bbclass | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)

I really don't like building tools just because we might need them. Is there a way we can tell which compression format is being used for the initramfs and make the dependencies conditional?

Cheers,

Richard