sushichao 11 godzin temu
rodzic
commit
e2a25e6086

+ 3 - 0
etc/rc.local

@@ -4,6 +4,9 @@
 #if [ -f "/root/restart_count.log" ];then
 #	/bin/bash /usr/local/bin/test_reboot.sh
 #fi
+#check factory reset
+etc/scripts/S99input-event-daemon start
+
 /etc/scripts/gpio_init.sh
 
 /etc/scripts/product_model.sh

+ 72 - 0
etc/scripts/S99input-event-daemon

@@ -0,0 +1,72 @@
+#! /bin/sh
+
+[ -f /usr/bin/input-event-daemon ] || exit 0
+
+check_oem_exist()
+{
+	if [ -f "/oem/.userdata" ]; then
+		if [ ! -f "/oem/.upgrade" ]; then
+			echo "keep config upgrade"
+			/etc/scripts/merge_conf.sh
+			touch /oem/.upgrade
+			sleep 1
+			rm -rf /userdata/config
+			sync
+			/sbin/reboot
+			exit 0
+		fi
+	else
+		[ -f /userdata/updatetime.txt ] && updatetime="`sysconf /userdata/updatetime.txt get upgrade date`"
+		TARGET_DIR="/oem"
+		find "$TARGET_DIR" -mindepth 1 ! -path "$TARGET_DIR/.flag" ! -path "$TARGET_DIR/.flag/*" ! -path "$TARGET_DIR/.onvif_upgrade" ! -path "$TARGET_DIR/.onvif_upgrade/*" ! -path "$TARGET_DIR/.language" ! -path "$TARGET_DIR/.language/*" -exec rm -rf {} +
+		
+		tar xvf /oem_backup.tar -C /oem/
+		
+		[ ! -z "${updatetime}" ] && sysconf /etc/speaker.conf set upgrade date ${updatetime}
+		[ -f /oem/.flag/.language ] && language="`sysconf /oem/.flag/.language get system language`" && [ ! -z ${language} ] && sysconf /etc/speaker.conf set system language ${language}
+		sleep 1
+		touch /oem/.userdata
+		rm -rf /userdata/config
+		sync
+		/sbin/reboot
+		exit 0
+	fi
+}
+
+start() {
+	printf "Starting input-event-daemon: "
+	input-event-daemon -v
+	echo "done"
+	printf "Check oem: "
+	check_oem_exist
+}
+
+
+stop() {
+	printf "Stopping input-event-daemon: "
+	killall input-event-daemon
+	echo "done"
+}
+
+restart() {
+	stop
+	start
+}
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart|reload)
+	restart
+	;;
+  *)
+	echo "Usage: $0 {start|stop|reload|restart}"
+	exit 1
+esac
+
+exit $?

+ 1 - 1
etc/scripts/getmodel.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
 
-echo -n "G2-DIA"
+echo -n "G2-DIA-CDD2"
 
 exit 0

+ 2 - 0
etc/speaker_update.conf

@@ -0,0 +1,2 @@
+[system]
+firmware=s0.0.0.001

+ 1 - 1
readyForTarget.sh

@@ -20,7 +20,7 @@ if [ $# = 1 ];then
 
     [ ! -d output ] && mkdir output
 
-    tar -zcf output/${name} oem_backup.tar etc oem usr www app && echo "Wirte Sign..." && /bin/rk_generate output/${name} G2-DIA ${SOFT_VERSION} && echo "Wirte Sign complete!"
+    tar -zcf output/${name} oem_backup.tar etc oem usr www app && echo "Wirte Sign..." && /bin/rk_generate output/${name} G2-DIA-CDD2 ${SOFT_VERSION} && echo "Wirte Sign complete!"
 
     rm -rf oem_backup.tar
 

BIN
usr/bin/rk_parser