Index: emit_gpt_scripts.sh |
diff --git a/emit_gpt_scripts.sh b/emit_gpt_scripts.sh |
index b16e4b3a4285e8cc994b78521af4a9bbe8d243af..12e3629f1bd3c5ddabcbf47098f06f9a307837a7 100755 |
--- a/emit_gpt_scripts.sh |
+++ b/emit_gpt_scripts.sh |
@@ -26,7 +26,7 @@ UNPACK="${DIR}/unpack_partitions.sh" |
locate_gpt |
TMP=$(mktemp) |
-sudo $GPT -r show -l "$IMAGE" > $TMP |
+$GPT show "$IMAGE" > $TMP |
HEADER='#!/bin/sh -eu |
# File generated by emit_gpt_scripts.sh. Do not edit. |
@@ -42,9 +42,8 @@ echo "$HEADER" > "$UNPACK" |
cat $TMP | sed -e 's/^/# /' >> "$PACK" |
cat $TMP | sed -e 's/^/# /' >> "$UNPACK" |
-sort -n -k 3 $TMP | \ |
- grep 'GPT part -' | \ |
- while read start size part x x x label x; do \ |
+$GPT show -q "$IMAGE" | \ |
+ while read start size part x; do \ |
file="part_$part" |
loc="\"\$TARGET\"" |
echo "dd if=$loc of=$file bs=512 skip=$start count=$size" \ |