<?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>2388</bug_id>
          
          <creation_ts>2012-05-02 16:20:54 +0000</creation_ts>
          <short_desc>[Hob] Separate the hob image writer into a separate application</short_desc>
          <delta_ts>2012-06-20 02:25:34 +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>Hob</product>
          <component>hob</component>
          <version>1.2</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>(QA testing completed) Done </status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.3 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Darren Hart">dvhart</reporter>
          <assigned_to name="Kai Kang">kai.kang</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>jiajun.xu</cc>
    
    <cc>liang.li2</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>shane.wang</cc>
    
    <cc>song.liu</cc>
    
    <cc>yi.zhao</cc>
    
    <cc>zhenfeng.zhao</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>20990</commentid>
    <comment_count>0</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-05-02 16:20:54 +0000</bug_when>
    <thetext>The Hob image writer should be broken out as a separate application that Hob calls. This would enable use of this image writer independently from Hob when users have an image and no build environment. It&apos;s also unfortunate to have to parse recipes and build pseudo just to write an image. ddimage provides a workaround, but for the GUI folks, this would be a boon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21234</commentid>
    <comment_count>1</comment_count>
    <who name="Shane Wang">shane.wang</who>
    <bug_when>2012-05-09 02:58:28 +0000</bug_when>
    <thetext>Kai, can you help to separate the deploy dialog from Hob into an app and then Hob to call the app to deploy images?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21236</commentid>
    <comment_count>2</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-05-09 05:24:11 +0000</bug_when>
    <thetext>ok，I&apos;ll take it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21652</commentid>
    <comment_count>3</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-05-28 02:59:37 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Kai, can you help to separate the deploy dialog from Hob into an app and
&gt; then Hob to call the app to deploy images?

How about create a gui tool using the existing codes without separate them?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21700</commentid>
    <comment_count>4</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-05-29 16:04:29 +0000</bug_when>
    <thetext>Mostly just basic UNIX philosophy: Do one thing and do it well.

What would the advantage be of not separating the tool?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21715</commentid>
    <comment_count>5</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-05-30 01:58:41 +0000</bug_when>
    <thetext>The deploy dialog is already a independent class.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21746</commentid>
    <comment_count>6</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-05-30 15:57:14 +0000</bug_when>
    <thetext>That doesn&apos;t really answer the question for me. There is a distinct advantage of having a GUI tool to write images we create that can be deployed as a single file that people can run without pulling in all of the bitbake API code or even the rest of the Hob UI (even if they don&apos;t load it).

If the image writer class is indeed self sufficient, then adding a python main block which allows it to run standalone, then this is a good plan.

e.g.

# just pseudocode, surely complete wrong class names, gtk api, etc. It&apos;s the &quot;if __name__&quot; bit that is relevant:


class DiskWriterUI(object):
    ...

def main():
    ui = DiskWriterUI()
    # validate arguments
    gtk.main()

if __name__ == &quot;__main__&quot;:
    main()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22083</commentid>
    <comment_count>7</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-06-13 02:55:33 +0000</bug_when>
    <thetext>Patch merged，but need new patches to tweak string issues.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22235</commentid>
    <comment_count>8</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-06-15 01:09:07 +0000</bug_when>
    <thetext>Strings issues are fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22280</commentid>
    <comment_count>9</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-06-18 10:12:54 +0000</bug_when>
    <thetext>I have tried the following :
1. plug a usb device to my pc machine
2. run &quot;path_to_git/poky/bitbake/bin/image-writer&quot;

Can choose a ext3 file and select the usb drive and chose &quot;Write USB image&quot;,after type root passwd and wait and can get success info (Deploy images successfully).
then can get the extracted rootfs info from the usb device. 

some warning messages met from the terminal during test:

maybe sometimes following info :
/home/liangli/test_poky_git_43/poky/bitbake/lib/bb/ui/crumbs/hig.py:872: RuntimeWarning: tmpnam is a potential security risk to your program
  tmpname = os.tmpnam()

maybe that would be no helpful to user.

git info:   4f65868ea56695177212ebe4b357b6e1d010e483
git branch: poky/master

test env:
host : ubuntu 12.04 x86_64
kernel: 3.2.0-25-generic #40-Ubuntu SMP</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22285</commentid>
    <comment_count>10</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-06-18 14:32:40 +0000</bug_when>
    <thetext>(In reply to comment #9)

&gt; some warning messages met from the terminal during test:
&gt; 
&gt; maybe sometimes following info :
&gt; /home/liangli/test_poky_git_43/poky/bitbake/lib/bb/ui/crumbs/hig.py:872:
&gt; RuntimeWarning: tmpnam is a potential security risk to your program
&gt;   tmpname = os.tmpnam()

The preferred temp file mechansim is now tempfile:

from tempfile import *
f = NamedTemporaryFile(...)

http://docs.python.org/library/tempfile.html

Available since python 2.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22394</commentid>
    <comment_count>11</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-06-20 02:25:34 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; 
&gt; &gt; some warning messages met from the terminal during test:
&gt; &gt; 
&gt; &gt; maybe sometimes following info :
&gt; &gt; /home/liangli/test_poky_git_43/poky/bitbake/lib/bb/ui/crumbs/hig.py:872:
&gt; &gt; RuntimeWarning: tmpnam is a potential security risk to your program
&gt; &gt;   tmpname = os.tmpnam()
&gt; 
&gt; The preferred temp file mechansim is now tempfile:
&gt; 
&gt; from tempfile import *
&gt; f = NamedTemporaryFile(...)
&gt; 
&gt; http://docs.python.org/library/tempfile.html
&gt; 
&gt; Available since python 2.3

Thanks. I&apos;ll fix it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>