kernel.bbclass: make dependency on lzop-native conditional
PATCH 1/1 kernel.bbclass: make dependency on lzop-native conditional
From: Timon Ulrich <[email protected]>
a native lzop is only needed when an lzo compressed initramfs is actually present
--- meta/classes/kernel.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +2 -1
@@ -4,7 +4,8 @@ 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 bison-native" +DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", "lzop-native", "", d)}" DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", "lz4-native", "", d)}" PACKAGE_WRITE_DEPS += "depmodwrapper-cross"
Signature · 1 line
2.17.1
Quoted 4 lines · T. Ulrich
From: Timon Ulrich <[email protected]>
a native lzop is only needed when an lzo compressed initramfs is actually present
Is the logic actually that native lzop is only needed if an lzo compressed initramfs is present AND and a plain .cpio or .cpio.gz is NOT present?
Quoted 24 lines
Signed-off-by Timon Ulrich <[email protected]>--- meta/classes/kernel.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)meta/classes/kernel.bbclass +2
-2@@ -4,7 +4,8 @@ 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 bison-native" +DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", "lzop-native", "", d)}" DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", "lz4-native", "", d)}" PACKAGE_WRITE_DEPS += "depmodwrapper-cross" --2.17.1
Quoted 3 lines
Is the logic actually that native lzop is only needed if an lzo compressed initramfs is present AND and a plain .cpio or .cpio.gz is NOT present?
Yes, that is the case. If a plain cpio is present then there's no need to uncompress, hence there's no need for lzop-native.
IMO this patch still improves the behavior:
before lzop-native would be built regardless,
now it gets if it _might_ be necessary.
Am 07.07.2020 um 21:47 schrieb Andre McCurdy:
Quoted 33 lines · T. Ulrich
Quoted 3 lines
From: Timon Ulrich <[email protected]>
a native lzop is only needed when an lzo compressed initramfs is actually present
Is the logic actually that native lzop is only needed if an lzo compressed initramfs is present AND and a plain .cpio or .cpio.gz is NOT present?
Quoted 20 lines
Signed-off-by Timon Ulrich <[email protected]>--- meta/classes/kernel.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)meta/classes/kernel.bbclass +2
-2@@ -4,7 +4,8 @@ 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 bison-native" +DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", "lzop-native", "", d)}" DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", "lz4-native", "", d)}" PACKAGE_WRITE_DEPS += "depmodwrapper-cross" --Quoted 4 lines
2.17.1
.
Quoted 10 lines · Andre McCurdy
Quoted 4 lines · T. Ulrich
From: Timon Ulrich <[email protected]>
a native lzop is only needed when an lzo compressed initramfs is actually present
Is the logic actually that native lzop is only needed if an lzo compressed initramfs is present AND and a plain .cpio or .cpio.gz is NOT present?
This patch improves things but as you point out there appears to be further room for improvement. Not sure how much more ugly implementing that logic would be and whether its worth it...
Cheers,
Richard
Quoted 9 lines · Richard Purdie
Quoted 7 lines · Andre McCurdy
Quoted 4 lines · T. Ulrich
From: Timon Ulrich <[email protected]>
a native lzop is only needed when an lzo compressed initramfs is actually present
Quoted 7 lines
Quoted 3 lines
Is the logic actually that native lzop is only needed if an lzo compressed initramfs is present AND and a plain .cpio or .cpio.gz is NOT present?
This patch improves things but as you point out there appears to be further room for improvement. Not sure how much more ugly implementing that logic would be and whether its worth it...
Then we should at least add a comment explaining the real dependency, even if coding it is too ugly.
Alternatively we could simplify the code significantly and remove all the -native dependencies by just stating that if you want to bundle an initramfs then you need to include "cpio" or "cpio.gz" in INITRAMFS_FSTYPES...