[gnome-continuous] Create a smaller disk image for the hwtest tree



commit 298719dfd9a0bed864e6ae7f2423b827473c6c00
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sat Sep 20 10:27:05 2014 -0400

    Create a smaller disk image for the hwtest tree
    
    Since the hwtest tree doesn't include the desktop and is considerably
    smaller than the other trees, and since one of the uses of the tree
    is writing to a USB disk for installation, build only a 4GB image
    for the hwtest tree.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737185

 src/js/libqa.js                 |    7 ++++---
 src/js/tasks/task-builddisks.js |    6 +++++-
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/js/libqa.js b/src/js/libqa.js
index 02d3898..fb7efe8 100644
--- a/src/js/libqa.js
+++ b/src/js/libqa.js
@@ -93,14 +93,15 @@ function newReadWriteMount(diskpath, cancellable) {
     return [gfmnt, mntdir];
 }
 
-function createDisk(diskpath, cancellable) {
-    let sizeMb = 8 * 1024;
+function createDisk(diskpath, params, cancellable) {
+    params = Params.parse(params, { sizeMB: 8 * 1024 });
+
     let bootsizeMb = 200;
     let swapsizeMb = 64;
 
     let guestfishProcess;
     
-    ProcUtil.runSync(['qemu-img', 'create', '-f', 'qcow2', diskpath.get_path(), '' + sizeMb + 'M'], 
cancellable);
+    ProcUtil.runSync(['qemu-img', 'create', '-f', 'qcow2', diskpath.get_path(), '' + params.sizeMB + 'M'], 
cancellable);
     let makeDiskCmd = 'launch\n\
 part-init /dev/sda mbr\n\
 blockdev-getsize64 /dev/sda\n\
diff --git a/src/js/tasks/task-builddisks.js b/src/js/tasks/task-builddisks.js
index ec4cabc..26ca923 100644
--- a/src/js/tasks/task-builddisks.js
+++ b/src/js/tasks/task-builddisks.js
@@ -111,7 +111,11 @@ const TaskBuildDisks = new Lang.Class({
             if (doCloneDisk) {
                 LibQA.copyDisk(prevPath, diskPath, cancellable);
             } else {
-                LibQA.createDisk(diskPath, cancellable);
+                // create a smaller disk for the hwtest image to facilitate writing to a thumbdrive
+                let params = {};
+                if (JSUtil.stringEndswith(targetName, '-hwtest'))
+                    params.sizeMB = 4 * 1024;
+                LibQA.createDisk(diskPath, params, cancellable);
             }
             let mntdir = Gio.File.new_for_path('mnt-' + squashedName);
             GSystem.file_ensure_directory(mntdir, true, cancellable);


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