supervisor
supervisor copied to clipboard
RFC: Snapshot also Home Assistant OS settings
Context
Currently, we only snapshot Supervisor settings but no Home Assistant OS data. If people move between devices, they lost settings like hostname or other customization which are possible with Home Assistant OS. The goal for the OS is just to be a layer for the Supervisor and all logic running and controlled by the Supervisor. We need archive this but allow also the minimal customization and address the differences between different devices/systems.
Decision
We use the OS-agent to write/read overlay from/to a snapshot file based on a dbus command. The file to read/write is part of the command.
The snapshot gets new options for Home Assistant OS. However, the restore of OS data is only possible on the same mayor OS level. Also, we only snapshot config.txt and cmd.txt which are only restore on the same machine type (We need to maintain a list between compatible machine type).
Implemented on OS > 5.1 / 4.12
@pvizeli does it mean that after enabling I2C or 1Wire we can use snapshot functionality to restore (enable) the same config on a different machine (assuming it's the same type, for example, pi3/4)? This would be a massive help because many users have a problem with this, like in this issue: https://github.com/Misiu/argon40/issues/1.
According to the instructions: https://community.home-assistant.io/t/i2c-not-working-on-the-pi4/160489/7?u=misiu to enable I2C 2 files are needed: hassos-boot\config.txt hassos-overlay\etc\modules-load.d\rpi-i2c.conf
the first one (config.txt) is mentioned by you, but what about files in overlay partition?
You can use the config feature to modify the modules-load.d for now until there come up a new solution
I need to add a file called rpi-i2c.conf to assos-overlay\etc\modules-load.d.
Changing only the config.txt won't be enough.
But we are one step closer thanks to your change.
backup and restore of config.txt will allow for easy enabling/disabling 1Wire, but I2C also requires creating that extra file.
Are there any security reasons why the rest (etc\modules-load.d folder) can't be also added?
@agners I think we should have that into the OS agent that we can send him a tarfile path for restore somethings. I going to store the Network Settings into snapshot since we have a Layer on it
We already store some files from boot/overlay in the snapshot correct? Should we then not either do all on OS level or all on Supervisor level?
not today. I would like to have an command like os.snapshot "/mnt/data/supervisor/tmp/fsdfjjl/os.tar.gz" and the OS snapshot his overlay there