Add a script to put in a rootfs from one image into another.

Also add an option to prevent sign_official_build from attempting to re-sign the firmware.

This is needed because we want both the SSD and RECOVERY images to have the same rootfs for delta updates to work correctly.

BUG=chromium-os:7242
TEST=manually verified that rootfs gets replaced correctly (by verifying the rootfs hash).

Change-Id: I2ca4f2bef938ca14301fed6a0b16c1a7dc2ba6d9

Review URL: http://codereview.chromium.org/3529007
This commit is contained in:
Gaurav Shah
2010-10-01 13:01:37 -07:00
parent 9565edc4c9
commit 815193daee
2 changed files with 34 additions and 0 deletions

View File

@@ -186,6 +186,11 @@ get_firmwarebin_from_shellball() {
resign_firmware_payload() {
local image=$1
if [ -n "${NO_FWUPDATE}" ]; then
echo "Skipping firmware update."
return
fi
# Grab firmware image from the autoupdate shellball.
local rootfs_dir=$(make_temp_dir)
mount_image_partition ${image} 3 ${rootfs_dir}

View File

@@ -0,0 +1,29 @@
#!/bin/bash
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Load common constants and variables.
. "$(dirname "$0")/common.sh"
# Print usage string
usage() {
cat <<EOF
Usage: $PROG dst_image src_image
This will put the root file system from src_image into dst_image.
EOF
}
if [ $# -ne 2 ]; then
usage
exit 1
fi
DST_IMAGE=$1
SRC_IMAGE=$2
temp_rootfs=$(make_temp_file)
extract_image_partition ${SRC_IMAGE} 3 ${temp_rootfs}
replace_image_partition ${DST_IMAGE} 3 ${temp_rootfs}
echo "RootFS from ${SRC_IMAGE} was copied into ${DST_IMAGE}"