-   Linux - General (
-   -   Compiling embedded linux image. Some general questions (

alpha_lt 01-22-2013 01:26 AM

Compiling embedded linux image. Some general questions
Hello to all,

I'm trying to learn some things about compiling and building OpenWRT linux image, but I'm stuck. I can't get help in appropriate forums maybe because my question is too stupid or maybe because it refers to general linux kernel building issues. So I'll try to specify my problem as detailed as possible and hope will get answer.
When you select package in 'make menuconfig' tool with 'y' or 'm' then everything is clear and no problems. Problem arrive when you select for example iptables modules 'iptables-mod-extra' with 'y'. This module contains several matches and somehow all matches are automatically selected as 'm'. I can't find rules which describe that particular modules must be autoselected with 'm'. What I found so far is:
1. In file 'include/' the is line
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_OWNER, $(P_XT)xt_owner))
MATCH_OWNER is one of the matches of 'iptables-mod-extra' and as I understand CONFIG_NETFILTER_XT_MATCH_OWNER should be evaluated into 'm' in that line above and it is true.
2. CONFIG_NETFILTER_XT_MATCH_OWNER is defined as 'm' in file 'build_dir/toolchain-mips_r2_gcc_-4.6-linaro_uClibc-'. Here is the question itself. Whole build_dir is generated during make time and there should be some rule which describes how build system must generate that ./config file. If I could find definition which tell to build system that CONFIG_NETFILTER_XT_MATCH_OWNER must be assigned to 'm' then all the rest would be clear to me.

Could please someone help me to find an answer or at least guide me to right path of finding the answer. I even tried 'make -d', but without success.

elucches 02-01-2013 09:42 AM

Perhaps this helps.

alpha_lt 02-03-2013 07:48 AM


This is indeed very good article, but still I can't find rules which defines submodules for particular module. I'm trying to look at the make -d output, but still not so much success here.

elucches 02-04-2013 08:15 AM

Hello alpha_lt,
You can track dependencies by looking in the Kconfig files. For example, using grep for NETFILTER_XT_MATCH_OWNER you'll find that net/netfilter/Kconfig says it's tristate and depends on NETFILTER_ADVANCED, then you can grep for NETFILTER_ADVANCED, etc. If that's not what you're after, then I don't understand the question.
Best regards,

alpha_lt 02-05-2013 12:57 AM


Yes you understand my question right. I'll try to grep for NETFILTER_ADVANCED and see what it show me.
