-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update sfs_load.overlay: Workarounds for /etc, /run, and /var #4264
base: testing
Are you sure you want to change the base?
Conversation
The problem with symlink method for loading sfs modules on the fly on overlay is that files under /etc, /run, and /var where got read-only. To fix this issue simply exclude those folder when creating symlinks. Then perform copy of files of /etc, /run, and /var from sfs module to rootfs
How and when does this (files under /etc, /run, and /var where got read-only) cause problems? @dimkr review requested |
The symlinks point to read-only files, yes. That's a limitation of the symlinks method. But why restrict this to these arbitrary directories and not copy the entire SFS? (By the way, I see no reason for a SFS to include files under /var and /run) |
Copy the entire SFS contents defeats the purpose of SFS on the fly loading and will eat a lot of disk space. Symlink method saves disk space because it was just a symlink. Also /etc was config files it requires write access. /var was self-explanatory on its name. The files inside of that folder always change.
Some linux apps have files on /var and /run. |
True, but users who use sfs_load.overlay instead of loading the SFS at boot time probably know its limitations.
But /run is a tmpfs and /var is mostly for things like state or cache. |
|
I can see why you'd want directories in /var (for example, a package-specific subdirectory of /var/cache), but not files. If your SFS contains an application but also its cache or state, these files will always get copied up. The entire database will be copied to RAM on first change, if you have a snapshot of the database in /var of a SFS. Same with Flatpak - the package database is huge, changes often and gets copied to RAM if you actually use Flatpak. (This is only my opinion, I don't have veto power but I'm not going to cherry-pick this PR into my fork when it's merged) |
This proposed change needs to be exposed to wider scrutiny and fully tested. The best way to do this is probably to release a test build on the forum with requests to test apps which are likely to produce problems. (If flatpak apps are converted to sfs then presumably they can be reconfigured during the conversion to conform to sfs_load.overlay constraints?) |
You can put whatever you want in a SFS, but sometimes it doesn't make sense. For example, if you put /var/cache/apt in a SFS and Same thing with Flatpak, its cache is huge and you'll need to rebuild the SFS with the current cache every time you install or update something, unless you want to download everything and waste RAM again. |
Including /var/cache on sfs module is a bad idea for dev's perspective. If someone converts installed flatpak apps to sfs then the repo objects in flatpak folder on /var must not be included in the first place |
I'd say the same logic applies to all files under /var. A SFS shouldn't contain state and cache (= files under /var) if it's supposed to ship an application in its "clean slate" state. |
The problem with symlink method for loading sfs modules on the fly on overlay is that files under /etc, /run, and /var where got read-only. To fix this issue simply exclude those folder when creating symlinks. Then perform copy of files of /etc, /run, and /var from sfs module to rootfs