Revert "call copy_attachment() after configure() and move attachment files"
authorDohyung Kim <dohyung2.kim@samsung.com>
Tue, 13 Mar 2018 06:31:29 +0000 (15:31 +0900)
committermao xiaojuan <xiaojuan.mao@samsung.com>
Thu, 22 Mar 2018 03:00:29 +0000 (11:00 +0800)
This reverts commit 7db9b0c91a5b26f96a86ec10dfad261a7d781f3b.

Change-Id: Iaa242d65fd7fb14c379fff0f268ac1607005169e

mic/imager/baseimager.py
mic/imager/loop.py
plugins/imager/fs_plugin.py
plugins/imager/loop_plugin.py
plugins/imager/qcow_plugin.py
plugins/imager/raw_plugin.py

index ef86f0f..022d955 100755 (executable)
@@ -1195,7 +1195,7 @@ class BaseImageCreator(object):
                     raise CreatorError("Tpk package missing.")
 
     def postinstall(self):
-        pass
+        self.copy_attachment()
 
     def _get_sign_scripts_env(self):
         """Return an environment dict for %post-umount scripts.
index e9815c9..268ba84 100755 (executable)
@@ -507,13 +507,13 @@ class LoopImageCreator(BaseImageCreator):
 
         self._check_imgdir()
 
-        msger.info("Moving attachment files...")
+        msger.info("Copying attachment files...")
         for item in self._attachment:
             if not os.path.exists(item):
                 continue
             dpath = os.path.join(self._imgdir, os.path.basename(item))
-            msger.verbose("Move attachment %s to %s" % (item, dpath))
-            shutil.move(item, dpath)
+            msger.verbose("Copy attachment %s to %s" % (item, dpath))
+            shutil.copy(item, dpath)
 
     def move_post_umount_scripts(self):
         scripts_dir = self._instroot + "/var/tmp/post_umount_scripts"
index b922b28..c639211 100755 (executable)
@@ -104,7 +104,6 @@ class FsPlugin(ImagerPlugin):
 
             creator.configure(creatoropts["repomd"])
             creator.copy_kernel()
-            creator.copy_attachment()
             creator.unmount()
             creator.package(creatoropts["destdir"])
             creator.create_manifest()
index d81eb45..0b94f0e 100755 (executable)
@@ -104,7 +104,6 @@ class LoopPlugin(ImagerPlugin):
             creator.tpkinstall()
             creator.configure(creatoropts["repomd"])
             creator.copy_kernel()
-            creator.copy_attachment()
             creator.create_cpio_image()
             creator.unmount()
             creator.copy_cpio_image()
index 2cc9d43..d6758c5 100755 (executable)
@@ -135,7 +135,6 @@ class QcowPlugin(ImagerPlugin):
             creator.tpkinstall()
             creator.configure(creatoropts["repomd"])
             creator.copy_kernel()
-            creator.copy_attachment()
             creator.create_cpio_image()
             creator.unmount()
             creator.copy_cpio_image()
index 7d44bc3..e954b7b 100755 (executable)
@@ -102,7 +102,6 @@ class RawPlugin(ImagerPlugin):
             creator.tpkinstall()
             creator.configure(creatoropts["repomd"])
             creator.copy_kernel()
-            creator.copy_attachment()
             creator.unmount()
             creator.generate_bmap()
             creator.package(creatoropts["destdir"])