pmb/install: have size_boot, size_root in MiB (MR 1946)

Prepare for a future patch, that adds reserved space in MiB, by changing
size_boot and size_root from bytes to MB everywhere. This is what we need
most of the time and allows to drop some /1024**2 statements.
This commit is contained in:
Oliver Smith 2020-06-06 18:39:21 +02:00 committed by Bart Ribbers
parent 63fc2b621a
commit 2fc0794e30
No known key found for this signature in database
GPG key ID: 699D16185DAFAE61
4 changed files with 15 additions and 15 deletions

View file

@ -34,17 +34,17 @@ def get_subpartitions_size(args):
Calculate the size of the boot and root subpartition.
:returns: (boot, root) the size of the boot and root
partition as integer in bytes
partition as integer in MiB
"""
boot = int(args.boot_size) * 1024 * 1024
boot = int(args.boot_size)
# Estimate root partition size, then add some free space. The size
# calculation is not as trivial as one may think, and depending on the
# file system etc it seems to be just impossible to get it right.
chroot = args.work + "/chroot_rootfs_" + args.device
root = pmb.helpers.other.folder_size(args, chroot)
root = pmb.helpers.other.folder_size(args, chroot) / 1024 / 1024
root *= 1.20
root += 50 * 1024 * 1024
root += 50
return (boot, root)