Manually sync disk to prevent hardware reboot lost

This commit is contained in:
Qi Luo 2016-09-12 17:49:15 -07:00
parent c14bfde3c0
commit 20d1ed42d5

View File

@ -12,5 +12,10 @@ echo 0 > /sys/class/gpio/gpio2/value
# replace the original reboot binary with the following command
rm /sbin/reboot
echo 'i2cset -y 0 0x31 1 0xfd' > /sbin/reboot
cat <<EOF >> /sbin/reboot
#!/bin/sh
sync
i2cset -y 0 0x31 1 0xfd
EOF
chmod a+x /sbin/reboot