imx: make sdcard/eMMC sysupgrade more resilient
Ensure, that kernel update is performed atomically on filesystem, to reduce likelihood of failure if power-cut occurs during sysupgrade. If kernel update fails for whatever reason, skip updating rootfs as well. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
This commit is contained in:
		 Lech Perczak
					Lech Perczak
				
			
				
					committed by
					
						 Piotr Dymacz
						Piotr Dymacz
					
				
			
			
				
	
			
			
			 Piotr Dymacz
						Piotr Dymacz
					
				
			
						parent
						
							70a9c75ef3
						
					
				
				
					commit
					4436d7bae8
				
			| @@ -41,9 +41,12 @@ imx_sdcard_do_upgrade() { | |||||||
| 	board_dir="${board_dir%/}" | 	board_dir="${board_dir%/}" | ||||||
|  |  | ||||||
| 	imx_sdcard_mount_boot | 	imx_sdcard_mount_boot | ||||||
| 	get_image "$1" | tar Oxf - ${board_dir}/kernel > /boot/uImage | 	get_image "$1" | tar Oxf - ${board_dir}/kernel > /boot/uImage-new && \ | ||||||
| 	get_image "$1" | tar Oxf - ${board_dir}/root > $(rootpart_from_uuid) | 		mv /boot/uImage-new /boot/uImage && \ | ||||||
|  | 		sync && \ | ||||||
|  | 		get_image "$1" | tar Oxf - ${board_dir}/root > $(rootpart_from_uuid) && \ | ||||||
| 		sync | 		sync | ||||||
|  |  | ||||||
| 	umount /boot | 	umount /boot | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user