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 11 usage() { 12 cat <<EOF 13 Usage: $PROG dst_image src_image 14 This will put the root file system from src_image into dst_image. 15 EOF 16 } 17 18 if [ $# -ne 2 ]; then 19 usage 20 exit 1 21 fi 22 23 DST_IMAGE=$1 24 SRC_IMAGE=$2 25 26 temp_rootfs=$(make_temp_file) 27 extract_image_partition ${SRC_IMAGE} 3 ${temp_rootfs} 28 replace_image_partition ${DST_IMAGE} 3 ${temp_rootfs} 29 echo "RootFS from ${SRC_IMAGE} was copied into ${DST_IMAGE}" 30