base-files: Ensure reset only works if an overlay exists
Currently the reset script will try to run jffs2reset on boards that are running a rw rootfs, such as ext4. This will cause jffs2reset to fail and the board to never reboot while the LED blinks until a manual reboot. This commit does two different things: 1. Disables reset on boards that do not have an overlay mount 2. Disables the Blinking LED after 5 seconds if the board does not support reset Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						John Crispin
					
				
			
			
				
	
			
			
			
						parent
						
							83ece71d63
						
					
				
				
					commit
					b745bfa6dc
				
			@@ -2,8 +2,12 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
. /lib/functions.sh
 | 
					. /lib/functions.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					OVERLAY="$( grep ' /overlay ' /proc/mounts )"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$ACTION" in
 | 
					case "$ACTION" in
 | 
				
			||||||
pressed)
 | 
					pressed)
 | 
				
			||||||
 | 
						[ -z "$OVERLAY" ] && return 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 5
 | 
						return 5
 | 
				
			||||||
;;
 | 
					;;
 | 
				
			||||||
timeout)
 | 
					timeout)
 | 
				
			||||||
@@ -16,7 +20,7 @@ released)
 | 
				
			|||||||
		echo "REBOOT" > /dev/console
 | 
							echo "REBOOT" > /dev/console
 | 
				
			||||||
		sync
 | 
							sync
 | 
				
			||||||
		reboot
 | 
							reboot
 | 
				
			||||||
	elif [ "$SEEN" -gt 5 ]
 | 
						elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
 | 
				
			||||||
	then
 | 
						then
 | 
				
			||||||
		echo "FACTORY RESET" > /dev/console
 | 
							echo "FACTORY RESET" > /dev/console
 | 
				
			||||||
		jffs2reset -y && reboot &
 | 
							jffs2reset -y && reboot &
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user