target_config.lua and target_config_check.lua don't pass a table of
callbacks anymore, so target_config_lib.lua can by simplified by moving
all the code that was in the returned function to the toplevel.
So far, we were using a sort operation on the generated .config to
implement precedence of =y packages over =m, and =m over unset.
Unfortunately, this sort not only used for packages, but for all config
lines. This made it impossible to override settings from targets/generic
in a target config when the new setting was sorted before the generic
setting.
To fix this, track configurations by their keys, so we can properly
override config keys that were set before. Value-based precedence is
only preserved for package configuration.
The config() and try_config() calls always take key and value as
separate arguments now. Strings are quoted automatically; the values
true, nil and false map to y, m and unset for tristate options. config()
can take an optional third argument to override the error message to
display when the setting fails to apply.
All existing target configs generate the same .config with the old and the
new code. The new code is also a bit faster on targets with many devices.
This changes the ath10k firmware and driver selection, as
ath10k-ct is now the default in upstream OpenWrt.
However, for 802.11s operation we need the QCA firmware and driver.
ar71xx-generic and -tiny benefit most from the optimized kernel, as they
contain all devices with 32MB RAM. We enable CONFIG_GLUON_SPECIALIZE_KERNEL
for all targets using the mips24_kc architecture so packages shared between
targets don't need to be rebuild all the time.
The file targets/$GLUON_TARGET/config becomes optional, as many targets
only used it to set the board and subtarget.
Also fix targets without subtarget.
With a backported patch from the OpenWrt trunk, it is now easy to generate an
equivalent configuration using CONFIG_ALL_KMODS.
The build will take a bit longer because all kernel module packages are actually
built even when they are not included in the image, but adding new targets
becomes a lot easier.
Also, related documentation updates and fixes.