| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 2 | 5 |
| 3 # Usage: | 6 # Usage: |
| 4 # update_image.sh [image_to_update] [packages...] | 7 # update_image.sh [image_to_update] [packages...] |
| 5 usage() | 8 usage() |
| 6 { | 9 { |
| 7 cat <<EOF | 10 cat <<EOF |
| 8 | 11 |
| 9 usage: | 12 usage: |
| 10 update_image.sh [image_to_update] [packages...] | 13 update_image.sh [image_to_update] [packages...] |
| 11 EOF | 14 EOF |
| 12 } | 15 } |
| 13 | 16 |
| 14 if [[ $# < 2 ]]; then | 17 if [[ $# < 2 ]]; then |
| 15 echo "Not enough arguments supplied." | 18 echo "Not enough arguments supplied." |
| 16 usage | 19 usage |
| 17 exit 1 | 20 exit 1 |
| 18 fi | 21 fi |
| 19 | 22 |
| 20 if [[ -f /home/${USER}/trunk/src/scripts/.default_board ]]; then | 23 if [[ -f /home/${USER}/trunk/src/scripts/.default_board ]]; then |
| 21 BOARD=$( cat /home/${USER}/trunk/src/scripts/.default_board ) | 24 BOARD=$( cat /home/${USER}/trunk/src/scripts/.default_board ) |
| 22 else | 25 else |
| 23 BOARD=st1q | 26 BOARD=st1q |
| 24 fi | 27 fi |
| 25 | 28 |
| 26 IMAGE=$( readlink -f ${1} ) | 29 IMAGE=$( readlink -f ${1} ) |
| 27 IMAGE_DIR=$( dirname ${IMAGE} ) | 30 IMAGE_DIR=$( dirname "${IMAGE}" ) |
| 28 shift | 31 shift |
| 29 PKGS=$@ | 32 PKGS=$@ |
| 30 | 33 |
| 31 if [[ -z "${IMAGE}" || ! -f ${IMAGE} ]]; then | 34 if [[ -z "${IMAGE}" || ! -f ${IMAGE} ]]; then |
| 32 echo "Missing required argument 'image_to_update'" | 35 echo "Missing required argument 'image_to_update'" |
| 33 usage | 36 usage |
| 34 exit 1 | 37 exit 1 |
| 35 fi | 38 fi |
| 36 | 39 |
| 37 cd ${IMAGE_DIR} | 40 cd ${IMAGE_DIR} |
| (...skipping 25 matching lines...) Expand all Loading... |
| 63 sudo dd if="./rootfs/boot/vmlinuz" of=part_2 bs=512 count=8192 conv=notrunc | 66 sudo dd if="./rootfs/boot/vmlinuz" of=part_2 bs=512 count=8192 conv=notrunc |
| 64 fi | 67 fi |
| 65 | 68 |
| 66 sudo umount rootfs/usr/local | 69 sudo umount rootfs/usr/local |
| 67 sudo umount rootfs/var | 70 sudo umount rootfs/var |
| 68 sudo umount rootfs | 71 sudo umount rootfs |
| 69 sudo umount stateful_part | 72 sudo umount stateful_part |
| 70 ./pack_partitions.sh ${IMAGE} | 73 ./pack_partitions.sh ${IMAGE} |
| 71 | 74 |
| 72 cd - | 75 cd - |
| OLD | NEW |