summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2023-11-24 11:50:48 +0100
committerSeung-Woo Kim <sw0312.kim@samsung.com>2023-11-27 01:53:16 +0000
commit81148d5c8c3d176f8d33b7b8abe2767b9db3fce2 (patch)
treeb57ccd9030f787cb0cd44a2fb5062cb0b506a691
parent2464a809bddfb59563d9e83417818d1b04f6aae8 (diff)
downloadu-boot-81148d5c8c3d176f8d33b7b8abe2767b9db3fce2.tar.gz
u-boot-81148d5c8c3d176f8d33b7b8abe2767b9db3fce2.tar.bz2
u-boot-81148d5c8c3d176f8d33b7b8abe2767b9db3fce2.zip
scripts: support targets without the user partiton
x86 emulator images do not ship user partition. Therefore there is no point in doing all the size calculations required for other targets. Change-Id: Ia59156c653695cc9067e9f971a7b4dcaa8af9d71 Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
-rwxr-xr-xscripts/tizen/sd_fusing.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/tizen/sd_fusing.py b/scripts/tizen/sd_fusing.py
index 7cd72be073..3952681402 100755
--- a/scripts/tizen/sd_fusing.py
+++ b/scripts/tizen/sd_fusing.py
@@ -96,13 +96,16 @@ class SdFusingTarget:
self.with_super = False
self.device = device
total_size = device_size(device)
- self.user_size = total_size - self.reserved_space - \
- reduce(lambda x, y: x + (y["size"] or 0), self.part_table, 0)
- if self.user_size < 100:
- logging.error(f"Not enough space for user data ({self.user_size}). Use larger storage.")
- raise OSError(errno.ENOSPC, os.strerror(errno.ENOSPC), device)
- # self.user_partition counts from 0
- self.part_table[self.user_partition]["size"] = self.user_size
+
+ if hasattr(self, 'user_partition'):
+ self.user_size = total_size - self.reserved_space - \
+ reduce(lambda x, y: x + (y["size"] or 0), self.part_table, 0)
+ if self.user_size < 100:
+ logging.error(f"Not enough space for user data ({self.user_size}). Use larger storage.")
+ raise OSError(errno.ENOSPC, os.strerror(errno.ENOSPC), device)
+ # self.user_partition counts from 0
+ self.part_table[self.user_partition]["size"] = self.user_size
+
self.label = Label(self.part_table, ltype)
self.binaries = self._get_binaries('binaries')