Repository navigation
rapido-cut: only install modprobe if kmods are gathered - #287
Merged
Merged
Conversation
Some cut scripts, e.g. simple-example, don't have any explicit kmod dependencies. 9p and virtio_rng modules may still be pulled in via conf_kmod_deps(), based on VIRTFS_SHARE_PATH and QEMU_EXTRA_ARGS (-device virtio-rng-pci) respectively. If no kmods are resolved then we can save quite some space by omitting modprobe (and modules.dep etc) from the initramfs image. This change implements that logic, which on my machine saves quite some space: simple-example image size drops from 19537576 to 11959184 bytes, i.e. a 7M saving. I also implemented the modprobe omission logic if all modules are built-in (detected via cpio_state.off across gather_archive_kmods() calls), but that becomes ugly when autorun scripts call modprobe for built-in modules. That means we'll likely not use this much, but the cost to code complexity is minimal, which makes it worthwhile IMO. Signed-off-by: David Disseldorp <[email protected]>
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.
Some cut scripts, e.g. simple-example, don't have any explicit kmod dependencies. 9p and virtio_rng modules may still be pulled in via conf_kmod_deps(), based on VIRTFS_SHARE_PATH and QEMU_EXTRA_ARGS (-device virtio-rng-pci) respectively. If no kmods are resolved then we can save quite some space by omitting modprobe (and modules.dep etc) from the initramfs image.
This change implements that logic, which on my machine saves quite some space: simple-example image size drops from 19537576 to 11959184 bytes, i.e. a 7M saving.
I also implemented the modprobe omission logic if all modules are built-in (detected via cpio_state.off across gather_archive_kmods() calls), but that becomes ugly when autorun scripts call modprobe for built-in modules. That means we'll likely not use this much, but the cost to code complexity is minimal, which makes it worthwhile IMO.