mirror of
				git://git.openwrt.org/openwrt/openwrt.git
				synced 2025-11-03 22:44:27 -05:00 
			
		
		
		
	image: add support for k unit suffix to pad-offset
Allows to specificy the padding and offset in kilobytes to be consistent with pad-to. Signed-off-by: Mathias Kresin <dev@kresin.me>
This commit is contained in:
		
							parent
							
								
									5369a03d52
								
							
						
					
					
						commit
						b99a93ebaf
					
				@ -137,8 +137,8 @@ endef
 | 
			
		||||
define Build/pad-offset
 | 
			
		||||
	let \
 | 
			
		||||
		size="$$(stat -c%s $@)" \
 | 
			
		||||
		pad="$(word 1, $(1))" \
 | 
			
		||||
		offset="$(word 2, $(1))" \
 | 
			
		||||
		pad="$(subst k,* 1024,$(word 1, $(1)))" \
 | 
			
		||||
		offset="$(subst k,* 1024,$(word 2, $(1)))" \
 | 
			
		||||
		pad="(pad - ((size + offset) % pad)) % pad" \
 | 
			
		||||
		newsize='size + pad'; \
 | 
			
		||||
		dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user