mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-01-01 13:58:06 +00:00
iwd: add systemv-init script
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
3f08abfc9c
commit
7b836e6ed2
42
meta-oe/recipes-connectivity/iwd/iwd/iwd
Normal file
42
meta-oe/recipes-connectivity/iwd/iwd/iwd
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
|
||||
DAEMON=/usr/libexec/iwd
|
||||
PIDFILE=/var/run/iwd.pid
|
||||
DESC="iNet wireless daemon"
|
||||
|
||||
if [ -f /etc/default/iwd ] ; then
|
||||
. /etc/default/iwd
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
do_start() {
|
||||
start-stop-daemon --start --background --name iwd --quiet --exec $DAEMON
|
||||
}
|
||||
|
||||
do_stop() {
|
||||
start-stop-daemon --stop --oknodo --name iwd --quiet
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting $DESC"
|
||||
do_start
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping $DESC"
|
||||
do_stop
|
||||
;;
|
||||
restart|force-reload)
|
||||
echo "Restarting $DESC"
|
||||
do_stop
|
||||
sleep 1
|
||||
do_start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
|
@ -7,10 +7,11 @@ DEPENDS = "dbus"
|
|||
|
||||
SRC_URI = "https://www.kernel.org/pub/linux/network/wireless/${BP}.tar.xz \
|
||||
file://0001-build-Use-abs_top_srcdir-instead-of-abs_srcdir-for-e.patch \
|
||||
file://iwd \
|
||||
"
|
||||
SRC_URI[sha256sum] = "8189e15e701112f871fb5f5e9351f007c9098754b4168ed43cc5422a3adc0255"
|
||||
|
||||
inherit autotools manpages pkgconfig python3native systemd
|
||||
inherit autotools manpages pkgconfig python3native systemd update-rc.d
|
||||
|
||||
PACKAGECONFIG ??= " \
|
||||
client \
|
||||
|
|
@ -24,6 +25,9 @@ PACKAGECONFIG[wired] = "--enable-wired,--disable-wired"
|
|||
PACKAGECONFIG[ofono] = "--enable-ofono,--disable-ofono"
|
||||
PACKAGECONFIG[systemd] = "--with-systemd-unitdir=${systemd_system_unitdir},--disable-systemd-service,systemd"
|
||||
|
||||
INITSCRIPT_NAME = "iwd"
|
||||
INITSCRIPT_PARAMS = "start 04 5 2 3 . stop 23 0 1 6 ."
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = " \
|
||||
iwd.service \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'wired', 'ead.service', '', d)} \
|
||||
|
|
@ -36,6 +40,11 @@ do_configure:prepend() {
|
|||
do_install:append() {
|
||||
# If client and monitor are disabled, bindir is empty, causing a QA error
|
||||
rmdir --ignore-fail-on-non-empty ${D}/${bindir}
|
||||
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -m 0755 ${UNPACKDIR}/iwd ${D}${sysconfdir}/init.d/iwd
|
||||
fi
|
||||
}
|
||||
|
||||
FILES:${PN} += " \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user