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

Unified Diff: build_image

Issue 2813029: recovery installer: fix build_gpt and build_image (Closed) Base URL: ssh://git@chromiumos-git/crosutils.git
Patch Set: minor fix per review comment Created 10 years, 6 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 | « build_gpt.sh ('k') | mod_image_for_recovery.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build_image
diff --git a/build_image b/build_image
index 545dd657279c8274b1330de4a6003135dde37c48..77ce152c931bf9e79e7c5d35cafb75e6ac3aca5c 100755
--- a/build_image
+++ b/build_image
@@ -44,8 +44,6 @@ DEFINE_boolean factory_install ${FLAGS_FALSE} \
is also required in image_to_usb."
DEFINE_string arm_extra_bootargs "" \
"Additional command line options to pass to the ARM kernel."
-DEFINE_boolean recovery ${FLAGS_FALSE} \
- "Build a recovery image. Default: False."
DEFINE_integer rootfs_partition_size 1024 \
"rootfs parition size in MBs."
DEFINE_integer rootfs_size 720 \
@@ -96,11 +94,6 @@ if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then
DEVELOPER_IMAGE_NAME=chromiumos_image.bin
fi
-# If we are creating a recovery image, rename pristine image.
-if [ "${FLAGS_recovery}" -eq "${FLAGS_TRUE}" ]; then
- PRISTINE_IMAGE_NAME=recovery_image.bin
-fi
-
OUTPUT_IMG=${FLAGS_to:-${OUTPUT_DIR}/${PRISTINE_IMAGE_NAME}}
BOARD="${FLAGS_board}"
@@ -283,35 +276,6 @@ update_dev_packages() {
${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${ROOT_FS_DIR}" -s "${STATEFUL_FS_DIR}"
}
-
-# Modifies an existing image to add recovery packages
-update_recovery_packages() {
- local image_name=$1
-
- echo "Adding recovery packages to ${image_name}"
-
- # Create stateful partition of the same size as the rootfs.
- trap "mount_gpt_cleanup \"${ROOT_FS_DIR}\" \"${STATEFUL_FS_DIR}\"" EXIT
-
- ${SCRIPTS_DIR}/mount_gpt_image.sh --from "${OUTPUT_DIR}" \
- --image "$( basename ${image_name} )" -r "${ROOT_FS_DIR}" \
- -s "${STATEFUL_FS_DIR}"
-
- # Install recovery installer.
- sudo ${EMERGE_BOARD_CMD} --root=${ROOT_FS_DIR} --usepkg \
- --root-deps=rdeps --nodeps chromeos-recovery
-
- # Re-run ldconfig to fix /etc/ldconfig.so.cache.
- sudo /sbin/ldconfig -r "${ROOT_FS_DIR}"
-
- # Mark the image as a developer image (input to chromeos_startup).
- sudo mkdir -p "${ROOT_FS_DIR}/root"
- sudo touch "${ROOT_FS_DIR}/root/.recovery_installer"
-
- trap - EXIT
- ${SCRIPTS_DIR}/mount_gpt_image.sh -u -r "${ROOT_FS_DIR}" -s "${STATEFUL_FS_DIR}"
-}
-
create_base_image() {
trap "cleanup && delete_prompt" EXIT
@@ -499,18 +463,12 @@ EOF
trap delete_prompt EXIT
- RECOVERY="--norecovery"
- if [[ ${FLAGS_recovery} -eq ${FLAGS_TRUE} ]]; then
- RECOVERY="--recovery"
- fi
-
# Create the GPT-formatted image.
${SCRIPTS_DIR}/build_gpt.sh \
--arch=${ARCH} \
--board=${FLAGS_board} \
--arm_extra_bootargs="${FLAGS_arm_extra_bootargs}" \
--rootfs_partition_size=${FLAGS_rootfs_partition_size} \
- ${RECOVERY} \
"${OUTPUT_DIR}" \
"${OUTPUT_IMG}"
}
@@ -523,13 +481,6 @@ mkdir -p "${ESP_FS_DIR}"
create_base_image ${OUTPUT_DIR}/${PRISTINE_IMAGE_NAME}
-# Create a recovery image based on the chromium os base image.
-if [ "${FLAGS_recovery}" -eq "${FLAGS_TRUE}" ] ; then
- update_recovery_packages ${OUTPUT_DIR}/${PRISTINE_IMAGE_NAME}
-fi
-trap - EXIT
-
-
# Create a developer image based on the chromium os base image.
if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ] ; then
echo "Creating developer image from base image ${OUTPUT_IMG}"
@@ -554,9 +505,6 @@ rmdir "${ROOT_FS_DIR}" "${STATEFUL_FS_DIR}" "${ESP_FS_DIR}"
echo "Done. Image created in ${OUTPUT_DIR}"
echo "Chromium OS image created as ${PRISTINE_IMAGE_NAME}"
-if [ "${FLAGS_recovery}" -eq "${FLAGS_TRUE}" ]; then
- echo "Recovery image created as ${PRISTINE_IMAGE_NAME}"
-fi
if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then
echo "Developer image created as ${DEVELOPER_IMAGE_NAME}"
fi
« no previous file with comments | « build_gpt.sh ('k') | mod_image_for_recovery.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698