<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>3515</bug_id>
          
          <creation_ts>2012-11-29 20:32:16 +0000</creation_ts>
          <short_desc>The size of the kernel image is too big</short_desc>
          <delta_ts>2013-04-17 08:45:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>1.3</version>
          <rep_platform>Routerstationpro</rep_platform>
          <op_sys>mips</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.4 M6</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Lisandro Damián Nicanor Pérez Meyer">perezmeyer</reporter>
          <assigned_to name="Michel Thebeau">michel.thebeau</assigned_to>
          <cc>bruce.ashfield</cc>
    
    <cc>dvhart</cc>
    
    <cc>michel.thebeau</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>27831</commentid>
    <comment_count>0</comment_count>
    <who name="Lisandro Damián Nicanor Pérez Meyer">perezmeyer</who>
    <bug_when>2012-11-29 20:32:16 +0000</bug_when>
    <thetext>The size of the latest kernel image for routerstationpro [0] it&apos;s far beyond it&apos;s 16 MB of flash.

Looking at [1] the kernel itself seems to be in the kernel-dev package. They are most surely related bugs.

[0] &lt;http://downloads.yoctoproject.org/releases/yocto/yocto-1.3/machines/routerstationpro/&gt;
[1] &lt;http://downloads.yoctoproject.org/releases/yocto/yocto-1.3/ipk/routerstationpro/&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27849</commentid>
    <comment_count>1</comment_count>
    <who name="Lisandro Damián Nicanor Pérez Meyer">perezmeyer</who>
    <bug_when>2012-11-30 13:23:19 +0000</bug_when>
    <thetext>Some more test I did:

- I modified the recipes to get the latest HEAD from the kernel repo, branch standard/routerstationpro. The result keeps being a huge image.

- I cloned the aforementioned git repo, same branch, but in the commit used by default. Then I got the .config file from the work dir and rebuilt the kernel under a Debian mips chroot. Same result.

I am now going to try using the .config file from denzil, do make oldconfig and build. I&apos;ll do it on the Debian chroot because I don&apos;t now how to modify the .config file from the recipes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27850</commentid>
    <comment_count>2</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-11-30 13:38:10 +0000</bug_when>
    <thetext>I&apos;ll do some build tests here as well, I&apos;m just struggling with some binutils build issues at the moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27854</commentid>
    <comment_count>3</comment_count>
    <who name="Lisandro Damián Nicanor Pérez Meyer">perezmeyer</who>
    <bug_when>2012-11-30 16:13:23 +0000</bug_when>
    <thetext>Hi Bruce! Don&apos;t worry, please do continue with the binutils stuff :-)

In the meantime I tested using the .config file from denzil, do make oldconfig and build inside the Debian chroot with qemu. I&apos;ve got a 6.7 MB kernel, which is not bad.

I haven&apos;t tested it yet, but at least I think it helps in seeing where the problem could be.

Kinds regards, Lisandro.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27855</commentid>
    <comment_count>4</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-11-30 16:19:36 +0000</bug_when>
    <thetext>The .config angle might also be a bit of a wrong path, since the kernel version change between the
branches would impact the default image, as would any BSP machine.conf changes.

The kernel configuration is one angle (it&apos;s actually much better in the 3.4 BSP), but it could be more of
a matter of the default MIPS kernel images are not stripped.

&gt; ll -h vmlinux-3.4.18+git34+8b0a93c0a224c9b91f90545b123b055b2e313bfc_2+574953480e9c2b2e1840297473c67bfe05a7b997-r4.3-routerstationpro-20121130135334.bin-orig
-rw-r--r-- 1 bruce bruce 86M Nov 30 11:12 vmlinux-3.4.18+git34+8b0a93c0a224c9b91f90545b123b055b2e313bfc_2+574953480e9c2b2e1840297473c67bfe05a7b997-r4.3-routerstationpro-20121130135334.bin-orig

