| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 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 # Shutdown is best-effort. We don't want to die on errors. | 7 # Shutdown is best-effort. We don't want to die on errors. |
| 8 set +e | 8 set +e |
| 9 | 9 |
| 10 # Measure shutdown time | 10 # Measure shutdown time. /var/log/metrics is created by chromeos_startup. |
| 11 if [ ! -d "/var/log/metrics" ]; then | |
| 12 mkdir -p /var/log/metrics | |
| 13 fi | |
| 14 | |
| 15 cut -f 1 -d ' ' /proc/uptime > /var/log/metrics/uptime_shutdown_start | 11 cut -f 1 -d ' ' /proc/uptime > /var/log/metrics/uptime_shutdown_start |
| 16 cat /sys/block/sda/stat > /var/log/metrics/disk_shutdown_start | 12 cat /sys/block/sda/stat > /var/log/metrics/disk_shutdown_start |
| 17 | 13 |
| 18 # Sync the system clock to the hardware clock. | 14 # Sync the system clock to the hardware clock. |
| 19 HWCLOCK=/sbin/hwclock | 15 HWCLOCK=/sbin/hwclock |
| 20 ${HWCLOCK} --systohc --utc --noadjfile & | 16 ${HWCLOCK} --systohc --utc --noadjfile & |
| 21 | 17 |
| 22 . /sbin/killers | 18 . /sbin/killers |
| 23 | 19 |
| 24 # Remount root in case a developer has remounted it rw for some reason. | 20 # Remount root in case a developer has remounted it rw for some reason. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 51 if [ $? -ne 0 ] ; then | 47 if [ $? -ne 0 ] ; then |
| 52 mount > /mnt/stateful_partition/var/log/shutdown_stateful_umount_failure | 48 mount > /mnt/stateful_partition/var/log/shutdown_stateful_umount_failure |
| 53 mount > /var/log/shutdown_stateful_umount_failure | 49 mount > /var/log/shutdown_stateful_umount_failure |
| 54 fi | 50 fi |
| 55 | 51 |
| 56 # Just in case something didn't unmount properly above. | 52 # Just in case something didn't unmount properly above. |
| 57 sync | 53 sync |
| 58 | 54 |
| 59 # Ensure that we always claim success. | 55 # Ensure that we always claim success. |
| 60 exit 0 | 56 exit 0 |
| OLD | NEW |