diff options
author | Dohyung Kim <dohyung2.kim@samsung.com> | 2017-11-15 17:48:39 +0900 |
---|---|---|
committer | yuhuan.yang <yuhuan.yang@samsung.com> | 2018-01-30 11:18:36 +0800 |
commit | 2f7aece3af62a2120b2117799c21f5ec5e937665 (patch) | |
tree | cfb1ca86b530d05b10bba608272829068d1010ed | |
parent | 2af451af4f5b4cacbc47a36fee8ebda99ef28b73 (diff) | |
download | mic-2f7aece3af62a2120b2117799c21f5ec5e937665.tar.gz mic-2f7aece3af62a2120b2117799c21f5ec5e937665.tar.bz2 mic-2f7aece3af62a2120b2117799c21f5ec5e937665.zip |
call copy_attachment() after configure() and move attachment files
- Call BaseImager.copy_attachment() after BaseImager.configure()
Post scripts on configure() cannot access attachment files which come from install_root.
So call copy_attachment() after running post scripts.
- Move attachment files not copy.
If copying attachment files from install_root, then attachment files remain in install_root.
So use mv instead of cp for deduplication.
Change-Id: Ie7a1d516331e29eaba975bc186b9644b96c17fbc
Signed-off-by: Dohyung Kim <dohyung2.kim@samsung.com>
-rwxr-xr-x | mic/imager/baseimager.py | 2 | ||||
-rwxr-xr-x | mic/imager/loop.py | 6 | ||||
-rwxr-xr-x | plugins/imager/fs_plugin.py | 1 | ||||
-rwxr-xr-x | plugins/imager/loop_plugin.py | 1 | ||||
-rwxr-xr-x | plugins/imager/qcow_plugin.py | 1 | ||||
-rwxr-xr-x | plugins/imager/raw_plugin.py | 1 |
6 files changed, 8 insertions, 4 deletions
diff --git a/mic/imager/baseimager.py b/mic/imager/baseimager.py index c1bb418..a1ddb6a 100755 --- a/mic/imager/baseimager.py +++ b/mic/imager/baseimager.py @@ -1197,7 +1197,7 @@ class BaseImageCreator(object): raise CreatorError("Tpk package missing.") def postinstall(self): - self.copy_attachment() + pass def _get_sign_scripts_env(self): """Return an environment dict for %post-umount scripts. diff --git a/mic/imager/loop.py b/mic/imager/loop.py index 1e44343..fd4830c 100755 --- a/mic/imager/loop.py +++ b/mic/imager/loop.py @@ -497,13 +497,13 @@ class LoopImageCreator(BaseImageCreator): self._check_imgdir() - msger.info("Copying attachment files...") + msger.info("Moving 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("Copy attachment %s to %s" % (item, dpath)) - shutil.copy(item, dpath) + msger.verbose("Move attachment %s to %s" % (item, dpath)) + shutil.move(item, dpath) def create_manifest(self): if self.compress_image: diff --git a/plugins/imager/fs_plugin.py b/plugins/imager/fs_plugin.py index c639211..b922b28 100755 --- a/plugins/imager/fs_plugin.py +++ b/plugins/imager/fs_plugin.py @@ -104,6 +104,7 @@ class FsPlugin(ImagerPlugin): creator.configure(creatoropts["repomd"]) creator.copy_kernel() + creator.copy_attachment() creator.unmount() creator.package(creatoropts["destdir"]) creator.create_manifest() diff --git a/plugins/imager/loop_plugin.py b/plugins/imager/loop_plugin.py index 0b94f0e..d81eb45 100755 --- a/plugins/imager/loop_plugin.py +++ b/plugins/imager/loop_plugin.py @@ -104,6 +104,7 @@ 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() diff --git a/plugins/imager/qcow_plugin.py b/plugins/imager/qcow_plugin.py index d6758c5..2cc9d43 100755 --- a/plugins/imager/qcow_plugin.py +++ b/plugins/imager/qcow_plugin.py @@ -135,6 +135,7 @@ 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() diff --git a/plugins/imager/raw_plugin.py b/plugins/imager/raw_plugin.py index e954b7b..7d44bc3 100755 --- a/plugins/imager/raw_plugin.py +++ b/plugins/imager/raw_plugin.py @@ -102,6 +102,7 @@ class RawPlugin(ImagerPlugin): creator.tpkinstall() creator.configure(creatoropts["repomd"]) creator.copy_kernel() + creator.copy_attachment() creator.unmount() creator.generate_bmap() creator.package(creatoropts["destdir"]) |