&gt; ../../../tmp/sysroots/x86_64-linux/usr/bin/mips32-poky-linux/mips-poky-linux-strip  -s -R .comment vmlinux-3.4.18+git34+8b0a93c0a224c9b91f90545b123b055b2e313bfc_2+574953480e9c2b2e1840297473c67bfe05a7b997-r4.3-routerstationpro-20121130135334.bin-orig 
&gt; ll -h vmlinux-3.4.18+git34+8b0a93c0a224c9b91f90545b123b055b2e313bfc_2+574953480e9c2b2e1840297473c67bfe05a7b997-r4.3-routerstationpro-20121130135334.bin-orig
-rw-r--r-- 1 bruce bruce 8.0M Nov 30 11:14 vmlinux-3.4.18+git34+8b0a93c0a224c9b91f90545b123b055b2e313bfc_2+574953480e9c2b2e1840297473c67bfe05a7b997-r4.3-routerstationpro-20121130135334.bin-orig

And we have a kernel image that is consistent with the rest of the builds. My routerstation pro isn&apos;t available right now, 
so I have no idea if this is bootable. 

But if we can confirm that this is still bootable, the BSP config can switch to vmlinux.strip as the default. Can we try
a boot with a stripped vmlinux ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27859</commentid>
    <comment_count>5</comment_count>
    <who name="Lisandro Damián Nicanor Pérez Meyer">perezmeyer</who>
    <bug_when>2012-11-30 18:42:38 +0000</bug_when>
    <thetext>Sure, I&apos;ll try it in a few minutes!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27860</commentid>
    <comment_count>6</comment_count>
    <who name="Lisandro Damián Nicanor Pérez Meyer">perezmeyer</who>
    <bug_when>2012-11-30 19:16:06 +0000</bug_when>
    <thetext>Boots perfectly. I think it would be nice to have the stripped image then :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27862</commentid>
    <comment_count>7</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-11-30 20:55:42 +0000</bug_when>
    <thetext>Thanks for the test. I&apos;ll make this the default.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28246</commentid>
    <comment_count>8</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-12-13 16:09:21 +0000</bug_when>
    <thetext>Is this now in progress? Is it done?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28279</commentid>
    <comment_count>9</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2012-12-14 05:24:21 +0000</bug_when>
    <thetext>Thanks for the ping .. this is in progress. Changing the state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29042</commentid>
    <comment_count>10</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-01-22 15:18:47 +0000</bug_when>
    <thetext>switching the default to the stripped image is not quite as simple as it first looked. 

patches accepted for the fix, but for now, I&apos;m bumping this out to M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30266</commentid>
    <comment_count>11</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-02-28 16:24:29 +0000</bug_when>
    <thetext>Bruce, is this perhaps an M5?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30267</commentid>
    <comment_count>12</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-02-28 16:31:47 +0000</bug_when>
    <thetext>missed this one in my bumping of defects.

I&apos;ll shoot for M5, but cycles may get in the way again. The status is still correct, 
and I&apos;m still looking for the least impact/cleanest way to make this change 
be something that is out of the box with no extra steps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30842</commentid>
    <comment_count>13</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-03-19 13:03:54 +0000</bug_when>
    <thetext>I&apos;m looking for someone to complete this bug, the assignee should change once they&apos;ve been found.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31006</commentid>
    <comment_count>14</comment_count>
    <who name="Michel Thebeau">michel.thebeau</who>
    <bug_when>2013-03-21 21:10:34 +0000</bug_when>
    <thetext> I just realized that I misread the size of vmlinux.bin in arch/mips/boot/.  The source code supports that this is the stripped vmlinux that this defect is looking for.

8337264 2013-03-21 16:36 vmlinux.bin

Does that sound right?

M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31007</commentid>
    <comment_count>15</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-03-21 21:18:54 +0000</bug_when>
    <thetext>It does sound right. So what remains ? Is the stripped image in the boot directory
the one that is being linked in the exported directory ? Are we looking
at a simple enough change to vmlinux.bin as the image type in the BSP configuration ? 
If that&apos;s it, there may well be some associated changes to the build, since
the image type triggers different processing and is passed to the kernel
build indirectly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31032</commentid>
    <comment_count>16</comment_count>
    <who name="Michel Thebeau">michel.thebeau</who>
    <bug_when>2013-03-22 14:27:44 +0000</bug_when>
    <thetext>What you said Bruce.  I&apos;m testing the following:

