Skip to content

Commit

Permalink
Load extra modules necessary in 6.1.x kernel
Browse files Browse the repository at this point in the history
virtio_pci_modern_dev and virtio_pci_legacy_dev are dependencies of
virtio_pci. netfs is a dependency of fscache and 9p.
Kernel config doesn't allow building those as built-in when actual
functionality is in a module, so load the extra modules manually when
necessary.

Make it optional, to still work with older kernel too.
  • Loading branch information
marmarek committed Oct 16, 2023
1 parent 65d01a4 commit f52f65f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runtime/init-container/src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1940,6 +1940,10 @@ int main(int argc, char **argv) {
load_module("/failover.ko");
load_module("/virtio.ko");
load_module("/virtio_ring.ko");
if (access("/virtio_pci_modern_dev.ko", R_OK) == 0)
load_module("/virtio_pci_modern_dev.ko");
if (access("/virtio_pci_legacy_dev.ko", R_OK) == 0)
load_module("/virtio_pci_legacy_dev.ko");
load_module("/virtio_pci.ko");
load_module("/net_failover.ko");
load_module("/virtio_net.ko");
Expand All @@ -1949,6 +1953,8 @@ int main(int argc, char **argv) {
load_module("/virtio_blk.ko");
load_module("/squashfs.ko");
load_module("/overlay.ko");
if (access("/netfs.ko", R_OK) == 0)
load_module("/netfs.ko");
load_module("/fscache.ko");
load_module("/af_packet.ko");
load_module("/ipv6.ko");
Expand Down

0 comments on commit f52f65f

Please sign in to comment.