factory_install: Try to do ec reboot after install.
Factory installer forces lid open to make backlight always on, which
causes that factory needs to turn off this setting to test lid switch.
Try to do ec reboot to clear the setting at the end of install script.
BUG=b:118089255
TEST=Manually test on DUT, both RMA install and netboot.
Change-Id: Ia8a9081c870379cb2b2f017cd4e438627d7fed6b
Reviewed-on: https://chromium-review.googlesource.com/1337233
Commit-Ready: Cheng-Han Yang <chenghan@chromium.org>
Tested-by: Cheng-Han Yang <chenghan@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>
diff --git a/factory_install.sh b/factory_install.sh
index 9e5e841..922d912 100644
--- a/factory_install.sh
+++ b/factory_install.sh
@@ -1047,11 +1047,13 @@
enable_cr50_factory_mode
fi
+ # Try to do EC reboot. If it fails, do normal reboot.
if [ -n "${NETBOOT_RAMFS}" ]; then
# There is no 'shutdown' and 'init' in initramfs.
- busybox reboot -f
+ ectool reboot_ec cold at-shutdown && busybox poweroff -f ||
+ busybox reboot -f
else
- shutdown -r now
+ ectool reboot_ec cold at-shutdown && shutdown -h now || shutdown -r now
fi
# sleep indefinitely to avoid re-spawning rather than shutting down