| OLD | NEW |
| 1 #!/bin/sh -e | 1 #!/bin/sh -e |
| 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 # This script is called after an AutoUpdate or USB install. The first argument | 7 # This script is called after an AutoUpdate or USB install. The first argument |
| 8 # is the partition where the new rootfs is installed. The autoupdate invocation | 8 # is the partition where the new rootfs is installed or empty. If non-empty |
| 9 # will provide a second argument, specifying the partition for the new kernel. | 9 # the rootfs should be updated w/ the new bootloader config. If empty, the |
| 10 # rootfs is mounted-read only and should not be updated. |
| 10 | 11 |
| 11 # Update /boot/extlinux.conf. | 12 # Update /boot/extlinux.conf. |
| 12 INSTALL_ROOT=`dirname "$0"` | 13 INSTALL_ROOT=`dirname "$0"` |
| 13 INSTALL_DEV="$1" | 14 INSTALL_DEV="$1" |
| 14 KINSTALL_DEV="$2" | |
| 15 | 15 |
| 16 # Only update extlinux.conf if $1 is non-empty |
| 17 if [ -n "$INSTALL_DEV" ]; then |
| 18 # Set default label to chromeos-hd. |
| 19 sed -i 's/^DEFAULT .*/DEFAULT chromeos-hd/' "$INSTALL_ROOT"/boot/extlinux.conf |
| 20 sed -i "{ s:HDROOT:$INSTALL_DEV: }" "$INSTALL_ROOT"/boot/extlinux.conf |
| 21 fi |
| 16 | 22 |
| 17 # Set default label to chromeos-hd. | |
| 18 sed -i 's/^DEFAULT .*/DEFAULT chromeos-hd/' "$INSTALL_ROOT"/boot/extlinux.conf | |
| 19 sed -i "{ s:HDROOT:$INSTALL_DEV: }" "$INSTALL_ROOT"/boot/extlinux.conf | |
| 20 | |
| 21 # NOTE: The stateful partition will not be mounted when this is called at | |
| 22 # USB-key install time. It will be mounted following an upgrade. ChromeOS | |
| 23 # hardware expects the kernel to be in a partition of its own. Legacy systems | |
| 24 # will use syslinux to boot from the kernel image found in the rootfs. | |
| 25 # TODO: The ChromeOS kernel partition will contain a signature header, a config | |
| 26 # file, and the kernel image as a single blob. We'll need to revisit this to | |
| 27 # ensure that gets installed properly. | |
| 28 if [ -n "$KINSTALL_DEV" ]; then | |
| 29 dd if=${INSTALL_ROOT}/boot/vmlinuz of=${KINSTALL_DEV} | |
| 30 fi | |
| OLD | NEW |