Externalized the additional CFLAGS. Removed the isohybrid functionality. These changes haven't been tested yet.
This commit is contained in:
		
							parent
							
								
									586f8eeab1
								
							
						
					
					
						commit
						acb5f0b617
					
				@ -45,7 +45,7 @@ SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.0
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
#   http://links.twibright.com
 | 
					#   http://links.twibright.com
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
LINKS_SOURCE_URL=http://links.twibright.com/download/links-2.13.tar.bz2
 | 
					LINKS_SOURCE_URL=http://links.twibright.com/download/links-2.14.tar.bz2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# You can find the latest Dropbear source bundles here:
 | 
					# You can find the latest Dropbear source bundles here:
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@ -166,3 +166,7 @@ USE_BOOT_LOGO=true
 | 
				
			|||||||
# value '2' and if your CPU has 4 cores, then the number of 'make' jobs will be
 | 
					# value '2' and if your CPU has 4 cores, then the number of 'make' jobs will be
 | 
				
			||||||
# 4 * 2 = 8. Don't change this property unless you know what 'make' jobs are!
 | 
					# 4 * 2 = 8. Don't change this property unless you know what 'make' jobs are!
 | 
				
			||||||
JOB_FACTOR=1
 | 
					JOB_FACTOR=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This property defines the default GCC flags to be used during the compilation
 | 
				
			||||||
 | 
					# process. You can use your own flags here or even completely remove the flags.
 | 
				
			||||||
 | 
					CFLAGS=-Os -s -fno-stack-protector -fomit-frame-pointer -U_FORTIFY_SOURCE
 | 
				
			||||||
 | 
				
			|||||||
@ -7,6 +7,9 @@ SRC_DIR=$(pwd)
 | 
				
			|||||||
# Read the 'JOB_FACTOR' property from '.config'
 | 
					# Read the 'JOB_FACTOR' property from '.config'
 | 
				
			||||||
JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
 | 
					JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Read the 'CFLAGS' property from '.config'
 | 
				
			||||||
 | 
					CFLAGS="$(grep -i ^CFLAGS .config | cut -f2 -d'=')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Find the number of available CPU cores.
 | 
					# Find the number of available CPU cores.
 | 
				
			||||||
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
 | 
					NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -91,7 +94,7 @@ fi
 | 
				
			|||||||
# http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux
 | 
					# http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux
 | 
				
			||||||
echo "Building kernel..."
 | 
					echo "Building kernel..."
 | 
				
			||||||
make \
 | 
					make \
 | 
				
			||||||
  CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE" \
 | 
					  CFLAGS="$CFLAGS" \
 | 
				
			||||||
  bzImage -j $NUM_JOBS
 | 
					  bzImage -j $NUM_JOBS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Install the kernel file.
 | 
					# Install the kernel file.
 | 
				
			||||||
 | 
				
			|||||||
@ -7,6 +7,9 @@ SRC_DIR=$(pwd)
 | 
				
			|||||||
# Read the 'JOB_FACTOR' property from '.config'
 | 
					# Read the 'JOB_FACTOR' property from '.config'
 | 
				
			||||||
JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
 | 
					JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Read the 'CFLAGS' property from '.config'
 | 
				
			||||||
 | 
					CFLAGS="$(grep -i ^CFLAGS .config | cut -f2 -d'=')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Find the number of available CPU cores.
 | 
					# Find the number of available CPU cores.
 | 
				
			||||||
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
 | 
					NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -50,7 +53,7 @@ $GLIBC_SRC/configure \
 | 
				
			|||||||
  --without-gd \
 | 
					  --without-gd \
 | 
				
			||||||
  --without-selinux \
 | 
					  --without-selinux \
 | 
				
			||||||
  --disable-werror \
 | 
					  --disable-werror \
 | 
				
			||||||
  CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE -fomit-frame-pointer"
 | 
					  CFLAGS="$CFLAGS"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Compile glibc with optimization for "parallel jobs" = "number of processors".
 | 
					# Compile glibc with optimization for "parallel jobs" = "number of processors".
 | 
				
			||||||
echo "Building glibc..."
 | 
					echo "Building glibc..."
 | 
				
			||||||
 | 
				
			|||||||
