Patchwork [dora] bitbake: hob: sync after image deploy

login
register
mail settings
Submitter Valentin Popa
Date May 9, 2014, 12:29 p.m.
Message ID <1399638546-27715-1-git-send-email-valentin.popa@intel.com>
Download mbox | patch
Permalink /patch/71813/
State New
Headers show

Comments

Valentin Popa - May 9, 2014, 12:29 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.

This patch was merged in 1.6. Alex Georgescu thinks it would be
nice to add it to dora also.

[YOCTO #5892]

(Bitbake rev: cc98b19112ab875ebc7cb604cd96acadac4cbf21)

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

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py b/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py
index bc1efbb..1d57b27 100644
--- a/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py
+++ b/bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py
@@ -166,7 +166,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: