Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 473124 - net-wireless/hostapd-2.0 - add savedconfig support
Summary: net-wireless/hostapd-2.0 - add savedconfig support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Andriy Utkin (RETIRED)
URL:
Whiteboard:
Keywords: PATCH, STABLE
Depends on:
Blocks:
 
Reported: 2013-06-12 17:18 UTC by Bertrand Jacquin
Modified: 2018-04-09 01:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
git diff --patience (hostapd-2.0.ebuild-BJA-savedconfig.diff,5.71 KB, patch)
2013-06-12 17:20 UTC, Bertrand Jacquin
Details | Diff
hostapd-2.0.ebuild-BJA-savedconfig.diff (hostapd-2.0.ebuild-BJA-savedconfig.diff,5.41 KB, patch)
2013-06-12 17:22 UTC, Bertrand Jacquin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Jacquin 2013-06-12 17:18:54 UTC
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
Comment 1 Bertrand Jacquin 2013-06-12 17:20:29 UTC
Created attachment 350842 [details, diff]
git diff --patience
Comment 2 Bertrand Jacquin 2013-06-12 17:22:55 UTC
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
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-06-12 17:55:19 UTC
I tend to regard savedconfig support as deprecated since epatch_user is now more widely supported. Maybe that's a useful alternative?
Comment 5 Bertrand Jacquin 2013-06-12 18:51:06 UTC
(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 ..)
Comment 6 SpanKY gentoo-dev 2013-12-03 19:31:28 UTC
(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.
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-03-20 13:01:01 UTC
What's the status here? Can we expect this to land in portage soon?
Comment 8 Conrad Kostecki gentoo-dev 2014-08-26 11:28:56 UTC
(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.
Comment 9 Andriy Utkin (RETIRED) gentoo-dev 2018-03-30 16:59:30 UTC
Will look into the ticket soon. Have not read it yet.
Comment 10 Larry the Git Cow gentoo-dev 2018-04-09 01:23:45 UTC
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(-)}
Comment 11 Andriy Utkin (RETIRED) gentoo-dev 2018-04-09 01:26:26 UTC
Sorry you people had to wait so long. Implemented now.
Comment 12 Andriy Utkin (RETIRED) gentoo-dev 2018-04-09 01:28:16 UTC
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.