diff options
author | Matt Delco <delco@chromium.org> | 2018-08-02 11:50:06 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-15 16:37:30 -0700 |
commit | 0c274a902539249db7e11d019dadfa0cbae1fd74 (patch) | |
tree | 490258b98281abfec39acfd7b554d532dd8ea46b /tests/run_cgpt_tests.sh | |
parent | 0f1de7b5fe7b4dbe12ed544ee7e0ae064393e898 (diff) | |
download | vboot-0c274a902539249db7e11d019dadfa0cbae1fd74.tar.gz |
cgpt: add edit commandstabilize-nocturne-10986.Bstabilize-11021.84.Bstabilize-11020.Bstabilize-11005.Bstabilize-10985.Brelease-R70-11021.Bfirmware-servo-11011.Bfirmware-nocturne-10984.Bfactory-nocturne-10984.B
This change adds a command to cgpt to
change the GUID of the drive.
BRANCH=none
BUG=None
TEST=Compiled and ran utility to verify that GUID changes.
Also verified that the new and existing tests completed
successfully.
Change-Id: Ia8a815447509626312e2b06c6f293901290c73c3
Signed-off-by: Matt Delco <delco@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1171834
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'tests/run_cgpt_tests.sh')
-rwxr-xr-x | tests/run_cgpt_tests.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/run_cgpt_tests.sh b/tests/run_cgpt_tests.sh index 88799ea5..81e5d3b6 100755 --- a/tests/run_cgpt_tests.sh +++ b/tests/run_cgpt_tests.sh @@ -74,6 +74,8 @@ RANDOM_LABEL="random stuff" RANDOM_GUID='2364a860-bf63-42fb-a83d-9ad3e057fcf5' RANDOM_NUM=6 +RANDOM_DRIVE_GUID='12345678-0000-1111-2222-123456789ABC' + $CGPT create $MTD ${DEV} run_basic_tests() { @@ -144,9 +146,32 @@ run_basic_tests() { $CGPT add $MTD -i 1 -t data ${DEV} || error X=$($CGPT show $MTD -t -i 1 ${DEV} | tr 'A-Z' 'a-z') [ "$X" = "$DATA_GUID" ] || error + + ORIG_ID=$($CGPT show $MTD -v ${DEV} | \ + grep -i "disk uuid" | head -1 | awk ' { print $3 } ' ) + [ ! "$ORIG_ID" = "$RANDOM_DRIVE_GUID" ] || error + $CGPT edit $MTD -u ${RANDOM_DRIVE_GUID} ${DEV} || error + X=$($CGPT show $MTD -v ${DEV} | grep -i "disk uuid" | \ + head -1 | awk ' { print $3 } ' ) + [ "$X" = "${RANDOM_DRIVE_GUID}" ] || error + $CGPT edit $MTD -u ${ORIG_ID} ${DEV} || error + X=$($CGPT show $MTD -v ${DEV} | grep -i "disk uuid" | \ + head -1 | awk ' { print $3 } ' ) + [ "$X" = "${ORIG_ID}" ] || error } run_basic_tests +ORIG_ID=$($CGPT show $MTD -v ${DEV} | \ + grep -i "disk uuid" | awk ' { print $3 } ' ) +[ ! "$ORIG_ID" = "$RANDOM_DRIVE_GUID" ] || error +$CGPT edit $MTD -u ${RANDOM_DRIVE_GUID} ${DEV} || error +X=$($CGPT show $MTD -v ${DEV} | grep -i "disk uuid" | \ + head -1 | awk ' { print $3 } ' ) +[ "$X" = "${RANDOM_DRIVE_GUID}" ] || error +$CGPT edit $MTD -u ${ORIG_ID} ${DEV} || error +X=$($CGPT show $MTD -v ${DEV} | grep -i "disk uuid" | \ + awk ' { print $3 } ' ) +[ "$X" = "${ORIG_ID}" ] || error echo "Set the boot partition.." $CGPT boot $MTD -i ${KERN_NUM} ${DEV} >/dev/null |