<?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>1783</bug_id>
          
          <creation_ts>2011-11-22 14:47:18 +0000</creation_ts>
          <short_desc>dosfstools mkdosfs -d option crashes with subdirectories</short_desc>
          <delta_ts>2011-12-15 09:05:35 +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>devtools / tool chain</component>
          <version>1.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Darren Hart">dvhart</reporter>
          <assigned_to name="Nitin Kamble">nitin.a.kamble</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>otavio</cc>
    
    <cc>richard.purdie</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>17342</commentid>
    <comment_count>0</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2011-11-22 14:47:18 +0000</bug_when>
    <thetext>When building images with bootimg.bbclass, we use the -d argument provided by mkdosfs-dir.patch for dosfstools. This allows us to populate the fs as we create it. We currently place all the files in the top level directory. If we add subdirectories, the mkdosfs command in bootimg.bbclass crashes with output at the end of this comment.

For proper live image creation for EFI booting we should be using an EFI/boot directory structure. So we need a way to create the image with directories - it may be that an alternate means is now available as many distributions now create EFI live images.


*** glibc detected *** mkdosfs: malloc(): memory corruption: 0x00000000006441f0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x78a96)[0x7f4a7dc3da96]
/lib/x86_64-linux-gnu/libc.so.6(+0x7a5f8)[0x7f4a7dc3f5f8]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x6d)[0x7f4a7dc4177d]
mkdosfs[0x401be7]
mkdosfs[0x402258]
mkdosfs[0x402499]
mkdosfs[0x4044f0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f4a7dbe630d]
mkdosfs[0x4012c9]
======= Memory map: ========
00400000-00407000 r-xp 00000000 09:00 3304324                            /build/poky/n450/tmp/sysroots/x86_64-linux/usr/sbin/mkdosfs
00607000-00608000 r--p 00007000 09:00 3304324                            /build/poky/n450/tmp/sysroots/x86_64-linux/usr/sbin/mkdosfs
00608000-00609000 rw-p 00008000 09:00 3304324                            /build/poky/n450/tmp/sysroots/x86_64-linux/usr/sbin/mkdosfs
00609000-0060d000 rw-p 00000000 00:00 0
00638000-00659000 rw-p 00000000 00:00 0                                  [heap]
7f4a78000000-7f4a78021000 rw-p 00000000 00:00 0
7f4a78021000-7f4a7c000000 ---p 00000000 00:00 0
7f4a7d58e000-7f4a7d5a3000 r-xp 00000000 08:01 786887                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4a7d5a3000-7f4a7d7a2000 ---p 00015000 08:01 786887                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4a7d7a2000-7f4a7d7a3000 r--p 00014000 08:01 786887                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4a7d7a3000-7f4a7d7a4000 rw-p 00015000 08:01 786887                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4a7d7a4000-7f4a7d7bc000 r-xp 00000000 08:01 786910                     /lib/x86_6
4-linux-gnu/libpthread-2.13.so
7f4a7d7bc000-7f4a7d9bb000 ---p 00018000 08:01 786910                     /lib/x86_64-linux-gnu/libpthread-2.13.so
7f4a7d9bb000-7f4a7d9bc000 r--p 00017000 08:01 786910                     /lib/x86_64-linux-gnu/libpthread-2.13.so
7f4a7d9bc000-7f4a7d9bd000 rw-p 00018000 08:01 786910                     /lib/x86_64-linux-gnu/libpthread-2.13.so
7f4a7d9bd000-7f4a7d9c1000 rw-p 00000000 00:00 0
7f4a7d9c1000-7f4a7d9c3000 r-xp 00000000 08:01 786898                     /lib/x86_64-linux-gnu/libdl-2.13.so
7f4a7d9c3000-7f4a7dbc3000 ---p 00002000 08:01 786898                     /lib/x86_64-linux-gnu/libdl-2.13.so
7f4a7dbc3000-7f4a7dbc4000 r--p 00002000 08:01 786898                     /lib/x86_64-linux-gnu/libdl-2.13.so
7f4a7dbc4000-7f4a7dbc5000 rw-p 00003000 08:01 786898                     /lib/x86_64-linux-gnu/libdl-2.13.so
7f4a7dbc5000-7f4a7dd5a000 r-xp 00000000 08:01 786896                     /lib/x86_64-linux-gnu/libc-2.13.so
7f4a7dd5a000-7f4a7df59000 ---p 00195000 08:01 786896                     /lib/x86_64-linux-gnu/libc-2.13.so
7f4a7df59000-7f4a7df5d000 r--p 00194000 08:01 786896                     /lib/x86_64-linux-gnu/libc-2.13.so
7f4a7df5d000-7f4a7df5e000 rw-p 00198000 08:01 786896                     /lib/x86_64-linux-gnu/libc-2.13.so
7f4a7df5e000-7f4a7df64000 rw-p 00000000 00:00 0
7f4a7df64000-7f4a7df95000 r-xp 00000000 09:00 3428306                    /build/poky/n450/tmp/sysroots/x86_64-linux/usr/lib/pseudo/lib64/libpseudo.so
7f4a7df95000-7f4a7e194000 ---p 00031000 09:00 3428306                    /build/poky/n450/tmp/sysroots/x86_64-linux/usr/lib/pseudo/lib64/libpseudo.so
7f4a7e194000-7f4a7e195000 r--p 00030000 09:00 3428306                    /build/poky/n450/tmp/sysroots/x86_64-linux/usr/lib/pseudo/lib64/libpseudo.so
7f4a7e195000-7f4a7e197000 rw-p 00031000 09:00 3428306                    /build/poky/n450/tmp/sysroots/x86_64-linux/usr/lib/pseudo/lib64/libpseudo.so
7f4a7e197000-7f4a7e19f000 rw-p 00000000 00:00 0
7f4a7e19f000-7f4a7e1c0000 r-xp 00000000 08:01 786908                     /lib/x86_64-linux-gnu/ld-2.13.so
7f4a7e3aa000-7f4a7e3ae000 rw-p 00000000 00:00 0
7f4a7e3bc000-7f4a7e3bf000 rw-p 00000000 00:00 0
7f4a7e3bf000-7f4a7e3c0000 r--p 00020000 08:01 786908                     /lib/x86_64-linux-gnu/ld-2.13.so
7f4a7e3c0000-7f4a7e3c2000 rw-p 00021000 08:01 786908                     /lib/x86_64-linux-gnu/ld-2.13.so
7ffff43d3000-7ffff43f5000 rw-p 00000000 00:00 0                          [stack]
7ffff43ff000-7ffff4400000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17503</commentid>
    <comment_count>1</comment_count>
    <who name="Otavio Salvador">otavio</who>
    <bug_when>2011-12-06 06:13:59 +0000</bug_when>
    <thetext>This is a blocker for bootimg and also to remove loopback use of sdcard_image class on meta-texasinstruments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17600</commentid>
    <comment_count>2</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2011-12-13 09:44:03 +0000</bug_when>
    <thetext>This is still an issue after the recent update to dosfstools:

