tizen: sd_fusing.py: Catch kernel not being able to re-read partition table
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 4 Apr 2024 12:15:27 +0000 (14:15 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 5 Apr 2024 00:15:09 +0000 (09:15 +0900)
commitf14d5fc9eaa6bdf18d924e9ff10ba541cefb0241
treee19dc3754aa2b46c675011f10a1c75a9566c9dee
parentb9ff22773cde89556b8afd35be4bdc8a006c2a0f
tizen: sd_fusing.py: Catch kernel not being able to re-read partition table

sfdisk(8) by default request kernel to reread partition table but does not
seem to return error code when it fails to do so.  This commit fixes followig
error:

    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    Re-reading the partition table failed.: Permission denied
    The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8).
    Syncing disks.
    Traceback (most recent call last):
      File "/usr/local/bin/sd_fusing.py", line 958, in <module>
        check_partition_format(args, target)
      File "/usr/local/bin/sd_fusing.py", line 711, in check_partition_format
        mkpart(args, target)
      File "/usr/local/bin/sd_fusing.py", line 596, in mkpart
        d = "/dev/" + get_partition_device(target.device, i+1)
            ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TypeError: can only concatenate str (not "NoneType") to str

Change-Id: I32e6636f0d374e5f4327d425373d8e38f48b7916
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
scripts/tizen/sd_fusing.py