<?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>1940</bug_id>
          
          <creation_ts>2012-01-30 09:22:28 +0000</creation_ts>
          <short_desc>live image failing at do_bootimg</short_desc>
          <delta_ts>2012-02-03 09:02:00 +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>OE-Core</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Path on oe-core list (Jan 31, 2011)</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.2 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Darren Hart">dvhart</assigned_to>
          <cc>dvhart</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</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>18416</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-01-30 09:22:28 +0000</bug_when>
    <thetext>On the autobuilder live images for nightly and nightly-x86 are failing with a somewhat obtuse error:

-----------------------
ERROR: Function failed: build_hddimg (see /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/atom_pc-poky-linux/core-image-minimal-1.0-r0/temp/log.do_bootimg.12839 for further information)
ERROR: Logfile of failure stored in: /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/atom_pc-poky-linux/core-image-minimal-1.0-r0/temp/log.do_bootimg.12839
Log data follows:
| ERROR: Function failed: build_hddimg (see /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/atom_pc-poky-linux/core-image-minimal-1.0-r0/temp/log.do_bootimg.12839 for further information)
| mkdosfs 2.11 (12 Mar 2005)
| syslinux: zero FAT sectors (FAT12/16)
NOTE: package core-image-minimal-1.0-r0: task do_bootimg: Failed
-----------------------

Full log from the autobuilder:

http://autobuilder.yoctoproject.org:8010/builders/nightly-x86/builds/337/steps/shell_32/logs/stdio</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18427</commentid>
    <comment_count>1</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-01-30 18:59:57 +0000</bug_when>
    <thetext>More digging seems to point that this is related to the recent size changes in the hddimg code.  It&apos;s possible we uncovered some other problem with those changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18433</commentid>
    <comment_count>2</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-01-31 07:30:31 +0000</bug_when>
    <thetext>It&apos;s interesting that it is reporting FAT12/16 as we have also forced the use of FAT32. I don&apos;t see anything in the syslinux manual about which FAT filesystem is being used. And indeed, the syslinux sources assume the default FAT size was selected:

    if (clusters &lt; 0xFFF5) {
     92 	/* FAT12 or FAT16 */
     93 
     94 	if (!get_16(&amp;sectbuf-&gt;bsFATsecs))
     95 	    return &quot;zero FAT sectors (FAT12/16)&quot;;

So it&apos;s looking for information in the wrong part of the image on really small images. We have two options:

1) Patch syslinux to detect which FAT size is used rather than assume it based on cluster count.

2) Modify do_bootimg to calculate the FAT overhead for both FAT16 and FAT32.

I&apos;m strongly in favor of #1. The other workaround is to ensure minimal images are at least 32MB - but that seems like serious overkill and will pose a real problem for poky-tiny images which should be &lt; 4MB :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18434</commentid>
    <comment_count>3</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-01-31 07:44:33 +0000</bug_when>
    <thetext>An alternative workaround is to perform the size calculations for FAT32 but allow mkdosfs to choose the FAT size based on cluster count as it normally would. This would result in more padding than necessary for small images, but would satisfy syslinux&apos;s pedantic expectations of the FAT size. Note that for small images, the extra padding is also not likely to be much in terms of absolute bytes anyway. This is the fastest &quot;get it working&quot; fix&quot;:

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index df3ee73..5b320bb 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -142,7 +142,7 @@ build_hddimg() {
                BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
 
                IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
-               mkdosfs -F 32 -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
+               mkdosfs -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
                # Copy HDDDIR recursively into the image file directly
                mcopy -i ${IMG} -s ${HDDDIR}/* ::/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18435</commentid>
    <comment_count>4</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-01-31 08:33:30 +0000</bug_when>
    <thetext>HPA confirms that the cluster count is what determines the proper FAT size according to the MS spec. So, my solution in Comment #3 appears to be the best solution. I&apos;ll send a patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18436</commentid>
    <comment_count>5</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-01-31 08:53:17 +0000</bug_when>
    <thetext>Patch is under test now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18475</commentid>
    <comment_count>6</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-02-03 09:02:00 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=217584211625b1c496fe5b78aa4765ccf605d2b9</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>