<?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>6990</bug_id>
          
          <creation_ts>2014-11-21 05:09:52 +0000</creation_ts>
          <short_desc>make extlinux work without mount the filesystem</short_desc>
          <delta_ts>2015-05-01 19:09:20 +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>1.8</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.8 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Yang">liezhi.yang</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>adrian.freihofer</cc>
    
    <cc>alexandru.c.georgescu</cc>
    
    <cc>costin.c.constantin</cc>
    
    <cc>dolpher.du</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          <qa_contact name="Costin">costin.c.constantin</qa_contact>
          <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>47132</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-11-21 05:09:52 +0000</bug_when>
    <thetext>Currently, the extlinux only can work after the filesystem (or disk partation) is mounted, for example:

mount image.ext3 /tmp/mnt
extlinux -i /tmp/mnt

The mount requires the root privilege, we can make extlinux to directly write to  without the mount, for example:

extlinux -i -d image.ext3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47668</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-12-24 09:13:05 +0000</bug_when>
    <thetext>Sent the patches to syslinux community:

The following changes since commit 81ad566f155fac31089fde69c87059b217e7e9b6:

  NEWS: Update for 6.03 release (2014-10-06 09:27:44 -0700)

are available in the git repository at:

  https://github.com/robertlinux/sys_tmp.git unmounted_ext

for you to fetch changes up to a3603826b88c5f000c5b0ba519cd0a5252eb6c6b:

  libinstaller/syslxopt.c: update the help text. (2014-12-24 16:07:50 +0800)
Robert Yang (8):
  extlinux/main.c: support unmounted ext2/3/4 filesystem
  extlinux/main.c: implement install_file_to_device()
  extlinux/main.c: implement handle_adv_on_device()
  extlinux/main.c: implent ext_read/write_xx_fs()
  extlinux/main.c: implement write_to_device()
  extlinux/main.c: implement patch_syslinux_bootsect()
  extlinux/main.c: implement ext_construct_sectmap_fs()
  libinstaller/syslxopt.c: update the help text.

 extlinux/Makefile       |   2 +-
 extlinux/main.c         | 611 +++++++++++++++++++++++++++++++++++++++++++-----
 libinstaller/syslxopt.c |   2 +-
 3 files changed, 553 insertions(+), 62 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49388</commentid>
    <comment_count>2</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-03-12 03:25:47 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=a2bfd4b1fb055e63a48d80e7e55a6cff475e06d1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50032</commentid>
    <comment_count>3</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-04-02 11:27:58 +0000</bug_when>
    <thetext>Hello,

Tested on latest master hash: 9e4adec98db325112ca7a8b9dd95722d4d0ab642

BB_VERSION        = &quot;1.27.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;Ubuntu-14.04&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;genericx86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;1.8+snapshot-20150401&quot;
TUNE_FEATURES     = &quot;m32 core2&quot;
TARGET_FPU        = &quot;&quot;
meta
meta-yocto
meta-yocto-bsp    = &quot;master:9e4adec98db325112ca7a8b9dd95722d4d0ab642&quot;


Steps performed to test this enhancement:
1) bitbake syslinux-native
2) sudo dd if=/dev/zero of=test.img bs=1M count=1k

~/poky/build$ ls -lh test.img
-rw-r--r-- 1 root root 1.0G Apr  1 11:33 test.img
...

3)sudo mkfs.ext3 -F test.img

4) $ pwd
/home/autobuilder/poky/build/tmp/sysroots/x86_64-linux/usr/bin
$ ./syslinux -i ../../../../../test.img
./syslinux: invalid media signature (not an FAT/NTFS volume?)

It seems not to work with ext3 filesystem. I also tried ext2 and ext4.

Costin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50256</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-04-13 03:15:45 +0000</bug_when>
    <thetext>It is because:
/home/autobuilder/poky/build/tmp/sysroots/x86_64-linux/usr/bin/syslinux

is syslinux-mtools, please use this one atm:

./tmp/work/x86_64-linux/syslinux-native/6.03-r0/syslinux-6.03/bios/linux/syslinux

We still need more work to do with syslinux, I will file another 2 to track them, so I will mark it as done atm.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50717</commentid>
    <comment_count>5</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-05-01 19:09:20 +0000</bug_when>
    <thetext>Hello,

Checked as per last comment&apos;s recommendation. It worked:

Steps performed:

all as on comment#3, the exception being the use of syslinux from this dir:
/media/poky/3poky/build/tmp/work/x86_64-linux/syslinux-native/6.03-r0/syslinux-6.03/bios/linux
This time, i put the test.img in this dir also (for ease of use)


To verify:
1)mkdir test
2)sudo mount test.img test
3)ls test
drwxr-xr-x 3 root    root      4096 mai  1 22:10 ./
drwxrwxr-x 3 cosscat cosscat   4096 mai  1 22:11 ../
-r--r--r-- 1 root    root    122308 mai  1 22:11 ldlinux.c32
-r--r--r-- 1 root    root     69632 mai  1 22:11 ldlinux.sys
drwx------ 2 root    root     16384 mai  1 22:10 lost+found/


Marking as verified

Costin</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>