base-files: flush kernel memory cache during sysupgrade
Flush kernel memory caches during sysupgrade in order to mitigate the impact from memory consumption spikes in low-RAM devices. This may help to prevent sysupgrade causing a reboot before the actual flashing starts. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
This commit is contained in:
		 Hannu Nyman
					Hannu Nyman
				
			
				
					committed by
					
						 Petr Štetiar
						Petr Štetiar
					
				
			
			
				
	
			
			
			 Petr Štetiar
						Petr Štetiar
					
				
			
						parent
						
							3064651bf7
						
					
				
				
					commit
					3d12b47985
				
			| @@ -297,6 +297,7 @@ indicate_upgrade() { | |||||||
| # $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m | # $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m | ||||||
| default_do_upgrade() { | default_do_upgrade() { | ||||||
| 	sync | 	sync | ||||||
|  | 	echo 3 > /proc/sys/vm/drop_caches | ||||||
| 	if [ -n "$UPGRADE_BACKUP" ]; then | 	if [ -n "$UPGRADE_BACKUP" ]; then | ||||||
| 		get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-image}" | 		get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-image}" | ||||||
| 	else | 	else | ||||||
|   | |||||||
| @@ -123,6 +123,7 @@ kill_remaining KILL 1 | |||||||
|  |  | ||||||
| sleep 1 | sleep 1 | ||||||
|  |  | ||||||
|  | echo 3 > /proc/sys/vm/drop_caches | ||||||
|  |  | ||||||
| if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then | if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then | ||||||
| 	platform_pre_upgrade "$IMAGE" | 	platform_pre_upgrade "$IMAGE" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user