Patchwork [3/5] wpa-supplicant-0.7.3: install only required files for dbus support

login
register
mail settings
Submitter Andreas Oberritter
Date Feb. 11, 2011, 12:57 p.m.
Message ID <1297429080-3986-3-git-send-email-obi@opendreambox.org>
Download mbox | patch
Permalink /patch/533/
State Accepted
Commit 00b6dea99b73c7964c39ac3c0819438087b20787
Headers show

Comments

Andreas Oberritter - Feb. 11, 2011, 12:57 p.m.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 recipes/wpa-supplicant/wpa-supplicant-0.7.inc |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
Stefan Schmidt - Feb. 11, 2011, 2:37 p.m.
Hello.

On Fri, 2011-02-11 at 12:57, Andreas Oberritter wrote:
> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
> ---
>  recipes/wpa-supplicant/wpa-supplicant-0.7.inc |   18 +++++++++++++-----
>  1 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/recipes/wpa-supplicant/wpa-supplicant-0.7.inc b/recipes/wpa-supplicant/wpa-supplicant-0.7.inc
> index b56d37c..ca7751c 100644
> --- a/recipes/wpa-supplicant/wpa-supplicant-0.7.inc
> +++ b/recipes/wpa-supplicant/wpa-supplicant-0.7.inc
> @@ -58,11 +58,19 @@ do_install () {
>  	cd ${D}${sysconfdir}/network/ && \
>  	ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
>  
> -	install -d ${D}/${sysconfdir}/dbus-1/system.d
> -	install -m 644 ${S}/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
> -	install -d ${D}/${datadir}/dbus-1/system-services
> -	sed -i -e s:${base_sbindir}:${sbindir}:g ${S}/dbus/*.service
> -	install -m 644 ${S}/dbus/*.service ${D}/${datadir}/dbus-1/system-services
> +	if grep -q ^CONFIG_CTRL_IFACE_DBUS=y .config || grep -q ^CONFIG_CTRL_IFACE_DBUS_NEW=y .config; then
> +		install -d ${D}/${sysconfdir}/dbus-1/system.d
> +		install -m 644 ${S}/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
> +		install -d ${D}/${datadir}/dbus-1/system-services
> +		if grep -q ^CONFIG_CTRL_IFACE_DBUS=y .config; then
> +			sed -i -e s:/sbin:${sbindir}:g ${S}/dbus/fi.epitest.hostap.WPASupplicant.service
> +			install -m 644 ${S}/dbus/fi.epitest.hostap.WPASupplicant.service ${D}/${datadir}/dbus-1/system-services
> +		fi
> +		if grep -q ^CONFIG_CTRL_IFACE_DBUS_NEW=y .config; then
> +			sed -i -e s:/sbin:${sbindir}:g ${S}/dbus/fi.w1.wpa_supplicant1.service
> +			install -m 644 ${S}/dbus/fi.w1.wpa_supplicant1.service ${D}/${datadir}/dbus-1/system-services
> +		fi
> +	fi
>  
>  	install -d ${D}/etc/default/volatiles
>  	install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles

I like it. Even checking for different dbus config options before installing the
service files. Good work.

Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>

regards
Stefan Schmidt

Patch

diff --git a/recipes/wpa-supplicant/wpa-supplicant-0.7.inc b/recipes/wpa-supplicant/wpa-supplicant-0.7.inc
index b56d37c..ca7751c 100644
--- a/recipes/wpa-supplicant/wpa-supplicant-0.7.inc
+++ b/recipes/wpa-supplicant/wpa-supplicant-0.7.inc
@@ -58,11 +58,19 @@  do_install () {
 	cd ${D}${sysconfdir}/network/ && \
 	ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
 
-	install -d ${D}/${sysconfdir}/dbus-1/system.d
-	install -m 644 ${S}/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
-	install -d ${D}/${datadir}/dbus-1/system-services
-	sed -i -e s:${base_sbindir}:${sbindir}:g ${S}/dbus/*.service
-	install -m 644 ${S}/dbus/*.service ${D}/${datadir}/dbus-1/system-services
+	if grep -q ^CONFIG_CTRL_IFACE_DBUS=y .config || grep -q ^CONFIG_CTRL_IFACE_DBUS_NEW=y .config; then
+		install -d ${D}/${sysconfdir}/dbus-1/system.d
+		install -m 644 ${S}/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
+		install -d ${D}/${datadir}/dbus-1/system-services
+		if grep -q ^CONFIG_CTRL_IFACE_DBUS=y .config; then
+			sed -i -e s:/sbin:${sbindir}:g ${S}/dbus/fi.epitest.hostap.WPASupplicant.service
+			install -m 644 ${S}/dbus/fi.epitest.hostap.WPASupplicant.service ${D}/${datadir}/dbus-1/system-services
+		fi
+		if grep -q ^CONFIG_CTRL_IFACE_DBUS_NEW=y .config; then
+			sed -i -e s:/sbin:${sbindir}:g ${S}/dbus/fi.w1.wpa_supplicant1.service
+			install -m 644 ${S}/dbus/fi.w1.wpa_supplicant1.service ${D}/${datadir}/dbus-1/system-services
+		fi
+	fi
 
 	install -d ${D}/etc/default/volatiles
 	install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles