AU: make mk_memento_images not change rootfs

Also, enforce use of cros_generate_update_payload to generate images.

BUG=5771
TEST=Ran ./cros_generate_update_payload to make full update

Review URL: http://codereview.chromium.org/3135024
This commit is contained in:
Andrew de los Reyes 2010-08-16 15:24:04 -07:00
parent 2fcfbbe8cf
commit 6faff36229
2 changed files with 8 additions and 13 deletions

View File

@ -167,7 +167,7 @@ else
GENERATOR="$(dirname "$0")/mk_memento_images.sh"
"$GENERATOR" "$DST_KERNEL" "$DST_ROOT"
CROS_GENERATE_UPDATE_PAYLOAD_CALLED=1 "$GENERATOR" "$DST_KERNEL" "$DST_ROOT"
mv "$(dirname "$DST_KERNEL")/update.gz" "$FLAGS_output"
trap - INT TERM EXIT

View File

@ -15,6 +15,12 @@ if [ -z "$2" -o -z "$1" ]; then
exit 1
fi
if [ "$CROS_GENERATE_UPDATE_PAYLOAD_CALLED" != "1" ]; then
echo "This script should only be called from cros_generate_update_payload"
echo "Please run that script with --help to see how to use it."
exit 1
fi
if [ $(whoami) = "root" ]; then
echo "running $0 as root which is unneccessary"
fi
@ -51,19 +57,8 @@ if [ $(stat -c%s "$UNCOMPRESSED_OUT_FILE") -ne $((8 + $KPART_SIZE)) ]; then
exit 1
fi
# Copy rootfs aside
TMP_ROOTFS=$(mktemp)
cp "$ROOT_PART" "$TMP_ROOTFS"
ORIGINAL_LABEL=$(/sbin/e2label "$TMP_ROOTFS")
NEW_LABEL="A${ORIGINAL_LABEL}"
/sbin/tune2fs -L "$NEW_LABEL" "$TMP_ROOTFS"
# TODO(adlr): Sign TMP_ROOTFS w/ OS vendor's private key
# Put rootfs into the out file
cat "$TMP_ROOTFS" >> "$UNCOMPRESSED_OUT_FILE"
rm "$TMP_ROOTFS"
cat "$ROOT_PART" >> "$UNCOMPRESSED_OUT_FILE"
# compress and hash
CS_AND_RET_CODES=$(gzip -c "$UNCOMPRESSED_OUT_FILE" | \