mirror of
				https://github.com/rafacouto/docker-openwrt-builder
				synced 2025-10-27 07:47:12 +00:00 
			
		
		
		
	Use the environment var OPENWRT_TARGET.
This commit is contained in:
		
							parent
							
								
									079aa0ed8e
								
							
						
					
					
						commit
						182554e7a2
					
				| @ -1,10 +1,19 @@ | ||||
| #!/bin/bash | ||||
| 
 | ||||
| OPENWRT_SRC="$WORKDIR/src" | ||||
| OPENWRT_CONFIGS="$WORKDIR/configs" | ||||
| 
 | ||||
| # ToDo: show target options | ||||
| if [ -z "$OPENWRT_TARGET" ] ; then | ||||
| 	echo 'ERROR: You have to set the environment variable OPENWRT_TARGET to one of these values:' | ||||
| 	for c in $(ls $OPENWRT_CONFIGS | sed 's/\.diff//g') ; do | ||||
| 		echo "$c" | ||||
| 	done | ||||
| 	exit | ||||
| fi | ||||
| 
 | ||||
| # ToDo: examine targets from env vars... | ||||
| 
 | ||||
| export OPENWRT_SRC="$WORKDIR/src" | ||||
| 
 | ||||
| # get the sources | ||||
| git clone https://github.com/openwrt/openwrt.git $OPENWRT_SRC | ||||
| @ -12,12 +21,15 @@ cd $OPENWRT_SRC | ||||
| git checkout $OPENWRT_RELEASE  | ||||
| 
 | ||||
| # set the config file | ||||
| cp "$WORKDIR/configs/$OPENWRT_TARGET.diff" "$OPENWRT_SRC/.config"  | ||||
| cp "$OPENWRT_CONFIGS/$OPENWRT_TARGET.diff" "$OPENWRT_SRC/.config"  | ||||
| 
 | ||||
| # update feeds | ||||
| ./scripts/feeds update -a  | ||||
| ./scripts/feeds install -a  | ||||
| 
 | ||||
| # compile | ||||
| ionice -c 3 nice -n19 make -j3 V=s | ||||
| PROCESSORS=$(cat /proc/cpuinfo | grep '^processor' | wc -l) | ||||
| JOBS=$(($PROCESSORS - 1)) | ||||
| 
 | ||||
| # compile | ||||
| time ionice -c 3 nice -n 19 make -j $JOBS V=s | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user