[gnome-ostree] Throw an error if qemu exits abnormally during bootloader installation



commit b27543d426a0008ca17137b277ddc770374171e1
Author: Colin Walters <walters verbum org>
Date:   Fri May 31 19:31:33 2013 -0400

    Throw an error if qemu exits abnormally during bootloader installation
    
    Otherwise we may silently fail to install it.  Also add some more
    verbosity.

 src/js/libqa.js                 |   13 ++-----------
 src/js/tasks/task-builddisks.js |    2 ++
 2 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/src/js/libqa.js b/src/js/libqa.js
index 52fc988..f975eec 100644
--- a/src/js/libqa.js
+++ b/src/js/libqa.js
@@ -354,18 +354,9 @@ function bootloaderInstall(diskpath, workdir, osname, cancellable) {
                                   '-append', 'console=ttyS0 root=LABEL=gnostree-root rw ostree=' + osname + 
'/current systemd.unit=gnome-ostree-install-bootloader.target'
                                  ]);
 
-    let qemuContext = new GSystem.SubprocessContext({ argv: qemuArgs });
-    qemuContext.set_cwd(workdir.get_path());
-    let qemu = new GSystem.Subprocess({context: qemuContext});
+    ProcUtil.runSync(qemuArgs, cancellable, { cwd: workdir.get_path(),
+                                             logInitiation: true });
 
-    print("starting bootloader installation : " + qemuArgs.join(' '));
-
-    qemu.init(cancellable);
-    let [success, status] = qemu.wait_sync(cancellable);
     tmpKernelPath.delete(cancellable);
     tmpInitrdPath.delete(cancellable);
-
-    if (!success)
-       throw new Error("Couldn't install bootloader through qemu, error code: " +
-                       status);
 }
diff --git a/src/js/tasks/task-builddisks.js b/src/js/tasks/task-builddisks.js
index 51840ce..7e37dd2 100644
--- a/src/js/tasks/task-builddisks.js
+++ b/src/js/tasks/task-builddisks.js
@@ -120,8 +120,10 @@ const TaskBuildDisks = new Lang.Class({
                 gfmnt.umount(cancellable);
             }
             LibQA.bootloaderInstall(diskPath, subworkdir, osname, cancellable);
+            print("Bootloader installation complete");
 
             this._postDiskCreation(diskPath, cancellable);
+            print("post-disk creation complete");
              }
 
         GSystem.file_rename(workImageDir, targetImageDir, cancellable);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]