]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Fix naming conflict
authorEd Bartosh <ed.bartosh@linux.intel.com>
Sat, 27 Jun 2015 12:08:15 +0000 (15:08 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 Jul 2015 22:01:39 +0000 (23:01 +0100)
Image file name is not unique for the partitions without label.
This causes image being rewritten and used as a source for all
partitions without label. Wic produces broken or incorrect result
images because of that.

Added wks line number to the image name to make it unique.

scripts/lib/wic/kickstart/custom_commands/partition.py

index 72f617a1b6bb7c370f4175b53378438126093dbf..874b20766da034b4fb5fc0810992d1293e31b683 100644 (file)
@@ -160,7 +160,8 @@ class Wic_PartData(Mic_PartData):
                 self.prepare_swap_partition(cr_workdir, oe_builddir,
                                             native_sysroot)
             elif self.fstype:
-                rootfs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
+                rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label,
+                                             self.lineno, self.fstype)
                 if os.path.isfile(rootfs):
                     os.remove(rootfs)
                 for prefix in ("ext", "btrfs", "vfat", "squashfs"):
@@ -227,7 +228,8 @@ class Wic_PartData(Mic_PartData):
         pseudo += "export PSEUDO_NOSYMLINKEXP=%s;" % p_nosymlinkexp
         pseudo += "%s/usr/bin/pseudo " % native_sysroot
 
-        rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
+        rootfs = "%s/rootfs_%s.%s.%s" % (cr_workdir, self.label,
+                                         self.lineno, self.fstype)
         if os.path.isfile(rootfs):
             os.remove(rootfs)