<?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>3848</bug_id>
          
          <creation_ts>2013-02-05 23:08:18 +0000</creation_ts>
          <short_desc>Create ext* filesystems using libext2fs and debugfs</short_desc>
          <delta_ts>2013-09-09 08:10:16 +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>deployment</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.5 M4</target_milestone>
          
          <blocked>4640</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Darren Hart">dvhart</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>bruce.ashfield</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>mihai.lindner</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>tom.zanussi</cc>
    
    <cc>zhenfeng.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>29549</commentid>
    <comment_count>0</comment_count>
      <attachid>1060</attachid>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-02-05 23:08:18 +0000</bug_when>
    <thetext>Created attachment 1060
example debugfs script

Now that symlink has been merged into upstream into e2fsprogs, we can prototype proper ext4 filesystem generation using a debugfs script and pseudo. This will take the place of genext2fs and serve as the proof of concept before we take the next step and incorporate the initial directory support into mke2fs directly.

The attached debugfs script is a start at what will be required to complete the task. It will need to be modified to make the stat calls on each file and update the destination inodes accordingly. Pseudo will be needed to provide the user/permission mapping to the files on disk.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29591</commentid>
    <comment_count>1</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-02-06 17:12:30 +0000</bug_when>
    <thetext>1.3 M5 has passed....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29980</commentid>
    <comment_count>2</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-02-20 09:08:57 +0000</bug_when>
    <thetext>Hi Darren,

Here are the initial design, please help me to take a look at it and feel free to give your comments.

* Upgrade the e2fsprogs to the update to date version, I&apos;d like to use the git repo if you are fine with it, it is e2fsprogs-1.42.6.tar.gz in yocto currently, which doesn&apos;t have the &quot;symlink&quot; commmand in debugfs shell.

* Replace the current genext2fs command with mkdebugfs.sh in image_types.bbclass:
  - I will go on working on your mkdebugfs.sh, I&apos;d like to add it to the e2fsprogs package in yocto, and install it to sysroot/usr/bin/mkdebugfs.sh

  - When the mkdebugfs.sh is ready, the new steps to generate the root filesystem would be:
    -&gt; use &quot;dd&quot; command to make rootfs.extX file
    -&gt; run &quot;mke2fs -t X rootfs.extX&quot; to create the filesystem
    -&gt; run the mkdebugfs.sh to generate the root filesystem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29994</commentid>
    <comment_count>3</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-02-20 16:00:18 +0000</bug_when>
    <thetext>This looks right to me. Once complete and shown to be working, the next step (separate bug/task) will be to refactor debugfs and move some code into libext2fs and enable mke2fs to prepopulate with an initial directory. We would then need to update yocto again for that. I see these as necessary incremental steps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30025</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-02-22 09:37:37 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Created attachment 1060 [details]
&gt; example debugfs script
&gt; 
&gt; Now that symlink has been merged into upstream into e2fsprogs, we can
&gt; prototype proper ext4 filesystem generation using a debugfs script and
&gt; pseudo. This will take the place of genext2fs and serve as the proof of
&gt; concept before we take the next step and incorporate the initial directory
&gt; support into mke2fs directly.
&gt; 
&gt; The attached debugfs script is a start at what will be required to complete
&gt; the task. It will need to be modified to make the stat calls on each file
&gt; and update the destination inodes accordingly. Pseudo will be needed to

Hi Darren,

I&apos;ve tried a core-image-minimal rootfs generation, it works well, but would you please give me more information about this:

&quot;&quot;&quot;
It will need to be modified to make the stat calls on each file
and update the destination inodes accordingly.
&quot;&quot;&quot;

What information should we update the inode, please? Would you please give me an example ?

The patch will be done sooner.

// Robert

&gt; provide the user/permission mapping to the files on disk.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30045</commentid>
    <comment_count>5</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-02-22 16:52:24 +0000</bug_when>
    <thetext>You need to use stat (which pseudo intercepts) to get the user, group, and permissions of each file. Pseudo will look them up in the database and return the appropriate values in the statbuf. You then pass these values to debugfs with the sif command.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30080</commentid>
    <comment_count>6</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-02-25 16:11:04 +0000</bug_when>
    <thetext>Hi Darren,

