diff --git a/content/designs/system-updates-and-rollback.md b/content/designs/system-updates-and-rollback.md index bfe5cce01235727997a3494140e2adfb71c056ae..18228d2443f8d7a98b4cadb7cfb196482136a451 100644 --- a/content/designs/system-updates-and-rollback.md +++ b/content/designs/system-updates-and-rollback.md @@ -778,6 +778,36 @@ image for decompression. The content of the update file is extracted into the temporary directory and the signature is checked for the extracted commit tree. +### Settings + +As described in +[preferences and persistence]( {{< ref "preferences-and-persistence.md" >}} ) +there are different types of settings which should be preserved across updates. +The setting should either be kept intact or updated to reflect new logic of the +application. + +When using `OSTree`, most of the file system is read-only. Since system +settings need write support, the `/etc` and `/var` partitions +are configured to be read-write. This also applies to the `/home` +partition, with it being configured as read-write so user data and +settings can be preserved. + +During an `OSTree` upgrade, a new commit is applied on the `OSTree` repo, +this provides the new content that will be used for the read-only portions of +the rootfs, but does not modify the read-write parts. +To handle the upgrade of system settings stored in `/etc`, a copy of its +default values are kept in `/usr/etc` which is updated with the new commit. +default values is kept in `/usr/etc` which is updated with the new commit. +Thanks to this information `OSTree` can detect the files that have been changed +and apply a 3-way merge, to update the `/etc`. + +This process allows to update settings to new defaults for files that were not +modified and keep intact those that were. + +Applications are encouraged to handle settings adaptation to new version +following the guidelines described in [user and user data management]( {{< ref "#user-and-user-data-management" >}} ) +and [preference and persistence]( {{< ref preferences-and-persistence.md >}} ). + ### Error handling If for any reason the update process fails to complete, the update will