<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 19, 2016 at 4:56 AM,  <span dir="ltr">&lt;<a href="mailto:zhe.he@windriver.com" target="_blank">zhe.he@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: He Zhe &lt;<a href="mailto:zhe.he@windriver.com" target="_blank">zhe.he@windriver.com</a>&gt;<br>
<br>
Add KERNEL_IMAGETYPES to support building packaging and installing<br>
multi types of kernel images, such as zImage uImage, at one time.<br>
<br>
KERNEL_IMAGETYPE works as before. All KERNEL_ALT_IMAGETYPEs are<br>
replaced by KERNEL_IMAGETYPES.<br></blockquote><div><br></div><div> </div><div>I see that you have updated layers/configs with the new variable, but obviously you can&#39;t see all the </div><div>layers that may be using that old variable.</div><div><br></div><div>Isn&#39;t it possible to have a python routine that detects the old ALT_IMAGETYPE variable and</div><div>assigns it to the new one (if it isn&#39;t already set) ? Sort of like how distro features/features backfill</div><div>work ?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Fixes [YOCTO #6945].<br>
<br>
Signed-off-by: He Zhe &lt;<a href="mailto:zhe.he@windriver.com" target="_blank">zhe.he@windriver.com</a>&gt;<br>
---<br>
 documentation/ref-manual/ref-variables.xml         |  10 +-<br>
 meta-yocto-bsp/conf/machine/edgerouter.conf        |   2 +-<br>
 meta/classes/kernel-fitimage.bbclass               |  20 +--<br>
 meta/classes/kernel-grub.bbclass                   |  44 ++++--<br>
 meta/classes/kernel-uimage.bbclass                 |  22 +--<br>
 meta/classes/kernel.bbclass                        | 171 +++++++++++++++------<br>
 meta/conf/documentation.conf                       |   1 +<br>
 meta/conf/machine/qemumips.conf                    |   2 +-<br>
 meta/conf/machine/qemumips64.conf                  |   2 +-<br>
 meta/recipes-kernel/linux/linux-dtb.inc            |  49 +++---<br>
 .../target/arch/mips/conf/machine/machine.conf     |   2 +-<br>
 .../target/arch/mips64/conf/machine/machine.conf   |   2 +-<br>
 .../target/arch/qemu/conf/machine/machine.conf     |   2 +-<br>
 13 files changed, 214 insertions(+), 115 deletions(-)<br>
<br>
diff --git a/documentation/ref-manual/ref-variables.xml b/documentation/ref-manual/ref-variables.xml<br>
index a76a8c2..a8e4fd8 100644<br>
--- a/documentation/ref-manual/ref-variables.xml<br>
+++ b/documentation/ref-manual/ref-variables.xml<br>
@@ -6417,14 +6417,14 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = &quot;${INC_PR}.3&quot;<br>
             &lt;/glossdef&gt;<br>
         &lt;/glossentry&gt;<br>
<br>
-        &lt;glossentry id=&#39;var-KERNEL_ALT_IMAGETYPE&#39;&gt;&lt;glossterm&gt;KERNEL_ALT_IMAGETYPE&lt;/glossterm&gt;<br>
+        &lt;glossentry id=&#39;var-KERNEL_IMAGETYPES&#39;&gt;&lt;glossterm&gt;KERNEL_IMAGETYPES&lt;/glossterm&gt;<br>
             &lt;info&gt;<br>
-                KERNEL_ALT_IMAGETYPE[doc] = &quot;Specifies an alternate kernel image type for creation.&quot;<br>
+                KERNEL_IMAGETYPES[doc] = &quot;Specifies alternate kernel image types for creation.&quot;<br>
             &lt;/info&gt;<br>
             &lt;glossdef&gt;<br>
                 &lt;para role=&quot;glossdeffirst&quot;&gt;<br>
 &lt;!--                &lt;para role=&quot;glossdeffirst&quot;&gt;&lt;imagedata fileref=&quot;figures/define-generic.png&quot; /&gt; --&gt;<br>
-                    Specifies an alternate kernel image type for creation in<br>
+                    Specifies alternate kernel image types for creation in<br>
                     addition to the kernel image type specified using the<br>
                     &lt;link linkend=&#39;var-KERNEL_IMAGETYPE&#39;&gt;&lt;filename&gt;KERNEL_IMAGETYPE&lt;/filename&gt;&lt;/link&gt;<br>
                     variable.<br>
@@ -6612,8 +6612,8 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = &quot;${INC_PR}.3&quot;<br>
                 &lt;/para&gt;<br>
<br>
                 &lt;para&gt;<br>
-                    If you want to build an alternate kernel image type, use the<br>
-                    &lt;link linkend=&#39;var-KERNEL_ALT_IMAGETYPE&#39;&gt;&lt;filename&gt;KERNEL_ALT_IMAGETYPE&lt;/filename&gt;&lt;/link&gt;<br>
+                    If you want to build alternate kernel image types, use the<br>
+                    &lt;link linkend=&#39;var-KERNEL_IMAGETYPES&#39;&gt;&lt;filename&gt;KERNEL_IMAGETYPES&lt;/filename&gt;&lt;/link&gt;<br>
                     variable.<br>
                 &lt;/para&gt;<br>
             &lt;/glossdef&gt;<br>
diff --git a/meta-yocto-bsp/conf/machine/edgerouter.conf b/meta-yocto-bsp/conf/machine/edgerouter.conf<br>
index 476e690..affd568 100644<br>
--- a/meta-yocto-bsp/conf/machine/edgerouter.conf<br>
+++ b/meta-yocto-bsp/conf/machine/edgerouter.conf<br>
@@ -7,7 +7,7 @@ require conf/machine/include/tune-mips64.inc<br>
 MACHINE_FEATURES = &quot;pci ext2 ext3 serial&quot;<br>
<br>
 KERNEL_IMAGETYPE = &quot;vmlinux&quot;<br>
-KERNEL_ALT_IMAGETYPE = &quot;vmlinux.bin&quot;<br>
+KERNEL_IMAGETYPES = &quot;vmlinux.bin&quot;<br></blockquote><div><br></div><div>This now reads a bit ... odd (for back of a better description). I&#39;m concerned that it will cause</div><div>confusion, there are two variables:</div><div><br></div><div>KERNEL_IMAGETYPE and KERNEL_IMAGETYPES ..</div><div><br></div><div>They are very close in name, and just reading the variable doesn&#39;t really tell us why</div><div>we&#39;d set one and not the other. The old &quot;ALT&quot; made it more obvious.</div><div><br></div><div>But from the patch, KERNEL_IMAGETYPE isn&#39;t used, so does it have to be set at</div><div>all in these .conf files ? .. or maybe I missed where it is still used other than for</div><div>compatibility.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 KERNEL_IMAGE_STRIP_EXTRA_SECTIONS  = &quot;.comment&quot;<br>
<br>
 PREFERRED_PROVIDER_virtual/kernel ?= &quot;linux-yocto&quot;<br>
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass<br>
index f1b409c..51df19d 100644<br>
--- a/meta/classes/kernel-fitimage.bbclass<br>
+++ b/meta/classes/kernel-fitimage.bbclass<br>
@@ -1,8 +1,8 @@<br>
 inherit kernel-uboot<br>
