소스 검색

remove update file and reboot in normal mode when update file is corrupted

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
Michel-FK 3 년 전
부모
커밋
320c699689
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      Recovery/board/funkey/rootfs-overlay/etc/init.d/S60recovery
  2. 4 2
      Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu

+ 2 - 2
Recovery/board/funkey/rootfs-overlay/etc/init.d/S60recovery

@@ -18,8 +18,8 @@ case "$1" in
 	    for file in ${updates} ; do
 		swupdate -i "${file}"
 		if [ $? -ne 0 ]; then
-	            menu &
-		    exit 1
+	            notif_disp 10 "         CORRUPTED^        UPDATE FILE"
+		    rm -f "${file}"
 		fi
 	    done
 	    notif "^^^^^^^^      RESTARTING...^^^^^^^^"

+ 4 - 2
Recovery/board/funkey/rootfs-overlay/usr/local/sbin/menu

@@ -139,8 +139,10 @@ menu_run () {
 		    for file in $(ls /mnt/FunKey-*.fwu); do
 			swupdate -i "${file}"
 			if [ $? -ne 0 ]; then
-			    notif "${message}...^CANNOT UPDATE!"
-			    break
+			    notif_disp 10 "${message}...^         CORRUPTED^        UPDATE FILE"
+			    rm -f "${file}"
+			    notif "^^^^^^^^         RESTARTING...^^^^^^^^"
+			    normal_mode
 			fi
 		    done
 		    message=" USB MOUNT"