Skip to contentSkip to conversation

kernel: Permit overriding of KERNEL_IMAGETYPE_FOR_MAKE

PATCH New Mike Crowe 1 participant 1 message May 2, 2018

lore
Share & tools
lore

Mike Crowe

author
#0 lore raw

PATCH 1/1 kernel: Permit overriding of KERNEL_IMAGETYPE_FOR_MAKE

Commit a1690131691507bbf5853540229b3ad775b836bf removed the ability of recipes to set KERNEL_IMAGETYPE_FOR_MAKE. Fix that by letting recipes continue to set their own KERNEL_IMAGETYPE_FOR_MAKE if they so wish. They may have been doing so for a while, and don't want to have their carefully-selected value trampled on by kernel.bbclass.

This may be required if the recipe itself wants to build one type of kernel, but post-process it into a different type, rather like the vmlinux->vmlinux.gz support provided by kernel.bbclass.

---
A similar change was originally submitted 2.5 years ago as
https://patchwork.openembedded.org/patch/106849/ but fell through the cracks.

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

 1 file changed, 6 insertions(+), 5 deletions(-)
meta/classes/kernel.bbclass +6 -5
index 78d6c30b07..6595a04fb1 100644
@@ -69,11 +69,12 @@ python __anonymous () {
         types = (alttype + ' ' + types).strip()
     d.setVar('KERNEL_IMAGETYPES', types)
 
-    # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz
-    # typeformake lists only valid kernel make targets, and post processing can be done after the kernel
-    # is built (such as using gzip to compress vmlinux)
-    typeformake = types.replace('vmlinux.gz', 'vmlinux')
-    d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
+    if not d.getVar('KERNEL_IMAGETYPE_FOR_MAKE'):
+        # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz
+        # typeformake lists only valid kernel make targets, and post processing can be done after the kernel
+        # is built (such as using gzip to compress vmlinux)
+        typeformake = types.replace('vmlinux.gz', 'vmlinux')
+        d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
 
     for type in types.split():
         typelower = type.lower()
Signature · 1 line
2.11.0