aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-08-15 01:35:51 -0400
committerMartin Jansa <Martin.Jansa@gmail.com>2014-08-21 21:35:05 +0200
commit8f09c03e478d285c344177eef7090560f60e0fcc (patch)
treef2b758f224afa01c2c9ad0a7e826600dde45a623
parentffe0b3cc750eaba6f8608a0ee8deca49f3d7d524 (diff)
downloadmeta-openembedded-contrib-8f09c03e478d285c344177eef7090560f60e0fcc.tar.gz
meta-openembedded-contrib-8f09c03e478d285c344177eef7090560f60e0fcc.tar.bz2
meta-openembedded-contrib-8f09c03e478d285c344177eef7090560f60e0fcc.zip
hostapd: add systemd support
Add hostapd.service file. The file mostly comes from Fedora20. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-connectivity/hostapd/hostapd-2.2/hostapd.service11
-rw-r--r--meta-oe/recipes-connectivity/hostapd/hostapd_2.2.bb11
2 files changed, 19 insertions, 3 deletions
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd-2.2/hostapd.service b/meta-oe/recipes-connectivity/hostapd/hostapd-2.2/hostapd.service
new file mode 100644
index 0000000000..151c0504fc
--- /dev/null
+++ b/meta-oe/recipes-connectivity/hostapd/hostapd-2.2/hostapd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/hostapd.pid
+ExecStart=@SBINDIR@/hostapd @SYSCONFDIR@/hostapd.conf -P /run/hostapd.pid -B
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd_2.2.bb b/meta-oe/recipes-connectivity/hostapd/hostapd_2.2.bb
index d0d9df986d..f1c6b3a80f 100644
--- a/meta-oe/recipes-connectivity/hostapd/hostapd_2.2.bb
+++ b/meta-oe/recipes-connectivity/hostapd/hostapd_2.2.bb
@@ -5,9 +5,11 @@ LIC_FILES_CHKSUM = "file://README;md5=0854a4da34ac3990770794d771fac7fd"
DEPENDS = "libnl openssl"
SUMMARY = "User space daemon for extended IEEE 802.11 management"
-inherit update-rc.d
+inherit update-rc.d systemd
INITSCRIPT_NAME = "hostapd"
-
+SYSTEMD_PACKAGES = "hostapd"
+SYSTEMD_SERVICE_hostapd = "hostapd.service"
+SYSTEMD_AUTO_ENABLE_hostapd = "disable"
DEFAULT_PREFERENCE = "-1"
@@ -15,6 +17,7 @@ SRC_URI = " \
http://hostap.epitest.fi/releases/hostapd-${PV}.tar.gz \
file://defconfig \
file://init \
+ file://hostapd.service \
"
S = "${WORKDIR}/hostapd-${PV}/hostapd"
@@ -30,11 +33,13 @@ do_compile() {
}
do_install() {
- install -d ${D}${sbindir} ${D}${sysconfdir}/init.d
+ install -d ${D}${sbindir} ${D}${sysconfdir}/init.d ${D}${systemd_unitdir}/system/
install -m 0644 ${S}/hostapd.conf ${D}${sysconfdir}
install -m 0755 ${S}/hostapd ${D}${sbindir}
install -m 0755 ${S}/hostapd_cli ${D}${sbindir}
install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/hostapd
+ install -m 0644 ${WORKDIR}/hostapd.service ${D}${systemd_unitdir}/system/
+ sed -i -e 's,@SBINDIR@,${sbindir},g' -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/hostapd.service
}
CONFFILES_${PN} += "${sysconfdir}/hostapd.conf"