mirror of
https://git.yoctoproject.org/poky
synced 2026-09-16 00:49:32 +02:00
wic: use // operator instead of /
Division operator works differently in Python 3. It results in float unlike in Python 2, where it results in int. Explicitly used "floor division" operator instead of 'division' operator. This should make the code to result in integer under both pythons. [YOCTO #9412] (From OE-Core rev: 997ff239bd753a7957cc14c6829b2f093d9bcef6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
bc89dc4225
commit
5f06463c6c
@@ -95,7 +95,7 @@ class Image():
|
||||
ks_pnum = len(self.partitions)
|
||||
|
||||
# Converting kB to sectors for parted
|
||||
size = size * 1024 / self.sector_size
|
||||
size = size * 1024 // self.sector_size
|
||||
|
||||
part = {'ks_pnum': ks_pnum, # Partition number in the KS file
|
||||
'size': size, # In sectors
|
||||
@@ -173,12 +173,12 @@ class Image():
|
||||
# gaps we could enlargea the previous partition?
|
||||
|
||||
# Calc how much the alignment is off.
|
||||
align_sectors = disk['offset'] % (part['align'] * 1024 / self.sector_size)
|
||||
align_sectors = disk['offset'] % (part['align'] * 1024 // self.sector_size)
|
||||
|
||||
if align_sectors:
|
||||
# If partition is not aligned as required, we need
|
||||
# to move forward to the next alignment point
|
||||
align_sectors = (part['align'] * 1024 / self.sector_size) - align_sectors
|
||||
align_sectors = (part['align'] * 1024 // self.sector_size) - align_sectors
|
||||
|
||||
msger.debug("Realignment for %s%s with %s sectors, original"
|
||||
" offset %s, target alignment is %sK." %
|
||||
|
||||
Reference in New Issue
Block a user