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

Unified Diff: src/scripts/build_image

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
Index: src/scripts/build_image
diff --git a/src/scripts/build_image b/src/scripts/build_image
index dbe62a74be21b308045950d7ebe9d622781f6ff4..b6b665a6b56d2036d025334e6140f2192e8222f6 100755
--- a/src/scripts/build_image
+++ b/src/scripts/build_image
@@ -69,7 +69,6 @@ IMAGE_SUBDIR="${CHROMEOS_VERSION_STRING}-a${FLAGS_build_attempt}"
OUTPUT_DIR="${FLAGS_output_root}/${FLAGS_board}/${IMAGE_SUBDIR}"
ROOT_FS_DIR="${OUTPUT_DIR}/rootfs"
ROOT_FS_IMG="${OUTPUT_DIR}/rootfs.image"
-MBR_IMG="${OUTPUT_DIR}/mbr.image"
OUTPUT_IMG="${OUTPUT_DIR}/chromiumos_image.bin"
BOARD="${FLAGS_board}"
@@ -323,7 +322,7 @@ fi
# Extract the kernel from the root filesystem for use by the GPT image. Legacy
# BIOS will use the kernel in the rootfs (via syslinux), ChromeOS BIOS will use
# the kernel partition.
-sudo cp -f ${ROOT_FS_DIR}/boot/vmlinuz ${OUTPUT_DIR}/vmlinuz.image
+sudo cp -f "${ROOT_FS_DIR}/boot/vmlinuz" "${OUTPUT_DIR}/vmlinuz.image"
#TODO(sosa@chromium.org) - Does it make sense to leave /usr/local bound here?
"${SCRIPTS_DIR}/customize_rootfs" \
@@ -355,8 +354,11 @@ cleanup_rootfs_loop
# Create the GPT-formatted image
${SCRIPTS_DIR}/build_gpt.sh \
--arch=${ARCH} --board=${FLAGS_board} --board_root=${BOARD_ROOT} \
- ${OUTPUT_DIR} ${OUTPUT_IMG}
+ "${OUTPUT_DIR}" "${OUTPUT_IMG}"
+# Clean up temporary files.
+rm -f "${ROOT_FS_IMG}" "${STATEFUL_IMG}" "${OUTPUT_DIR}/vmlinuz.image"
+rmdir "${ROOT_FS_DIR}" "${STATEFUL_DIR}"
OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}"
echo "Done. Image created in ${OUTPUT_DIR}"

Powered by Google App Engine
This is Rietveld 408576698