From: Łukasz Stelmach Date: Fri, 24 Nov 2023 10:50:48 +0000 (+0100) Subject: scripts: support targets without the user partiton X-Git-Tag: accepted/tizen/unified/20241126.175211~114 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=265336acaf2c8cb7a8dce6147e1696695f5b9cab;p=platform%2Fkernel%2Fu-boot.git 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 --- 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')