[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4362/8267] wic: get rid of baseimager inheritance



commit 75318c7b0c0ce1f811fb020692abe572c5192743
Author: Ed Bartosh <ed bartosh linux intel com>
Date:   Tue Jan 24 15:43:50 2017 +0200

    wic: get rid of baseimager inheritance
    
    Simplified DirectImageCreator code by removing inheritance
    from BaseImageCreator. This inheritance doesn't make much sense
    as DirectImageCreator is the only class that was inherited from
    BaseImageCreator.
    
    (From OE-Core rev: 4e9952514211ef4b9a3731ce915090385f335a31)
    
    Signed-off-by: Ed Bartosh <ed bartosh linux intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 scripts/lib/wic/imager/baseimager.py |  191 ----------------------------------
 scripts/lib/wic/imager/direct.py     |   19 +++-
 2 files changed, 13 insertions(+), 197 deletions(-)
---
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index 52828c1..825c9d7 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -32,7 +32,6 @@ from wic import msger
 from wic.utils.oe.misc import get_bitbake_var
 from wic.utils.partitionedfs import Image
 from wic.utils.errors import CreatorError, ImageError
-from wic.imager.baseimager import BaseImageCreator
 from wic.plugin import pluginmgr
 from wic.utils.oe.misc import exec_cmd, exec_native_cmd
 
@@ -61,7 +60,7 @@ class DiskImage():
 
         self.created = True
 
-class DirectImageCreator(BaseImageCreator):
+class DirectImageCreator:
     """
     Installs a system into a file containing a partitioned disk image.
 
@@ -72,15 +71,23 @@ class DirectImageCreator(BaseImageCreator):
     media and used on actual hardware.
     """
 
-    def __init__(self, oe_builddir, image_output_dir, rootfs_dir, bootimg_dir,
-                 kernel_dir, native_sysroot, compressor, creatoropts=None,
-                 bmap=False):
+    def __init__(self, oe_builddir, image_output_dir, rootfs_dir,
+                 bootimg_dir, kernel_dir, native_sysroot, compressor,
+                 creatoropts, bmap=False):
         """
         Initialize a DirectImageCreator instance.
 
         This method takes the same arguments as ImageCreator.__init__()
         """
-        BaseImageCreator.__init__(self, creatoropts)
+
+        self.name = creatoropts['name']
+        self.ks = creatoropts['ks']
+
+        self.tmpdir = "/var/tmp/wic"
+        self.workdir = "/var/tmp/wic/build"
+
+        if not os.path.exists(self.tmpdir):
+            os.makedirs(self.tmpdir)
 
         self.__image = None
         self.__disks = {}


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