]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: keep rootfs_size as integer
authorAlexander Kanavin <alex.kanavin@gmail.com>
Fri, 17 Sep 2021 12:59:20 +0000 (14:59 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 17 Sep 2021 20:32:51 +0000 (21:32 +0100)
The corrected line accidentally converted it to float,
which causes problems later on with python 3.10:

|   File "/home/alex/development/poky/scripts/lib/wic/partition.py", line 278, in prepare_rootfs_ext
|     os.ftruncate(sparse.fileno(), rootfs_size * 1024)
| TypeError: 'float' object cannot be interpreted as an integer

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/partition.py

index ab304f1b2a8ae9c1b50d48e5e0cc74d160e25708..a25834048e81bb6988734e4967363459755c3721 100644 (file)
@@ -105,7 +105,7 @@ class Partition():
                 extra_blocks = self.extra_space
 
             rootfs_size = actual_rootfs_size + extra_blocks
-            rootfs_size *= self.overhead_factor
+            rootfs_size = int(rootfs_size * self.overhead_factor)
 
             logger.debug("Added %d extra blocks to %s to get to %d total blocks",
                          extra_blocks, self.mountpoint, rootfs_size)