I&apos;ve finished the patches and pushed them to:

  git://git.pokylinux.org/poky-contrib robert/e2fsprogs
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/e2fsprogs

Robert Yang (7):
  e2fsprogs: upgrade to the git version (rename only)
  e2fsprogs: upgrade to the git version
  e2fsprogs: add the original mkdebugfs.sh
  mkdebugfs.sh: convert the tab to 4 spaces
  mkdebugfs.sh: several fixes
  e2fsprogs: ship mkfsdebug.sh
  image_types.bbclass: replace genext2fs with mkdebugfs.sh

It would be great if you can help to take a look at them, or I will send them to the oe-core mailing list later after enough testing.

NOTE:


1) These patches would cause the rootfs generation a little slower:

* For a core-image-minimal generation (IMAGE_FSTYPES=&quot;tar.bz2 ext3&quot;):

Before:
$ time bitbake core-image-minimal

real    1m10.823s
user    0m37.108s
sys     0m15.894s

After:
$ time bitbake core-image-minimal

real    1m17.501s
user    0m29.304s
sys     0m20.731s

7 seconds lost.

* For a core-image-sato generation (IMAGE_FSTYPES=&quot;tar.bz2 ext3&quot;):

Before:
$ time bitbake core-image-sato

real    11m10.645s
user    2m43.503s
sys     1m1.589s

After:
$ time bitbake core-image-sato

real    11m53.131s
user    3m18.988s
sys     2m8.350s

43 seconds lost.

2) The image size are the same by &quot;ls -h&quot;, but different by &quot;du -sh&quot;: (core-image-sato)

$ ls -lh BEFORE.rootfs.ext3 AFTER.rootfs.ext3 | awk &apos;{print $5&quot;\t&quot;$NF}&apos;
357M BEFORE.rootfs.ext3
357M AFTER.rootfs.ext3

$ du -sh BEFORE.rootfs.ext3 AFTER.rootfs.ext3
238M    BEFORE.rootfs.ext3
357M    AFTER.rootfs.ext3

It seems that the genext2fs has done several optimization during the rootfs generation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30107</commentid>
    <comment_count>7</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-02-26 10:11:33 +0000</bug_when>
    <thetext>The patch has been sent to oe-core mailing list:

http://lists.linuxtogo.org/pipermail/openembedded-core/2013-February/036290.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32196</commentid>
    <comment_count>8</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-04-16 06:06:24 +0000</bug_when>
    <thetext>Move it to 1.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35940</commentid>
    <comment_count>9</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2013-08-27 04:36:03 +0000</bug_when>
    <thetext>Merged:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f1e6091a1b20f66ede7098e54a2974232943c1c7
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=a758b9302145d0a5b8f6b0e7d276b521ccd49061
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=2cece576b351228cb24bf24a53845646a51f7f6b
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=1b214059be350a3abfc57140cbad00f5bab437bf
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=39d80f6d4ff56e13a621d5f3b9e2b2348efdf3d6
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6a78e22aaede80cd4e0bcbc06b878574766d7b7c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36411</commentid>
    <comment_count>10</comment_count>
    <who name="Mihai Lindner">mihai.lindner</who>
    <bug_when>2013-09-09 08:10:16 +0000</bug_when>
    <thetext>set to verified.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1060</attachid>
            <date>2013-02-05 23:08:18 +0000</date>
            <delta_ts>2013-02-05 23:08:18 +0000</delta_ts>
            <desc>example debugfs script</desc>
            <filename>mkdebugfs.sh</filename>
            <type>application/x-sh</type>
            <size>879</size>
            <attacher name="Darren Hart">dvhart</attacher>
            
              <data encoding="base64">IyEvYmluL3NoClNSQ0RJUj0kMQpERVZJQ0U9JDIKREVCVUdGUz0iZGVidWdmcy9kZWJ1Z2ZzIgoK
eWVzIHwgbWtmcy5leHQ0IHRlc3QuaW1nCgp7CglDV0Q9Ii8iCglmaW5kICRTUkNESVIgfCB3aGls
ZSByZWFkIEZJTEU7IGRvCgkJI1RHVD0ke0ZJTEUjJFNSQ0RJUn0KCQlUR1Q9JChiYXNlbmFtZSAi
JHtGSUxFIyRTUkNESVJ9IikKCQlESVI9JChk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