I'm often using specific options to hostapd as CONFIG_VLAN_NETLINK and CONFIG_VLAN_NETLINK. At the moment this maintain my own ebuild which is not really powerfull. So here is a patch proposal for the current stable net-wireless/hostapd-2.0 to use the savedconfig eclass. The current implementation is : restore_config if USE=savedconfig (eclass to that check) Use tc-exportCC, append-cflags when needed (based on USE flag), user can still define it's own LDFLAGS in his .config. If .config is found, then abort src_configure () and use the .config as-is. If no .config is found, then copy the default defconfig as .config. And then define default gentoo value. Instead of building the .config from scratch as it may lead to a better upstream following (for exemple, CONFIG_DRIVER_PRISM54 as gone in 2.0, but the ebuild still define it). instead of using echo >> $CONFIG, a function to this in place, for exemple : # Forced value hostapd_config_option EAP_GTC y # USE base value # define to "y" if ipv6 use is setted, "n" otherwise hostapd_config_option IPV6 $(usex ipv6 y n) hostapd_config_option() work as the following : It accept 2 arguments, a key and a value. If value is 'n', then it define "# CONFIG_$KEY is not set" (as is kernel) If value is 'y', then it define "CONFIG_$KEY=y" This is independant if the value was first enable/disable or commented out in .config. sed expressions are done in a way that the following will be recognize: CONFIG_DRIVER_MADWIFI=y CONFIG_DRIVER_MADWIFI =y #CONFIG_DRIVER_MADWIFI=y #CONFIG_DRIVER_MADWIFI=n # CONFIG_DRIVER_MADWIFI=y #CONFIG_DRIVER_MADWIFI = y ###CONFIG_DRIVER_MADWIFI=y ## CONFIG_DRIVER_MADWIFI=y But not CONFIG_DRIVER_MADWIFI_FOO=y CONFIG_DRIVER_MADWIFIFOO =y So it's almost all case resistent. If the request KEY is not present in the defconfig, then it emit a eqawarn as it's probably someting now unsupported upstream, or a missing CONFIG key in defconfig, so need to be reported upstream. Then it define the requestd value with a comment. Also, CC is exported globally and not defined in .config and append-cflags/append-libs from flag-o-matic is used. Previously, ebuild was definning "LIBS += -L/usr/lib" for CONFIG_DRIVER_NL80211, I don't see the point to definning it as it's already present in default gcc search path, and can break cross compilation. Then, at src_install() the .config is saved in ${PORTAGE_CONFIROOT}/savedconfig/... Reproducible: Always
Created attachment 350842 [details, diff] git diff --patience
Created attachment 350844 [details, diff] hostapd-2.0.ebuild-BJA-savedconfig.diff Previous patch was included my previous work on DYNAMIC_VLAN etc .. so removing it
See also: http://git.meleeweb.net/cgit.cgi/distros/gentoo/portage.git/log/net-wireless/hostapd
I tend to regard savedconfig support as deprecated since epatch_user is now more widely supported. Maybe that's a useful alternative?
(In reply to Jeroen Roovers from comment #4) > I tend to regard savedconfig support as deprecated since epatch_user is now > more widely supported. Maybe that's a useful alternative? I didn't know about the deprecate. Gaa. Here it's much more a ecopy_from_user than epatch_user if I can tell this like this. In my point of view, it's too different things, and using savedconfig make it more longterm maintenable (meanning, I would have to diff defconfig with mean at each new realease, but only have to adapted new config key, delete old, but now have to handle order, comments etc ..)
(In reply to Jeroen Roovers from comment #4) they serve different functions. if hostapd has a kconfig style input file (and it seems it does), then savedconfig makes sense.
What's the status here? Can we expect this to land in portage soon?
(In reply to Lars Wendler (Polynomial-C) from comment #7) > What's the status here? Can we expect this to land in portage soon? Are there any news? I would need support for savedconfig too. The current hostapd 2.2 in portage does not enable CONFIG_IEEE80211AC=y. Without it, I can't use fully my new atheros wifi card.
Will look into the ticket soon. Have not read it yet.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=492fc8d469625b2f93f6651eef4e65d82a208ecd commit 492fc8d469625b2f93f6651eef4e65d82a208ecd Author: Andrey Utkin <andrey_utkin@gentoo.org> AuthorDate: 2018-04-08 14:00:03 +0000 Commit: Andrey Utkin <andrey_utkin@gentoo.org> CommitDate: 2018-04-09 01:19:21 +0000 net-wireless/hostapd: add savedconfig support Bug: https://bugs.gentoo.org/473124 Package-Manager: Portage-2.3.24, Repoman-2.3.6 net-wireless/hostapd/hostapd-2.6-r2.ebuild | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)}
Sorry you people had to wait so long. Implemented now.
oh, and: savedconfig feature is added to newly committed upstable 2.6-r2 ebuild, so ACCEPT_KEYWORDS=~arch if you want to try it out immediately.