OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.# Use of this |
| 4 # source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 7 # Load common constants. This should be the first executable line. |
| 8 # The path to common.sh should be relative to your script's location. |
| 9 . "$(dirname "$0")/../../../scripts/common.sh" |
| 10 |
| 11 DEFINE_string to "-" "Path of the output image; if \\\"-\\\", meaning stdout." |
| 12 |
| 13 # Parse command line |
| 14 FLAGS "$@" || exit 1 |
| 15 eval set -- "${FLAGS_ARGV}" |
| 16 |
| 17 # List the files need to be packed. |
| 18 PACK_FILES="system_rom.bin ec_rom.bin" |
| 19 |
| 20 for file in ${PACK_FILES}; do |
| 21 if [ ! -e ${file} ]; then |
| 22 echo "File ${file} does not exist." >&2 |
| 23 exit 1 |
| 24 fi |
| 25 done |
| 26 |
| 27 TMP_FILE="/tmp/firmware" |
| 28 cp -f install_firmware.sh "${TMP_FILE}" |
| 29 tar zcO ${PACK_FILES} | uuencode packed_files.tgz >> "${TMP_FILE}" |
| 30 |
| 31 if [ ${FLAGS_to} = "-" ]; then |
| 32 cat "${TMP_FILE}" |
| 33 rm -f "${TMP_FILE}" |
| 34 else |
| 35 mv "${TMP_FILE}" "${FLAGS_to}" |
| 36 echo "Packed output image is: ${FLAGS_to}" |
| 37 fi |
OLD | NEW |