scripts: sd_fusing: Check the raw_binary_table attribute 16/315716/2
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 7 Aug 2024 00:38:07 +0000 (09:38 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 7 Aug 2024 01:01:18 +0000 (10:01 +0900)
If there is no raw_binary_table, it doesn't work fine with below
message. RPI4/VF2 don't have raw_binary_table attribute.

AttributeError: 'Rpi4' object has no attribute 'raw_binary_table'

Change-Id: I379a87d9731fe82a3a32f54b38eb533b1ca4f885
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
scripts/tizen/sd_fusing.py

index ba05029f0f4c02298d9fba2bcd3f90c351dcbc33..a40cbb7ed8b74685841f03bdf363cb9004178bdc 100755 (executable)
@@ -15,7 +15,7 @@ import sys
 import tarfile
 import tempfile
 
-__version__ = "1.1.8"
+__version__ = "1.1.9"
 
 Format = False
 Device = ""
@@ -176,10 +176,13 @@ class SdFusingTarget:
         return [self.binaries.get(binary, None)]
 
     def get_raw_binary_sector(self, binary):
-        for entry in self.raw_binary_table:
-            if entry['binaries'] == binary:
-                return entry['start_sector'];
-        return None
+        if hasattr(self, "raw_binary_table"):
+            for entry in self.raw_binary_table:
+                if entry['binaries'] == binary:
+                    return entry['start_sector'];
+            return None
+        else:
+            return None
 
     def ensure_parttable(self):
         logging.notice(f"Verifying that partition table on {Device} matches target specification")