<br>
 python __anonymous () {<br>
-    kerneltype = d.getVar(&#39;KERNEL_IMAGETYPE&#39;, True)<br>
-    if kerneltype == &#39;fitImage&#39;:<br>
+    kerneltypes = d.getVar(&#39;KERNEL_IMAGETYPES&#39;, True) or &quot;&quot;<br>
+    if &#39;fitImage&#39; in kerneltypes.split():<br>
         depends = d.getVar(&quot;DEPENDS&quot;, True)<br>
         depends = &quot;%s u-boot-mkimage-native dtc-native&quot; % depends<br>
         d.setVar(&quot;DEPENDS&quot;, depends)<br>
@@ -10,7 +10,9 @@ python __anonymous () {<br>
        # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal<br>
        # to kernel.bbclass . We have to override it, since we pack zImage<br>
        # (at least for now) into the fitImage .<br>
-        d.setVar(&quot;KERNEL_IMAGETYPE_FOR_MAKE&quot;, &quot;zImage&quot;)<br>
+        typeformake = d.getVar(&quot;KERNEL_IMAGETYPE_FOR_MAKE&quot;, True) or &quot;&quot;<br>
+        if &#39;fitImage&#39; in typeformake.split():<br>
+            d.setVar(&#39;KERNEL_IMAGETYPE_FOR_MAKE&#39;, typeformake.replace(&#39;fitImage&#39;, &#39;zImage&#39;))<br>
<br>
         image = d.getVar(&#39;INITRAMFS_IMAGE&#39;, True)<br>
         if image:<br>
@@ -154,7 +156,7 @@ EOF<br>
 }<br>
<br>
 do_assemble_fitimage() {<br>
-       if test &quot;x${KERNEL_IMAGETYPE}&quot; = &quot;xfitImage&quot; ; then<br>
+       if echo ${KERNEL_IMAGETYPES} | grep -Pq &quot;\bfitImage\b&quot;; then<br></blockquote><div><br></div><div>Not that it really matters, but grep -w would work here as well, and might read bit simpler.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                kernelcount=1<br>
                dtbcount=&quot;&quot;<br>
                rm -f fit-image.its<br>
@@ -217,14 +219,14 @@ addtask assemble_fitimage before do_install after do_compile<br>
<br>
 kernel_do_deploy_append() {<br>
        # Update deploy directory<br>
-       if test &quot;x${KERNEL_IMAGETYPE}&quot; = &quot;xfitImage&quot; ; then<br>
+       if echo ${KERNEL_IMAGETYPES} | grep -Pq &quot;\bfitImage\b&quot;; then<br>
                cd ${B}<br>
                echo &quot;Copying fit-image.its source file...&quot;<br>
-               its_base_name=&quot;${KERNEL_IMAGETYPE}-its-${PV}-${PR}-${MACHINE}-${DATETIME}&quot;<br>
-               its_symlink_name=${KERNEL_IMAGETYPE}-its-${MACHINE}<br>
+               its_base_name=&quot;fitImage-its-${PV}-${PR}-${MACHINE}-${DATETIME}&quot;<br>
+               its_symlink_name=fitImage-its-${MACHINE}<br>
                install -m 0644 fit-image.its ${DEPLOYDIR}/${its_base_name}.its<br>
-               linux_bin_base_name=&quot;${KERNEL_IMAGETYPE}-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}&quot;<br>
-               linux_bin_symlink_name=${KERNEL_IMAGETYPE}-linux.bin-${MACHINE}<br>
+               linux_bin_base_name=&quot;fitImage-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}&quot;<br>
+               linux_bin_symlink_name=fitImage-linux.bin-${MACHINE}<br>
                install -m 0644 linux.bin ${DEPLOYDIR}/${linux_bin_base_name}.bin<br>
<br>
                cd ${DEPLOYDIR}<br>
diff --git a/meta/classes/kernel-grub.bbclass b/meta/classes/kernel-grub.bbclass<br>
index a63f482..f7dcc07 100644<br>
--- a/meta/classes/kernel-grub.bbclass<br>
+++ b/meta/classes/kernel-grub.bbclass<br>
@@ -10,41 +10,44 @@<br>
 #   updates the new kernel as the boot priority.<br>
 #<br>
<br>
-pkg_preinst_kernel-image_append () {<br>
+python __anonymous () {<br></blockquote><div><br></div><div>Maybe it is just the patch context making me misread this, but can you elaborate on</div><div>what is changing here ?</div><div><br></div><div>Is it the old preinst is being replaced by anonymous python that generates the preinst as</div><div>a string, and that this injected into the package via the python ? Are we guaranteed</div><div>to run the anonymous python at the right time ? .. I&#39;ve been burned by that before, so</div><div>I wanted to check that it has been considered.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+    import re<br>
+<br>
+    preinst = &#39;&#39;&#39;<br>
        # Parsing confliction<br>
        [ -f &quot;$D/boot/grub/menu.list&quot; ] &amp;&amp; grubcfg=&quot;$D/boot/grub/menu.list&quot;<br>
        [ -f &quot;$D/boot/grub/grub.cfg&quot; ] &amp;&amp; grubcfg=&quot;$D/boot/grub/grub.cfg&quot;<br>
        if [ -n &quot;$grubcfg&quot; ]; then<br>
                # Dereference symlink to avoid confliction with new kernel name.<br>
-               if grep -q &quot;/${KERNEL_IMAGETYPE} \+root=&quot; $grubcfg; then<br>
-                       if [ -L &quot;$D/boot/${KERNEL_IMAGETYPE}&quot; ]; then<br>
-                               kimage=`realpath $D/boot/${KERNEL_IMAGETYPE} 2&gt;/dev/null`<br>
+               if grep -q &quot;/KERNEL_IMAGETYPE \+root=&quot; $grubcfg; then<br></blockquote><div><br></div><div>It&#39;s lines like these that made me ask my question above. This looks like its checking the</div><div>grubcfg on disk. Is that same grep going to work in this anonymous python .. or maybe this</div><div>isn&#39;t being run now, and only when the package is being installed ? I&#39;m most likely missing</div><div>something.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                       if [ -L &quot;$D/boot/KERNEL_IMAGETYPE&quot; ]; then<br>
+                               kimage=`realpath $D/boot/KERNEL_IMAGETYPE 2&gt;/dev/null`<br>
                                if [ -f &quot;$D$kimage&quot; ]; then<br>
-                                       sed -i &quot;s:${KERNEL_IMAGETYPE} \+root=:${kimage##*/} root=:&quot; $grubcfg<br>
+                                       sed -i &quot;s:KERNEL_IMAGETYPE \+root=:${kimage##*/} root=:&quot; $grubcfg<br>
                                fi<br>
                        fi<br>
                fi<br>
<br>
                # Rename old kernel if it conflicts with new kernel name.<br>
-               if grep -q &quot;/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} \+root=&quot; $grubcfg; then<br>
-                       if [ -f &quot;$D/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}&quot; ]; then<br>
+               if grep -q &quot;/KERNEL_IMAGETYPE-${KERNEL_VERSION} \+root=&quot; $grubcfg; then<br>
+                       if [ -f &quot;$D/boot/KERNEL_IMAGETYPE-${KERNEL_VERSION}&quot; ]; then<br>
                                timestamp=`date +%s`<br>
-                               kimage=&quot;$D/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}-$timestamp-back&quot;<br>
-                               sed -i &quot;s:${KERNEL_IMAGETYPE}-${KERNEL_VERSION} \+root=:${kimage##*/} root=:&quot; $grubcfg<br>
-                               mv &quot;$D/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}&quot; &quot;$kimage&quot;<br>
+                               kimage=&quot;$D/boot/KERNEL_IMAGETYPE-${KERNEL_VERSION}-$timestamp-back&quot;<br>
+                               sed -i &quot;s:KERNEL_IMAGETYPE-${KERNEL_VERSION} \+root=:${kimage##*/} root=:&quot; $grubcfg<br>
+                               mv &quot;$D/boot/KERNEL_IMAGETYPE-${KERNEL_VERSION}&quot; &quot;$kimage&quot;<br>
                        fi<br>
                fi<br>
        fi<br>
-}<br>
+&#39;&#39;&#39;<br>
<br>
-pkg_postinst_kernel-image_prepend () {<br>
+    postinst = &#39;&#39;&#39;<br>
        get_new_grub_cfg() {<br>
                grubcfg=&quot;$1&quot;<br>
                old_image=&quot;$2&quot;<br>
-               title=&quot;Update ${KERNEL_IMAGETYPE}-${KERNEL_VERSION}-${PV}&quot;<br>
+               title=&quot;Update KERNEL_IMAGETYPE-${KERNEL_VERSION}-${PV}&quot;<br>
                if [ &quot;${grubcfg##*/}&quot; = &quot;grub.cfg&quot; ]; then<br>
                        rootfs=`grep &quot; *linux \+[^ ]\+ \+root=&quot; $grubcfg -m 1 | \<br>
-                                sed &quot;s#${old_image}#${old_image%/*}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}#&quot;`<br>
+                                sed &quot;s#${old_image}#${old_image%/*}/KERNEL_IMAGETYPE-${KERNEL_VERSION}#&quot;`<br>
<br>
                        echo &quot;menuentry \&quot;$title\&quot; {&quot;<br>
                        echo &quot;    set root=(hd0,1)&quot;<br>
@@ -52,7 +55,7 @@ pkg_postinst_kernel-image_prepend () {<br>
                        echo &quot;}&quot;<br>
                elif [ &quot;${grubcfg##*/}&quot; = &quot;menu.list&quot; ]; then<br>
                        rootfs=`grep &quot;kernel \+[^ ]\+ \+root=&quot; $grubcfg -m 1 | \<br>
-                                sed &quot;s#${old_image}#${old_image%/*}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}#&quot;`<br>
+                                sed &quot;s#${old_image}#${old_image%/*}/KERNEL_IMAGETYPE-${KERNEL_VERSION}#&quot;`<br>
<br>
                        echo &quot;default 0&quot;<br>
                        echo &quot;timeout 30&quot;<br>
@@ -87,5 +90,16 @@ pkg_postinst_kernel-image_prepend () {<br>
                mv $grubcfgtmp $grubcfg<br>
                echo &quot;Caution! Update kernel may affect kernel-module!&quot;<br>
        fi<br>
+&#39;&#39;&#39;<br>
+<br>
+    imagetypes = d.getVar(&#39;KERNEL_IMAGETYPES&#39;, True)<br>
+    imagetypes = re.sub(r&#39;\.gz$&#39;, &#39;&#39;, imagetypes)<br>
+<br>
+    for type in imagetypes.split():<br>
+        typelower = type.lower()<br>
+        preinst_append = preinst.replace(&#39;KERNEL_IMAGETYPE&#39;, type)<br>
+        postinst_prepend = postinst.replace(&#39;KERNEL_IMAGETYPE&#39;, type)<br>
+        d.setVar(&#39;pkg_preinst_kernel-image-&#39; + typelower + &#39;_append&#39;, preinst_append)<br>
+        d.setVar(&#39;pkg_postinst_kernel-image-&#39; + typelower + &#39;_prepend&#39;, postinst_prepend)<br>
 }<br>
<br>
diff --git a/meta/classes/kernel-uimage.bbclass b/meta/classes/kernel-uimage.bbclass<br>
index f73965b..a238ce4 100644<br>
--- a/meta/classes/kernel-uimage.bbclass<br>
+++ b/meta/classes/kernel-uimage.bbclass<br>
@@ -1,23 +1,25 @@<br>
 inherit kernel-uboot<br>
<br>
 python __anonymous () {<br>
-    kerneltype = d.getVar(&#39;KERNEL_IMAGETYPE&#39;, True)<br>
-    if kerneltype == &#39;uImage&#39;:<br>
+    if &quot;uImage&quot; in (d.getVar(&#39;KERNEL_IMAGETYPES&#39;, True) or &quot;&quot;).split():<br>
         depends = d.getVar(&quot;DEPENDS&quot;, True)<br>
         depends = &quot;%s u-boot-mkimage-native&quot; % depends<br>
         d.setVar(&quot;DEPENDS&quot;, depends)<br>
<br>
-       # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal<br>
-       # to kernel.bbclass . We override the variable here, since we need<br>
-       # to build uImage using the kernel build system if and only if<br>
-       # KEEPUIMAGE == yes. Otherwise, we pack compressed vmlinux into<br>
-       # the uImage .<br>
-       if d.getVar(&quot;KEEPUIMAGE&quot;, True) != &#39;yes&#39;:<br>
-            d.setVar(&quot;KERNEL_IMAGETYPE_FOR_MAKE&quot;, &quot;zImage&quot;)<br>
+        # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal<br>
+        # to kernel.bbclass . We override the variable here, since we need<br>
+        # to build uImage using the kernel build system if and only if<br>
+        # KEEPUIMAGE == yes. Otherwise, we pack compressed vmlinux into<br>
+        # the uImage .<br>
+        if d.getVar(&quot;KEEPUIMAGE&quot;, True) != &#39;yes&#39;:<br>
+            typeformake = d.getVar(&quot;KERNEL_IMAGETYPE_FOR_MAKE&quot;, True) or &quot;&quot;<br>
+            if &quot;uImage&quot; in typeformake.split():<br>
+                typeformake.replace(&#39;uImage&#39;, &#39;zImage&#39;)<br>
+            d.setVar(&#39;KERNEL_IMAGETYPE_FOR_MAKE&#39;, typeformake)<br>
 }<br>
<br>
 do_uboot_mkimage() {<br>
-       if test &quot;x${KERNEL_IMAGETYPE}&quot; = &quot;xuImage&quot; ; then<br>
+       if echo &quot;${KERNEL_IMAGETYPES}&quot; | grep -Pq &quot;\buImage\b&quot;; then<br>
                if test &quot;x${KEEPUIMAGE}&quot; != &quot;xyes&quot; ; then<br>
                        uboot_prep_kimage<br>
<br>
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass<br>
index c3eab50..6db2e2e 100644<br>
--- a/meta/classes/kernel.bbclass<br>
+++ b/meta/classes/kernel.bbclass<br>
@@ -16,12 +16,48 @@ INITRAMFS_IMAGE ?= &quot;&quot;<br>
 INITRAMFS_TASK ?= &quot;&quot;<br>
 INITRAMFS_IMAGE_BUNDLE ?= &quot;&quot;<br>
<br>
+# KERNEL_VERSION is extracted from source code. It is evaluated as<br>
+# None for the first parsing, since the code has not been fetched.<br>
+# After the code is fetched, it will be evaluated as real version<br>
+# number and cause kernel to be rebuilt. To avoid this, make<br>
+# KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on<br>
+# LINUX_VERSION which is a constant.<br>
+KERNEL_VERSION_NAME = &quot;${@d.getVar(&#39;KERNEL_VERSION&#39;, True) or &quot;&quot;}&quot;<br>
+KERNEL_VERSION_NAME[vardepvalue] = &quot;${LINUX_VERSION}&quot;<br>
+KERNEL_VERSION_PKG_NAME = &quot;${@legitimize_package_name(d.getVar(&#39;KERNEL_VERSION&#39;, True))}&quot;<br>
+KERNEL_VERSION_PKG_NAME[vardepvalue] = &quot;${LINUX_VERSION}&quot;<br>
+<br>
 python __anonymous () {<br>
     import re<br>
<br>
-    kerneltype = d.getVar(&#39;KERNEL_IMAGETYPE&#39;, True)<br>
+    type = d.getVar(&#39;KERNEL_IMAGETYPE&#39;, True) or &quot;&quot;<br></blockquote><div><br></div><div>Aha. Here is that use of KERNEL_IMAGETYPE. Like I mentioned for the alt image type, can&#39;t</div><div>this existing variable be checked, and then added to KERNEL_IMAGE_TYPES in some</div><div>python code ? That would simplify the code here, and also not require the two variables to </div><div>be kept around.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+    types = d.getVar(&#39;KERNEL_IMAGETYPES&#39;, True) or &quot;&quot;<br>
+    if type not in types.split():<br>
+        types = (type + &#39; &#39; + types).strip()<br>
+        d.setVar(&#39;KERNEL_IMAGETYPES&#39;, types)<br>
+    typeformake = re.sub(r&#39;\.gz&#39;, &#39;&#39;, types)<br>
+    d.setVar(&#39;KERNEL_IMAGETYPE_FOR_MAKE&#39;, typeformake)<br>
+<br>
+    for type in typeformake.split():<br>
+        typelower = type.lower()<br>
+<br>
+        d.appendVar(&#39;PACKAGES&#39;, &#39; &#39; + &#39;kernel-image-&#39; + typelower)<br>
+<br>
+        d.setVar(&#39;FILES_kernel-image-&#39; + typelower, &#39;/boot/&#39; + type + &#39;*&#39;)<br>
+<br>
+        d.appendVar(&#39;RDEPENDS_kernel-image&#39;, &#39; &#39; + &#39;kernel-image-&#39; + typelower)<br>
+<br>
+        d.setVar(&#39;PKG_kernel-image-&#39; + typelower, &#39;kernel-image-&#39; + typelower + &#39;-${KERNEL_VERSION_PKG_NAME}&#39;)<br>
+<br>
+        d.setVar(&#39;ALLOW_EMPTY_kernel-image-&#39; + typelower, &#39;1&#39;)<br>
<br>
-    d.setVar(&quot;KERNEL_IMAGETYPE_FOR_MAKE&quot;, re.sub(r&#39;\.gz$&#39;, &#39;&#39;, kerneltype))<br>
+        imagedest = d.getVar(&#39;KERNEL_IMAGEDEST&#39;, True)<br>
+        priority = d.getVar(&#39;KERNEL_PRIORITY&#39;, True)<br>
+        postinst = &#39;#!/bin/sh\n&#39; + &#39;update-alternatives --install /&#39; + imagedest + &#39;/&#39; + type + &#39; &#39; + type + &#39; &#39; + &#39;/&#39; + imagedest + &#39;/&#39; + type + &#39;-${KERNEL_VERSION_NAME} &#39; + priority + &#39; || true&#39; + &#39;\n&#39;<br>
+        d.setVar(&#39;pkg_postinst_kernel-image-&#39; + typelower, postinst)<br>
+<br>
+        postrm = &#39;#!/bin/sh\n&#39; + &#39;update-alternatives --remove&#39; + &#39; &#39; + type + &#39; &#39; + type + &#39;-${KERNEL_VERSION_NAME} || true&#39; + &#39;\n&#39;<br>
+        d.setVar(&#39;pkg_postrm_kernel-image-&#39; + typelower, postrm)<br>
<br>
     image = d.getVar(&#39;INITRAMFS_IMAGE&#39;, True)<br>
     if image:<br>
@@ -92,8 +128,8 @@ KERNEL_PRIORITY ?= &quot;${@int(d.getVar(&#39;PV&#39;,1).split(&#39;-&#39;)[0].split(&#39;+&#39;)[0].split(&#39;.<br>
<br>
 KERNEL_RELEASE ?= &quot;${KERNEL_VERSION}&quot;<br>
<br>
-# Where built kernel lies in the kernel tree<br>
-KERNEL_OUTPUT ?= &quot;arch/${ARCH}/boot/${KERNEL_IMAGETYPE}&quot;<br>
+# The directory where built kernel lies in the kernel tree<br>
+KERNEL_OUTPUT_DIR ?= &quot;arch/${ARCH}/boot&quot;<br>
 KERNEL_IMAGEDEST = &quot;boot&quot;<br>
<br>
 #<br>
@@ -119,8 +155,6 @@ KERNEL_EXTRA_ARGS ?= &quot;&quot;<br>
 # We don&#39;t want to override kernel Makefile variables from the environment<br>
 EXTRA_OEMAKE = &quot;&quot;<br>
<br>
-KERNEL_ALT_IMAGETYPE ??= &quot;&quot;<br>
-<br>
 # Define where the kernel headers are installed on the target as well as where<br>
 # they are staged.<br>
 KERNEL_SRC_PATH = &quot;/usr/src/kernel&quot;<br>
@@ -166,23 +200,48 @@ copy_initramfs() {<br>
        echo &quot;Finished copy of initramfs into ./usr&quot;<br>
 }<br>
<br>
-INITRAMFS_BASE_NAME = &quot;${KERNEL_IMAGETYPE}-initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}&quot;<br>
+INITRAMFS_BASE_NAME = &quot;initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}&quot;</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 INITRAMFS_BASE_NAME[vardepsexclude] = &quot;DATETIME&quot;<br>
 do_bundle_initramfs () {<br>
        if [ ! -z &quot;${INITRAMFS_IMAGE}&quot; -a x&quot;${INITRAMFS_IMAGE_BUNDLE}&quot; = x1 ]; then<br>
                echo &quot;Creating a kernel image with a bundled initramfs...&quot;<br>
                copy_initramfs<br>
-               if [ -e ${KERNEL_OUTPUT} ] ; then<br>
-                       mv -f ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.bak<br>
-               fi<br>
+               # Backuping kernel image relies on its type(regular file or symbolic link)<br></blockquote><div><br></div><div>s/Backuping/Backing up/</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+               tmp_path=&quot;&quot;<br>
+               for type in ${KERNEL_IMAGETYPES} ; do<br>
+                       if [ -h ${KERNEL_OUTPUT_DIR}/$type ] ; then<br>
+                               linkpath=`readlink -n ${KERNEL_OUTPUT_DIR}/$type`<br>
+                               realpath=`readlink -fn ${KERNEL_OUTPUT_DIR}/$type`<br>
+                               mv -f $realpath $realpath.bak<br>
+                               tmp_path=$tmp_path&quot; &quot;$type&quot;#&quot;$linkpath&quot;#&quot;$realpath<br>
+                       elif [ -f ${KERNEL_OUTPUT_DIR}/$type ]; then<br>
+                               mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.bak<br>
+                               tmp_path=$tmp_path&quot; &quot;$type&quot;##&quot;<br>
+                       fi<br>
+               done<br>
                use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio<br>
                kernel_do_compile<br>
-               mv -f ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.initramfs<br>
-               mv -f ${KERNEL_OUTPUT}.bak ${KERNEL_OUTPUT}<br>
+               # Restoring kernel image<br>
+               for tp in $tmp_path ; do<br>
+                       type=`echo $tp|cut -d &quot;#&quot; -f 1`<br>
+                       linkpath=`echo $tp|cut -d &quot;#&quot; -f 2`<br>
+                       realpath=`echo $tp|cut -d &quot;#&quot; -f 3`<br>
+                       if [ -n &quot;$realpath&quot; ]; then<br>
+                               mv -f $realpath $realpath.initramfs<br>
+                               mv -f $realpath.bak $realpath<br>
+                               cd ${B}/${KERNEL_OUTPUT_DIR}<br>
+                               ln -sf $linkpath.initramfs<br>
+                       else<br>
+                               mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.initramfs<br>
+                               mv -f ${KERNEL_OUTPUT_DIR}/$type.bak ${KERNEL_OUTPUT_DIR}/$type<br>
+                       fi<br>
+               done<br>
                # Update install area<br>
-               echo &quot;There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT}.initramfs&quot;<br>
-               install -m 0644 ${B}/${KERNEL_OUTPUT}.initramfs ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin<br>
-               echo &quot;${B}/${KERNEL_OUTPUT}.initramfs&quot;<br>
+               for type in ${KERNEL_IMAGETYPES} ; do<br>
+                       echo &quot;There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs&quot;<br>
+                       install -m 0644 ${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs ${D}/boot/$type-initramfs-${MACHINE}.bin<br>
+                       echo &quot;${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs&quot;<br>
+               done<br>
        fi<br>
 }<br>
<br>
@@ -207,10 +266,15 @@ kernel_do_compile() {<br>
                copy_initramfs<br>
                use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio<br>
        fi<br>
-       oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC=&quot;${KERNEL_CC}&quot; LD=&quot;${KERNEL_LD}&quot; ${KERNEL_EXTRA_ARGS} $use_alternate_initrd<br>
-       if test &quot;${KERNEL_IMAGETYPE_FOR_MAKE}.gz&quot; = &quot;${KERNEL_IMAGETYPE}&quot;; then<br>
-               gzip -9c &lt; &quot;${KERNEL_IMAGETYPE_FOR_MAKE}&quot; &gt; &quot;${KERNEL_OUTPUT}&quot;<br>
-       fi<br>
+       oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} CC=&quot;${KERNEL_CC}&quot; LD=&quot;${KERNEL_LD}&quot; ${KERNEL_EXTRA_ARGS} $use_alternate_initrd<br></blockquote><div><br></div><div><br></div><div>This is probably something that is worth mentioning in the top of the commit message. You are</div><div>building multiple kernel image types, but they are all currently using the same configuration.</div><div><br></div><div>If the make invokations were split into separate calls per image type, we could conceivably</div><div>extend this to generate and use a separate config int he future.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+       for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do<br>
+               for type in ${KERNEL_IMAGETYPES} ; do<br>
+                       if test &quot;${typeformake}.gz&quot; = &quot;${type}&quot;; then<br>
+                               gzip -9c &lt; &quot;${typeformake}&quot; &gt; &quot;${KERNEL_OUTPUT_DIR}/${type}&quot;<br>
+                               break;<br>
+                       fi<br>
+               done<br>
+       done<br>
 }<br>
<br>
 do_compile_kernelmodules() {<br>
@@ -251,7 +315,9 @@ kernel_do_install() {<br>
        #<br>
        install -d ${D}/${KERNEL_IMAGEDEST}<br>
        install -d ${D}/boot<br>
-       install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}<br>
+       for type in ${KERNEL_IMAGETYPES} ; do<br>
+               install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} ${D}/${KERNEL_IMAGEDEST}/${type}-${KERNEL_VERSION}<br>
+       done<br>
        install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}<br>
        install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}<br>
        install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}<br>
@@ -365,12 +431,12 @@ EXPORT_FUNCTIONS do_compile do_install do_configure<br>
 PACKAGES = &quot;kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules&quot;<br>
 FILES_${PN} = &quot;&quot;<br>
 FILES_kernel-base = &quot;/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin&quot;<br>
-FILES_kernel-image = &quot;/boot/${KERNEL_IMAGETYPE}*&quot;<br>
+FILES_kernel-image = &quot;&quot;<br>
 FILES_kernel-dev = &quot;/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build&quot;<br>
 FILES_kernel-vmlinux = &quot;/boot/vmlinux*&quot;<br>
 FILES_kernel-modules = &quot;&quot;<br>
 RDEPENDS_kernel = &quot;kernel-base&quot;<br>
-# Allow machines to override this dependency if kernel image files are<br>
+# Allow machines to override this dependency if kernel image files are<br>
 # not wanted in images as standard<br>
 RDEPENDS_kernel-base ?= &quot;kernel-image&quot;<br>
 PKG_kernel-image = &quot;kernel-image-${@legitimize_package_name(&#39;${KERNEL_VERSION}&#39;)}&quot;<br>
@@ -394,14 +460,6 @@ pkg_postinst_kernel-base () {<br>
        fi<br>
 }<br>
<br>
-pkg_postinst_kernel-image () {<br>
-       update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true<br>
-}<br>
-<br>
-pkg_postrm_kernel-image () {<br>
-       update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true<br>
-}<br>
-<br>
 PACKAGESPLITFUNCS_prepend = &quot;split_kernel_packages &quot;<br>
<br>
 python split_kernel_packages () {<br>
@@ -422,13 +480,13 @@ do_kernel_link_vmlinux() {<br>
<br>
 do_strip() {<br>
        if [ -n &quot;${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}&quot; ]; then<br>
-               if [ &quot;${KERNEL_IMAGETYPE}&quot; != &quot;vmlinux&quot; ]; then<br>
-                       bbwarn &quot;image type will not be stripped (not supported): ${KERNEL_IMAGETYPE}&quot;<br>
+               if ! (echo &quot;${KERNEL_IMAGETYPES}&quot; | grep -q &quot;vmlinux&quot;); then<br></blockquote><div><br></div><div>You had used the \bfitImage\b, but here you don&#39;t .. grep -w could work for them all.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                       bbwarn &quot;image type(s) will not be stripped (not supported): ${KERNEL_IMAGETYPES}&quot;<br></blockquote><div><br></div><div><br></div><div>But on another note. Is it really right to say that none of the images will be stripped if you</div><div>find vmlinux anywhere in the image type list ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                        return<br>
                fi<br>
<br>
                cd ${B}<br>
-               headers=`&quot;$CROSS_COMPILE&quot;readelf -S ${KERNEL_OUTPUT} | \<br>
+               headers=`&quot;$CROSS_COMPILE&quot;readelf -S ${KERNEL_OUTPUT_DIR}/vmlinux | \<br>
                          grep &quot;^ \{1,\}\[[0-9 ]\{1,\}\] [^ ]&quot; | \<br>
                          sed &quot;s/^ \{1,\}\[[0-9 ]\{1,\}\] //&quot; | \<br>
                          gawk &#39;{print $1}&#39;`<br>
@@ -438,7 +496,7 @@ do_strip() {<br>
                                bbwarn &quot;Section not found: $str&quot;;<br>
                        fi<br>
<br>
-                       &quot;$CROSS_COMPILE&quot;strip -s -R $str ${KERNEL_OUTPUT}<br>
+                       &quot;$CROSS_COMPILE&quot;strip -s -R $str ${KERNEL_OUTPUT_DIR}/vmlinux<br>
                }; done<br>
<br>
                bbnote &quot;KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is set, stripping sections:&quot; \<br>
@@ -457,20 +515,22 @@ do_sizecheck() {<br>
                if [ -n &quot;$invalid&quot; ]; then<br>
                        die &quot;Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integerx (The unit is Kbytes)&quot;<br>
                fi<br>
-               size=`du -ks ${B}/${KERNEL_OUTPUT} | awk &#39;{ print $1}&#39;`<br>
-               if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then<br>
-                       die &quot;This kernel (size=$size(K) &gt; ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device. Please reduce the size of the kernel by making more of it modular.&quot;<br>
-               fi<br>
+               for type in ${KERNEL_IMAGETYPES} ; do<br>
+                       size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$type | awk &#39;{print $1}&#39;`<br>
+                       if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then<br>
+                               die &quot;This kernel $type (size=$size(K) &gt; ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device. Please reduce the size of the kernel by making more of it modular.&quot;<br></blockquote><div><br></div><div>Hmm. Again here. Multiple image types are being built. If one of them is too large for the device,</div><div>who&#39;s to say that that&#39;s the one that is going to be used ? Maybe this should be a warn, instead</div><div>of a die ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                       fi<br>
+               done<br>
        fi<br>
 }<br>
 do_sizecheck[dirs] = &quot;${B}&quot;<br>
<br>
 addtask sizecheck before do_install after do_strip<br>
<br>
-KERNEL_IMAGE_BASE_NAME ?= &quot;${KERNEL_IMAGETYPE}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}&quot;<br>
+KERNEL_IMAGE_BASE_NAME ?= &quot;${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}&quot;<br>
 # Don&#39;t include the DATETIME variable in the sstate package signatures<br>
 KERNEL_IMAGE_BASE_NAME[vardepsexclude] = &quot;DATETIME&quot;<br>
-KERNEL_IMAGE_SYMLINK_NAME ?= &quot;${KERNEL_IMAGETYPE}-${MACHINE}&quot;<br>
+KERNEL_IMAGE_SYMLINK_NAME ?= &quot;${MACHINE}&quot;<br>
 MODULE_IMAGE_BASE_NAME ?= &quot;modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}&quot;<br>
 MODULE_IMAGE_BASE_NAME[vardepsexclude] = &quot;DATETIME&quot;<br>
 MODULE_TARBALL_BASE_NAME ?= &quot;${MODULE_IMAGE_BASE_NAME}.tgz&quot;<br>
@@ -479,28 +539,37 @@ MODULE_TARBALL_SYMLINK_NAME ?= &quot;modules-${MACHINE}.tgz&quot;<br>
 MODULE_TARBALL_DEPLOY ?= &quot;1&quot;<br>
<br>
 kernel_do_deploy() {<br>
-       install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin<br>
+       for type in ${KERNEL_IMAGETYPES} ; do<br>
+               base_name=${type}-${KERNEL_IMAGE_BASE_NAME}<br>
+               install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} ${DEPLOYDIR}/${base_name}.bin<br>
+       done<br>
        if [ ${MODULE_TARBALL_DEPLOY} = &quot;1&quot; ] &amp;&amp; (grep -q -i -e &#39;^CONFIG_MODULES=y$&#39; .config); then<br>
                mkdir -p ${D}/lib<br>
                tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib<br>
                ln -sf ${MODULE_TARBALL_BASE_NAME} ${DEPLOYDIR}/${MODULE_TARBALL_SYMLINK_NAME}<br>
        fi<br>
<br>
-       ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGE_SYMLINK_NAME}.bin<br>
-       ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGETYPE}<br>
+       for type in ${KERNEL_IMAGETYPES} ; do<br>
+               base_name=${type}-${KERNEL_IMAGE_BASE_NAME}<br>
+               symlink_name=${type}-${KERNEL_IMAGE_SYMLINK_NAME}<br>
+               ln -sf ${base_name}.bin ${DEPLOYDIR}/${symlink_name}.bin<br>
+               ln -sf ${base_name}.bin ${DEPLOYDIR}/${type}<br>
+       done<br>
<br>
        cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt<br>
<br>
        cd ${B}<br>
        # Update deploy directory<br>
-       if [ -e &quot;${KERNEL_OUTPUT}.initramfs&quot; ]; then<br>
-               echo &quot;Copying deploy kernel-initramfs image and setting up links...&quot;<br>
-               initramfs_base_name=${INITRAMFS_BASE_NAME}<br>
-               initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE}<br>
-               install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin<br>
-               cd ${DEPLOYDIR}<br>
-               ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin<br>
-       fi<br>
+       for type in ${KERNEL_IMAGETYPES} ; do<br>
+               if [ -e &quot;${KERNEL_OUTPUT_DIR}/${type}.initramfs&quot; ]; then<br>
+                       echo &quot;Copying deploy ${type} kernel-initramfs image and setting up links...&quot;<br>
+                       initramfs_base_name=${type}-${INITRAMFS_BASE_NAME}<br>
+                       initramfs_symlink_name=${type}-initramfs-${MACHINE}<br>
+                       install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin<br>
+                       cd ${DEPLOYDIR}<br>
+                       ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin<br>
+               fi<br>
+       done<br>
 }<br>
 do_deploy[cleandirs] = &quot;${DEPLOYDIR}&quot;<br>
 do_deploy[dirs] = &quot;${DEPLOYDIR} ${B}&quot;<br>
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf<br>
index 00a69da..b3969b0 100644<br>
--- a/meta/conf/documentation.conf<br>
+++ b/meta/conf/documentation.conf<br>
@@ -246,6 +246,7 @@ KERNEL_CLASSES[doc] = &quot;A list of classes defining kernel image types that kernel<br>
 KERNEL_EXTRA_ARGS[doc] = &quot;Specifies additional make command-line arguments the OpenEmbedded build system passes on when compiling the kernel.&quot;<br>
 KERNEL_FEATURES[doc] = &quot;Includes additional metadata from the Yocto Project kernel Git repository. The metadata you add through this variable includes config fragments and features descriptions.&quot;<br>
 KERNEL_IMAGETYPE[doc] = &quot;The type of kernel to build for a device, usually set by the machine configuration files and defaults to &#39;zImage&#39;.&quot;<br>
+KERNEL_IMAGETYPES[doc] = &quot;The list of types of kernel to build for a device, usually set by the machine configuration files and defaults to KERNEL_IMAGETYPE.&quot;<br>
 KERNEL_MODULE_AUTOLOAD[doc] = &quot;Lists kernel modules that need to be auto-loaded during boot&quot;<br>
 KERNEL_MODULE_PROBECONF[doc] = &quot;Lists kernel modules for which the build system expects to find module_conf_* values that specify configuration for each of the modules&quot;<br>
 KERNEL_PATH[doc] = &quot;The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass).&quot;<br>
diff --git a/meta/conf/machine/qemumips.conf b/meta/conf/machine/qemumips.conf<br>
index fbf8137..67ce161 100644<br>
--- a/meta/conf/machine/qemumips.conf<br>
+++ b/meta/conf/machine/qemumips.conf<br>
@@ -6,7 +6,7 @@ require conf/machine/include/qemu.inc<br>
 require conf/machine/include/tune-mips32r2.inc<br>
<br>
 KERNEL_IMAGETYPE = &quot;vmlinux&quot;<br>
-KERNEL_ALT_IMAGETYPE = &quot;vmlinux.bin&quot;<br>
+KERNEL_IMAGETYPES = &quot;vmlinux.bin&quot;<br>
<br>
 SERIAL_CONSOLES = &quot;115200;ttyS0 115200;ttyS1&quot;<br>
<br>
diff --git a/meta/conf/machine/qemumips64.conf b/meta/conf/machine/qemumips64.conf<br>
index 8c3f1fe..393212e 100644<br>
--- a/meta/conf/machine/qemumips64.conf<br>
+++ b/meta/conf/machine/qemumips64.conf<br>
@@ -6,7 +6,7 @@ require conf/machine/include/qemu.inc<br>
 require conf/machine/include/tune-mips64.inc<br>
<br>
 KERNEL_IMAGETYPE = &quot;vmlinux&quot;<br>
-KERNEL_ALT_IMAGETYPE = &quot;vmlinux.bin&quot;<br>
+KERNEL_IMAGETYPES = &quot;vmlinux.bin&quot;<br>
<br>
 SERIAL_CONSOLES = &quot;115200;ttyS0 115200;ttyS1&quot;<br>
<br>
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc<br>
index 651a19e..74f5ef8 100644<br>
--- a/meta/recipes-kernel/linux/linux-dtb.inc<br>
+++ b/meta/recipes-kernel/linux/linux-dtb.inc<br>
@@ -34,9 +34,12 @@ do_install_append() {<br>
        for DTB in ${KERNEL_DEVICETREE}; do<br>
                DTB=`normalize_dtb &quot;${DTB}&quot;`<br>
                DTB_BASE_NAME=`basename ${DTB} .dtb`<br>
-               DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
-               DTB_PATH=`get_real_dtb_path_in_kernel &quot;${DTB}&quot;`<br>
-               install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb<br>
+               for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do<br>
+                       symlink_name=${type}&quot;-&quot;${KERNEL_IMAGE_SYMLINK_NAME}<br></blockquote><div><br></div><div>If there are multiple image types being built, is this valid for them all ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                       DTB_SYMLINK_NAME=`echo ${symlink_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
+                       DTB_PATH=`get_real_dtb_path_in_kernel &quot;${DTB}&quot;`<br>
+                       install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb<br>
+               done<br>
        done<br>
 }<br>
<br>
@@ -44,31 +47,39 @@ do_deploy_append() {<br>
        for DTB in ${KERNEL_DEVICETREE}; do<br>
                DTB=`normalize_dtb &quot;${DTB}&quot;`<br>
                DTB_BASE_NAME=`basename ${DTB} .dtb`<br>
-               DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
-               DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
-               DTB_PATH=`get_real_dtb_path_in_kernel &quot;${DTB}&quot;`<br>
-               install -d ${DEPLOYDIR}<br>
-               install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb<br>
-               ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb<br>
+               for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do<br>
+                       base_name=${type}&quot;-&quot;${KERNEL_IMAGE_BASE_NAME}<br>
+                       symlink_name=${type}&quot;-&quot;${KERNEL_IMAGE_SYMLINK_NAME}<br>
+                       DTB_NAME=`echo ${base_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
+                       DTB_SYMLINK_NAME=`echo ${symlink_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
+                       DTB_PATH=`get_real_dtb_path_in_kernel &quot;${DTB}&quot;`<br>
+                       install -d ${DEPLOYDIR}<br>
+                       install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb<br>
+                       ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb<br>
+               done<br>
        done<br>
 }<br>
<br>
 pkg_postinst_kernel-devicetree () {<br>
        cd /${KERNEL_IMAGEDEST}<br>
-       for DTB in ${KERNEL_DEVICETREE}<br>
-       do<br>
-               DTB_BASE_NAME=`basename ${DTB} | awk -F &quot;.&quot; &#39;{print $1}&#39;`<br>
-               DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
-               update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true<br>
+       for DTB in ${KERNEL_DEVICETREE}; do<br>
+               for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do<br>
+                       symlink_name=${type}&quot;-&quot;${KERNEL_IMAGE_SYMLINK_NAME}<br>
+                       DTB_BASE_NAME=`basename ${DTB} | awk -F &quot;.&quot; &#39;{print $1}&#39;`<br>
+                       DTB_SYMLINK_NAME=`echo ${symlink_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
+                       update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true<br>
+               done<br>
        done<br>
 }<br>
<br>
 pkg_postrm_kernel-devicetree () {<br>
        cd /${KERNEL_IMAGEDEST}<br>
-       for DTB in ${KERNEL_DEVICETREE}<br>
-       do<br>
-               DTB_BASE_NAME=`basename ${DTB} | awk -F &quot;.&quot; &#39;{print $1}&#39;`<br>
-               DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
-               update-alternatives --remove ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true<br>
+       for DTB in ${KERNEL_DEVICETREE}; do<br>
+               for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do<br>
+                       symlink_name=${type}&quot;-&quot;${KERNEL_IMAGE_SYMLINK_NAME}<br>
+                       DTB_BASE_NAME=`basename ${DTB} | awk -F &quot;.&quot; &#39;{print $1}&#39;`<br>
+                       DTB_SYMLINK_NAME=`echo ${symlink_name} | sed &quot;s/${MACHINE}/${DTB_BASE_NAME}/g&quot;`<br>
+                       update-alternatives --remove ${DTB_BASE_NAME}.dtb /boot/devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true<br>
+               done<br>
        done<br>
 }<br>
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf b/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf<br>
index b319d62..e4a6f30 100644<br>
--- a/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf<br>
+++ b/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/machine.conf<br>
@@ -9,7 +9,7 @@ require conf/machine/include/tune-mips32.inc<br>
 MACHINE_FEATURES = &quot;screen keyboard pci usbhost ext2 ext3 serial&quot;<br>
<br>
 KERNEL_IMAGETYPE = &quot;vmlinux&quot;<br>
-KERNEL_ALT_IMAGETYPE = &quot;vmlinux.bin&quot;<br>
+KERNEL_IMAGETYPES = &quot;vmlinux.bin&quot;<br>
 KERNEL_IMAGE_STRIP_EXTRA_SECTIONS  = &quot;.comment&quot;<br>
<br>
 {{ if kernel_choice == &quot;custom&quot;: preferred_kernel = &quot;linux-yocto-custom&quot; }}<br>
diff --git a/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf b/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf<br>
index 3afc5e0..2c2d8af 100644<br>
--- a/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf<br>
+++ b/scripts/lib/bsp/substrate/target/arch/mips64/conf/machine/machine.conf<br>
@@ -9,7 +9,7 @@ require conf/machine/include/tune-mips64.inc<br>
 MACHINE_FEATURES = &quot;pci ext2 ext3 serial&quot;<br>
<br>
 KERNEL_IMAGETYPE = &quot;vmlinux&quot;<br>
-KERNEL_ALT_IMAGETYPE = &quot;vmlinux.bin&quot;<br>
+KERNEL_IMAGETYPES = &quot;vmlinux.bin&quot;<br></blockquote><div><br></div><div><br></div><div>Again, why can&#39;t vmlinux just bein in KERNEL_IMAGETYPES ?</div><div><br></div><div>Bruce</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 KERNEL_IMAGE_STRIP_EXTRA_SECTIONS  = &quot;.comment&quot;<br>
<br>
 {{ if kernel_choice == &quot;custom&quot;: preferred_kernel = &quot;linux-yocto-custom&quot; }}<br>
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf b/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf<br>
index 67e1cbd..7a0a4d3 100644<br>
--- a/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf<br>
+++ b/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/machine.conf<br>
@@ -69,6 +69,6 @@ SERIAL_CONSOLE = &quot;115200 ttyS0&quot;<br>
<br>
 {{ if qemuarch == &quot;mips&quot; or qemuarch == &quot;mips64&quot;: }}<br>
 KERNEL_IMAGETYPE = &quot;vmlinux&quot;<br>
-KERNEL_ALT_IMAGETYPE = &quot;vmlinux.bin&quot;<br>
+KERNEL_IMAGETYPES = &quot;vmlinux.bin&quot;<br>
 SERIAL_CONSOLE = &quot;115200 ttyS0&quot;<br>
 MACHINE_EXTRA_RRECOMMENDS = &quot; kernel-modules&quot;<br>
<span><font color="#888888">--<br>
1.9.1<br>
<br>
--<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>&quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end&quot;</div>
</div></div>