| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -13,34 +13,53 @@ error_exit() {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					# Copy the rootfs additions
 | 
					 | 
					 | 
					 | 
					# Copy the rootfs additions
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					if [ -d "$BOARD_DIR/rootfs-additions" ]; then
 | 
					 | 
					 | 
					 | 
					if [ -d "$BOARD_DIR/rootfs-additions" ]; then
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						echo "Copying rootfs additions ..."
 | 
					 | 
					 | 
					 | 
						echo "==> Copying rootfs additions ..."
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						rsync -va $BOARD_DIR/rootfs-additions/* $TARGET_DIR/
 | 
					 | 
					 | 
					 | 
						rsync -va $BOARD_DIR/rootfs-additions/* $TARGET_DIR/
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						error_exit $?
 | 
					 | 
					 | 
					 | 
						error_exit $?
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					else
 | 
					 | 
					 | 
					 | 
					else
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						echo "No rootfs additions found !"
 | 
					 | 
					 | 
					 | 
						echo "==> No rootfs additions found !"
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					fi
 | 
					 | 
					 | 
					 | 
					fi
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					# Disable dropbear server
 | 
					 | 
					 | 
					 | 
					# Disable dropbear server
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					if [ -e $TARGET_DIR/etc/init.d/S50dropbear ]; then
 | 
					 | 
					 | 
					 | 
					if [ -e $TARGET_DIR/etc/init.d/S50dropbear ]; then
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						echo "Disabling dropbear server ..."
 | 
					 | 
					 | 
					 | 
						echo -n "==> Disable Dropbear server: [Y/n] "
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						chmod a-x $TARGET_DIR/etc/init.d/S50dropbear
 | 
					 | 
					 | 
					 | 
						read DROPBEARSERVER
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						error_exit $?
 | 
					 | 
					 | 
					 | 
						if [ "$DROPBEARSERVER" != "n" ]; then
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							echo "==> Disabling dropbear server ..."
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							#chmod a-x $TARGET_DIR/etc/init.d/S50dropbear
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							mkdir -p $TARGET_DIR/etc/init.disabled
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							mv -f $TARGET_DIR/etc/init.d/S50dropbear $TARGET_DIR/etc/init.disabled/
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							error_exit $?
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						fi
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					fi
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					# Disable gpe01 fix
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					if [ -e $TARGET_DIR/etc/init.d/S00gpefix ]; then
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						echo -n "==> Disable GPE01 fix: [y/N] "
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						read DISABLEGPEFIX
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						if [ "$DISABLEGPEFIX" = "y" ]; then
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							echo "==> Disabling gpe01 fix ..."
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							#chmod a-x $TARGET_DIR/etc/init.d/S00gpefix
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							mkdir -p $TARGET_DIR/etc/init.disabled
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							mv -f $TARGET_DIR/etc/init.d/S00gpefix $TARGET_DIR/etc/init.disabled/
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							error_exit $?
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						fi
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					fi
 | 
					 | 
					 | 
					 | 
					fi
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					# Enable virtual terminals in inittab
 | 
					 | 
					 | 
					 | 
					# Enable virtual terminals in inittab
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					if [ ! $(fgrep tty12 "$TARGET_DIR/etc/inittab") ]; then
 | 
					 | 
					 | 
					 | 
					if [ ! $(fgrep tty12 "$TARGET_DIR/etc/inittab") ]; then
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						echo "Enabling virtual terminal 2..12 ..."
 | 
					 | 
					 | 
					 | 
						echo "==> Enabling virtual terminal 2..12 ..."
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						for ii in {12..2}; do
 | 
					 | 
					 | 
					 | 
						for ii in {12..2}; do
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							sed -E -i 's/GENERIC_SERIAL/GENERIC_SERIAL\ntty'$ii'::askfirst:-\/bin\/login/' "$TARGET_DIR/etc/inittab"
 | 
					 | 
					 | 
					 | 
							sed -E -i 's/GENERIC_SERIAL/GENERIC_SERIAL\ntty'$ii'::askfirst:-\/bin\/login/' "$TARGET_DIR/etc/inittab"
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							error_exit $?
 | 
					 | 
					 | 
					 | 
							error_exit $?
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						done
 | 
					 | 
					 | 
					 | 
						done
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					else
 | 
					 | 
					 | 
					 | 
					else
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						echo "Virtual terminals already enabled."
 | 
					 | 
					 | 
					 | 
						echo "==> Virtual terminals already enabled."
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					fi
 | 
					 | 
					 | 
					 | 
					fi
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					# Set pax flax (tentative)
 | 
					 | 
					 | 
					 | 
					# Set pax flax (tentative)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					if [ -e "$TARGET_DIR/usr/lib/libcrypto.so.1.0.0" ]; then
 | 
					 | 
					 | 
					 | 
					if [ -e "$TARGET_DIR/usr/lib/libcrypto.so.1.0.0" ]; then
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						echo "Setting paxflag on libcrypto ..."
 | 
					 | 
					 | 
					 | 
						echo "==> Setting paxflag on libcrypto ..."
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/sbin/paxctl -c $TARGET_DIR/usr/lib/libcrypto.so.1.0.0
 | 
					 | 
					 | 
					 | 
						/sbin/paxctl -c $TARGET_DIR/usr/lib/libcrypto.so.1.0.0
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						error_exit $?
 | 
					 | 
					 | 
					 | 
						error_exit $?
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/sbin/paxctl -m $TARGET_DIR/usr/lib/libcrypto.so.1.0.0
 | 
					 | 
					 | 
					 | 
						/sbin/paxctl -m $TARGET_DIR/usr/lib/libcrypto.so.1.0.0
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -49,6 +68,6 @@ fi
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					# Add symlink to gpg2 for convenience
 | 
					 | 
					 | 
					 | 
					# Add symlink to gpg2 for convenience
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					if [ ! -e "$TARGET_DIR/usr/bin/gpg" ]; then
 | 
					 | 
					 | 
					 | 
					if [ ! -e "$TARGET_DIR/usr/bin/gpg" ]; then
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						echo "Symlinking gpg2 ..."
 | 
					 | 
					 | 
					 | 
						echo "==> Symlinking gpg2 ..."
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						ln -s /usr/bin/gpg2 $TARGET_DIR/usr/bin/gpg
 | 
					 | 
					 | 
					 | 
						ln -s /usr/bin/gpg2 $TARGET_DIR/usr/bin/gpg
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					fi
 | 
					 | 
					 | 
					 | 
					fi
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					 | 
					
 
 |