mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 06:31:18 +02:00
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:
parent
258021c878
commit
d6f3d0771a
@ -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"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user