Repository navigation
Conversation
Copy Dakota's elements/bluefin/zswap-config.bst (20-zswap.toml kargs, 60-zswap.conf sysctls) and swapfile.bst (bluefin-swapfile-init, its oneshot unit, var-swap-swapfile.swap and the static swap.target.wants link), and drop zram-generator(-defaults). Two Utah-only pieces Dakota does not need: - Hummingbird's kernel builds zstd as a module (CONFIG_CRYPTO_ZSTD=m) and zswap resolves zswap.compressor=zstd during kernel init, so a dracut drop-in adds zstd to the initramfs and regenerate-initramfs.sh fails the build if a modular zstd is missing from it. - Utah keeps SELinux: a one-line CIL module labels /var/swap/swapfile swapfile_t (installed into the /usr/lib/selinux store at build time and checked with matchpathcon), and the init script restorecons the file before writing it. Closes #1224 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hanthor The full list of commands accepted by this bot can be found here. Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
|
Withdrawn: this PR is not back in your court after all. The failing checks ( |
Member
Author
|
Folded into the part-2 landing PR (fold/dakota-sq) with this change unchanged apart from rebase and conflict resolution. Closing here; review continues there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopts Dakota's swap: zswap in front of a disk-backed
/var/swap/swapfile, no zram (owner decision on #1224).What changed
bf271777), verbatim:usr/lib/bootc/kargs.d/20-zswap.tomlandusr/lib/sysctl.d/60-zswap.confcome fromelements/bluefin/zswap-config.bst.usr/libexec/bluefin-swapfile-init,bluefin-swapfile-init.service,var-swap-swapfile.swapand the staticswap.target.wantslink come fromfiles/swapfile/andelements/bluefin/swapfile.bst.zram-generatorandzram-generator-defaultsare out ofpackages/utah.toml. Hummingbird's base doesn't ship either one.CONFIG_CRYPTO_ZSTD=m, with lzo as the default compressor. zswap readszswap.compressor=zstdduring kernel init, so it can only load the module from the initramfs.usr/lib/dracut/dracut.conf.d/50-utah-zswap-zstd.confaddsadd_drivers+=" zstd ".scripts/regenerate-initramfs.shnow fails the build when the kernel builds zstd as a module and the initramfs doesn't carry it. Kernels with zstd built in, or without it, have nothing to carry.Containerfile.kerneland theinstall-*-kernelscripts are untouched./var/swap, so the swapfile would bevar_tand swapon would be denied.usr/share/selinux/packages/utah-swapfile.cilis a one-line module that labels/var/swap/swapfileasswapfile_t.configure-services.shinstalls it withsemodule -n -iinto Hummingbird's/usr/lib/selinuxstore, so it ships in the image and survives ostree's per-deploymentsemodule -N --refresh. The script then checks the label withmatchpathcon.bluefin-swapfile-initrunsrestoreconon the file right aftertouch, before dd and mkswap, when SELinux is enabled.contracts/bluefin-desktop.tomlasserts every new file, plus the kargs, sysctls, dracut line, swap unit and restorecon.tests/test_zswap_swapfile.pyis new.tests/test_regenerate_initramfs.pycovers the zstd guard. The configure-services harness stubssemoduleandmatchpathcon.desktop-contract/references/dakota-system-defaults.mdgets a Swap section and a corrected Lid/sleep note.containerfile.mdcovers the initramfs check.Flagged
x86_64_defconfig. I haven't confirmed whether it hasCONFIG_ZSWAP; if it doesn't, the kargs are ignored and the swapfile works as plain swap. Turning zswap on there is a kernel-cache change and isn't in this PR.install-ogc-kernel.shstill enablesCONFIG_ZRAM, and its comment gives zram-generator as the reason. That's harmless; I left it alone because the kernel-cache rules put that script out of scope here.Verification
just checkpasses (1343 tests).os-minimalimage:semodule -n -i utah-swapfile.cil, thenmatchpathcon /var/swap/swapfilegivessystem_u:object_r:swapfile_t:s0.semodule -N --refresh, and/var/swapitself staysvar_t.CONFIG_ZSWAP=y,CONFIG_CRYPTO_ZSTD=mandCONFIG_ZSWAP_COMPRESSOR_DEFAULT="lzo", and the module sits atkernel/crypto/zstd.ko.xz.swapon --show,/sys/module/zswap/parameters/compressor(should read zstd) andls -Z /var/swap/swapfile.Stacked on #1291 (
feat/dakota-fish-shell).Closes #1224