995a09e dosfstools: Add patch to disable fat32 autoselection and behave as 2.10
0c45ecb dosfstools: update native to 2.11

(Nitin requested a retest)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17601</commentid>
    <comment_count>3</comment_count>
    <who name="Otavio Salvador">otavio</who>
    <bug_when>2011-12-13 09:58:23 +0000</bug_when>
    <thetext>Yes it does fail.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17603</commentid>
    <comment_count>4</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-12-13 10:01:19 +0000</bug_when>
    <thetext>dave, 
I am able to reproduce the issue:
mkdosfs 2.11 (12 Mar 2005)
ADD fri2-live-fs/ldlinux.sys
ADD fri2-live-fs/initrd
ADD fri2-live-fs/syslinux.cfg
ADD fri2-live-fs/EFI/BOOT/initrd
*** glibc detected *** image/builddisk/build/build0/tmp/sysroots/x86_64-linux/usr/sbin/mkdosfs: malloc(): memory corruption: 0x000000000195aa40 ***


BTW do you know when it was working, and which patch broke it?

Thanks,
Nitin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17604</commentid>
    <comment_count>5</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2011-12-13 10:42:05 +0000</bug_when>
    <thetext>(In reply to comment #4)
 
&gt; BTW do you know when it was working, and which patch broke it?

It was never working to my knowledge. This is why bootimg crams everything into the root directory. EFI requires live images to use the EFI/BOOT/bootia32.efi directory structure. We can&apos;t do that because dosfstools breaks when using a non-flat directory structure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17613</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-12-13 11:52:40 +0000</bug_when>
    <thetext>For reference that code is also broken with fat32 (-F 32).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17629</commentid>
    <comment_count>7</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-12-13 15:28:12 +0000</bug_when>
    <thetext>I have a patch to fix this issue, will send the commit to mailing list soon.
Nitin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17661</commentid>
    <comment_count>8</comment_count>
    <who name="Nitin Kamble">nitin.a.kamble</who>
    <bug_when>2011-12-15 09:05:35 +0000</bug_when>
    <thetext>This commit went into master to fix the issue.


commit 8413a9b4e80b65e0ad0ddac659cc6abbd305ba35
Author: Nitin A Kamble &lt;nitin.a.kamble@intel.com&gt;
Date:   Tue Dec 13 15:26:22 2011 -0800

    dosfstools: fix populated image creation with dirs
    
    This fixes bug: [YOCTO #1783]
    
    Fix populated image creation. Earlier subdirectories support
    was broken, and files can only be placed in the root directory.
    Now directory hirarchy is supported in the image. Also support
    for long names is extended to directory names.
    
    There are some outstanding issues as documented in the patch
    header, these issues can be worked around by running
    dosfsck tool after populated image creation. The dosfsck tool
    is also part of this package.
    
    (From OE-Core rev: 2de8f008b304017de7ca116aa79ef778ab40362d)
    
    Signed-off-by: Nitin A Kamble &lt;nitin.a.kamble@intel.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>