On Mon, 12 Feb 2024 at 17:23, Emil Velikov via B4 Relay <devnull+emil.l.velikov.gmail.com@xxxxxxxxxx> wrote: > > From: Emil Velikov <emil.l.velikov@xxxxxxxxx> > > Currently, when built w/o given compression we'll incorrectly report a > "compression_none". > > As we reach do_finit_module(), we'll naively assume that the kernel can > handle the compressed module, yet omit the MODULE_INIT_COMPRESSED_FILE > flag. > > As result the kernel will barf at us, do_finit_module will fail with non > -ENOSYS and we won't end in the do_init_module codepath (which will also > fail). > > In other words: with this change, you can build kmod without zstd, xz > and zlib support and the kernel will load the modules, assuming it > supports the format \o/ > Important part to note here is that the above is only valid for insmod and modprobe. Tools such as depmod and modinfo, still depend on kmod being built with e.g. zstd, in order for `.ko.zstd` modules to be considered valid entries. I'm not 100% sure about modinfo, at a glance those tools require decompression support in order to parse the elfs and extract the required module information. Regardless of this caveat I do see value in this series: - it notably simplifies the codebase - You can use different kmod on the build vs target system. Namely: Yocto recipe with full blown kmod/depmod generates the mutable modules.xxx files, yet the target system uses compression-less kmod for insmod/modprobe/rmmod/lsmod. HTH Emil