diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2024-08-01 12:26:08 +0200 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2024-08-02 03:06:22 +0000 |
commit | f687fea2c6d43a4653c91104ccdb5d43767eeff7 (patch) | |
tree | d2f1a262d0d4ba831c5472ae876a9c4d2fed57af | |
parent | a2b2d60af10ffe5e05e09bbccb12e8a365835907 (diff) | |
download | u-boot-f687fea2c6d43a4653c91104ccdb5d43767eeff7.tar.gz u-boot-f687fea2c6d43a4653c91104ccdb5d43767eeff7.tar.bz2 u-boot-f687fea2c6d43a4653c91104ccdb5d43767eeff7.zip |
scripts: sd_fusing: Write bootcode before calling 'udevadm settle'
Writing bootcode to the first sector of the device might trigger kernel
or udev to reread partition table, so do this before calling 'udevadm
settle' command.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Iaab903a31b3ff97de3195f02b5220f26b246a832
-rwxr-xr-x | scripts/tizen/sd_fusing.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/tizen/sd_fusing.py b/scripts/tizen/sd_fusing.py index c776a3c605..2954838c63 100755 --- a/scripts/tizen/sd_fusing.py +++ b/scripts/tizen/sd_fusing.py @@ -886,6 +886,12 @@ def mkpart(args, target): logging.error(f"New partition table:\n" + str(target.label)) sys.exit(1) + if target.bootcode: + logging.debug("Writing bootcode\n") + with open(Device, "wb") as f: + f.write(target.bootcode) + f.close + # Run `udevadm settle` to ensure that partition change made by `sfdisk` is completely reflected in userspace. logging.info("Waiting for the udev event queue to empty...") argv = ['udevadm', 'settle'] @@ -898,12 +904,6 @@ def mkpart(args, target): else: logging.info("The udev event queue is empty.") - if target.bootcode: - logging.debug("Writing bootcode\n") - with open(Device, "wb") as f: - f.write(target.bootcode) - f.close - for i, part in enumerate(target.part_table): d = "/dev/" + get_partition_device(target.device, i+1) if not 'fstype' in part: |