feat: enhance CPIO compression selection - #428
Conversation
|
checking the actual kernel config is something i've wanted to do for a while, but the main issue is the fact that this is hard to reliably find across distros. It's not too bad on gentoo, but outside of gentoo, a lot of distros don't even provide the .config file, and your only option is reading /proc/config which won't tell you about the target kernel. I'm gonna need to think about this set of changes for a while, because I don't want to rush this kind of functionality. I think it would be best for the kernel .config reading code to possibly be in the kmod category, maybe a new module just called "config" (ugrd.kmod.config). this category was somewhat intentionally called "kmod" because ugrd should generally be working with kmods and not doing "kernel build" steps like genkernel or similar, but I don't see a great reason to make a new "kernel" category or make this specific to compression settings. there are a lot of other interesting checks you can do with this, and it's really important for users using no kmods (where modinfo/builtin modules can't be determined) I'm also not opposed to ugrd warning users about things like the efifb module missing and things of that nature, I think there are a lot of ways this could help sanity check custom kernels in addition to just making the process smoother |
|
I may update the dev manual a bit, but there are a few style things that are admittedly inconsistent currently and I'd like to make it clear what sort of style I'm trying to move towards. It's a small thing, but I'd like to use fstrings wherever possible, and if some variable is mentioned, ideally it's at the end of a line or within brackets and colored (so users can easily distinguish the info unique to their error) I made a PR here, feel free to add some input if you have ideas about style/standards |
|
I think this looks good, but would you mind rebasing this so each commit is for the particular set of changes it applies to? The fstring stuff could probably just be edited into past commits instead of being added later it may make more sense to have a separate PR to add the kconfig reading stuff first, then make one to use that for CPIO detection |
Improve the logic for choosing the best compression system available in the Linux kernel, by analysing the kernel parameters CONFIG_RD_ZSTD (only when the zstandard module is installed in Python) and CONFIG_RD_XZ
Opinions and flow of the cpio_compression parameter:
true → xz, zstd, nocompression
xz → xz, zstd, nocompression
zstd → zstd, xz, nocompression
false → nocompression
Tests