2008-01-03 10:37:12

by Ph. Marek

[permalink] [raw]
Subject: "mconf" and help texts

Hello everybody!

[[ Please keep me CC'ed. Thank you. ]]


I just tried looking at NF_CONNTRACK_MARK (menuconfig, in 2.6.23.12), and
found it disallowed.

So I took a look at "Help", and saw that blob:

Selected by: NETFILTER_XT_TARGET_CONNMARK && NET && INET && NETFILTER &&
NETFILTER_XTABLES && (IP_NF_MANGLE || IP6_NF_MANGLE) && NF_CONNTRACK ||
NETFILTER_XT_MATCH_CONNMARK && NET && INET && NETFILTER &&
NETFILTER_XTABLES && NF_CONNTRACK || IP_NF_TARGET_CLUSTERIP && NET &&
INET && NETFILTER && IP_NF_MANGLE && EXPERIMENTAL && NF_CONNTRACK_IPV4

That is a _bit_ unreadable.


Now breaking that into multiple lines would show me this:
NETFILTER_XT_TARGET_CONNMARK && NET && INET && NETFILTER &&
NETFILTER_XTABLES && (IP_NF_MANGLE || IP6_NF_MANGLE) && NF_CONNTRACK ||
NETFILTER_XT_MATCH_CONNMARK && NET && INET && NETFILTER &&
NETFILTER_XTABLES && NF_CONNTRACK ||
IP_NF_TARGET_CLUSTERIP && NET && INET && NETFILTER && IP_NF_MANGLE &&
EXPERIMENTAL && NF_CONNTRACK_IPV4

Is that correct? If yes, how about putting such line-breaks in the shown text?

Furthermore ... how about removing duplicate symbols from there?
A bit of editing shows me

1 EXPERIMENTAL
3 INET
1 IP6_NF_MANGLE
2 IP_NF_MANGLE
1 IP_NF_TARGET_CLUSTERIP
3 NET
3 NETFILTER
2 NETFILTER_XTABLES
1 NETFILTER_XT_MATCH_CONNMARK
1 NETFILTER_XT_TARGET_CONNMARK
2 NF_CONNTRACK
1 NF_CONNTRACK_IPV4

Now I wonder ... complete reductions of this might be a bit awful, but
repeated
INET && ... ||
INET && ... ||
INET && ...
could surely be made shorter.

It would be nice (depending on your value of "nice", of course :-))
to see
NET && INET && NETFILTER &&
NETFILTER_XT_TARGET_CONNMARK && NETFILTER_XTABLES &&
(IP_NF_MANGLE || IP6_NF_MANGLE) && NF_CONNTRACK ||
NETFILTER_XT_MATCH_CONNMARK && NETFILTER_XTABLES && NF_CONNTRACK ||
IP_NF_TARGET_CLUSTERIP && IP_NF_MANGLE && EXPERIMENTAL && NF_CONNTRACK_IPV4

I'm not sure whether it would be worth the additional work to get
NET && INET && NETFILTER &&
( NETFILTER_XTABLES && NF_CONNTRACK &&
( NETFILTER_XT_MATCH_CONNMARK && NETFILTER_XTABLES ) ||
( NETFILTER_XT_TARGET_CONNMARK && NF_CONNTRACK &&
(IP_NF_MANGLE || IP6_NF_MANGLE) ) ||
IP_NF_TARGET_CLUSTERIP && IP_NF_MANGLE && EXPERIMENTAL &&
NF_CONNTRACK_IPV4

(if I translated that correctly, manually)


Would there be interest if I supplied some script (perl would be easiest for
me) that tried to simplify such strings? Calling that from C wouldn't be
nice, but acceptable for the occasional help text showing.

There has to be some expression parser for that ... could that be used? Where
gets this string built?


As a side-node - I cannot get xconfig to work (pkg-config); is there some way
in menuconfig to see why some config option is disallowed? The location tree
shows some data ("-> Networking support (NET [=y])"), but not for all
dependencies. [Does xconfig allow enabling them while seeing this option?]



Regards,

Phil


2008-01-07 03:36:40

by Roman Zippel

[permalink] [raw]
Subject: Re: "mconf" and help texts

Hi,

On Thursday 3. January 2008, Ph. Marek wrote:

> So I took a look at "Help", and saw that blob:
>
> Selected by: NETFILTER_XT_TARGET_CONNMARK && NET && INET && NETFILTER &&
> NETFILTER_XTABLES && (IP_NF_MANGLE || IP6_NF_MANGLE) && NF_CONNTRACK
> || NETFILTER_XT_MATCH_CONNMARK && NET && INET && NETFILTER &&
> NETFILTER_XTABLES && NF_CONNTRACK || IP_NF_TARGET_CLUSTERIP && NET &&
> INET && NETFILTER && IP_NF_MANGLE && EXPERIMENTAL && NF_CONNTRACK_IPV4
>
> That is a _bit_ unreadable.

What you see here is the internal representation of the select expression. To
make it more easily readable, you could just cut off everything between &&
and || (it's the dependency of the symbol which does the select, the one
before &&).
The readable expression could be generated when needed, but it might be easier
to just generate at the same time as the full expression (in menu_finalize).

> As a side-node - I cannot get xconfig to work (pkg-config);

Why exactly? What's the error message?

> is there some
> way in menuconfig to see why some config option is disallowed? The location
> tree shows some data ("-> Networking support (NET [=y])"), but not for all
> dependencies.

I don't quite understand. The dependency for option itself is above the
location tree and the for dependencies of the dependencies you have to look
at their individual info.

> [Does xconfig allow enabling them while seeing this option?]

Only if you enable the missing dependency. This is insofar a little easier as
they are linked if you enable the deubg info, so the prompt may be a little
easier to find.

bye, Roman

2008-01-07 06:05:24

by Ph. Marek

[permalink] [raw]
Subject: Re: "mconf" and help texts

Hell Roman!

Thank you for your answer.

On Montag, 7. Januar 2008, Roman Zippel wrote:
> On Thursday 3. January 2008, Ph. Marek wrote:
> > So I took a look at "Help", and saw that blob:
...
> > That is a _bit_ unreadable.
>
> What you see here is the internal representation of the select expression.
> To make it more easily readable, you could just cut off everything between
> && and || (it's the dependency of the symbol which does the select, the one
> before &&).
> The readable expression could be generated when needed, but it might be
> easier to just generate at the same time as the full expression (in
> menu_finalize).
>
> > As a side-node - I cannot get xconfig to work (pkg-config);
>
> Why exactly? What's the error message?
CHECK qt
*
* Unable to find the QT3 installation. Please make sure that
* the QT3 development package is correctly installed and
* either install pkg-config or set the QTDIR environment
* variable to the correct location.
*
I didn't find a package for debian that has a qt3.pc.

> > is there some
> > way in menuconfig to see why some config option is disallowed? The
> > location tree shows some data ("-> Networking support (NET [=y])"), but
> > not for all dependencies.
>
> I don't quite understand. The dependency for option itself is above the
> location tree and the for dependencies of the dependencies you have to look
> at their individual info.
If there's some option I currently can not choose (because of the
dependencies), I'd like to see *which* dependency (-ies) prohibit that.

If all I see is
Depends on: NET && INET && NETFILTER && NF_CONNTRACK
I have to manually hunt down which isn't enabled.

> > [Does xconfig allow enabling them while seeing this option?]
>
> Only if you enable the missing dependency. This is insofar a little easier
> as they are linked if you enable the deubg info, so the prompt may be a
> little easier to find.
So there's no easy way to say "I want that ... aktivate that, that and this
option as needed", and it recurses through the symbols.


Thank you!


Regards,

Phil