@ -58,10 +58,13 @@ GLIBC_PREPARED_ESCAPED=$(echo \"$GLIBC_PREPARED\" | sed 's/\//\\\//g')
 | 
				
			|||||||
# Now we tell BusyBox to use the glibc prepared area.
 | 
					# Now we tell BusyBox to use the glibc prepared area.
 | 
				
			||||||
sed -i "s/.*CONFIG_SYSROOT.*/CONFIG_SYSROOT=$GLIBC_PREPARED_ESCAPED/" .config
 | 
					sed -i "s/.*CONFIG_SYSROOT.*/CONFIG_SYSROOT=$GLIBC_PREPARED_ESCAPED/" .config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Read the 'CFLAGS' property from '.config'
 | 
				
			||||||
 | 
					CFLAGS="$(grep -i ^CFLAGS .config | cut -f2 -d'=')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Compile busybox with optimization for "parallel jobs" = "number of processors".
 | 
					# Compile busybox with optimization for "parallel jobs" = "number of processors".
 | 
				
			||||||
echo "Building BusyBox..."
 | 
					echo "Building BusyBox..."
 | 
				
			||||||
make \
 | 
					make \
 | 
				
			||||||
  EXTRA_CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE" \
 | 
					  EXTRA_CFLAGS="$CFLAGS" \
 | 
				
			||||||
  busybox -j $NUM_JOBS
 | 
					  busybox -j $NUM_JOBS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Create the symlinks for busybox. The file 'busybox.links' is used for this.
 | 
					# Create the symlinks for busybox. The file 'busybox.links' is used for this.
 | 
				
			||||||
 | 
				
			|||||||
@ -153,10 +153,6 @@ genisoimage \
 | 
				
			|||||||
  -boot-info-table \
 | 
					  -boot-info-table \
 | 
				
			||||||
  ./
 | 
					  ./
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This allows the ISO image to be bootable if it is burned on USB flash drive.
 | 
					 | 
				
			||||||
# The -u option is used in EFI boot mode and it reduces the ISO image size.
 | 
					 | 
				
			||||||
isohybrid -u ../minimal_linux_live.iso 2>/dev/null || true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Copy the ISO image to the root project folder.
 | 
					# Copy the ISO image to the root project folder.
 | 
				
			||||||
cp ../minimal_linux_live.iso ../../
 | 
					cp ../minimal_linux_live.iso ../../
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -6,15 +6,14 @@ echo "Cleaning up the overlay work area. This may take a while..."
 | 
				
			|||||||
rm -rf work/overlay
 | 
					rm -rf work/overlay
 | 
				
			||||||
mkdir -p work/overlay
 | 
					mkdir -p work/overlay
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Just in case we execute the overlay software generation script before we
 | 
					 | 
				
			||||||
# execute the main build script.
 | 
					 | 
				
			||||||
mkdir -p work/src/minimal_overlay
 | 
					mkdir -p work/src/minimal_overlay
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# -p stops errors if the directory already exists
 | 
					# -p stops errors if the directory already exists.
 | 
				
			||||||
mkdir -p source/overlay
 | 
					mkdir -p source/overlay
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cd minimal_overlay
 | 
					cd work/src/minimal_overlay
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Remove all previously prepared overlay artifacts.
 | 
				
			||||||
for dir in $(ls -d */ 2>/dev/null) ; do
 | 
					for dir in $(ls -d */ 2>/dev/null) ; do
 | 
				
			||||||
  rm -rf $dir
 | 
					  rm -rf $dir
 | 
				
			||||||
  echo "Overlay folder '$dir' has been removed."
 | 
					  echo "Overlay folder '$dir' has been removed."
 | 
				
			||||||
 | 
				
			|||||||
@ -5,6 +5,9 @@ SRC_DIR=$(pwd)
 | 
				
			|||||||
# Read the 'JOB_FACTOR' property from '.config'
 | 
					# Read the 'JOB_FACTOR' property from '.config'
 | 
				
			||||||
JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
 | 
					JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Read the 'CFLAGS' property from '.config'
 | 
				
			||||||
 | 
					CFLAGS="$(grep -i ^CFLAGS .config | cut -f2 -d'=')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Find the number of available CPU cores.
 | 
					# Find the number of available CPU cores.
 | 
				
			||||||
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
 | 
					NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -31,7 +34,7 @@ echo "Configuring Dropbear..."
 | 
				
			|||||||
  --prefix=$SRC_DIR/work/overlay/dropbear/dropbear_installed \
 | 
					  --prefix=$SRC_DIR/work/overlay/dropbear/dropbear_installed \
 | 
				
			||||||
  --disable-zlib \
 | 
					  --disable-zlib \
 | 
				
			||||||
  --disable-loginfunc \
 | 
					  --disable-loginfunc \
 | 
				
			||||||
  CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE"
 | 
					  CFLAGS="$CFLAGS"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "Building Dropbear..."
 | 
					echo "Building Dropbear..."
 | 
				
			||||||
make -j $NUM_JOBS
 | 
					make -j $NUM_JOBS
 | 
				
			||||||
 | 
				
			|||||||
@ -5,6 +5,9 @@ SRC_DIR=$(pwd)
 | 
				
			|||||||
# Read the 'JOB_FACTOR' property from '.config'
 | 
					# Read the 'JOB_FACTOR' property from '.config'
 | 
				
			||||||
JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
 | 
					JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Read the 'CFLAGS' property from '.config'
 | 
				
			||||||
 | 
					CFLAGS="$(grep -i ^CFLAGS .config | cut -f2 -d'=')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Find the number of available CPU cores.
 | 
					# Find the number of available CPU cores.
 | 
				
			||||||
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
 | 
					NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -32,7 +35,7 @@ echo "Configuring Links..."
 | 
				
			|||||||
  --without-x
 | 
					  --without-x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Set CFLAGS directly in Makefile.
 | 
					# Set CFLAGS directly in Makefile.
 | 
				
			||||||
sed -i "s/^CFLAGS = .*/CFLAGS = \\-Os \\-s \\-fno\\-stack\\-protector \\-U_FORTIFY_SOURCE/" Makefile
 | 
					sed -i "s/^CFLAGS = .*/CFLAGS = $CFLAGS/" Makefile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "Building Links..."
 | 
					echo "Building Links..."
 | 
				
			||||||
make -j $NUM_JOBS
 | 
					make -j $NUM_JOBS
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user