--- a/meta-yocto-bsp/conf/machine/routerstationpro.conf
+++ b/meta-yocto-bsp/conf/machine/routerstationpro.conf
@@ -6,8 +6,8 @@ require conf/machine/include/tune-mips32.inc
 
 MACHINE_FEATURES = &quot;screen keyboard pci usbhost ext2 ext3 serial&quot;
 
-KERNEL_IMAGETYPE = &quot;vmlinux&quot;
-KERNEL_ALT_IMAGETYPE = &quot;vmlinux.bin&quot;
+KERNEL_ALT_IMAGETYPE = &quot;vmlinux&quot;
+KERNEL_IMAGETYPE = &quot;vmlinux.bin&quot;

This carries vmlinux.bin into the deploy/images dir, instead of vmlinux.

It looks safe for kernel, because the image types get passed to linux like this:

kernel_do_compile() {
        oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC=&quot;${KERNEL_CC}&quot; LD=&quot;${KERNEL_LD}&quot; ${KERNEL_EXTRA_ARGS}

Unless the order of `make vmlinux vmlinux.bin matters`.  I don&apos;t think it does, but I&apos;m not comfortable with make either.

Here is my test for kernel:
Before:
-rwxr-xr-x 1 mitch users 90230265 2013-03-22 10:23 ./vmlinux
-rwxr-xr-x 1 mitch users  8337264 2013-03-22 10:23 ./arch/mips/boot/vmlinux.bin

After swapping image types:
-rwxr-xr-x 1 mitch users 90230265 2013-03-22 08:58 ./vmlinux
-rwxr-xr-x 1 mitch users  8337264 2013-03-22 08:58 ./arch/mips/boot/vmlinux.bin


&gt; If that&apos;s it, there may well be some associated changes to the build

I&apos;ll concentrate on what oe is doing for &quot;vmlinux.bin&quot; versus &quot;vmlinux&quot; before I submit another patch.

M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31046</commentid>
    <comment_count>17</comment_count>
    <who name="Michel Thebeau">michel.thebeau</who>
    <bug_when>2013-03-22 20:40:03 +0000</bug_when>
    <thetext>Bruce,

&gt; Is the stripped image in the boot directory the one that is being 
&gt; linked in the exported directory ?

After swapping the IMAGETYPE and ALT_IMAGETYPE for rsp the links in tmp/deploy/images/ are correct.  

The names get &quot;.bin&quot; added, i.e.; $ ls -l
images/vmlinux.bin-routerstationpro.bin -&gt; vmlinux.bin--3.4.34[...]-routerstationpro-20130322180516.bin

The other observation I have is, after the image type swap, the vmlinux rpm gains the stripped vmlinux.bin while retaining vmlinux.  Before versus After:

tmp/deploy/rpm/routerstationpro$ ls -l
--rw-r--r-- 1 mitch users  43395695 kernel-vmlinux-[...].routerstationpro.rpm
+-rw-r--r-- 1 mitch users  46895047 kernel-vmlinux-[...].routerstationpro.rpm

I didn&apos;t expect that and I don&apos;t have the reason yet.

But looks good so far.

M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31278</commentid>
    <comment_count>18</comment_count>
    <who name="Michel Thebeau">michel.thebeau</who>
    <bug_when>2013-03-28 21:10:44 +0000</bug_when>
    <thetext>I&apos;d noted in email that arch/mips/boot/vmlinux.bin is looks like the stripped file we were looking for.  But it doesn&apos;t load:

RedBoot&gt; load -m tftp -h 192.168.1.6 mthebeau/vmlinux.bin
Unrecognized image type: 0x0

I was able to load the larger vmlinux and boot it.

And as previously noted by ,  using tmp/sysroots/x86_64-linux/usr/bin/mips32-poky-linux/mips-poky-linux-strip would get a bootable image as well from the vmlinux.

I&apos;ll try to figure out what the difference is between that and vmlinux.bin.

M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32267</commentid>
    <comment_count>19</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-04-17 08:45:49 +0000</bug_when>
    <thetext>Fixed in master after http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=95b71d2b03a3a6dc5d32a7d6a84ec3420f39aa61</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>