From 571b6dd9c40d4250f9e718429ca2e32f8d301d6f Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Mon, 25 Sep 2017 15:51:38 +0000 Subject: [PATCH] Use partx instead of fdisk --- test/partition_alignment.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/test/partition_alignment.sh b/test/partition_alignment.sh index 801b84d..76255c5 100644 --- a/test/partition_alignment.sh +++ b/test/partition_alignment.sh @@ -1,19 +1,12 @@ #!/bin/false -TABLE="$(fdisk -l "$IMG_FILE" | grep "^$IMG_FILE")" - -test 2 -eq $(echo "$TABLE" | wc -l) - -TABLE="$(echo "$TABLE" | sed "s|^$IMG_FILE. ||")" - -echo '--- table ---' -echo "$TABLE" | while read -r line; do echo $line; done - -STARTS=$(echo "$TABLE" | while read -r line; do echo "$(echo $line | cut -d ' ' -f 1)"; done) +STARTS=$(partx --show --noheadings --output START - "$IMG_FILE") echo '--- starts ---' echo "$STARTS" | while read -r line; do echo $line; done +test 2 -eq $(echo "$STARTS" | wc -l) + REMS=$(echo "$STARTS" | while read -r line; do echo $(($line % 4096)); done) echo '--- rems ---'