]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: do not remove build dir in source plugins
authorEd Bartosh <ed.bartosh@linux.intel.com>
Tue, 19 Jan 2016 16:51:05 +0000 (18:51 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Jan 2016 21:30:37 +0000 (21:30 +0000)
Interesting bug was found during implementation of 'include'
parser command.

Build directory was removed in do_configure_partition method of
bootimg- source plugins. This can cause removal of previously
prepared partition images if /boot partition is mentioned after
other partitions in .ks file.

Moved work directory removal to direct.py before processing
partitions.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/imager/direct.py
scripts/lib/wic/plugins/source/bootimg-efi.py
scripts/lib/wic/plugins/source/bootimg-partition.py
scripts/lib/wic/plugins/source/bootimg-pcbios.py

index 8d4daece0df3e8167b68dd4b59931f976e550d88..a1b424965173146a1ae555a6fbd060ef67733f6f 100644 (file)
@@ -229,6 +229,9 @@ class DirectImageCreator(BaseImageCreator):
 
         fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
 
+        shutil.rmtree(self.workdir)
+        os.mkdir(self.workdir)
+
         for part in parts:
             # get rootfs size from bitbake variable if it's not set in .ks file
             if not part.size:
index 125c943d1249821fa9fdd8a6d51694ad85764c3b..a4734c9b36635328a219c4f260d255e2d110dacc 100644 (file)
@@ -142,8 +142,6 @@ class BootimgEFIPlugin(SourcePlugin):
         Called before do_prepare_partition(), creates loader-specific config
         """
         hdddir = "%s/hdd/boot" % cr_workdir
-        rm_cmd = "rm -rf %s" % cr_workdir
-        exec_cmd(rm_cmd)
 
         install_cmd = "install -d %s/EFI/BOOT" % hdddir
         exec_cmd(install_cmd)
index bc2ca0f6fae3d956cee4378393d22c595c2a8051..b76c1211ae63162c6e73b90d479f3b87d4c9cd68 100644 (file)
@@ -71,9 +71,6 @@ class BootimgPartitionPlugin(SourcePlugin):
         - copies all files listed in IMAGE_BOOT_FILES variable
         """
         hdddir = "%s/boot" % cr_workdir
-        rm_cmd = "rm -rf %s/boot" % cr_workdir
-        exec_cmd(rm_cmd)
-
         install_cmd = "install -d %s" % hdddir
         exec_cmd(install_cmd)
 
index a1bfa2671e8a146757e48991d799ac5f4e4c4d99..5b719bf3bb8ffc22517ec9da5322518097df85a0 100644 (file)
@@ -78,8 +78,6 @@ class BootimgPcbiosPlugin(SourcePlugin):
         Called before do_prepare_partition(), creates syslinux config
         """
         hdddir = "%s/hdd/boot" % cr_workdir
-        rm_cmd = "rm -rf " + cr_workdir
-        exec_cmd(rm_cmd)
 
         install_cmd = "install -d %s" % hdddir
         exec_cmd(install_cmd)