This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Adding Kernel Modules to EVM5432 GLSDK

I hope this is the correct forum post these questions.  I would like to configure an OMAP uEVM5432 as a NAT router.  Both the LAN and WAN interfaces appear to be working correctly, and every reference that I have seen says that I can use iptables to do the NATing for me.

That's where I run in to trouble.  The Linux build that I'm using is missing the kernel modules required by iptables.

I'm running a recently built version of GLSDK 6.03.00.01.  I built it using the instructions found here:
http://processors.wiki.ti.com/index.php/OMAP5_GLSDK_Software_Developers_Guide#Building_Yocto_Filesystem

The build completed with several warnings, but no errors and appears to be functioning correctly.  However, the kernel appears to be built without any of the modules for iptables.

Here's an example of what happens when I try to get a list of all of the current iptables rules.

root@omap5-evm:~# iptables -L
FATAL: Module ip_tables not found.
iptables v1.4.17: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

I tried both:
# modprobe ip_tables
and
# insmod ip_tables

Neither command worked.

# cd /lib
# find . -name ip* -print

Shows no results.  GLSDK 6.03.00.01 did not build with ip_tables.ko or any of the other kernel modules that appear to be be required by iptables.

My guess is that it's pretty simple to build a new kernel with all of the modules required for iptables, but I can't figure out how to do it.  I found instructions on how to build a kernel here:
http://processors.wiki.ti.com/index.php/OMAP5_GLSDK_Software_Developers_Guide#Additional_Procedures

But they are lacking two pieces of information that I haven't been able to figure out:

  1. Where is the config file kept, so that I can attempt to add the kernel modules needed by iptables?
  2. Does this build the kernel from the same source that is used when I followed the instructions on building the yocto filesystem?

Any guidance that can be offered is appreciated.

-Michael

  • Hi Michael,

    You can build IP tables linux driver yourself through make menuconfig at linux source

    cd ~/linux-source

    make menuconfig ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

    [*] Networking support  --->

    Networking options  --->

     [*] Network packet filtering framework (Netfilter)  --->

     IP: Netfilter Configuration  --->

    <*> IP tables support (required for filtering/masq/NAT)        [ Titus : building as in built  kernel image (uImage)]

    OR

    <M> IP tables support (required for filtering/masq/NAT)       [ Titus : building as module ip_tables.ko (.ko) ]

     

    make uImage ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-   [ Titus : Command for building as in built  kernel image (uImage)]

     

    make modules ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-  [ Titus : Command for building as module ip_tables.ko (.ko) ]

     

    Symbol: IP_NF_IPTABLES [=y]                                                                                                  
    Type  : tristate                                                                                                           
    Prompt: IP tables support (required for filtering/masq/NAT)                                                                
    Defined at net/ipv4/netfilter/Kconfig:52                                                                                  
    Depends on: NET [=y] && INET [=y] && NETFILTER [=y]                                                                        
    Location:                                                                                                                  
    -> Networking support (NET [=y])                                                                                         
     -> Networking options                                                                                               
      -> Network packet filtering framework (Netfilter) (NETFILTER [=y])                                                   
        -> IP: Netfilter Configuration                                                                                
    Selects: NETFILTER_XTABLES [=y]

  • Thank you for the quick reply.  I won't be able to verify until Monday.

    I take it this means the source in the Linux source directory, ${GLSDK}/board-support/linux in my case, is the source that was used by yocto when I built the filesystem.

    -Michael

  • Okay, I finally had some time to try this suggestion an a few other variants and have failed miserably.

    I think my Linux source directory is ${GLSDK}/board-support/linux

    As I stated in my original post, I'm using a file system created by yocto based on the instructions at the following link, and I'm not sure where the source kernel and .config files come from.

    http://processors.wiki.ti.com/index.php/OMAP5_GLSDK_Software_Developers_Guide#Building_Yocto_Filesystem


    When I issue the following commands:

    $ cd

    $ make menuconfig ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

    I get the configuration menu and I can make all of the suggested selections.  The problem is that the wrong base configuration is used.  The host machine is running Ubuntu 12.04 and its configuration file is the one that's getting used.  I know that it's the Ubuntu config file, because I get this message:

    #
    # using defaults found in /boot/config-3.5.0-47-generic
    #

    The next thing that I tried was copying the config file from ${GLSDK}/board-support/linux/arch/arm/configs/omap2plus_defconfig to ${GLSDK}/board-support/linux/.config because that's the configuration file used when I follow these steps:

    http://processors.wiki.ti.com/index.php/OMAP5_GLSDK_Software_Developers_Guide#Additional_Procedures

    Using that file as the initial configuration file resulted in a build with a different set of modules than the Kernel created by the yocto build and it's missing at least one driver that I need.

    So where are the configuration file and sources used by yocto, and how do I get that Kernel to rebuild after editing the configuration file?

    -Michael

  • Rereading http://processors.wiki.ti.com/index.php/OMAP5_GLSDK_Software_Developers_Guide#Modifying_source_code_and_rebuilding_a_component clued me in to the fact that the source is in:

    ${GLSDK}/yocto-layers/build/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-3.8-oe-linux-gnueabi/

    There's a .config file in ${GLSDK}/yocto-layers/build/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-3.8-oe-linux-gnueabi/linux-libc-headers/3.8-r0/linux-3.8, but that still doesn't appear to be the one that was used.  The top level network support isn't even enabled.


    Any clues about where I should be looking are much appreciated.

    -Michael

  • Hi,

    I do not have any idea about yocto,

    But you can find Makefile and Kconfig file which is used to build kernel & .config,

    Refer the below kernel location

    src/kernel/linux-davinci/net/ipv4/netfilter/Makefile

    # generic IP tables
    obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o

    src/kernel/linux-davinci/net/ipv4/netfilter/Kconfig

    config IP_NF_IPTABLES
        tristate "IP tables support (required for filtering/masq/NAT)"
        default m if NETFILTER_ADVANCED=n
        select NETFILTER_XTABLES
        help
          iptables is a general, extensible packet identification framework.
          The packet filtering and full NAT (masquerading, port forwarding,
          etc) subsystems now use this: say `Y' or `M' here if you want to use
          either of those.

          To compile it as a module, choose M here.  If unsure, say N.

    To compile IP tables without considering .config file from kernel,

    change the Makefile to compile directly If you do not know how to select menuconfig in linux

    obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o

    TO

    obj-y += ip_tables.o

     

    IP tables

  • Okay, I think I found the source and Makefile used by netfilter in:

    $GLSDK/yocto-layers/build/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-3.8-oe-linux-gnueabi/linux-libc-headers/3.8-r0/linux-3.8/net/ipv4/netfilter

    I made the recommended change, but I couldn't get any of the yocto build scripts to build anything.  This is my first time working with yocto and it really shows.  I appreciate all of the help and I'll report back with a solution once I have things working.

    -Michael