summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Kryszyn <j.kryszyn@samsung.com>2024-05-22 10:02:42 +0200
committerJacek Kryszyn <j.kryszyn@samsung.com>2024-05-22 15:01:37 +0200
commitfd75c9b88ee8d6cf62b2b9db80e1eaba2050759c (patch)
tree20b65380c6c768f142b6738ad45c852f2681b9f9
parentab17ee33e3e0ebd89710628b1055651fe8ba6038 (diff)
downloadu-boot-fd75c9b88ee8d6cf62b2b9db80e1eaba2050759c.tar.gz
u-boot-fd75c9b88ee8d6cf62b2b9db80e1eaba2050759c.tar.bz2
u-boot-fd75c9b88ee8d6cf62b2b9db80e1eaba2050759c.zip
Dynamic partitions: change size of a slot
Slot size was incorrect due to missing brackets. Now it is equal to double size of hal and rootfs. Some additional code is added to take into account metadata size and alignment of super. Change-Id: I7f163d7e4a74b3f5e7a1a2f207ebece9581b4876 Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
-rwxr-xr-xscripts/tizen/sd_fusing.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/tizen/sd_fusing.py b/scripts/tizen/sd_fusing.py
index 0d2bd228ba..7624f69097 100755
--- a/scripts/tizen/sd_fusing.py
+++ b/scripts/tizen/sd_fusing.py
@@ -1035,8 +1035,19 @@ def do_fuse_image_super(tmpd, target):
logging.warning(f"{fn} is missing, skipping super partition image")
return
- group_size = 2 * hal_size + rootfs_size
- super_size = metadata_size + 2 * group_size
+ group_size = 2 * (hal_size + rootfs_size)
+ super_size = 2 * group_size
+
+ # calculate additional space needed for metadata.
+ # There are 2 metadata slots having 65536 B each. 131072 B in total
+ additional_space = (metadata_slots * metadata_size) / target.super_alignment
+
+ if additional_space > 1:
+ # if metadata takes more than super alignment, add 1 MiB to super
+ super_size += 1024*1024
+ else:
+ # if metadata takes less than super alignment, add alignment size to super
+ super_size += target.super_alignment
argv = ["lpmake", "-F",
f"-o={super_path}",