Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
base-files: sysupgrade: always setup overlay when creating backup
Setting overlay while creating backup allows including extra files in archive without actually writing them to flash. Right now this feature is limited to /etc/backup/ directory and is used only for including installed_packages.txt. Extend this solution to make it more generic: 1. Always mount overlay while creating backup 2. Overlay whole / to don't limit it to /etc/backup/ This allows including any additional files in backups and adding more sysupgrade features. Cc: Luiz Angelo Daros de Luca <luizluca@gmail.com> Cc: Christian Marangi <ansuelsmth@gmail.com> Cc: Jo-Philipp Wich <jo@mein.io> Cc: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
- Loading branch information
4fa9aaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit breaks the backup of files outside the root filesystem (see 14ac91c#commitcomment-138828645).
Overlay does not seem (by design) to be following mounted filesystems in lowerdir. I did a quick check and I couldn't an option to change that behavior. You need to mount a new overlay for each mounted filesystems into the backup rootfs to get access to those files (and unmount them afterwards).
Another option is to focus on a solution just to protect the directory you actually need to change. For example, we can overlay the directories we actually need to change (/etc/backup, /etc/uci-defaults), exclude them from rootfs backup and append the overlay-etc backup content. If we include the whole /etc/, it might still suffer the same issue if someone mounted a different filesystem there.