[devices]: Fix arista-convertfs for aligning flash via sfdisk in Jessie (#2402) (#2406)

The sfdisk in Jessie use unit Cylinder by default. To perform 1M
aligning partition, 2048 sector unit is desirable instead.
This commit is contained in:
shawnli-van 2018-12-31 09:40:11 -08:00 committed by lguohan
parent 1a84813f0d
commit 69d5d61eb8

View File

@ -170,7 +170,7 @@ umount "$root_mnt"
# Create a new partition table (content in flash_dev will be deleted)
err_msg="Error: repartitioning $flash_dev failed"
cmd="echo '2048' | sfdisk $flash_dev || (sleep 3; blockdev --rereadpt $flash_dev && fdisk -l $flash_dev | grep -q ${root_dev}.*Linux)"
cmd="echo '2048' | sfdisk -u S --force $flash_dev || (sleep 3; blockdev --rereadpt $flash_dev && fdisk -l $flash_dev | grep -q ${root_dev}.*Linux)"
run_cmd "$cmd" "$err_msg"
sleep 5