[systemd-devel] [PATCH 2/2] wpa_supplicant: Edit BINDIR in dbus and systemd service files
Henry Gebhardt
hsggebhardt at googlemail.com
Tue Jul 12 13:04:36 PDT 2011
This is useful, since in Gentoo BINDIR=/usr/sbin.
---
wpa_supplicant/.gitignore | 1 +
wpa_supplicant/Makefile | 11 +++++++++++
... => fi.epitest.hostap.WPASupplicant.service.in} | 2 +-
...t1.service => fi.w1.wpa_supplicant1.service.in} | 2 +-
....service => wpa_supplicant-nl80211 at .service.in} | 2 +-
...d at .service => wpa_supplicant-wired at .service.in} | 2 +-
...upplicant.service => wpa_supplicant.service.in} | 2 +-
...plicant at .service => wpa_supplicant at .service.in} | 2 +-
8 files changed, 18 insertions(+), 6 deletions(-)
create mode 100644 wpa_supplicant/.gitignore
rename wpa_supplicant/dbus/{fi.epitest.hostap.WPASupplicant.service => fi.epitest.hostap.WPASupplicant.service.in} (75%)
rename wpa_supplicant/dbus/{fi.w1.wpa_supplicant1.service => fi.w1.wpa_supplicant1.service.in} (73%)
rename wpa_supplicant/systemd/{wpa_supplicant-nl80211 at .service => wpa_supplicant-nl80211 at .service.in} (77%)
rename wpa_supplicant/systemd/{wpa_supplicant-wired at .service => wpa_supplicant-wired at .service.in} (77%)
rename wpa_supplicant/systemd/{wpa_supplicant.service => wpa_supplicant.service.in} (83%)
rename wpa_supplicant/systemd/{wpa_supplicant at .service => wpa_supplicant at .service.in} (79%)
diff --git a/wpa_supplicant/.gitignore b/wpa_supplicant/.gitignore
new file mode 100644
index 0000000..0e3ad1b
--- /dev/null
+++ b/wpa_supplicant/.gitignore
@@ -0,0 +1 @@
+*.service
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 3536084..4b3f5a0 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -21,6 +21,14 @@ ifndef CONFIG_NO_WPA_PASSPHRASE
ALL += wpa_passphrase
endif
+ALL += systemd/wpa_supplicant.service
+ALL += systemd/wpa_supplicant at .service
+ALL += systemd/wpa_supplicant-nl80211 at .service
+ALL += systemd/wpa_supplicant-wired at .service
+ALL += dbus/fi.epitest.hostap.WPASupplicant.service
+ALL += dbus/fi.w1.wpa_supplicant1.service
+
+
all: verify_config $(ALL) dynamic_eap_methods
verify_config:
@@ -1422,6 +1430,9 @@ eap_ikev2.so: ../src/eap_peer/eap_ikev2.c ../src/eap_peer/ikev2.c ../src/eap_com
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
@$(E) " CC " $<
+%.service: %.service.in
+ sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
+
wpa_supplicant.exe: wpa_supplicant
mv -f $< $@
wpa_cli.exe: wpa_cli
diff --git a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
similarity index 75%
rename from wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
rename to wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
index 2a2edc1..a75918f 100644
--- a/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service
+++ b/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in
@@ -1,5 +1,5 @@
[D-BUS Service]
Name=fi.epitest.hostap.WPASupplicant
-Exec=/sbin/wpa_supplicant -u
+Exec=@BINDIR@/wpa_supplicant -u
User=root
SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
similarity index 73%
rename from wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
rename to wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
index ff40621..d97ff39 100644
--- a/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service
+++ b/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service.in
@@ -1,5 +1,5 @@
[D-BUS Service]
Name=fi.w1.wpa_supplicant1
-Exec=/sbin/wpa_supplicant -u
+Exec=@BINDIR@/wpa_supplicant -u
User=root
SystemdService=wpa_supplicant.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant-nl80211 at .service b/wpa_supplicant/systemd/wpa_supplicant-nl80211 at .service.in
similarity index 77%
rename from wpa_supplicant/systemd/wpa_supplicant-nl80211 at .service
rename to wpa_supplicant/systemd/wpa_supplicant-nl80211 at .service.in
index 04aa1ba..4d9c146 100644
--- a/wpa_supplicant/systemd/wpa_supplicant-nl80211 at .service
+++ b/wpa_supplicant/systemd/wpa_supplicant-nl80211 at .service.in
@@ -7,7 +7,7 @@ After=sys-subsystem-net-devices-%i.device
[Service]
Type=simple
-ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-nl80211-%I.conf -Dnl80211 -i%I
+ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-nl80211-%I.conf -Dnl80211 -i%I
[Install]
Alias=network.target.wants/wpa_supplicant-nl80211 at wlan0.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant-wired at .service b/wpa_supplicant/systemd/wpa_supplicant-wired at .service.in
similarity index 77%
rename from wpa_supplicant/systemd/wpa_supplicant-wired at .service
rename to wpa_supplicant/systemd/wpa_supplicant-wired at .service.in
index 83f8c91..f2e7f11 100644
--- a/wpa_supplicant/systemd/wpa_supplicant-wired at .service
+++ b/wpa_supplicant/systemd/wpa_supplicant-wired at .service.in
@@ -7,7 +7,7 @@ After=sys-subsystem-net-devices-%i.device
[Service]
Type=simple
-ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wired-%I.conf -Dwired -i%I
+ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wired-%I.conf -Dwired -i%I
[Install]
Alias=network.target.wants/wpa_supplicant-wired at wlan0.service
diff --git a/wpa_supplicant/systemd/wpa_supplicant.service b/wpa_supplicant/systemd/wpa_supplicant.service.in
similarity index 83%
rename from wpa_supplicant/systemd/wpa_supplicant.service
rename to wpa_supplicant/systemd/wpa_supplicant.service.in
index a9ab246..5b947ac 100644
--- a/wpa_supplicant/systemd/wpa_supplicant.service
+++ b/wpa_supplicant/systemd/wpa_supplicant.service.in
@@ -4,7 +4,7 @@ Description=WPA supplicant
[Service]
Type=dbus
BusName=fi.epitest.hostap.WPASupplicant
-ExecStart=/sbin/wpa_supplicant -u
+ExecStart=@BINDIR@/wpa_supplicant -u
[Install]
WantedBy=network.target
diff --git a/wpa_supplicant/systemd/wpa_supplicant at .service b/wpa_supplicant/systemd/wpa_supplicant at .service.in
similarity index 79%
rename from wpa_supplicant/systemd/wpa_supplicant at .service
rename to wpa_supplicant/systemd/wpa_supplicant at .service.in
index 129dd1f..0340b4d 100644
--- a/wpa_supplicant/systemd/wpa_supplicant at .service
+++ b/wpa_supplicant/systemd/wpa_supplicant at .service.in
@@ -7,7 +7,7 @@ After=sys-subsystem-net-devices-%i.device
[Service]
Type=simple
-ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I
+ExecStart=@BINDIR@/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I
[Install]
Alias=network.target.wants/wpa_supplicant at wlan0.service
--
1.7.6
More information about the systemd-devel
mailing list