Externalized the additional CFLAGS. Removed the isohybrid functionality. These changes haven't been tested yet.

This commit is contained in:
Ivan Davidov 2017-01-15 03:24:31 +02:00
parent 586f8eeab1
commit acb5f0b617
8 changed files with 28 additions and 14 deletions

View File

@ -45,7 +45,7 @@ SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.0
#
# 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:
#
@ -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
# 4 * 2 = 8. Don't change this property unless you know what 'make' jobs are!
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

View File

@ -7,6 +7,9 @@ SRC_DIR=$(pwd)
# Read the 'JOB_FACTOR' property from '.config'
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.
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
echo "Building kernel..."
make \
CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE" \
CFLAGS="$CFLAGS" \
bzImage -j $NUM_JOBS
# Install the kernel file.

View File

@ -7,6 +7,9 @@ SRC_DIR=$(pwd)
# Read the 'JOB_FACTOR' property from '.config'
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.
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
@ -50,7 +53,7 @@ $GLIBC_SRC/configure \
--without-gd \
--without-selinux \
--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".
echo "Building glibc..."

View File

@ -58,10 +58,13 @@ GLIBC_PREPARED_ESCAPED=$(echo \"$GLIBC_PREPARED\" | sed 's/\//\\\//g')
# Now we tell BusyBox to use the glibc prepared area.
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".
echo "Building BusyBox..."
make \
EXTRA_CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE" \
EXTRA_CFLAGS="$CFLAGS" \
busybox -j $NUM_JOBS
# Create the symlinks for busybox. The file 'busybox.links' is used for this.

View File

@ -153,10 +153,6 @@ genisoimage \
-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.
cp ../minimal_linux_live.iso ../../

View File

@ -6,15 +6,14 @@ echo "Cleaning up the overlay work area. This may take a while..."
rm -rf 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
# -p stops errors if the directory already exists
# -p stops errors if the directory already exists.
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
rm -rf $dir
echo "Overlay folder '$dir' has been removed."

View File

@ -5,6 +5,9 @@ SRC_DIR=$(pwd)
# Read the 'JOB_FACTOR' property from '.config'
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.
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
@ -31,7 +34,7 @@ echo "Configuring Dropbear..."
--prefix=$SRC_DIR/work/overlay/dropbear/dropbear_installed \
--disable-zlib \
--disable-loginfunc \
CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE"
CFLAGS="$CFLAGS"
echo "Building Dropbear..."
make -j $NUM_JOBS

View File

@ -5,6 +5,9 @@ SRC_DIR=$(pwd)
# Read the 'JOB_FACTOR' property from '.config'
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.
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
@ -32,7 +35,7 @@ echo "Configuring Links..."
--without-x
# 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..."
make -j $NUM_JOBS