[bitbake-devel] hob: sync after image deploy

Submitted by Valentin Popa on March 17, 2014, 3:53 p.m.

Details

Message ID 1395071618-24702-1-git-send-email-valentin.popa@intel.com
State New
Headers show

Commit Message

Valentin Popa March 17, 2014, 3:53 p.m.
Showing "Deploy image successful" after 'dd' returns
may determine the user to disconnect the usb stick even
though the writing operations are not finished.
This patch makes sure that the entire image is deployed
on the usb stick before the user is informed about any result.

[YOCTO #5892]

Signed-off-by: Valentin Popa <valentin.popa@intel.com>
---
 bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py b/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py
index f64fbd6..a13fff9 100644
--- a/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py
+++ b/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py
@@ -167,7 +167,7 @@  class DeployImageDialog (CrumbsDialog):
                 if cmdline:
                     tmpfile = tempfile.NamedTemporaryFile()
                     cmdline += "\"sudo dd if=" + self.image_path + \
-                                " of=" + combo_item + "; echo $? > " + tmpfile.name + "\""
+                                " of=" + combo_item + " && sync; echo $? > " + tmpfile.name + "\""
                     subprocess.call(shlex.split(cmdline))
 
                     if int(tmpfile.readline().strip()) == 0: