1#!/bin/bash
2
3# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7# Load common constants and variables.
8. "$(dirname "$0")/common.sh"
9
10# Print usage string
11usage() {
12    cat <<EOF
13Usage: $PROG dst_image src_image
14This will put the root file system from src_image into dst_image.
15EOF
16}
17
18if [ $# -ne 2 ]; then
19  usage
20  exit 1
21fi
22
23DST_IMAGE=$1
24SRC_IMAGE=$2
25
26temp_rootfs=$(make_temp_file)
27extract_image_partition ${SRC_IMAGE} 3 ${temp_rootfs}
28replace_image_partition ${DST_IMAGE} 3 ${temp_rootfs}
29echo "RootFS from ${SRC_IMAGE} was copied into ${DST_IMAGE}"
30