epidose icon indicating copy to clipboard operation
epidose copied to clipboard

Monitor hard resets and restore device to pristine state

Open dspinellis opened this issue 4 years ago • 1 comments

  • On boot check if /var/lib/epidose/restore exists, and if so, perform a clean installation
  • On boot create /var/lib/epidose/restore to indicate that a full restore is needed
  • On a graceful shutdown remove /var/lib/epidose/restore

The procedure for running these commands is described here.

dspinellis avatar Sep 12 '20 09:09 dspinellis

In order to help with restoring the device to a pristine state, one could use a special initramfs that checks the root partition and either loads linux from an image or a different partition, or repairs the root partition using an included rootfs image (for example as a tar.gz file on the boot partition). For example: https://unix.stackexchange.com/questions/460219/how-to-run-a-script-before-switch-root-in-initramfs

A different approach could be a second stage bootloader (for example u-boot) but that could complicate things.

konasimakopoulos avatar Sep 20 '20 12:09 konasimakopoulos