| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Load common constants. This should be the first executable line. | 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. | 8 # The path to common.sh should be relative to your script's location. |
| 9 . "$(dirname "$0")/common.sh" | 9 . "$(dirname "$0")/common.sh" |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 trap do_cleanup EXIT | 42 trap do_cleanup EXIT |
| 43 | 43 |
| 44 # | 44 # |
| 45 # Set up loop device. This time it is used to fetch the built kernel from the | 45 # Set up loop device. This time it is used to fetch the built kernel from the |
| 46 # root image. This kernel is then written to the fourth partition. | 46 # root image. This kernel is then written to the fourth partition. |
| 47 # | 47 # |
| 48 echo "Fetching kernel from root image..." | 48 echo "Fetching kernel from root image..." |
| 49 mkdir /tmp/kernel_fetch.$$ | 49 mkdir /tmp/kernel_fetch.$$ |
| 50 sudo mount -o loop "${FLAGS_from}/rootfs.image" /tmp/kernel_fetch.$$ | 50 sudo mount -o ro,loop "${FLAGS_from}/rootfs.image" /tmp/kernel_fetch.$$ |
| 51 | 51 |
| 52 echo "Writing kernel to ${FLAGS_to} at ${FLAGS_offset}..." | 52 echo "Writing kernel to ${FLAGS_to} at ${FLAGS_offset}..." |
| 53 sudo "${SCRIPTS_DIR}"/file_copy.py \ | 53 sudo "${SCRIPTS_DIR}"/file_copy.py \ |
| 54 if=/tmp/kernel_fetch.$$/boot/vmlinux.uimg \ | 54 if=/tmp/kernel_fetch.$$/boot/vmlinux.uimg \ |
| 55 of="${FLAGS_to}" \ | 55 of="${FLAGS_to}" \ |
| 56 seek_bytes="${FLAGS_offset}" | 56 seek_bytes="${FLAGS_offset}" |
| 57 echo "Done." | 57 echo "Done." |
| 58 | 58 |
| 59 do_cleanup | 59 do_cleanup |
| 60 | 60 |
| 61 trap - EXIT | 61 trap - EXIT |
| OLD | NEW |