summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2024-06-13 13:12:41 +0200
committerŁukasz Stelmach <l.stelmach@samsung.com>2024-06-13 13:12:41 +0200
commit94c72f097369eca6be604b2815fe13a1d5ca725b (patch)
treea025eb040efb59456bd07a6778010e59787effe0
parent149d7a5e348e129ab72e8af5f061fc2c0a0db15e (diff)
downloadu-boot-94c72f097369eca6be604b2815fe13a1d5ca725b.tar.gz
u-boot-94c72f097369eca6be604b2815fe13a1d5ca725b.tar.bz2
u-boot-94c72f097369eca6be604b2815fe13a1d5ca725b.zip
scripts: sd_fusing: support device symlinks in ensure_parttable()
sd_fusing needs to support referring to devices by symlinks created by udev like /dev/disk/by-id/usb-Generic_STORAGE_DEVICE_000000000272-0. Their partitions are named /dev/disk/by-id/usb-Generic_STORAGE_DEVICE_000000000272-0-partX. Therefore there is no universal way to access both /dev/sdXY and the symlinked partitions and using get_partition_device() is the way to go. Change-Id: I4c586f8e9b6e3940faa6055c90835bbff1777ec5 Fixes: 43ab41c7e7 ("sd_fusing.py: Ensure selected flashing target actually matches what is on device") Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
-rwxr-xr-xscripts/tizen/sd_fusing.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/tizen/sd_fusing.py b/scripts/tizen/sd_fusing.py
index 8f57d15a8b..1996250aa6 100755
--- a/scripts/tizen/sd_fusing.py
+++ b/scripts/tizen/sd_fusing.py
@@ -15,7 +15,7 @@ import sys
import tarfile
import tempfile
-__version__ = "1.1.2"
+__version__ = "1.1.3"
Format = False
Device = ""
@@ -179,7 +179,8 @@ class SdFusingTarget:
def ensure_parttable(self):
logging.notice(f"Verifying that partition table on {Device} matches target specification")
for partnum, part in enumerate(self.part_table, 1):
- bo = subprocess.check_output(["blkid", "-o", "export", Device + str(partnum)]).decode('utf-8')
+ d = "/dev/" + get_partition_device(Device, partnum)
+ bo = subprocess.check_output(["blkid", "-o", "export", d]).decode('utf-8')
if "PARTLABEL=" in bo and f"PARTLABEL={part['name']}" not in bo:
logging.error(f'On-device partition label mismatch with selected target: partlabel={part["name"]}, on-device:\n{bo}')
sys.exit(1)