Call sync at end of update_kernel

If the kernel panics early during reboot then
the filesystem hasn't been synced yet. This can lead
to corrupted images and other bad things.

BUG=None
TEST=Ran update_kernel, saw sync call run on device

Change-Id: Iea079ba13fef19c1fa30163935d85e4dd5b0f905
Reviewed-on: https://gerrit.chromium.org/gerrit/27288
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>
Tested-by: Jon Kliegman <kliegs@chromium.org>
This commit is contained in:
Jonathan Kliegman 2012-07-12 12:45:33 -04:00 committed by Gerrit
parent 258021c878
commit d6f3d0771a

View File

@ -158,6 +158,10 @@ main() {
copy_kernelimage copy_kernelimage
# An early kernel panic can prevent the normal sync on reboot. Explicitly
# sync for safety to avoid random file system corruption.
remote_sh sync
if [ "${FLAGS_reboot}" -eq ${FLAGS_TRUE} ]; then if [ "${FLAGS_reboot}" -eq ${FLAGS_TRUE} ]; then
echo "rebooting" echo "rebooting"