From 48e17ce1dc027a85592c8415443faa51ae325f9e Mon Sep 17 00:00:00 2001 From: Shawn Li Date: Thu, 27 Dec 2018 17:32:15 -0800 Subject: [PATCH] [devices]: Fix arista-convertfs for aligning flash via sfdisk in Jessie The sfdisk in Jessie use unit Cylinder by default. To perform 1M aligning partition, 2048 sector unit is desirable instead. --- files/initramfs-tools/arista-convertfs.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/initramfs-tools/arista-convertfs.j2 b/files/initramfs-tools/arista-convertfs.j2 index ffe5797ab72b..91633d8f5e6b 100644 --- a/files/initramfs-tools/arista-convertfs.j2 +++ b/files/initramfs-tools/arista-convertfs.j2 @@ -172,7 +172,7 @@ umount "$root_mnt" if [ $(echo -n "$root_dev" | tail -c 1) == "1" ]; then # 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" fi