This does not enable the script for existing users. Should we?
rebased onto a55e199399c77df672207a06f3a11e7d0d6a9007
Updated to add a min free space check
IMO, what would be best is to align with what upstream Fedora does, I don't think upstream Fedora make a choice of turning on swap or not based on this, it's probably static (but unsure, might be a percentage based thing):
ConditionMemory=<=16G
I'm the type of guy, who would normally have swap off if given the choice, and just turn it on when I start to do something where I end up running out of memory.
But please merge feel free to merge regardless. I'm sure this MR is opened for a reason :)
In many of our distros in the Fedora, CentOS Stream family, this is often the type of thing we would do while composing the OS image via osbuild or equivalent tool.
I think we have zram on by default in upstream Fedora also. Do we do have this on in Asahi? (I'm AFK today kinda, just typing a few comments on my Chromebook)
We have zram like upstream Fedora, but it's not enough. People keep running out of RAM on 8G machines, and blame Asahi. macOS does swap by default and swap is very fast on these machines, which is why it gets away with it. We absolutely need disk-backed swap by default on the lower-RAM machines, at least a reasonable amount as configured here, to give users the expected experience. The logic here is based on user pain reports (nobody has complained on a 24G or higher machine yet).
Users who don't want swap can always turn it off and remove it after install, it's easy enough and the script self-disables so it won't happen again.
Typing quickly, this might still be accurate:
https://fedoraproject.org/wiki/Changes/SwapOnZRAM
Feel free to merge this! I'll be on and offline the next week or two.
Pull-Request has been merged by ecurtin
Cool, lets merge, we can always revisit again in future!
I don't think we should enable this for existing users. This looks fine to me, we'll just need to add the enable line into the kiwi description config.sh once this is merged.
This does not enable the script for existing users. Should we?