scripts: ubinize-image: make rootfs optional
Currently ubinize-image script always expects the rootfs image to be passed and a volume for it created. So, to allow only ubinizing a kernel for example which the MikroTik hAP ac3 and other new NAND devices from MikroTik require make rootfs an optional parameter like kernel. Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
		 Robert Marko
					Robert Marko
				
			
				
					committed by
					
						 Hauke Mehrtens
						Hauke Mehrtens
					
				
			
			
				
	
			
			
			 Hauke Mehrtens
						Hauke Mehrtens
					
				
			
						parent
						
							da3261e57c
						
					
				
				
					commit
					5a305e429f
				
			| @@ -66,6 +66,7 @@ ubilayout() { | |||||||
| 		vol_id=$(( $vol_id + 1 )) | 		vol_id=$(( $vol_id + 1 )) | ||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
|  | 	if [ "$2" ]; then | ||||||
| 		case "$rootfs_type" in | 		case "$rootfs_type" in | ||||||
| 		"ubifs") | 		"ubifs") | ||||||
| 			autoresize=1 | 			autoresize=1 | ||||||
| @@ -80,6 +81,7 @@ ubilayout() { | |||||||
|  |  | ||||||
| 		vol_id=$(( $vol_id + 1 )) | 		vol_id=$(( $vol_id + 1 )) | ||||||
| 		[ "$rootfs_type" = "ubifs" ] || ubivol $vol_id rootfs_data "" 1 | 		[ "$rootfs_type" = "ubifs" ] || ubivol $vol_id rootfs_data "" 1 | ||||||
|  | 	fi | ||||||
| } | } | ||||||
|  |  | ||||||
| set_ubinize_seq() { | set_ubinize_seq() { | ||||||
| @@ -101,6 +103,12 @@ while [ "$1" ]; do | |||||||
| 		shift | 		shift | ||||||
| 		continue | 		continue | ||||||
| 		;; | 		;; | ||||||
|  | 	"--rootfs") | ||||||
|  | 		rootfs="$2" | ||||||
|  | 		shift | ||||||
|  | 		shift | ||||||
|  | 		continue | ||||||
|  | 		;; | ||||||
| 	"--part") | 	"--part") | ||||||
| 		parts="$parts $2" | 		parts="$parts $2" | ||||||
| 		shift | 		shift | ||||||
| @@ -112,11 +120,6 @@ while [ "$1" ]; do | |||||||
| 		break | 		break | ||||||
| 		;; | 		;; | ||||||
| 	*) | 	*) | ||||||
| 		if [ ! "$rootfs" ]; then |  | ||||||
| 			rootfs=$1 |  | ||||||
| 			shift |  | ||||||
| 			continue |  | ||||||
| 		fi |  | ||||||
| 		if [ ! "$outfile" ]; then | 		if [ ! "$outfile" ]; then | ||||||
| 			outfile=$1 | 			outfile=$1 | ||||||
| 			shift | 			shift | ||||||
| @@ -126,8 +129,8 @@ while [ "$1" ]; do | |||||||
| 	esac | 	esac | ||||||
| done | done | ||||||
|  |  | ||||||
| if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$outfile" ]; then | if [ ! -r "$rootfs" -a ! -r "$kernel" -a ! "$outfile" ]; then | ||||||
| 	echo "syntax: $0 [--uboot-env] [--part <name>=<file>] [--kernel kernelimage] rootfs out [ubinize opts]" | 	echo "syntax: $0 [--uboot-env] [--part <name>=<file>] [--kernel kernelimage] [--rootfs rootfsimage] out [ubinize opts]" | ||||||
| 	exit 1 | 	exit 1 | ||||||
| fi | fi | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user