[Feature][ZXW-42][system] add auto-boot for ril service
Change-Id: Ieba9ed481c3c5603f85edbc50257d022e4108c9f
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-ril-service/lynq-ril-service.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-ril-service/lynq-ril-service.bb
index b46c235..24ce5bc 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-ril-service/lynq-ril-service.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-ril-service/lynq-ril-service.bb
@@ -43,6 +43,11 @@
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${B}/lynq_ril_service.service ${D}${systemd_unitdir}/system
+ else
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${S}lynq-ril-service.sh ${D}${sysconfdir}/init.d/lynq-ril-service.sh
+ install -d ${D}${sysconfdir}/rcS.d
+ ln -s ../init.d/lynq-ril-service.sh ${D}${sysconfdir}/rcS.d/S82lynq-ril-service
fi
# install -d ${D}${includedir}
# install ${S}/atci/ATCI.h ${D}${includedir}
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/lynq-ril-service.sh b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/lynq-ril-service.sh
new file mode 100644
index 0000000..267f42b
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/lynq-ril-service.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="lynq-ril-service"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/lynq-ril-service"
+EXEC_ARGS=""
+
+
+start() {
+ echo -n "Starting $DAEMON... "
+ start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $EXEC_ARGS
+ [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+stop() {
+ echo -n "Stopping $DAEMON... "
+ start-stop-daemon -K -p $PIDFILE
+ [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart)
+ "$1"
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
+