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

Unified Diff: scripts/image_signing/customize_image.sh

Issue 3066034: Add a script to generate builds signed using the official keys. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: . Created 10 years, 4 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 | « scripts/image_signing/common.sh ('k') | scripts/image_signing/sign_official_build.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/image_signing/customize_image.sh
diff --git a/scripts/image_signing/customize_image b/scripts/image_signing/customize_image.sh
similarity index 73%
rename from scripts/image_signing/customize_image
rename to scripts/image_signing/customize_image.sh
index 2496c392dc39603670c0d18f8f7fdca98e43d326..08b5bd39c924893ba6b9a94b06303b41f2bf6c1d 100755
--- a/scripts/image_signing/customize_image
+++ b/scripts/image_signing/customize_image.sh
@@ -10,7 +10,10 @@
# The following changes are applied:
# - Set the root password.
-# Usage: ./customize_image <image.bin> <root_password>
+# Usage: ./customize_image.sh <image.bin> <root_password>
+
+# Load common constants and variables.
+. "$(dirname "$0")/common.sh"
readonly ROOTFS_DIR=$(mktemp -d)
readonly GPT=cgpt
@@ -27,20 +30,6 @@ failure() {
exit 1
}
-# Read GPT table to find the starting location of a specific partition.
-# Args: DEVICE PARTNUM
-# Returns: offset (in sectors) of partition PARTNUM
-partoffset() {
- sudo $GPT show -b -i $2 $1
-}
-
-mount_image() {
- local image=$1
- echo "Mounting image '$image'..."
- local offset=$(partoffset "$image" 3)
- sudo mount -o loop,offset=$((offset * 512)) "$image" "$ROOTFS_DIR"
-}
-
change_root_password() {
local password=$1
echo "Changing root password to '$password'..."
@@ -63,7 +52,7 @@ main() {
set -e
trap failure EXIT
- mount_image "$image"
+ mount_image_partition "$image" 3 $ROOTFS_DIR
change_root_password "$root_password"
cleanup
echo "Done."
« no previous file with comments | « scripts/image_signing/common.sh ('k') | scripts/image_signing/sign_official_build.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698