Usb Imagewriter progress bar is not working

Bug #354142 reported by Krasimir Chonov
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
USB ImageWriter
Incomplete
Medium
Unassigned

Bug Description

When I start the write process, the progress bar is not moving. I`m using images of ubuntu-notebook-remix Jaunty Jackalope (development branch). I tried several times with different images but is still the same.

Revision history for this message
Oliver Grawert (ogra) wrote :

can you run it as: sudo imagewriter
from a gnome terminal and paste teh output here (if you get any at least)

Changed in usb-imagewriter:
status: New → Incomplete
Oliver Grawert (ogra)
Changed in usb-imagewriter:
importance: Undecided → Medium
Revision history for this message
ZillaVilla (zillavilla) wrote :

when I try it all I get is:

Image: /home/scott/Desktop/ubuntu-9.04-netbook-remix-i386.img
Target Device: Generic USB SD Reader (/dev/sdb)
Executing: dd if=/home/scott/Desktop/ubuntu-9.04-netbook-remix-i386.img of=/dev/sdb

and it stays there forever...1+ hour without any progress. the light is flashing on my card reader but nothing seems to happen.

Revision history for this message
Fedik (fedikw) wrote :

when run as: sudo imagewriter

~$ sudo imagewriter
0
Traceback (most recent call last):
  File "/usr/lib/imagewriter/imagewriter.py", line 112, in do_write
    self.raw_write(source, target)
  File "/usr/lib/imagewriter/imagewriter.py", line 166, in raw_write
    size = float(target_size)*100/float(src_size)
ValueError: could not convert string to float: copied

Revision history for this message
Fedik (fedikw) wrote :

looks like problem at line imagewriter.py:164
there "target_size = line.split()[0]" return "скопійовано"(copied) instead of number of the bytes in my locale (uk_UA)

Revision history for this message
DooBLER (mrdoobler+lp) wrote :

Quick fix for this bug:

Add after line 164 ( target_size = line.split()[0] )

                if not target_size.isdigit():
                    target_size = line.split()[1]

Spaces are important!

This should work for languages that have word "copied" before the actual number of copied bytes.
For example in Polish - output from "dd" command is: "skopiowane 231735296 bajtów (232 MB), 35,5015 s, 6,5 MB/s"

Below entire function with changes:

    def raw_write(self, source, target):
        data = Popen(['ls -l '+source], shell=True, stdout=PIPE, stderr=PIPE)
        src_size = float(data.stdout.readline().split()[4])*1.0
        progress = self.wTree.get_widget("progressbar")
        progress.set_sensitive(True)
        progress.set_text(_('Writing ')+source.split('/')[-1]+_(' to ')+self.dev)
        self.logger(_('Executing: dd if=')+source+' of='+target)
        while gtk.events_pending():
           gtk.main_iteration(True)
        output = Popen(['dd if='+source+' of='+target+' bs=1M'], stdout=PIPE, stderr=STDOUT, shell=True)
        self.ddpid = output.pid
        while output.stdout.readline():
            line = output.stdout.readline().strip()
            while gtk.events_pending():
                gtk.main_iteration(True)
            if line.endswith('MB/s'):
                target_size = line.split()[0]
                if not target_size.isdigit():
                    target_size = line.split()[1]
                self.logger(_('Wrote: ')+target_size+' bytes')
                size = float(target_size)*100/float(src_size)
                while gtk.events_pending():
                    gtk.main_iteration(True)
                progress.set_fraction(float(size/100))
        pid, sts = os.waitpid(output.pid, 0)
        if sts != 0:
            self.logger(_('The dd process ended with an error !'))
            self.emergency()
            return False
        progress.set_fraction(1.0)
        self.logger(_('Image ')+source.split('/')[-1]+_(' successfully written to')+target)
        self.success()

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.