# "Some dhcpcd hooks are now examples"

## charles17

 * https://gentoo.org/support/news-items/2016-01-08-some-dhcpcd-hooks-are-now-examples.html wrote:*   

> Title: Some dhcpcd hooks are now examples
> 
> Author: William Hubbs <williamh@gentoo.org>
> 
> Content-Type: text/plain
> ...

 

This news item recommends copying files manually into /lib/dhcpcd/dhcpcd-hooks?  

After doing so it starts working again.  But, couldn't this be done better automatically by using appropriate USE flags in the ebuild?

----------

## steveL

 *charles17 wrote:*   

> This news item recommends copying files manually into /lib/dhcpcd/dhcpcd-hooks?  
> 
> After doing so it starts working again.  But, couldn't this be done better automatically by using appropriate USE flags in the ebuild?

 

USE flags that don't affect what is delivered, are frowned upon/banned by policy depending on whom you talk with, and whether they want to ignore the policy for situation X.

So in general, no; I'd check the upstream dhcpcd codebase if I were you.

----------

## UberLord

 *steveL wrote:*   

> I'd check the upstream dhcpcd codebase if I were you.

 

We would find that the Gentoo ebuild and news item are just reflecing upstream at this point.

----------

## steveL

 *UberLord wrote:*   

> We would find that the Gentoo ebuild and news item are just reflecing upstream at this point.

 

Cool, that's pretty much what I expected.

----------

## UberLord

A slight update on this .... wpa_supplicant upstream just accepted my patch to allow interface matching

https://w1.fi/cgit/hostap/commit/?id=45e3fc72c61a61dbd1e2fc3fd9fd7bf853b9f5fe

https://w1.fi/cgit/hostap/commit/?id=2e997eece5776eca0a99d53893e343539f9f8eb2

So you can achieve the same functionality that the dhcpcd wpa_supplicant hook script provided like so

conf.d/wpa_supplicant

```
wpa_supplicant_args="-B -M -c/etc/wpa_supplicant/wpa_supplicant.conf"
```

and voila  :Smile: 

You'll probably have to disable udev network naming rules though.

Of course, you'll either need to apply the above patches to your ebuild, or install a wpa_supplicant git snapshot yourself, or just wait for the next wpa_supplicant release.

Either way, you'll need to enable CONFIG_MATCH_IFACE support when building it.

----------

## charles17

Means with those patches applied, no more need to copy the example hooks but should have wpa_supplicant started as a service?

Then the wiki article needs to be adjusted for next release.

Without epatch_user support in the ebuild I'll prefer waiting for a next wpa_suplicant release.

----------

## UberLord

 *charles17 wrote:*   

> Means with those patches applied, no more need to copy the example hooks but should have wpa_supplicant started as a service?

 

Exactly so.

 *Quote:*   

> Then the wiki article needs to be adjusted for next release.
> 
> Without epatch_user support in the ebuild I'll prefer waiting for a next wpa_suplicant release.

 

I have no idea when that would be, and I would likely forget so I posted this here once the patches were accepted upstream.

----------

## charles17

Thanks for clarification and for all your brilliant work.  

Would this change also affect dhcpcd-ui?

----------

## UberLord

No, dhcpcd-ui functions the same as before with this.

----------

## charles17

 *UberLord wrote:*   

> I have no idea when that would be, and I would likely forget so I posted this here once the patches were accepted upstream.

 Are the changes included in wpa_supplicant-2.6?

----------

## UberLord

Yes

CONFIG_MATCH_IFACE=yes

is needed to build support in for it though, so the ebuild will probably need to be modified.

----------

## charles17

bug 596606

Will there be any need for running wpa_supplicant as a service then?

----------

## UberLord

Yes, it's now run as a service in the boot or default runlevel.

----------

## charles17

 *UberLord wrote:*   

> CONFIG_MATCH_IFACE=yes
> 
> is needed to build support in for it though, so the ebuild will probably need to be modified.

 Maybe I could start a pull request for this.

Should it be activated unconditionally or does it need an additional USE flag?

----------

## UberLord

There is no harm in pulling it in automatically.

There is no real need for a use flag.

----------

## charles17

Now in Gentoo main repository.

----------

## dmpogo

A stupid question,  does one still need to run dhcpcd as an initi service ?   I.e am I to not copying the hook, but running both dhcpcd and wpa_supplicant (with M option) as services ?

----------

## UberLord

You run both as a service.

----------

## dmpogo

 *UberLord wrote:*   

> You run both as a service.

 

Thx,  works nicely !

----------

