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)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Wed, 4 Dec 2024 11:00:00 +0000 (12:00 +0100)
commitc00fe97c974f8d3f5e48594bb03f4f4008cd28e5
tree4a3c325a989d6d110490c685dcc1f63bbc40adb6
parent55d5d945a021e36d27ea7a06c66f206eb07f65df
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>
sd_fusing.py