Revert "call copy_attachment() after configure() and move attachment files" 94/172294/2
authorDohyung Kim <dohyung2.kim@samsung.com>
Tue, 13 Mar 2018 06:31:29 +0000 (15:31 +0900)
committerpark <sk7.park@samsung.com>
Tue, 20 Mar 2018 11:36:06 +0000 (11:36 +0000)
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 ef86f0fad64313db8e580634112183f858bed682..022d95515e701ee19080e768b556647d61215506 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 e9815c9d2708aef4f462ba08a2bc97c92b3ebf1d..268ba842d559736fec998c7346691de14ccf630e 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 b922b28c84211fac80e2c12d79637946364eabe2..c63921179c0423ef489ca1e6c99865ae0d2e289a 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 d81eb457656a3a6e54b1f646e338c0c91c39a9cb..0b94f0ea17d5f9ac66909220256096e9fbac924e 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 239778b828379075fe3846edb5aec91ae3830f41..3962ec00a846d8bf8aba99556bf075dd8a6129e0 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 7d44bc3266338dd4f3a9caafc9850346475e0957..e954b7b271bbc583d4c2f987278df29885daf04e 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"])