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

Unified Diff: build_image

Issue 2857037: Change code of copy vmlinuz_hd.vblock to make_image_bootable(). (Closed) Base URL: ssh://gitrw.chromium.org/crosutils.git
Patch Set: Created 10 years, 5 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 | no next file » | 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 2bdbbc7220e470c3bab5cc0dfa2dcbf8f650877b..8ea3556e8cecc7339c9117425411abf594ee143e 100755
--- a/build_image
+++ b/build_image
@@ -312,6 +312,19 @@ make_image_bootable() {
--root=${cros_root} \
--keys_dir="${DEVKEYSDIR}"
+ # Move the verification block needed for the hard disk install to the
+ # stateful partition. Mount stateful fs, copy file, and umount fs.
+ STATEFUL_LOOP_DEV=$(sudo losetup -f)
+ if [ -z "${STATEFUL_LOOP_DEV}" ] ; then
+ echo "No free loop device. Free up a loop device or reboot. exiting. "
+ exit 1
+ fi
+ sudo losetup "${STATEFUL_LOOP_DEV}" "${STATEFUL_FS_IMG}"
+ sudo mount "${STATEFUL_LOOP_DEV}" "${STATEFUL_FS_DIR}"
+ sudo cp "${OUTPUT_DIR}/vmlinuz_hd.vblock" "${STATEFUL_FS_DIR}"
+ sudo umount -d "${STATEFUL_FS_DIR}"
+ STATEFUL_LOOP_DEV=
+
# START_KERN_A is set by the first call to install the gpt.
local koffset="$(partoffset ${OUTPUT_DIR}/${image_name} 2)"
sudo dd if="${OUTPUT_DIR}/vmlinuz.image" of="${OUTPUT_DIR}/${image_name}" \
@@ -602,10 +615,6 @@ create_base_image() {
# Create an empty esp image to be updated in by update_bootloaders.sh.
${SCRIPTS_DIR}/create_esp.sh --to="${ESP_FS_IMG}"
- # Move the verification block needed for the hard disk install to the
- # stateful partition.
- sudo cp "${OUTPUT_DIR}/vmlinuz_hd.vblock" "${STATEFUL_FS_DIR}"
-
cleanup
trap delete_prompt EXIT
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698