Fix partition removal after wipe

After the wipe step, partitions are not removed when installing the load.
This commit fixes this.

Also, on some systems with NVMe, udev doesn't correctly remove the device
nodes to the deleted partitions from /dev/nvme* causing them to be seen as
non block devices, this leads to failures on format or assigning LVM PVs.

Change-Id: I3ab9f70d00a38568fc00063cdaa54ec3be48dc58
Closes-Bug: 1876374
Signed-off-by: Ovidiu Poncea <ovidiu.poncea@windriver.com>
This commit is contained in:
Ovidiu Poncea 2020-05-02 11:47:44 -04:00
parent fbb2ef2eed
commit a56b99c846
1 changed files with 6 additions and 1 deletions

View File

@ -162,7 +162,12 @@ do
echo "Wiping partition $part"
dd if=/dev/zero of=$part bs=512 count=34
dd if=/dev/zero of=$part bs=512 count=34 seek=$((`blockdev --getsz $part` - 34))
parted -s $dev rm $p
parted -s $dev rm $part_number
# LP 1876374: On some nvme systems udev doesn't correctly remove the
# links to the deleted partitions from /dev/nvme* causing them to be
# seen as non block devices.
sleep 0.3 # Wait for udev to settle
rm -f $part # Delete remaining /dev node leftover
done
if [ $BACKUP_CREATED -eq 0 ] ; then
echo "Creating disk label for $dev"