Skip to content

parse.kconfig: support checking generated kconfig from fragments

Clayton Craft requested to merge craftyguy/kconfigcheck-generated-config into master

This teaches kconfig check to generate and validate kconfig that was generated by abuild prepare, e.g. when using config fragments.

If the standard *.config files are not found in pmaports for a kernel package, then it runs abuild unpack && abuild prepare to unpack the kernel source, apply patches, and (for pkgs that use fragments) generate a config based on those fragments. After this, it runs the check on that generated config.

It seems kinda wasteful to be downloading/extracting the kernel source just to validate the kconfig, but I think that in most situations where the kconfig is being checked, the kernel source is already being downloaded for other reasons (build testing / checksumming in CI or locally). Obviously there are exceptions and this way of doing kconfig check could be annoying (making broad kernel changes in CI), but I still think it's not that bad since 1) very few kernels in pmaports use fragments, and 2) we can improve this later if the first point changes significantly

I used this on a kernel pkg being developed in pmaports!5837 and it found real kconfig check failures with some earlier version of the kconfig fragments in that patch:

[11:46:14] WARNING: .config: CONFIG_LEDS_TRIGGER_PATTERN should be set (category:community_various)
[11:46:14] WARNING: .config: CONFIG_NETFILTER_XT_MATCH_MARK should be set (category:community_various)
[11:46:14] WARNING: .config: CONFIG_NETFILTER_XT_MATCH_MULTIPORT should be set (category:community_various)
[11:46:14] WARNING: .config: CONFIG_NETFILTER_XT_MATCH_STATISTIC should be set (category:community_various)
[11:46:14] WARNING: .config: CONFIG_UCLAMP_TASK should be set (category:community_various)
[11:46:14] WARNING: .config: CONFIG_UCLAMP_TASK_GROUP should be set (category:community_various)
[11:46:14] WARNING: .config: CONFIG_RT_GROUP_SCHED should *not* be set (category:community_various)
[11:46:14] WARNING: .config: CONFIG_DM_INTEGRITY should be set (category:community_various)
[11:46:14] WARNING: .config: CONFIG_NFT_COMPAT should be set (category:containers)
[11:46:14] WARNING: .config: CONFIG_DYNAMIC_FTRACE should be set (category:debug)
[11:46:14] WARNING: .config: CONFIG_UDF_FS should be set (category:filesystems)
[11:46:14] WARNING: .config: CONFIG_XFS_FS should be set (category:filesystems)
[11:46:14] WARNING: .config: CONFIG_HIDRAW should be set (category:input)
[11:46:14] WARNING: .config: CONFIG_JOYSTICK_XPAD should be set (category:input)
[11:46:14] WARNING: .config: CONFIG_JOYSTICK_XPAD_FF should be set (category:input)
[11:46:14] WARNING: .config: CONFIG_JOYSTICK_XPAD_LEDS should be set (category:input)
[11:46:14] WARNING: .config: CONFIG_USB_ANNOUNCE_NEW_DEVICES should be set (category:input)
[11:46:14] WARNING: .config: CONFIG_USB_HIDDEV should be set (category:input)
[11:46:14] WARNING: .config: CONFIG_USB_PRINTER should be set (category:input)
Edited by Clayton Craft

Merge request reports

Loading