Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix partition initialization bug. (#10702)
After creating a partition, the toolkit must wait for the partition device to be created (under /dev). However, the naming scheme of partitions is inconsistent, with both `/dev/<name>XX` and `/dev/<name>pXX` being used, depending on the device driver. So, the toolkit checks for both. However, a problem occurs when the device name itself ends in a digit. If the disk device path is say `/dev/loop1`, then `/dev/loop11` is also a valid disk device path. For such disks, the `/dev/<name>pXX` form must be used for partitions. While the toolkit prioritizes `/dev/loop1p1` over `/dev/loop11`, if the `/dev/loop1p1` device doesn't exist yet and `/dev/loop11` is in use, then the toolkit may pick the wrong device path for the partition. This change fixes this by ignoring the `/dev/<name>XX` variant if the disk device path ends in a digit.
- Loading branch information