summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Borzecki <maciej.borzecki@open-rnd.pl>2014-09-22 13:35:15 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-23 20:35:56 +0100
commit6b8c9def1647f9ecf8697e91fc23c162b33c3bc5 (patch)
treebb725efe5f81172b2293448cdc5a5bd0497833d4
parentee893797fa4d7a8c0cf1ad9e84fdb180cba72048 (diff)
downloadtizen-distro-6b8c9def1647f9ecf8697e91fc23c162b33c3bc5.tar.gz
tizen-distro-6b8c9def1647f9ecf8697e91fc23c162b33c3bc5.tar.bz2
tizen-distro-6b8c9def1647f9ecf8697e91fc23c162b33c3bc5.zip
wic: fix vfat partition sector count only if needed
VFAT rootfs partitions sector count would get updated always even if there is no need. Since parition size in wic is expressed in MB, any sub MB change will cause the generated partition image to be larger than allocated space within the disk image. Fortunately, partitions sized in MB will most of the time have a proper sector count. (From OE-Core rev: 99bee4cb489800d74dea4d2158ff834413685f04) Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/wic/kickstart/custom_commands/partition.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index f41d136d8f..8b0ace6299 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -318,9 +318,11 @@ class Wic_PartData(Mic_PartData):
# Ensure total sectors is an integral number of sectors per
# track or mcopy will complain. Sectors are 512 bytes, and we
- # generate images with 32 sectors per track. This calculation is
- # done in blocks, thus the mod by 16 instead of 32.
- blocks += (16 - (blocks % 16))
+ # generate images with 32 sectors per track. This calculation
+ # is done in blocks, thus the mod by 16 instead of 32. Apply
+ # sector count fix only when needed.
+ if blocks % 16 != 0:
+ blocks += (16 - (blocks % 16))
dosfs_cmd = "mkdosfs -n boot -S 512 -C %s %d" % (rootfs, blocks)
exec_native_cmd(dosfs_cmd, native_sysroot)