Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: src/scripts/build_gpt.sh

Issue 1567013: Clean up temporary files and directories left by build_image, etc. (Closed)
Patch Set: Emit scripts to pack/unpack the image. Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/scripts/build_image » ('j') | src/scripts/emit_gpt_scripts.sh » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/build_gpt.sh
diff --git a/src/scripts/build_gpt.sh b/src/scripts/build_gpt.sh
index f9179b2b8d3f6624b062e304ebbe6ce8097e5cc1..d9346202f014290c236f2115f389da71be4dc620 100755
--- a/src/scripts/build_gpt.sh
+++ b/src/scripts/build_gpt.sh
@@ -130,6 +130,7 @@ if [[ "$ARCH" = "arm" ]]; then
hexdump -v -C "$MBR_IMG"
else
echo "Error: u-boot mkimage not found or not executable."
+ exit 1
fi
PMBRCODE=${MBR_IMG}
else
@@ -140,6 +141,9 @@ fi
# describing the partition table entries (see the comments in the source).
install_gpt $OUTDEV $ROOTFS_IMG $KERNEL_IMG $STATEFUL_IMG $PMBRCODE
+# Emit helpful scripts for testers, etc.
+${SCRIPTS_DIR}/emit_gpt_scripts.sh "${OUTDEV}" "${IMAGEDIR}"
+
# Now populate the partitions.
echo "Copying stateful partition..."
dd if=${STATEFUL_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_STATEFUL}
@@ -150,3 +154,7 @@ dd if=${KERNEL_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_KERN_A}
echo "Copying rootfs..."
dd if=${ROOTFS_IMG} of=${OUTDEV} conv=notrunc bs=512 seek=${START_ROOTFS_A}
+# Clean up temporary files.
+if [[ -n "${MBR_IMG:-}" ]]; then
+ rm "${MBR_IMG}"
+fi
« no previous file with comments | « no previous file | src/scripts/build_image » ('j') | src/scripts/emit_gpt_scripts.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698