1

I am trying to add IPtables to a Yocto Linux image but I think versions of compiled modules and modules needed for IPtables do not match. IPtables is looking for modules under /lib/modules/4.9.88 but kernel modules are under /lib/modules/5.4.94.

root@imx6ullevk:~# iptables -L
modprobe: FATAL: Module ip_tables not found in directory /lib/modules/4.9.88+g5e23f9d61147
iptables v1.8.5 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

root@imx6ullevk:/lib/modules# ls -al drwxr-xr-x 3 root root 240 Apr 6 11:50 . drwxr-xr-x 7 root root 4528 Apr 6 11:50 .. drwxr-xr-x 3 root root 1208 Apr 6 11:50 5.4.94+g4b9631852aa7

root@imx6ullevk:/lib/modules/5.4.94+g4b9631852aa7# cat modules.builtin | grep ip_ kernel/net/ipv4/ip_tunnel.ko kernel/net/ipv4/netfilter/ip_tables.ko

Is there anything I could try to fix this?

I use the following steps to create an image. I have also tried newer branches than Gatesgarth (Thud, Master, Zeus, Warrior…) and making the modules included and modular but the problem consists.

repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b gatesgarth;
repo sync;
DISTRO=fslc-framebuffer MACHINE=imx6ullevk source setup-environment build;

#Add necessary recipies to the local.conf echo 'MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules" IMAGE_INSTALL_append = "
packagegroup-core-ssh-openssh
openssh-sftp-server
iptables "' >> build/conf/local.conf;

#Add ip_tables modules bitbake -c menuconfig virtual/kernel;

#Build the image bitbake core-image-base;

HYK
  • 21

1 Answers1

1

Reboot. If it still doesn't work probably the "actual" /boot filesystem that the bootloader uses was not mounted on /boot correctly when you upgraded the kernel. (Or, when the bootloader was installed, /boot isn't mounted with the filesystem you desired to use.)

Tom Yan
  • 10,996