Last active
January 2, 2022 16:12
-
-
Save bonzini/64a45b4404431747d10519302babcd27 to your computer and use it in GitHub Desktop.
Protecting the initrd with a watchdog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# /etc/initramfs-tools/hooks/sunxi_wdt | |
set -e | |
PREREQS="" | |
prereqs() { echo "$PREREQS"; } | |
case $1 in | |
prereqs) | |
prereqs | |
exit 0 | |
;; | |
esac | |
. /usr/share/initramfs-tools/hook-functions | |
manual_add_modules sunxi_wdt | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# /etc/initramfs-tools/scripts/init-premount/sunxi_wdt | |
if test -e /dev/watchdog; then | |
echo "$(date) /dev/watchdog starting" | |
echo 1 > /dev/watchdog | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# /etc/initramfs-tools/scripts/local-premount/sunxi_wdt | |
if test -e /dev/watchdog; then | |
echo "$(date) /dev/watchdog stopping" | |
echo V > /dev/watchdog | |
echo "$(date) /dev/watchdog stopped" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment