diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2019-08-21 12:14:26 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-08-21 12:32:03 +0100 |
commit | 978f22f7b0a0c5fc92eb9f49ecc7c08dd962bf3b (patch) | |
tree | ebedb6677c452973ddf9a942598f34bfee64da5d | |
parent | a4811031179509d1b28b805fbe4ab4709379224b (diff) | |
download | aports-978f22f7b0a0c5fc92eb9f49ecc7c08dd962bf3b.tar.bz2 aports-978f22f7b0a0c5fc92eb9f49ecc7c08dd962bf3b.tar.xz |
main/wpa_supplicant: misc fixes for init.d
Make sure wpa_supplicant is started after udev-settle
Enable dbus if wpa_supplicant_conf is not set and default config is missing.
This way networkmanager will work out of the box.
Let user explicitly enable/disable dbus via wpa_supplicant_dbus.
-rw-r--r-- | main/wpa_supplicant/APKBUILD | 6 | ||||
-rw-r--r-- | main/wpa_supplicant/wpa_supplicant.confd | 9 | ||||
-rw-r--r-- | main/wpa_supplicant/wpa_supplicant.initd | 32 |
3 files changed, 38 insertions, 9 deletions
diff --git a/main/wpa_supplicant/APKBUILD b/main/wpa_supplicant/APKBUILD index 677c65a400..61e05b2d44 100644 --- a/main/wpa_supplicant/APKBUILD +++ b/main/wpa_supplicant/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=wpa_supplicant pkgver=2.9 -pkgrel=0 +pkgrel=1 pkgdesc="A utility providing key negotiation for WPA wireless networks" url="https://w1.fi/wpa_supplicant/" arch="all" @@ -110,8 +110,8 @@ package() { } sha512sums="37a33f22cab9d27084fbef29856eaea0f692ff339c5b38bd32402dccf293cb849afd4a870cd3b5ca78179f0102f4011ce2f3444a53dc41dc75a5863b0a2226c8 wpa_supplicant-2.9.tar.gz -2758109ccdd7d13e3839fc640ff2c321d5474d62a9dfce40ceb3c89e09b5cd6fe8b5f2f3184380513dc0e10f166669965e92005c0288c3f0814fd084d9673932 wpa_supplicant.initd -cbfc6b80cb47d4e33415018054a0d8ba39acbadbc3e44776afa918cc4c1e4d36ed3dd809b3448332575ac4fa0b82ad77d7530563f0b9f5e1374a5deea73a3b93 wpa_supplicant.confd +18fde087bfe53d092ab39e7db5cea59125ce3a7a15937e0113d2e7e5a7935e29e063b24f92fd162fb8e17b69044302c190ae3c4cc0aa8dcbc869f4364e063688 wpa_supplicant.initd +24bc4d46f3a8923890f233e433928c3f1204ab5f15a1c32b21dca220af89e2474026059e1040834db88cd3d8f6b61c46abb5cf18bda906e78dcd8fccd0f2a382 wpa_supplicant.confd c3db077fa78dd296d90d07626cb4e684f87618a77ffd51c1ae04b47be7bc0db1e9a3e0f7442acef21c081f6bb782f150cbbd3d0bf245d6ab43f19da3899b53b9 wpa_cli.confd a0ac905ef23af18f1899a797e18157a54fa509c7cc3c59583de768a493d750876bbc0a89237373b67171e7c84259d2350d2c0e33d8e1ea56db9a2e5f27b64128 wpa_cli.initd 2be055dd1f7da5a3d8e79c2f2c0220ddd31df309452da18f290144d2112d6dbde0fc633bb2ad02c386a39d7785323acaf5f70e5969995a1e8303a094eb5fe232 eloop.patch diff --git a/main/wpa_supplicant/wpa_supplicant.confd b/main/wpa_supplicant/wpa_supplicant.confd index aac6d3628d..56a6c11b9b 100644 --- a/main/wpa_supplicant/wpa_supplicant.confd +++ b/main/wpa_supplicant/wpa_supplicant.confd @@ -1,7 +1,10 @@ # conf.d file for wpa_supplicant # # Please check man 8 wpa_supplicant for more information about the options -# wpa_supplicant accepts. Add "-u" (enable dbus) option for controling this -# service with other apps/services like NetworkManager over dbus. -# +# wpa_supplicant accepts. wpa_supplicant_args="" + +# The dbus interface will be enabled by default if wpa_supplicant.conf is +# missing. use wpa_supplicant_dbus to explicitly enable/disable dbus interface + +#wpa_supplicant_dbus=no diff --git a/main/wpa_supplicant/wpa_supplicant.initd b/main/wpa_supplicant/wpa_supplicant.initd index da4da16c3a..c9a06f9074 100644 --- a/main/wpa_supplicant/wpa_supplicant.initd +++ b/main/wpa_supplicant/wpa_supplicant.initd @@ -3,16 +3,18 @@ # All rights reserved. Released under the 2-clause BSD license. command=/sbin/wpa_supplicant -: ${wpa_supplicant_conf:=/etc/wpa_supplicant/wpa_supplicant.conf} +default_conf=/etc/wpa_supplicant/wpa_supplicant.conf wpa_supplicant_if=${wpa_supplicant_if:+-i}$wpa_supplicant_if -command_args="$wpa_supplicant_args -B -c$wpa_supplicant_conf $wpa_supplicant_if" +command_args="$wpa_supplicant_args -B $wpa_supplicant_if" name="WPA Supplicant Daemon" +default_conf=/etc/wpa_supplicant/wpa_supplicant.conf + depend() { need localmount use logger dbus - after bootmisc modules entropy + after bootmisc modules entropy udev-settle before dns dhcpcd net keyword -shutdown } @@ -50,4 +52,28 @@ start_pre() *" -i"*) ;; *) append_wireless;; esac + + # set default conf if dbus is explicitly disabled + if [ -n "${wpa_supplicant_dbus}" ] && ! yesno "${wpa_supplicant_dbus}"; then + : ${wpa_supplicant_conf:=${default_conf}} + fi + + # use default conf if it exists + if [ -f "${default_conf}" ]; then + : ${wpa_supplicant_conf:=${default_conf}} + fi + + # enable default dbus if we still dont have a config + if [ -z "${wpa_supplicant_conf}" ]; then + : ${wpa_supplicant_dbus:=yes} + else + command_args="${command_args} -c$wpa_supplicant_conf" + fi + case " ${command_args}" in + *" -u"*);; + *) if yesno "{wpa_supplicant_dbus}"; then + command_args="-u ${command_args}" + fi + ;; + esac } |