Hello all,
i created a new hwmon driver package which needs CONFIG_REGMAP set in kernel config.
But this variable is not set bydefault in my target config.
When i add another kernel module which requires these settings with make menuconfig (e.g. kmod-hwmon-lm75) , also my driver compiles without error.
But without this workaround CONFIG_REMAP is not set and compilation fails.
Check tmp/.config-package.in to see that your package dependencies are being parsed correctly. Sometimes, I need to manually remove this tmp folder to get config to update correctly.
don't include in KCONFIG Kconfigs that you depend on packages for (HWMON I2C REGMAP_I2C)
I think, because you are not building this driver as part of the kernel build, the KernelPackageKCONFIG should be empty—this is what the other src kernel packages do, see: git grep KCONFIG -- 'package/kernel/**Makefile' ':!package/kernel/linux'
Check other examples of KernelPackage build from source: find package/kernel/ -maxdepth 2 -type d -iname src -printf '%h\n'
Thanks for your suggestions, but meanwhile i think it is not possible to add an required kernel config for a package which is not part of the kernel tree.
It looks like the lantiq atm packages do this with kmod-atm , so it should be possible:
Promising, but i think the kmod-atm dependecy is already set in the target configs,
as these packages can't be added to other targets.
Check tmp/.config-package.in to see that your package dependencies are being parsed correctly.
It looks good, all dependencies are here, but in kernel config CONFIG_REGMAP_I2C is missing.
don't include in KCONFIG Kconfigs that you depend on packages for (HWMON I2C REGMAP_I2C)
Removed it, but no change.
You should be able to use KERNEL_MAKE
Still no success.
Might be easier to remove the Kconfig your driver defines:
Also no change.
I think, because you are not building this driver as part of the kernel build, the KernelPackageKCONFIG should be empty
O.k., but the dependency is still missing.
Check other examples of KernelPackage build from source: find package/kernel/ -maxdepth 2 -type d -iname src -printf '%h\n'
I didn't find a good example here, they have either no dependencies or are target depended, so all dependcies are set already be the target.
Meanwhile i think i should move my driver to the kernel tree like ubnt-ledbar, see: target/linux/generic/hack-5.xx/800-ubnt-ledbar-driver-patch and target/linux/generic/files/drivers/leds/leds_ubnt-ledbar.c
Or better add patches under package/kernel/hwmon-isl28022 ?
Any thoughts on it?
Good information. This means that Openwrt is correctly setting the Kconfig options https://github.com/openwrt/openwrt/blob/9a5b1af670185f07a797920f861a6033e61c5c61/include/kernel-defaults.mk#L114, but then configure run by the kernel is dropping them.
I think this could be because REGMAP_I2C is hidden option (no prompt text), so kernel configure will drop it unless something else select or depends on it (from kernel .config). If that is the case, I think you will need to move your driver into the kernel build. I saw something similar (hidden .config option dropped) with kmod-sfp (not) being built by itself.
HIDDEN at OpenWrt level does not matter (relevant for OpenWrt make menuconfig)
We are looking at something that happens within the kernel build process: I think that no prompt text in kernel Kconfig does matter does matter here. Example:
config REGMAP_I2C
tristate
depends on I2C
vs.
config I2C
tristate "I2C support"
The way to test this is to patch it in kernel, example:
config REGMAP_I2C
tristate "REGMAP I2C support"
depends on I2C
This can be done in-place, under build_dir/target-*/linux-*/linux-*/drivers/i2c/Kconfig, then rebuild kernel via make target/linux/install, but it is easy to make mistakes, and you will lose changes when a clean happens.