[Feature][YUKUAI_patch]add 18.02 code

Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I7f71153004f10fc0ea5adfa083866aaeeb1053ac
diff --git a/rootfs/etc/init.d/adbd b/rootfs/etc/init.d/adbd
new file mode 100755
index 0000000..45f35e3
--- /dev/null
+++ b/rootfs/etc/init.d/adbd
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="adbd"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/adbd"
+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 $?
diff --git a/rootfs/etc/init.d/at_ctl b/rootfs/etc/init.d/at_ctl
new file mode 100755
index 0000000..f214352
--- /dev/null
+++ b/rootfs/etc/init.d/at_ctl
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="at_ctl"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/at_ctl"
+EXEC_ARGS=""
+
+
+start() {
+	echo -n "Starting $DAEMON... "
+	start-stop-daemon --notify-await --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 $?
diff --git a/rootfs/etc/init.d/busybox-cron b/rootfs/etc/init.d/busybox-cron
new file mode 100755
index 0000000..f0e6b15
--- /dev/null
+++ b/rootfs/etc/init.d/busybox-cron
@@ -0,0 +1,39 @@
+#!/bin/sh
+DAEMON=/usr/sbin/crond
+NAME=crond
+DESC="Busybox Periodic Command Scheduler"
+ARGS="-c /etc/cron/crontabs"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+    start)
+        echo -n "starting $DESC: $NAME... "
+	start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+	echo "done."
+	;;
+    stop)
+        echo -n "stopping $DESC: $NAME... "
+	start-stop-daemon -K -n $NAME
+	echo "done."
+	;;
+    restart)
+        echo -n "restarting $DESC: $NAME... "
+ 	$0 stop
+	$0 start
+	echo "done."
+	;;
+    reload)
+    	echo -n "reloading $DESC: $NAME... "
+    	killall -HUP $(basename ${DAEMON})
+	echo "done."
+	;;
+    *)
+	echo "Usage: $0 {start|stop|restart|reload}"
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/rootfs/etc/init.d/dbus-1 b/rootfs/etc/init.d/dbus-1
new file mode 100755
index 0000000..b889c7d
--- /dev/null
+++ b/rootfs/etc/init.d/dbus-1
@@ -0,0 +1,123 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          dbus
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      1
+# Short-Description: D-Bus systemwide message bus
+# Description:       D-Bus is a simple interprocess messaging system, used
+#                    for sending messages between applications.
+### END INIT INFO
+#
+# -*- coding: utf-8 -*-
+# Debian init.d script for D-BUS
+# Copyright © 2003 Colin Walters <walters@debian.org>
+
+# set -e
+
+# Source function library.
+. /etc/init.d/functions
+
+DAEMON=/usr/bin/dbus-daemon
+NAME=dbus
+DAEMONUSER=messagebus           # must match /usr/share/dbus-1/system.conf
+PIDFILE=/var/run/dbus/pid # must match /usr/share/dbus-1/system.conf
+UUIDDIR=/var/lib/dbus
+DESC="system message bus"
+EVENTDIR=/etc/dbus-1/event.d
+
+test -x $DAEMON || exit 0
+
+# Source defaults file; edit that file to configure this script.
+ENABLED=1
+PARAMS=""
+if [ -e /etc/default/dbus ]; then
+  . /etc/default/dbus
+fi
+
+test "$ENABLED" != "0" || exit 0
+
+start_it_up()
+{
+  mkdir -p "`dirname $PIDFILE`"
+  if [ -e $PIDFILE ]; then
+    PIDDIR=/proc/$(cat $PIDFILE)
+    if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then 
+      echo "$DESC already started; not starting."
+    else
+      echo "Removing stale PID file $PIDFILE."
+      rm -f $PIDFILE
+    fi
+  fi
+
+  if [ ! -d $UUIDDIR ]; then
+    mkdir -p $UUIDDIR
+    chown $DAEMONUSER $UUIDDIR
+    chgrp $DAEMONUSER $UUIDDIR
+  fi
+ 
+  dbus-uuidgen --ensure  
+
+  echo -n "Starting $DESC: "
+  start-stop-daemon -o --start --quiet --pidfile $PIDFILE \
+    --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
+  echo "$NAME."
+  if [ -d $EVENTDIR ]; then
+      run-parts --arg=start $EVENTDIR
+  fi
+}
+
+shut_it_down()
+{
+  if [ -d $EVENTDIR ]; then
+      # TODO: --reverse when busybox supports it
+      run-parts --arg=stop $EVENTDIR
+  fi
+  echo -n "Stopping $DESC: "
+  start-stop-daemon -o --stop  --quiet --pidfile $PIDFILE \
+    --user $DAEMONUSER
+  # We no longer include these arguments so that start-stop-daemon
+  # can do its job even given that we may have been upgraded.
+  # We rely on the pidfile being sanely managed
+  # --exec $DAEMON -- --system $PARAMS
+  echo "$NAME."
+  rm -f $PIDFILE
+}
+
+reload_it()
+{
+  echo -n "Reloading $DESC config: "
+  dbus-send --print-reply --system --type=method_call \
+            --dest=org.freedesktop.DBus \
+            / org.freedesktop.DBus.ReloadConfig > /dev/null
+  # hopefully this is enough time for dbus to reload it's config file.
+  echo "done."
+}
+
+case "$1" in
+  start)
+    start_it_up
+  ;;
+  stop)
+    shut_it_down
+  ;;
+  status)
+    status $DAEMON
+    exit $?
+  ;;
+  reload|force-reload)
+    reload_it
+  ;;
+  restart)
+    shut_it_down
+    sleep 1
+    start_it_up
+  ;;
+  *)
+    echo "Usage: /etc/init.d/$NAME {start|stop|status|restart|reload|force-reload}" >&2
+    exit 1
+  ;;
+esac
+
+exit 0
diff --git a/rootfs/etc/init.d/dhcp6c b/rootfs/etc/init.d/dhcp6c
new file mode 100755
index 0000000..50babd7
--- /dev/null
+++ b/rootfs/etc/init.d/dhcp6c
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="dhcp6c"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/dhcp6c"
+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 $?
diff --git a/rootfs/etc/init.d/dhcp6s b/rootfs/etc/init.d/dhcp6s
new file mode 100755
index 0000000..ff269bf
--- /dev/null
+++ b/rootfs/etc/init.d/dhcp6s
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="dhcp6s"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/dhcp6s"
+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 $?
diff --git a/rootfs/etc/init.d/dnsmasq b/rootfs/etc/init.d/dnsmasq
new file mode 100755
index 0000000..51c95df
--- /dev/null
+++ b/rootfs/etc/init.d/dnsmasq
@@ -0,0 +1,117 @@
+#!/bin/sh
+DAEMON=/usr/bin/dnsmasq
+NAME=dnsmasq
+DESC="DNS forwarder and DHCP server"
+ARGS="-7 /etc/dnsmasq.d"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+if [ -r /etc/default/$NAME ]
+then
+	. /etc/default/$NAME
+fi
+
+DNSMASQ_CONF="/etc/dnsmasq.conf"
+test "/etc/dnsmasq.d/*" != '/etc/dnsmasq.d/*' && DNSMASQ_CONF="${DNSMASQ_CONF} /etc/dnsmasq.d/*"
+
+test -z "${PIDFILE}" && PIFILE="/run/dnsmasq.pid"
+
+if [ -z "$IGNORE_RESOLVCONF" ]
+then
+	egrep -h -q '^no-resolv' ${DNSMASQ_CONF} && IGNORE_RESOLVCONF="yes"
+fi
+
+# RESOLV_CONF:
+# If the resolvconf package is installed then use the resolv conf file
+# that it provides as the default.  Otherwise use /etc/resolv.conf as
+# the default.
+#
+# If IGNORE_RESOLVCONF is set in /etc/default/dnsmasq or an explicit
+# filename is set there then this inhibits the use of the resolvconf-provided
+# information.
+#
+# Note that if the resolvconf package is installed it is not possible to
+# override it just by configuration in /etc/dnsmasq.conf, it is necessary
+# to set IGNORE_RESOLVCONF=yes in /etc/default/dnsmasq.
+
+test -z "$RESOLV_CONF" -a "$IGNORE_RESOLVCONF" != "yes" -a -x /sbin/resolvconf && \
+	RESOLV_CONF=/run/dnsmasq/resolv.conf
+
+start_resolvconf()
+{
+        if [ "$IGNORE_RESOLVCONF" != "yes" -a -x /sbin/resolvconf ]
+	then
+		echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.$NAME
+	fi
+	:
+}
+
+stop_resolvconf()
+{
+	if [ "$IGNORE_RESOLVCONF" != "yes" -a -x /sbin/resolvconf ]
+	then
+		/sbin/resolvconf -d lo.$NAME
+	fi
+	:
+}
+
+case "$1" in
+    start)
+        echo -n "starting $DESC: $NAME... "
+	test -d /var/lib/misc/ || mkdir /var/lib/misc/
+	start-stop-daemon -S -x $DAEMON -- $ARGS \
+		${RESOLV_CONF:+ -r $RESOLV_CONF} \
+		${PIDFILE:+ -x $PIDFILE}
+	test $? -eq 0 && start_resolvconf
+	echo "done."
+	;;
+    stop)
+        echo -n "stopping $DESC: $NAME... "
+	stop_resolvconf
+	start-stop-daemon -K -x $DAEMON
+	echo "done."
+	;;
+    status)
+	echo -n "dnsmasq "
+	start-stop-daemon -q -K -t -x $DAEMON
+	RET=$?
+	if [ "$RET" = "0" ]; then
+		PID=`cat ${PIDFILE}`
+		echo "($PID) is running"
+	else
+		echo "is not running"
+		exit $RET
+	fi
+	;;
+    restart)
+        echo "restarting $DESC: $NAME... "
+ 	$0 stop
+	$0 start
+	echo "done."
+	;;
+    reload)
+    	echo -n "reloading $DESC: $NAME... "
+    	killall -HUP $(basename ${DAEMON})
+	echo "done."
+	;;
+    systemd-start-resolvconf)
+	start_resolvconf
+	;;
+    systemd-stop-resolvconf)
+	stop_resolvconf
+	;;
+    systemd-exec)
+	test -d /var/lib/misc/ || mkdir /var/lib/misc/
+	exec $DAEMON --keep-in-foreground $ARGS \
+		${RESOLV_CONF:+ -r $RESOLV_CONF} \
+		${PIDFILE:+ -x $PIDFILE}
+	;;
+    *)
+	echo "Usage: $0 {start|stop|status|restart|reload}"
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/rootfs/etc/init.d/dropbear b/rootfs/etc/init.d/dropbear
new file mode 100755
index 0000000..8366205
--- /dev/null
+++ b/rootfs/etc/init.d/dropbear
@@ -0,0 +1,79 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:		sshd
+# Required-Start:	$remote_fs $syslog $networking
+# Required-Stop:	$remote_fs $syslog
+# Default-Start:	2 3 4 5
+# Default-Stop:		1
+# Short-Description:	Dropbear Secure Shell server
+### END INIT INFO
+#
+# Do not configure this file. Edit /etc/default/dropbear instead!
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/dropbear
+NAME=dropbear
+DESC="Dropbear SSH server"
+PIDFILE=/var/run/dropbear.pid
+
+# These values may be replaced by those from /etc/default/dropbear
+DROPBEAR_RSAKEY_DIR="/etc_rw/dropbear"
+DROPBEAR_PORT=22
+DROPBEAR_EXTRA_ARGS=
+DROPBEAR_RSAKEY_ARGS=
+NO_START=0
+
+set -e
+
+test ! -r /etc/default/dropbear || . /etc/default/dropbear
+test "$NO_START" = "0" || exit 0
+test -x "$DAEMON" || exit 0
+test ! -h /var/service/dropbear || exit 0
+
+test -z "$DROPBEAR_BANNER" || \
+  DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
+test -n "$DROPBEAR_RSAKEY" || \
+  DROPBEAR_RSAKEY="${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key"
+
+gen_keys() {
+    if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
+        rm $DROPBEAR_RSAKEY || true
+    fi
+    if [ ! -f "$DROPBEAR_RSAKEY" ]; then
+        mkdir -p ${DROPBEAR_RSAKEY%/*}
+        dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS
+    fi
+}
+
+start() {
+	gen_keys
+	start-stop-daemon -S -p $PIDFILE \
+	  -x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
+	    -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+}
+
+stop() {
+	start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
+}
+
+restart() {
+	stop
+	sleep 1
+	start
+}
+
+case "$1" in
+  start|stop|restart)
+	"$1"
+	;;
+  force-reload)
+    restart
+  ;;
+  *)
+	echo "Usage: $0 {start|stop|restart|force-reload}"
+	exit 1
+esac
+
+exit $?
+
diff --git a/rootfs/etc/init.d/enter_amt.sh b/rootfs/etc/init.d/enter_amt.sh
new file mode 100755
index 0000000..79fac89
--- /dev/null
+++ b/rootfs/etc/init.d/enter_amt.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+
+#/etc/init.d/mdev start
+#sh /etc/init.d/fscheck.sh
+#/etc/init.d/nvserver start
+#nv set ver_mode=0
+#/etc/init.d/zxic_usbCfgMng start
+#sh /etc/init.d/zcatlog_config.sh
+#/etc/init.d/zxic-amt start
+#exit 0
+
+# check amt mode begin
+cmdline=$(cat /proc/cmdline)
+result=$(echo $cmdline | grep "bootmode=")
+if [[ "$result" != "" ]]; then
+	bootmode=${cmdline##*bootmode=}
+	bootmode=${bootmode%% *}
+else
+	bootmode="0"
+fi
+if [[ $bootmode == "amt" ]]; then
+	/etc/init.d/mdev start
+	sh /etc/init.d/fscheck.sh
+	/etc/init.d/nvserver start
+	/etc/init.d/nv-rpc-daemon start
+	nv set ver_mode=0
+	/etc/init.d/zxic_usbCfgMng start
+	sh /etc/init.d/zcatlog_config.sh
+	/etc/init.d/zxic-amt start
+	prj=`cat /sys/gmac/gmacconfig/type`
+	if [ "$prj" == "cpe" ]; then
+		ifconfig eth0 192.168.0.1 up
+		if [ $? -ne 0 ];then
+			echo "Error: ifconfig eth0 up failed."
+		else
+			config-udhcpd.sh lan -s 192.168.0.100
+			config-udhcpd.sh lan -e 192.168.0.200
+			config-udhcpd.sh lan -i eth0
+			config-udhcpd.sh lan -m 255.255.255.0
+			config-udhcpd.sh lan -g 192.168.0.1
+			config-udhcpd.sh lan -l /etc_rw/udhcpd.leases
+			udhcpd -f /etc_rw/udhcpd.conf &
+		fi
+	fi
+	exit 0
+fi
+# check amt mode end
+
+exit 1
+
diff --git a/rootfs/etc/init.d/first.sh b/rootfs/etc/init.d/first.sh
new file mode 100755
index 0000000..b3dc7dd
--- /dev/null
+++ b/rootfs/etc/init.d/first.sh
@@ -0,0 +1,67 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          mountvirtfs
+# Required-Start:
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Mount kernel virtual file systems.
+# Description:       Mount initial set of virtual filesystems the kernel
+#                    provides and that are required by everything.
+### END INIT INFO
+
+if [ -e /proc ] && ! [ -e /proc/mounts ]; then
+  mount -t proc proc /proc
+fi
+
+if [ -e /sys ] && grep -q sysfs /proc/filesystems && ! [ -e /sys/class ]; then
+  mount -t sysfs sysfs /sys
+fi
+
+if [ -e /sys/kernel/debug ] && grep -q debugfs /proc/filesystems; then
+  mount -t debugfs debugfs /sys/kernel/debug
+fi
+
+if [ -e /sys/kernel/config ] && grep -q configfs /proc/filesystems; then
+  mount -t configfs configfs /sys/kernel/config
+fi
+
+if [ -e /sys/firmware/efi/efivars ] && grep -q efivarfs /proc/filesystems; then
+  mount -t efivarfs efivarfs /sys/firmware/efi/efivars
+fi
+
+if ! [ -e /dev/zero ] && [ -e /dev ] && grep -q devtmpfs /proc/filesystems; then
+  mount -n -t devtmpfs devtmpfs /dev
+fi
+
+mkdir -p /tmp
+#l.yang modify for T106BUG-387 start 
+mount   -t  tmpfs   tmpfs    /tmp -o nodev,nosuid,noexec
+#l.yang modify for T106BUG-387 end
+mkdir -p /run
+#l.yang modify for T106BUG-387 start
+mount   -t  tmpfs   tmpfs    /run  -o nodev,nosuid,noexec
+#l.yang modify for T106BUG-387 end
+mkdir -p /dev/pts
+mount   -t  devpts  devpts   /dev/pts
+
+mkdir -p /tmp/run
+
+#软锁panic
+#echo 1 > /proc/sys/kernel/softlockup_panic
+#内存耗尽oom panic
+echo 1 > /proc/sys/vm/panic_on_oom
+#警告panic
+#echo 1 > /proc/sys/kernel/panic_on_warn
+#echo 0 > /proc/sys/kernel/hung_task_timeout_secs
+
+echo "mount configfs..."
+mount none /sys/kernel/config  -t configfs
+
+
+echo "ifconfig lo up"
+ifconfig lo 127.0.0.1 up
+
+echo 2 > /proc/sys/kernel/randomize_va_space
+echo 2 > /proc/sys/kernel/kptr_restrict
+
diff --git a/rootfs/etc/init.d/fota_auto_sync b/rootfs/etc/init.d/fota_auto_sync
new file mode 100755
index 0000000..07da0f4
--- /dev/null
+++ b/rootfs/etc/init.d/fota_auto_sync
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="fota_auto_sync"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/fota_auto_sync"
+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 $?
diff --git a/rootfs/etc/init.d/fscheck.sh b/rootfs/etc/init.d/fscheck.sh
new file mode 100755
index 0000000..b5ccf20
--- /dev/null
+++ b/rootfs/etc/init.d/fscheck.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#cppdemo > /dev/null 2>&1 &
+
+fscheck -f /etc_ro/fscheck/userdata.ini
+
+#q.huang@20230920 add for network start
+mkdir -p /mnt/userdata/ril/network
+#q.huang@20230920 add for network end
+
+
+if [ -d "/etc/selinux" ];then
+  /sbin/restorecon -RF /etc_rw  /mnt/userdata/  /mnt/oemdata/ 
+fi
+
+ab_bootinfo
+if [ $? -eq 1 ]; then
+  /sbin/ubi_mount.sh  /mnt/oem     oem      vol_oem     squashfs
+else
+  /sbin/ubi_mount.sh  /mnt/oem     oem2     vol_oem     squashfs
+fi
+
+if [ $? -ne 0 ]; then
+  flags_tool_static --switch
+  reboot
+fi
+
+#l.yang modify for T106BUG-387 start
+if [ -e /dev/mmcblk1p1 ]; then
+  mount -t ext4 /dev/mmcblk1p1 /var/log
+  if [ $? -ne 0 ]; then
+    mkdir -p /mnt/oemdata/log
+    mount --bind /mnt/oemdata/log /var/log
+  fi     
+else
+  mkdir -p /mnt/oemdata/log
+  mount --bind /mnt/oemdata/log /var/log
+fi
+#l.yang modify for T106BUG-387 start
+
+
diff --git a/rootfs/etc/init.d/fsmonitor b/rootfs/etc/init.d/fsmonitor
new file mode 100755
index 0000000..952c6b6
--- /dev/null
+++ b/rootfs/etc/init.d/fsmonitor
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="fsmonitor"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/fsmonitor"
+EXEC_ARGS=""
+
+
+start() {
+	echo "Starting $DAEMON... "
+	start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $EXEC_ARGS
+	[ $? -eq 0 ] && echo "OK" || echo "ERROR"
+}
+
+stop() {
+	echo "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 $?
diff --git a/rootfs/etc/init.d/functions b/rootfs/etc/init.d/functions
new file mode 100755
index 0000000..01ad1ed
--- /dev/null
+++ b/rootfs/etc/init.d/functions
@@ -0,0 +1,91 @@
+# -*-Shell-script-*-
+#
+# functions     This file contains functions to be used by most or all
+#               shell scripts in the /etc/init.d directory.
+#
+
+NORMAL="\\033[0;39m"         # Standard console grey
+SUCCESS="\\033[1;32m"        # Success is green
+WARNING="\\033[1;33m"        # Warnings are yellow
+FAILURE="\\033[1;31m"        # Failures are red
+INFO="\\033[1;36m"           # Information is light cyan
+BRACKET="\\033[1;34m"        # Brackets are blue
+
+# NOTE: The pidofproc () doesn't support the process which is a script unless
+#       the pidof supports "-x" option. If you want to use it for such a
+#       process:
+#       1) If there is no "pidof -x", replace the "pidof $1" with another
+#          command like(for core-image-minimal):
+#            ps | awk '/'"$1"'/ {print $1}'
+#       Or
+#       2) If there is "pidof -x", replace "pidof" with "pidof -x".
+#
+# pidofproc - print the pid of a process
+# $1: the name of the process
+pidofproc () {
+
+	# pidof output null when no program is running, so no "2>/dev/null".
+	pid=`pidof $1`
+	status=$?
+	case $status in
+	0)
+		echo $pid
+		return 0
+		;;
+	127)
+		echo "ERROR: command pidof not found" >&2
+		exit 127
+		;;
+	*)
+		return $status
+		;;
+	esac
+}
+
+machine_id() { # return the machine ID
+	awk 'BEGIN { FS=": " } /Hardware/ \
+		{ gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo
+}
+
+killproc() { # kill the named process(es)
+	pid=`pidofproc $1` && kill $pid
+}
+
+status() {
+    local pid
+    if [ "$#" = 0 ]; then
+        echo "Usage: status {program}"
+        return 1
+    fi
+    pid=`pidofproc $1`
+    if [ -n "$pid" ]; then
+        echo "$1 (pid $pid) is running..."
+        return 0
+    else
+        echo "$1 is stopped"
+    fi
+    return 3
+}
+
+success() {
+    echo -n -e "${BRACKET}[${SUCCESS}  OK  ${BRACKET}]${NORMAL}"
+    return 0
+}
+
+failure() {
+    local rc=$*
+    echo -n -e "${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
+    return $rc
+}
+
+warning() {
+    local rc=$*
+    echo -n -e "${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
+    return $rc
+}
+
+passed() {
+    local rc=$*
+    echo -n -e "${BRACKET}[${SUCCESS} PASS ${BRACKET}]${NORMAL}"
+    return $rc
+}
diff --git a/rootfs/etc/init.d/gpsd b/rootfs/etc/init.d/gpsd
new file mode 100755
index 0000000..a4a9df9
--- /dev/null
+++ b/rootfs/etc/init.d/gpsd
@@ -0,0 +1,160 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          gpsd
+# Required-Start:    $remote_fs $syslog $network
+# Should-Start:      bluetooth dbus udev
+# Required-Stop:     $remote_fs $syslog $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# X-Start-Before:    ntp
+# Short-Description: GPS (Global Positioning System) daemon start/stop script
+# Description:       Start/Stop script for the gpsd service daemon,
+#                    which is able to monitor one or more GPS devices
+#                    connected to a host computer, making all data on
+#                    the location and movements of the sensors available
+#                    to be queried on TCP port 2947.
+### END INIT INFO
+
+# Author: Bernd Zeimetz <bzed@debian.org>
+#
+# Please remove the "Author" lines above and replace them
+# with your own name if you copy and modify this script.
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="GPS (Global Positioning System) daemon"
+NAME=gpsd
+DAEMON=/usr/sbin/$NAME
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+if [ -z "$GPSD_SOCKET" ] && [ -z "$DEVICES" ]; then
+	GPSD_SOCKET=/var/run/gpsd.sock
+fi
+
+if [ -n "$GPSD_SOCKET" ]; then
+        GPSD_OPTIONS="$GPSD_OPTIONS -F $GPSD_SOCKET"
+fi
+
+# Load the VERBOSE setting and other rcS variables
+. /etc/lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /etc/lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+	# Return
+	#   0 if daemon has been started
+	#   1 if daemon was already running
+	#   2 if daemon could not be started
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+		|| return 1
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+		$GPSD_OPTIONS -P $PIDFILE $DEVICES \
+		|| return 2
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+	# Return
+	#   0 if daemon has been stopped
+	#   1 if daemon was already stopped
+	#   2 if daemon could not be stopped
+	#   other if a failure occurred
+	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+	RETVAL="$?"
+	[ "$RETVAL" = 2 ] && return 2
+	# Many daemons don't delete their pidfiles when they exit.
+	rm -f $PIDFILE
+	return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+	#
+	# If the daemon can reload its configuration without
+	# restarting (for example, when it is sent a SIGHUP),
+	# then implement that here.
+	#
+	start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+	return 0
+}
+
+case "$1" in
+  start)
+        if [ "$START_DAEMON" = "true" ]; then
+		[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+		do_start
+		case "$?" in
+			0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+			2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+		esac
+	else
+		[ "$VERBOSE" != no ] && \
+			log_daemon_msg "Not starting $DESC" "$NAME" && \
+			log_end_msg 0
+	fi
+	;;
+  stop)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  status)
+       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+       ;;
+  reload|force-reload)
+	log_daemon_msg "Reloading $DESC" "$NAME"
+	do_reload
+	log_end_msg $?
+	;;
+  restart)
+	#
+	# If the "reload" option is implemented then remove the
+	# 'force-reload' alias
+	#
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	case "$?" in
+	  0|1)
+		do_start
+		case "$?" in
+			0) log_end_msg 0 ;;
+			1) log_end_msg 1 ;; # Old process is still running
+			*) log_end_msg 1 ;; # Failed to start
+		esac
+		;;
+	  *)
+	 	# Failed to stop
+		log_end_msg 1
+		;;
+	esac
+	;;
+  *)
+	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+	exit 3
+	;;
+esac
+
+:
diff --git a/rootfs/etc/init.d/inetd.busybox b/rootfs/etc/init.d/inetd.busybox
new file mode 100755
index 0000000..cf50bcd
--- /dev/null
+++ b/rootfs/etc/init.d/inetd.busybox
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# start/stop inetd super server.
+
+if ! [ -x /usr/sbin/inetd ]; then
+	exit 0
+fi
+
+case "$1" in
+    start)
+	echo -n "Starting internet superserver:"
+	echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null
+	echo "."
+	;;
+    stop)
+	echo -n "Stopping internet superserver:"
+	echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null
+	echo "."
+	;;
+    restart)
+	echo -n "Restarting internet superserver:"
+	echo -n " inetd "
+	killall -HUP inetd
+	echo "."
+	;;
+    *)
+	echo "Usage: /etc/init.d/inetd {start|stop|restart}"
+	exit 1
+	;;
+esac
+
+exit 0
+
diff --git a/rootfs/etc/init.d/ipv6_addr_conver b/rootfs/etc/init.d/ipv6_addr_conver
new file mode 100755
index 0000000..d76264d
--- /dev/null
+++ b/rootfs/etc/init.d/ipv6_addr_conver
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="zxic_ipv6_addr_conver"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/ipv6_addr_conver"
+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 $?
diff --git a/rootfs/etc/init.d/lynq-atcid.sh b/rootfs/etc/init.d/lynq-atcid.sh
new file mode 100755
index 0000000..ff91ada
--- /dev/null
+++ b/rootfs/etc/init.d/lynq-atcid.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="lynq-atcid"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/lynq-atcid"
+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 $?
+
diff --git a/rootfs/etc/init.d/lynq-autosuspend.sh b/rootfs/etc/init.d/lynq-autosuspend.sh
new file mode 100755
index 0000000..8e96831
--- /dev/null
+++ b/rootfs/etc/init.d/lynq-autosuspend.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="lynq-autosuspend-service"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/autosuspend"
+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 $?
+
diff --git a/rootfs/etc/init.d/lynq-fota-backup.sh b/rootfs/etc/init.d/lynq-fota-backup.sh
new file mode 100755
index 0000000..53eb20f
--- /dev/null
+++ b/rootfs/etc/init.d/lynq-fota-backup.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="lynq-fota-backup-service"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/lynq-fota-backup"
+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 $?
+
diff --git a/rootfs/etc/init.d/lynq-led-sev.sh b/rootfs/etc/init.d/lynq-led-sev.sh
new file mode 100755
index 0000000..a5f0230
--- /dev/null
+++ b/rootfs/etc/init.d/lynq-led-sev.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="lynq-led-sev"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/lynq-led-sev"
+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 $?
+
diff --git a/rootfs/etc/init.d/lynq-ril-service.sh b/rootfs/etc/init.d/lynq-ril-service.sh
new file mode 100755
index 0000000..4514ab0
--- /dev/null
+++ b/rootfs/etc/init.d/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 --notify-await --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 $?
+
diff --git a/rootfs/etc/init.d/lynq-sdk-ready.sh b/rootfs/etc/init.d/lynq-sdk-ready.sh
new file mode 100755
index 0000000..382e072
--- /dev/null
+++ b/rootfs/etc/init.d/lynq-sdk-ready.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="lynq-sdk-ready-service"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/lynq-sdk-ready"
+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 $?
+
diff --git a/rootfs/etc/init.d/mdev b/rootfs/etc/init.d/mdev
new file mode 100755
index 0000000..f64c7aa
--- /dev/null
+++ b/rootfs/etc/init.d/mdev
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# Run the mdev daemon
+#
+
+DAEMON="mdev"
+PIDFILE="/tmp/run/$DAEMON.pid"
+
+
+start() {
+  echo -n "Starting $DAEMON... "
+  start-stop-daemon -S -b -m -p $PIDFILE -x /sbin/mdev -- -df
+  [ $? -eq 0 ] && echo "OK" || echo "ERROR"
+
+  # coldplug modules
+  #find /sys/ -name modalias -print0 | \
+  #  xargs -0 sort -u | \
+  #  tr '\n' '\0' | \
+  #  xargs -0 modprobe -abq
+}
+
+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 $?
+
diff --git a/rootfs/etc/init.d/mnet_whitelist_proxy b/rootfs/etc/init.d/mnet_whitelist_proxy
new file mode 100755
index 0000000..54a56a5
--- /dev/null
+++ b/rootfs/etc/init.d/mnet_whitelist_proxy
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="mnet_whitelist_proxy"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/mnet_whitelist_proxy"
+
+start() {
+	echo -n "Starting $DAEMON... "	
+	start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC
+	[ $? -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 $?
diff --git a/rootfs/etc/init.d/msm_svr b/rootfs/etc/init.d/msm_svr
new file mode 100755
index 0000000..9a9e0e7
--- /dev/null
+++ b/rootfs/etc/init.d/msm_svr
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="msm_svr"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/msm_svr"
+
+start() {
+	echo -n "Starting $DAEMON... "	
+	start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC
+	[ $? -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 $?
diff --git a/rootfs/etc/init.d/nv-rpc-daemon b/rootfs/etc/init.d/nv-rpc-daemon
new file mode 100755
index 0000000..c96e4be
--- /dev/null
+++ b/rootfs/etc/init.d/nv-rpc-daemon
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="nv-rpc-daemon"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/nv-rpc-daemon"
+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 $?
diff --git a/rootfs/etc/init.d/nvserver b/rootfs/etc/init.d/nvserver
new file mode 100755
index 0000000..cc1a596
--- /dev/null
+++ b/rootfs/etc/init.d/nvserver
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="nvserver"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/nvserver"
+EXEC_ARGS=""
+
+
+start() {
+	echo -n "Starting $DAEMON... "
+	start-stop-daemon --notify-await --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 $?
diff --git a/rootfs/etc/init.d/radvd b/rootfs/etc/init.d/radvd
new file mode 100755
index 0000000..1bd2c16
--- /dev/null
+++ b/rootfs/etc/init.d/radvd
@@ -0,0 +1,136 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides:       radvd
+# Required-Start: $remote_fs $named $syslog
+# Required-Stop:  $remote_fs $named $syslog
+# Default-Start:  3 5
+# Default-Stop:   0 1 2 6
+# Description:    router advertisement daemon
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/radvd
+NAME=radvd
+DESC=radvd
+CONFIG=/etc/radvd.conf
+SAVED_SETTINGS=/var/run/radvd/saved-settings
+PIDFILE=/var/run/radvd/radvd.pid
+OPTIONS="-u radvd -p $PIDFILE"
+
+test -x $DAEMON || exit 0
+
+set -e
+
+# Check for IPv6 support in kernel
+if test \! -e /proc/sys/net/ipv6; then
+  echo "IPv6 support must be enabled in the kernel for $DESC to work."
+  exit
+fi
+
+save_settings()
+{
+    local file=$1
+    
+    rm -f $file
+    for if_conf in /proc/sys/net/ipv6/conf/*; do
+	echo -e "$if_conf/forwarding\t `cat $if_conf/forwarding`" >> $file
+    done
+    return 0
+}
+
+restore_settings()
+{
+    file=$1
+    
+    if [ ! -f $file ]; then
+	echo "$0: warning: cannot restore settings"
+	return
+    fi
+    
+    ( 
+	while read f value; do
+	    if [ -w $f ]; then
+		echo $value > $f
+	    fi
+	done
+    ) < $file
+}
+
+chkconfig() {
+    if [ ! -e $CONFIG -o ! -s $CONFIG ]; then
+        echo ""
+	echo "* $CONFIG does not exist or is empty." 
+	echo "* See /usr/share/doc/radvd/radvd.conf.example for a simple"
+	echo "* configuration suitable for most systems, and radvd.conf(5)"
+	echo "* for configuration file syntax. radvd will *not* be started."
+	exit 0
+    fi
+}
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	mkdir -p /var/run/$NAME
+	chkconfig
+	save_settings $SAVED_SETTINGS
+	
+        # We must enable IPv6 forwarding for radvd to work
+	echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
+
+	# Check for stale pidfile; radvd won't start if one is lying around
+	if [ -f $PIDFILE ] && ! ps `cat  $PIDFILE` > /dev/null; then
+	  rm -f $PIDFILE
+	fi
+	if ! start-stop-daemon --oknodo --start --pidfile $PIDFILE \
+		--exec $DAEMON -- $OPTIONS; then
+	  echo "failed." && exit 1
+	fi
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	if ! [ -f $PIDFILE ] ; then
+		echo "not running."
+		exit 0
+	fi
+	start-stop-daemon --oknodo --stop --pidfile $PIDFILE \
+		--exec $DAEMON
+	restore_settings $SAVED_SETTINGS
+	rm -f $SAVED_SETTINGS
+	echo "$NAME."
+	;;
+  status)
+	status $DAEMON;
+	exit $?
+	;;
+  reload|force-reload)
+	echo "Reloading $DESC configuration files."
+	start-stop-daemon --stop --signal HUP --quiet --pidfile \
+	    $PIDFILE --exec $DAEMON
+	;;
+  restart)
+	chkconfig
+	echo -n "Restarting $DESC: "
+	if ! start-stop-daemon --stop --quiet --pidfile \
+		$PIDFILE --exec $DAEMON; then
+	  # stop failed, so we were not running
+	  save_settings $SAVED_SETTINGS
+	  echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
+	fi
+	sleep 1
+	start-stop-daemon --start --quiet --pidfile \
+		$PIDFILE --exec $DAEMON -- $OPTIONS
+	echo "$NAME."
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|status|restart|reload|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/rootfs/etc/init.d/rcK b/rootfs/etc/init.d/rcK
new file mode 100755
index 0000000..c7e94a9
--- /dev/null
+++ b/rootfs/etc/init.d/rcK
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Stop all init scripts in /etc/rc6.d
+# executing them in numerical order.
+#
+for i in /etc/rcS.d/K??*; do
+
+     # Ignore dangling symlinks (if any).
+     [ ! -f "$i" ] && continue
+
+     case "$i" in
+	*.sh)
+	    # Source shell script for speed.
+	    (
+		trap - INT QUIT TSTP
+		set stop
+		. $i
+	    )
+	    ;;
+	*)
+	    # No sh extension, so fork subprocess.
+	    $i stop
+	    ;;
+    esac
+done
+
diff --git a/rootfs/etc/init.d/rcS b/rootfs/etc/init.d/rcS
new file mode 100755
index 0000000..0cb2386
--- /dev/null
+++ b/rootfs/etc/init.d/rcS
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# Start all init scripts in /etc/rcS.d and /etc/rc5.d
+# executing them in numerical order.
+#
+
+.  /etc/init.d/first.sh
+
+sh /etc/init.d/enter_amt.sh
+if [ $? -eq 0 ]; then
+    echo "enter into amt mode"
+    exit 0
+fi
+
+for i in /etc/rcS.d/S??* ;do
+
+     # Ignore dangling symlinks (if any).
+     [ ! -f "$i" ] && continue
+
+     case "$i" in
+	*.sh)
+	    # Source shell script for speed.
+	    (
+		trap - INT QUIT TSTP
+		set start
+		. $i
+	    )
+	    ;;
+	*)
+	    # No sh extension, so fork subprocess.
+	    $i start
+	    ;;
+    esac
+done
+
+.  /etc/rc.local
+
+sh /etc/lynq_monitor.sh &
+exit 0
+
diff --git a/rootfs/etc/init.d/rild b/rootfs/etc/init.d/rild
new file mode 100755
index 0000000..5257246
--- /dev/null
+++ b/rootfs/etc/init.d/rild
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="rild"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/rild"
+EXEC_ARGS=""
+
+
+start() {
+	echo -n "Starting $DAEMON... "
+	start-stop-daemon --notify-await --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 $?
diff --git a/rootfs/etc/init.d/rtc-service b/rootfs/etc/init.d/rtc-service
new file mode 100755
index 0000000..7bad2e0
--- /dev/null
+++ b/rootfs/etc/init.d/rtc-service
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="rtc-service"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/rtc-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 $?
diff --git a/rootfs/etc/init.d/run-postinsts b/rootfs/etc/init.d/run-postinsts
new file mode 100755
index 0000000..473a1f7
--- /dev/null
+++ b/rootfs/etc/init.d/run-postinsts
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+run-postinsts
diff --git a/rootfs/etc/init.d/selinux-init b/rootfs/etc/init.d/selinux-init
new file mode 100755
index 0000000..6231790
--- /dev/null
+++ b/rootfs/etc/init.d/selinux-init
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+/usr/sbin/selinuxenabled 2>/dev/null || exit 0
+
+CHCON=/usr/bin/chcon
+MATCHPATHCON=/usr/sbin/matchpathcon
+RESTORECON=/sbin/restorecon
+SECON=/usr/bin/secon
+SETENFORCE=/usr/sbin/setenforce
+
+for i in ${CHCON} ${MATCHPATHCON} ${RESTORECON} ${SECON} ${SETENFORCE}; do
+	test -x $i && continue
+	echo "$i is missing in the system."
+	echo "Please add \"selinux=0\" in the kernel command line to disable SELinux."
+	exit 1
+done
+
+check_rootfs()
+{
+	${CHCON} `${MATCHPATHCON} -n /` / >/dev/null 2>&1 && return 0
+	echo ""
+	echo "* SELinux requires the root '/' filesystem support extended"
+	echo "  filesystem attributes (XATTRs).  It does not appear that this"
+	echo "  filesystem has extended attribute support or it is not enabled."
+	echo ""
+	echo "  - To continue using SELinux you will need to enable extended"
+	echo "    attribute support on the root device."
+	echo ""
+	echo "  - To disable SELinux, please add \"selinux=0\" in the kernel"
+	echo "    command line."
+	echo ""
+	echo "* Halting the system now."
+	/sbin/shutdown -f -h now
+}
+
+# Contents will be added to selinux-init.sh to support relabelling with sysvinit
+# If first booting, the security context type of init would be
+# "kernel_t", and the whole file system should be relabeled.
+if [ "`${SECON} -t --pid 1`" = "kernel_t" ]; then
+	echo "Checking SELinux security contexts:"
+	check_rootfs
+	echo " * First booting, filesystem will be relabeled..."
+	test -x /etc/init.d/auditd && /etc/init.d/auditd start
+	${SETENFORCE} 0
+	${RESTORECON} -RF /
+	${RESTORECON} -F /
+	echo " * Relabel done, rebooting the system."
+	/sbin/reboot
+fi
+
+exit 0
diff --git a/rootfs/etc/init.d/selinux-labeldev b/rootfs/etc/init.d/selinux-labeldev
new file mode 100755
index 0000000..64bf1a8
--- /dev/null
+++ b/rootfs/etc/init.d/selinux-labeldev
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+/usr/sbin/selinuxenabled 2>/dev/null || exit 0
+
+CHCON=/usr/bin/chcon
+MATCHPATHCON=/usr/sbin/matchpathcon
+RESTORECON=/sbin/restorecon
+
+mkdir -p /dev/socket -m 777
+for i in ${CHCON} ${MATCHPATHCON} ${RESTORECON}; do
+	test -x $i && continue
+	echo "$i is missing in the system."
+	echo "Please add \"selinux=0\" in the kernel command line to disable SELinux."
+	exit 1
+done
+
+# Because /dev/console is not relabeled by kernel, many commands
+# would can not use it, including restorecon.
+${CHCON} -t `${MATCHPATHCON} -n /dev/null | cut -d: -f3` /dev/null
+${CHCON} -t `${MATCHPATHCON} -n /dev/console | cut -d: -f3` /dev/console
+
+# Now, we should relabel /dev for most services.
+mkdir -p /dev/socket -m 777
+${RESTORECON} -RF /dev
+
+exit 0
diff --git a/rootfs/etc/init.d/servicemanager b/rootfs/etc/init.d/servicemanager
new file mode 100755
index 0000000..0264b16
--- /dev/null
+++ b/rootfs/etc/init.d/servicemanager
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="servicemanager"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/servicemanager"
+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 $?
diff --git a/rootfs/etc/init.d/shutdown_first.sh b/rootfs/etc/init.d/shutdown_first.sh
new file mode 100755
index 0000000..549af07
--- /dev/null
+++ b/rootfs/etc/init.d/shutdown_first.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo "clear all" > /proc/abnormal_exit_task
+
+
diff --git a/rootfs/etc/init.d/sntp b/rootfs/etc/init.d/sntp
new file mode 100755
index 0000000..006a704
--- /dev/null
+++ b/rootfs/etc/init.d/sntp
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="sntp"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/sntp"
+EXEC_ARGS=""
+
+
+start() {
+	echo -n "Starting $DAEMON... "
+	start-stop-daemon -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 $?
diff --git a/rootfs/etc/init.d/syslog b/rootfs/etc/init.d/syslog
new file mode 100755
index 0000000..6a57c35
--- /dev/null
+++ b/rootfs/etc/init.d/syslog
@@ -0,0 +1,94 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:             sysklogd
+# Required-Start:       $remote_fs $time
+# Required-Stop:        $remote_fs $time
+# Default-Start:        2 3 4 5
+# Default-Stop:         0 1 6
+# Short-Description:    System logger
+### END INIT INFO
+
+set -e
+
+if [ -f /etc/syslog-startup.conf ]; then
+	. /etc/syslog-startup.conf
+	LOG_LOCAL=0
+	LOG_REMOTE=0
+	for D in $DESTINATION; do
+		if [ "$D" = "buffer" ]; then
+			SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
+			LOG_LOCAL=1
+		elif [ "$D" = "file" ]; then
+			if [ -n "$LOGFILE" ]; then
+				SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
+			fi
+			if [ -n "$ROTATESIZE" ]; then
+				SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
+			fi
+			if [ -n "$ROTATEGENS" ]; then
+				SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
+			fi
+			LOG_LOCAL=1
+		elif [ "$D" = "remote" ]; then
+			SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
+			LOG_REMOTE=1
+		fi
+	done
+	if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
+		SYSLOG_ARGS="$SYSLOG_ARGS -L"
+	fi
+	if [ "$REDUCE" = "yes" ]; then
+		SYSLOG_ARGS="$SYSLOG_ARGS -S"
+	fi
+	if [ "$DROPDUPLICATES" = "yes" ]; then
+	    SYSLOG_ARGS="$SYSLOG_ARGS -D"
+	fi
+	if [ -n "$LOGLEVEL" ]; then
+	    SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
+	fi
+else
+	# default: log to 16K shm circular buffer
+	SYSLOG_ARGS="-C"
+fi
+
+waitpid ()
+{
+  pid=$1
+  # Give pid a chance to exit before we restart with a 5s timeout in 1s intervals
+  if [ -z "$pid" ]; then
+    return
+  fi
+  timeout=5;
+  while [ $timeout -gt 0 ]
+  do
+    timeout=$(( $timeout-1 ))
+    kill -0 $pid 2> /dev/null || break
+    sleep 1
+  done
+}
+
+start() {
+	start-stop-daemon --no-close -S -b -m -p /run/syslogd.pid -x /sbin/syslogd -- -n $SYSLOG_ARGS
+	start-stop-daemon --no-close -S -b -m -p /run/klogd.pid -x /sbin/klogd -- -n
+}
+
+stop() {
+	start-stop-daemon -K -p /run/syslogd.pid
+	start-stop-daemon -K -p /run/klogd.pid
+}
+
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+  start|stop|restart)
+	"$1"
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
+
+exit $?
diff --git a/rootfs/etc/init.d/tee-supplicant b/rootfs/etc/init.d/tee-supplicant
new file mode 100755
index 0000000..96f070e
--- /dev/null
+++ b/rootfs/etc/init.d/tee-supplicant
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="tee-supplicant"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/sbin/tee-supplicant"
+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 $?
diff --git a/rootfs/etc/init.d/test_binder_server b/rootfs/etc/init.d/test_binder_server
new file mode 100755
index 0000000..82a7c84
--- /dev/null
+++ b/rootfs/etc/init.d/test_binder_server
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="test_binder_server"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/test_binder_server"
+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 $?
diff --git a/rootfs/etc/init.d/udhcpc b/rootfs/etc/init.d/udhcpc
new file mode 100755
index 0000000..e6582c6
--- /dev/null
+++ b/rootfs/etc/init.d/udhcpc
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="udhcpc"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/sbin/udhcpc"
+EXEC_ARGS=""
+
+
+start() {
+	echo -n "Starting $DAEMON... "
+	source /etc_rw/default/$DAEMON
+	start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $OPTIONS
+	[ $? -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 $?
diff --git a/rootfs/etc/init.d/udhcpd b/rootfs/etc/init.d/udhcpd
new file mode 100755
index 0000000..08c85d0
--- /dev/null
+++ b/rootfs/etc/init.d/udhcpd
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="udhcpd"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/sbin/udhcpd"
+EXEC_ARGS=""
+
+
+start() {
+	echo -n "Starting $DAEMON... "
+	source /etc_rw/default/$DAEMON	
+	start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $OPTIONS
+	[ $? -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 $?
diff --git a/rootfs/etc/init.d/umount.sh b/rootfs/etc/init.d/umount.sh
new file mode 100755
index 0000000..5943e72
--- /dev/null
+++ b/rootfs/etc/init.d/umount.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+/bin/umount -a -r
+
diff --git a/rootfs/etc/init.d/voiceipc_mainctrl b/rootfs/etc/init.d/voiceipc_mainctrl
new file mode 100755
index 0000000..4466cd4
--- /dev/null
+++ b/rootfs/etc/init.d/voiceipc_mainctrl
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="voiceipc_mainctrl"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/voiceipc_mainctrl"
+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 $?
diff --git a/rootfs/etc/init.d/wlan_proxy b/rootfs/etc/init.d/wlan_proxy
new file mode 100755
index 0000000..bf09fe5
--- /dev/null
+++ b/rootfs/etc/init.d/wlan_proxy
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="wlan_proxy"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/wlan_proxy"
+
+start() {
+	echo -n "Starting $DAEMON... "	
+	start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC
+	[ $? -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 $?
diff --git a/rootfs/etc/init.d/zcatlog_config.sh b/rootfs/etc/init.d/zcatlog_config.sh
new file mode 100755
index 0000000..0d099dd
--- /dev/null
+++ b/rootfs/etc/init.d/zcatlog_config.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+#jb.qi add for uci check start
+check_copy_file() {
+	if [ $# -ne 2 ];then
+		return
+	fi
+	
+	diff $1 $2 > /dev/null
+	if [ $? -ne 0 ]; then
+		echo "cp $1 $2" > /dev/kmsg
+		cp $1 $2
+	fi
+}
+
+check_uci()
+{
+    uci get lynq_uci.lynq_ril > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "$TAG: lynq_uci config cant get" > /dev/kmsg
+        cp /etc/config/lynq_uci /mnt/userdata/config/lynq_uci
+    fi
+}
+mkdir /mnt/userdata/config
+check_uci
+check_copy_file /etc/config/lynq_uci_ro /mnt/userdata/config/lynq_uci_ro
+
+#jb.qi add for uci check end
+ramdump_mode=`nv get ramdump_mode`
+
+if [ -e /proc/sys/ramdump_ap/ramdump_start_addr ]; then
+  if [ "$ramdump_mode" == "CAPEMMC" ]; then
+    ramdump_dev=`nv get ramdump_emmc_device`
+    if [ -b $ramdump_dev ]; then
+       ramdump_start=`fdisk -l | grep $ramdump_dev | awk '{ print $4 }'`
+       ramdump_save_size=`fdisk -l | grep $ramdump_dev | awk '{ print $6 }'`
+       echo $ramdump_start > /proc/sys/ramdump_ap/ramdump_start_addr
+       echo $ramdump_save_size > /proc/sys/ramdump_ap/ramdump_emmc_size
+    else
+       echo "[zxic_ramdump]$ramdump_dev is not exist!"
+    fi
+  else
+    if [ -b $ramdump_dev ]; then
+      echo 0 > /proc/sys/ramdump_ap/ramdump_start_addr
+    fi
+  fi
+fi
+# 0 for usb, 1 for net
+if [ -e /proc/sys/zcatkern/log_com_mode ]; then
+  zcat_com_mode=`nv get zcat_mode`
+  if [ "$zcat_com_mode" == "net" ]; then
+    echo 1 > /proc/sys/zcatkern/log_com_mode
+  else
+    echo 0 > /proc/sys/zcatkern/log_com_mode
+  fi
+#  sh /etc/zcatlog_monitor.sh &
+fi
+
diff --git a/rootfs/etc/init.d/zlog_agent b/rootfs/etc/init.d/zlog_agent
new file mode 100755
index 0000000..d13ef55
--- /dev/null
+++ b/rootfs/etc/init.d/zlog_agent
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="zlog_agent"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/zlog_agent"
+EXEC_ARGS=" "
+#EXEC_ARGS="-d  /mnt/userdata  -r /mnt/userdata/log.rule  -t 1024 -n 10"
+
+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 $?
diff --git a/rootfs/etc/init.d/zxic-amt b/rootfs/etc/init.d/zxic-amt
new file mode 100755
index 0000000..9a8fed6
--- /dev/null
+++ b/rootfs/etc/init.d/zxic-amt
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="zxic-amt"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/zxic-amt"
+EXEC_ARGS="-p 10027"
+
+
+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 $?
diff --git a/rootfs/etc/init.d/zxic_debug b/rootfs/etc/init.d/zxic_debug
new file mode 100755
index 0000000..bbcbea4
--- /dev/null
+++ b/rootfs/etc/init.d/zxic_debug
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="zxic_debug"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/zxic_debug"
+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 $?
diff --git a/rootfs/etc/init.d/zxic_hotplug b/rootfs/etc/init.d/zxic_hotplug
new file mode 100755
index 0000000..73e1f76
--- /dev/null
+++ b/rootfs/etc/init.d/zxic_hotplug
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="zxic_hotplug"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/zxic_hotplug"
+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 $?
diff --git a/rootfs/etc/init.d/zxic_ipv6_slaac b/rootfs/etc/init.d/zxic_ipv6_slaac
new file mode 100755
index 0000000..52624e0
--- /dev/null
+++ b/rootfs/etc/init.d/zxic_ipv6_slaac
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="zxic_ipv6_slaac"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/zxic_ipv6_slaac"
+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 $?
diff --git a/rootfs/etc/init.d/zxic_mainctrl b/rootfs/etc/init.d/zxic_mainctrl
new file mode 100755
index 0000000..01ed684
--- /dev/null
+++ b/rootfs/etc/init.d/zxic_mainctrl
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="zxic_mainctrl"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/zxic_mainctrl"
+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 $?
diff --git a/rootfs/etc/init.d/zxic_mmi b/rootfs/etc/init.d/zxic_mmi
new file mode 100755
index 0000000..88df652
--- /dev/null
+++ b/rootfs/etc/init.d/zxic_mmi
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="zxic_mmi"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/zxic_mmi"
+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 $?
diff --git a/rootfs/etc/init.d/zxic_ndp b/rootfs/etc/init.d/zxic_ndp
new file mode 100755
index 0000000..0b85f8f
--- /dev/null
+++ b/rootfs/etc/init.d/zxic_ndp
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Run the daemon
+#
+
+DAEMON="zxic_ndp"
+PIDFILE="/var/run/$DAEMON.pid"
+EXEC="/usr/bin/zxic_ndp"
+EXEC_ARGS=""
+
+
+start() {
+	echo -n "Starting $DAEMON... "
+	source /etc_rw/default/$DAEMON
+	start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC -- $OPTIONS
+	[ $? -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 $?