paulgazz / kmax

A collection of analysis tools for Kconfig and Kbuild constraints.
42 stars 21 forks source link

Non-global alternative to `--modules` #230

Open 6b6279 opened 1 year ago

6b6279 commented 1 year ago

Hello,

I was wondering if there is a way to pre-set a tristate symbol to m while calling klocalizer without the --modules flag. Not all tristate symbols I want to pre-set have the value m, so using --modules isn’t adequate. I was expecting something along the lines of the -U or the -D option.

Thanks in advance.

paulgazz commented 1 year ago

I don't think we this capability through the interface, but it should be possible to add via get_config_from_model. Could you say a little more about what behavior you are looking for? -D and -U tell klocalizer to force the configuration option on or off (respectively). Is this the behavior you'd like (but with the option set to m, e.g., with a -M flag) or would you just like the option set to m only when klocalizer determines the option to be enabled (i.e., it is either m or n)?

6b6279 commented 1 year ago

I am using klocalizer to test the validity of configuration files corresponding to an arbitrary Kconfig file (i.e. the Kconfig files aren’t necessarily from the Linux kernel source). I feed klocalizer with the output of kextract and kclause on a given Kconfig file and then enter the configuration to test over the -D and -U flags. There are of course Kconfig files with multiple tristate symbols and in that case there are configurations where one of the tristate symbols is set to m, and the other possibly to t. In that case I can’t give klocalizer the configuration using the --modules flag, because not all tristate symbols are set to m. So I am quite precisely looking for an -M option as you have described it in your comment.