diff --git a/board/common/rootfs/usr/libexec/infix/mnt b/board/common/rootfs/usr/libexec/infix/mnt index 56d6b7aa..82dd4e50 100755 --- a/board/common/rootfs/usr/libexec/infix/mnt +++ b/board/common/rootfs/usr/libexec/infix/mnt @@ -42,9 +42,17 @@ check_factory() factory_reset() { - # XXX: flash LEDs to confirm factory-reset in progress + find /sys/class/leds/ -type l -exec sh -c 'echo 100 > $0/brightness' {} \; logger $opt -p user.crit -t "$nm" "Resetting to factory defaults." + + # Shred all files to prevent restoring contents + find /mnt/cfg -type f -exec shred -zu {} \; + find /mnt/var -type f -exec shred -zu {} \; + + # Remove any lingering directories and symlinks as well rm -rf /mnt/cfg/* /mnt/var/* + + logger $opt -p user.crit -t "$nm" "Factory reset complete." sync }