Major refactoring - the overlay structure is now independet build subsystem. Tested on 32-bit, not tested on 64-bit.
This commit is contained in:
parent
acb5f0b617
commit
807e1b9bc0
@ -11,7 +11,7 @@
|
||||
#
|
||||
# http://kernel.org
|
||||
#
|
||||
KERNEL_SOURCE_URL=http://kernel.org/pub/linux/kernel/v4.x/linux-4.4.40.tar.xz
|
||||
KERNEL_SOURCE_URL=http://kernel.org/pub/linux/kernel/v4.x/linux-4.4.43.tar.xz
|
||||
|
||||
# You can find the latest GNU libc source bundles here:
|
||||
#
|
||||
@ -23,7 +23,7 @@ GLIBC_SOURCE_URL=http://ftp.gnu.org/gnu/glibc/glibc-2.24.tar.bz2
|
||||
#
|
||||
# http://busybox.net
|
||||
#
|
||||
BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.26.1.tar.bz2
|
||||
BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.26.2.tar.bz2
|
||||
|
||||
# You can find the latest Syslinux source bundles here:
|
||||
#
|
||||
@ -65,6 +65,7 @@ FELIX_SOURCE_URL=http://www-us.apache.org/dist/felix/org.apache.felix.main.distr
|
||||
# JAVA_ARCHIVE=/home/ivan/Downloads/jdk-8u102-linux-x64.tar.gz
|
||||
#
|
||||
#JAVA_ARCHIVE=/absolute/path/to/java.archive.tar.gz
|
||||
#JAVA_ARCHIVE=/home/ivan/Downloads/jdk-8u111-linux-i586.tar.gz
|
||||
|
||||
|
||||
|
||||
|
@ -53,7 +53,9 @@ OVERLAY_BUNDLES="$(grep -i ^OVERLAY_BUNDLES .config | cut -f2 -d'=')"
|
||||
|
||||
if [ ! "$OVERLAY_BUNDLES" = "" ] ; then
|
||||
echo "Generating additional overlay bundles. This may take a while..."
|
||||
time sh build_minimal_linux_overlay.sh
|
||||
cd minimal_overlay
|
||||
time sh overlay_build.sh
|
||||
cd $SRC_DIR
|
||||
else
|
||||
echo "Generation of additional overlay bundles has been skipped."
|
||||
fi
|
||||
@ -102,7 +104,7 @@ if [ "$OVERLAY_TYPE" = "sparse" -a "$(id -u)" = "0" ] ; then
|
||||
mkdir -p sparse/work
|
||||
|
||||
# Copy the overlay content.
|
||||
cp -r $SRC_DIR/work/src/minimal_overlay/* sparse/rootfs/
|
||||
cp -r $SRC_DIR/work/src/minimal_overlay/rootfs/* sparse/rootfs/
|
||||
|
||||
# Unmount the sparse file and delete the temporary folder.
|
||||
$BUSYBOX umount sparse
|
||||
@ -119,7 +121,8 @@ elif [ "$OVERLAY_TYPE" = "folder" ] ; then
|
||||
mkdir -p minimal/rootfs
|
||||
mkdir -p minimal/work
|
||||
|
||||
cp -rf $SRC_DIR/work/src/minimal_overlay/* minimal/rootfs/
|
||||
cp -rf $SRC_DIR/work/src/minimal_overlay/rootfs/* \
|
||||
minimal/rootfs/
|
||||
else
|
||||
echo "Generating ISO image with no overlay structure..."
|
||||
fi
|
||||
|
@ -18,7 +18,7 @@ clean:
|
||||
@echo "Removing predefined configuration files..."
|
||||
@rm -rf minimal_overlay/*.config
|
||||
@echo "Removing source level overlay software..."
|
||||
@cd minimal_overlay && rm -rf $(shell ls -d */) && cd ..
|
||||
@cd minimal_overlay/rootfs && rm -rf $(shell ls -d */) && cd ..
|
||||
@echo "Removing build log file..."
|
||||
@rm -f minimal_linux_live.log
|
||||
@$(eval USE_LOCAL_SOURCE := $(shell grep -i ^USE_LOCAL_SOURCE .config | cut -f2 -d'='))
|
||||
|
@ -1,25 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Read the 'OVERLAY_BUNDLES' property from '.config'
|
||||
OVERLAY_BUNDLES="$(grep -i ^OVERLAY_BUNDLES .config | cut -f2 -d'=')"
|
||||
|
||||
if [ "$OVERLAY_BUNDLES" = "" ] ; then
|
||||
echo "There are no overlay bundles to build."
|
||||
else
|
||||
time sh overlay_00_clean.sh
|
||||
|
||||
OVERLAY_BUNDLES_LIST="$(echo $OVERLAY_BUNDLES | tr ',' ' ')"
|
||||
|
||||
for BUNDLE in $OVERLAY_BUNDLES_LIST
|
||||
do
|
||||
OVERLAY_SCRIPT=overlay_$BUNDLE.sh
|
||||
|
||||
if [ ! -f $OVERLAY_SCRIPT ] ; then
|
||||
echo "Error - cannot find overlay script file '$OVERLAY_SCRIPT'."
|
||||
else
|
||||
echo "Building overlay bundle '$BUNDLE'..."
|
||||
time sh $OVERLAY_SCRIPT
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
@ -1,12 +0,0 @@
|
||||
|
||||
This file is located in the folder 'minimal_overlay'. You can use this folder to
|
||||
put your own content (files and folders) which will be visible in the root
|
||||
folder of your 'Minimal Linux Live' system, just like this file is visible. The
|
||||
files/folders will override the content in the root folder, so be careful what
|
||||
you put there because you may end up with broken system. If the boot media is
|
||||
writeable, then all changes on the root file system are persisted automatically,
|
||||
so be very careful what you do when you use the overlay support.
|
||||
|
||||
Check the '.config' file in the source folder for more details on the overlay
|
||||
options and how to use them.
|
||||
|
@ -2,28 +2,33 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
# Grab everything after the '=' character.
|
||||
DOWNLOAD_URL=$(grep -i DROPBEAR_SOURCE_URL .config | cut -f2 -d'=')
|
||||
DOWNLOAD_URL=$(grep -i DROPBEAR_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
|
||||
|
||||
# Grab everything after the last '/' character.
|
||||
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
|
||||
|
||||
# Read the 'USE_LOCAL_SOURCE' property from '.config'
|
||||
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE .config | cut -f2 -d'=')"
|
||||
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
|
||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
|
||||
echo "Source bundle $SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
|
||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
|
||||
echo "Source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
|
||||
USE_LOCAL_SOURCE="false"
|
||||
fi
|
||||
|
||||
cd source/overlay
|
||||
cd $MAIN_SRC_DIR/source/overlay
|
||||
|
||||
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
|
||||
# Downloading Dropbear source bundle file. The '-c' option allows the download to resume.
|
||||
echo "Downloading Links source bundle from $DOWNLOAD_URL"
|
||||
wget -c $DOWNLOAD_URL
|
||||
else
|
||||
echo "Using local Dropbear source bundle $SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||
echo "Using local Dropbear source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||
fi
|
||||
|
||||
# Delete folder with previously extracted Dropbear.
|
@ -2,11 +2,16 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
# Read the 'JOB_FACTOR' property from '.config'
|
||||
JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
|
||||
JOB_FACTOR="$(grep -i ^JOB_FACTOR $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
|
||||
# Read the 'CFLAGS' property from '.config'
|
||||
CFLAGS="$(grep -i ^CFLAGS .config | cut -f2 -d'=')"
|
||||
CFLAGS="$(grep -i ^CFLAGS $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
|
||||
# Find the number of available CPU cores.
|
||||
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
|
||||
@ -14,12 +19,12 @@ NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
|
||||
# Calculate the number of 'make' jobs to be used later.
|
||||
NUM_JOBS=$((NUM_CORES * JOB_FACTOR))
|
||||
|
||||
if [ ! -d $SRC_DIR/work/glibc/glibc_prepared ] ; then
|
||||
if [ ! -d $MAIN_SRC_DIR/work/glibc/glibc_prepared ] ; then
|
||||
echo "Cannot continue - Dropbear SSH depends on GLIBC. Please buld GLIBC first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd work/overlay/dropbear
|
||||
cd $MAIN_SRC_DIR/work/overlay/dropbear
|
||||
|
||||
# Change to the Dropbear source directory which ls finds, e.g. 'dropbear-2016.73'.
|
||||
cd $(ls -d dropbear-*)
|
||||
@ -31,7 +36,7 @@ rm -rf ../dropbear_installed
|
||||
|
||||
echo "Configuring Dropbear..."
|
||||
./configure \
|
||||
--prefix=$SRC_DIR/work/overlay/dropbear/dropbear_installed \
|
||||
--prefix=$MAIN_SRC_DIR/work/overlay/dropbear/dropbear_installed \
|
||||
--disable-zlib \
|
||||
--disable-loginfunc \
|
||||
CFLAGS="$CFLAGS"
|
||||
@ -45,10 +50,10 @@ make install -j $NUM_JOBS
|
||||
mkdir -p ../dropbear_installed/lib
|
||||
|
||||
# Copy all dependent GLIBC libraries.
|
||||
cp $SRC_DIR/work/glibc/glibc_prepared/lib/libnsl.so.1 ../dropbear_installed/lib
|
||||
cp $SRC_DIR/work/glibc/glibc_prepared/lib/libnss_compat.so.2 ../dropbear_installed/lib
|
||||
cp $SRC_DIR/work/glibc/glibc_prepared/lib/libutil.so.1 ../dropbear_installed/lib
|
||||
cp $SRC_DIR/work/glibc/glibc_prepared/lib/libcrypt.so.1 ../dropbear_installed/lib
|
||||
cp $MAIN_SRC_DIR/work/glibc/glibc_prepared/lib/libnsl.so.1 ../dropbear_installed/lib
|
||||
cp $MAIN_SRC_DIR/work/glibc/glibc_prepared/lib/libnss_compat.so.2 ../dropbear_installed/lib
|
||||
cp $MAIN_SRC_DIR/work/glibc/glibc_prepared/lib/libutil.so.1 ../dropbear_installed/lib
|
||||
cp $MAIN_SRC_DIR/work/glibc/glibc_prepared/lib/libcrypt.so.1 ../dropbear_installed/lib
|
||||
|
||||
mkdir -p ../dropbear_installed/etc/dropbear
|
||||
|
||||
@ -97,7 +102,7 @@ cp -r \
|
||||
../dropbear_installed/bin \
|
||||
../dropbear_installed/sbin \
|
||||
../dropbear_installed/lib \
|
||||
$SRC_DIR/work/src/minimal_overlay
|
||||
$MAIN_SRC_DIR/work/src/minimal_overlay/rootfs
|
||||
|
||||
echo "Dropbear has been installed."
|
||||
|
9
src/minimal_overlay/bundles/dropbear/bundle.sh
Executable file
9
src/minimal_overlay/bundles/dropbear/bundle.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
time sh 01_get.sh
|
||||
time sh 02_build.sh
|
||||
|
||||
cd $SRC_DIR
|
||||
|
@ -2,28 +2,33 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
# Grab everything after the '=' character.
|
||||
DOWNLOAD_URL=$(grep -i FELIX_SOURCE_URL .config | cut -f2 -d'=')
|
||||
DOWNLOAD_URL=$(grep -i FELIX_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
|
||||
|
||||
# Grab everything after the last '/' character.
|
||||
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
|
||||
|
||||
# Read the 'USE_LOCAL_SOURCE' property from '.config'
|
||||
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE .config | cut -f2 -d'=')"
|
||||
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
|
||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
|
||||
echo "Source bundle $SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
|
||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
|
||||
echo "Source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
|
||||
USE_LOCAL_SOURCE="false"
|
||||
fi
|
||||
|
||||
cd source/overlay
|
||||
cd $MAIN_SRC_DIR/source/overlay
|
||||
|
||||
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
|
||||
# Downloading Apache Felix source bundle file. The '-c' option allows the download to resume.
|
||||
echo "Downloading Apache Felix source bundle from $DOWNLOAD_URL"
|
||||
wget -c $DOWNLOAD_URL
|
||||
else
|
||||
echo "Using local Apache Felix source bundle $SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||
echo "Using local Apache Felix source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||
fi
|
||||
|
||||
# Delete folder with previously extracted Felix.
|
40
src/minimal_overlay/bundles/felix/02_install.sh
Executable file
40
src/minimal_overlay/bundles/felix/02_install.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
echo "Removing old Apache Felix artifacts. This may take a while..."
|
||||
rm -rf $MAIN_SRC_DIR/work/overlay/felix/felix_installed
|
||||
mkdir -p $MAIN_SRC_DIR/work/overlay/felix/felix_installed/opt/felix
|
||||
mkdir -p $MAIN_SRC_DIR/work/overlay/felix/felix_installed/bin
|
||||
|
||||
cd $MAIN_SRC_DIR/work/overlay/felix
|
||||
cd $(ls -d felix-*)
|
||||
|
||||
cat << CEOF > bin/felix-start.sh
|
||||
#!/bin/sh
|
||||
|
||||
cd /opt/felix
|
||||
java -jar bin/felix.jar
|
||||
|
||||
CEOF
|
||||
|
||||
chmod +rx bin/felix-start.sh
|
||||
|
||||
cp -r * $MAIN_SRC_DIR/work/overlay/felix/felix_installed/opt/felix
|
||||
|
||||
cd $MAIN_SRC_DIR/work/overlay/felix/felix_installed
|
||||
|
||||
ln -s ../opt/felix/bin/felix-start.sh bin/felix-start
|
||||
|
||||
cp -r $MAIN_SRC_DIR/work/overlay/felix/felix_installed/* \
|
||||
$MAIN_SRC_DIR/work/src/minimal_overlay/rootfs
|
||||
|
||||
echo "Apache Felix has been installed."
|
||||
|
||||
cd $SRC_DIR
|
||||
|
9
src/minimal_overlay/bundles/felix/bundle.sh
Executable file
9
src/minimal_overlay/bundles/felix/bundle.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
time sh 01_get.sh
|
||||
time sh 02_install.sh
|
||||
|
||||
cd $SRC_DIR
|
||||
|
@ -2,21 +2,26 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
if [ ! -d $SRC_DIR/work/glibc/glibc_prepared ] ; then
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
if [ ! -d $MAIN_SRC_DIR/work/glibc/glibc_prepared ] ; then
|
||||
echo "Cannot continue - GLIBC is missing. Please buld GLIBC first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Preparing the overlay glibc folder. This may take a while..."
|
||||
rm -rf work/overlay/glibc
|
||||
mkdir -p work/overlay/glibc/lib
|
||||
rm -rf $MAIN_SRC_DIR/work/overlay/glibc
|
||||
mkdir -p $MAIN_SRC_DIR/work/overlay/glibc/lib
|
||||
|
||||
cd work/glibc/glibc_prepared/lib
|
||||
cd $MAIN_SRC_DIR/work/glibc/glibc_prepared/lib
|
||||
|
||||
find . -type l -exec cp {} $SRC_DIR/work/overlay/glibc/lib \;
|
||||
find . -type l -exec cp {} $MAIN_SRC_DIR/work/overlay/glibc/lib \;
|
||||
echo "All libraries have been copied."
|
||||
|
||||
cd $SRC_DIR/work/overlay/glibc/lib
|
||||
cd $MAIN_SRC_DIR/work/overlay/glibc/lib
|
||||
|
||||
for FILE_DEL in $(ls *.so)
|
||||
do
|
||||
@ -33,8 +38,10 @@ echo "Duplicate libraries have been replaced with soft links."
|
||||
strip -g *
|
||||
echo "All libraries have been optimized for size."
|
||||
|
||||
cp -r $SRC_DIR/work/overlay/glibc/lib $SRC_DIR/work/src/minimal_overlay
|
||||
echo "All libraries have been installed."
|
||||
cp -r $MAIN_SRC_DIR/work/overlay/glibc/lib \
|
||||
$MAIN_SRC_DIR/work/src/minimal_overlay/rootfs
|
||||
|
||||
echo "All GNU C libraries have been installed."
|
||||
|
||||
cd $SRC_DIR
|
||||
|
@ -18,8 +18,13 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
# Read the 'JAVA_ARCHIVE' property from '.config'
|
||||
JAVA_ARCHIVE="$(grep -i ^JAVA_ARCHIVE .config | cut -f2 -d'=')"
|
||||
JAVA_ARCHIVE="$(grep -i ^JAVA_ARCHIVE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
|
||||
if [ "$JAVA_ARCHIVE" = "" ] ; then
|
||||
echo "ERROR: configuration property 'JAVA_ARCHIVE' is not set."
|
||||
@ -29,24 +34,25 @@ elif [ ! -f "$JAVA_ARCHIVE" ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf $SRC_DIR/work/overlay/java
|
||||
mkdir -p $SRC_DIR/work/overlay/java/opt
|
||||
rm -rf $MAIN_SRC_DIR/work/overlay/java
|
||||
mkdir -p $MAIN_SRC_DIR/work/overlay/java/opt
|
||||
|
||||
tar -xvf \
|
||||
$JAVA_ARCHIVE \
|
||||
-C $SRC_DIR/work/overlay/java/opt
|
||||
-C $MAIN_SRC_DIR/work/overlay/java/opt
|
||||
|
||||
cd $SRC_DIR/work/overlay/java/opt
|
||||
cd $MAIN_SRC_DIR/work/overlay/java/opt
|
||||
mv $(ls -d *) java
|
||||
|
||||
mkdir $SRC_DIR/work/overlay/java/bin
|
||||
mkdir $MAIN_SRC_DIR/work/overlay/java/bin
|
||||
|
||||
for FILE in $(ls java/bin)
|
||||
do
|
||||
ln -s ../opt/java/bin/$FILE ../bin/$FILE
|
||||
done
|
||||
|
||||
cp -r $SRC_DIR/work/overlay/java/* $SRC_DIR/work/src/minimal_overlay
|
||||
cp -r $MAIN_SRC_DIR/work/overlay/java/* \
|
||||
$MAIN_SRC_DIR/work/src/minimal_overlay/rootfs
|
||||
|
||||
echo "Java has been installed."
|
||||
|
@ -2,28 +2,33 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
# Grab everything after the '=' character.
|
||||
DOWNLOAD_URL=$(grep -i LINKS_SOURCE_URL .config | cut -f2 -d'=')
|
||||
DOWNLOAD_URL=$(grep -i LINKS_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
|
||||
|
||||
# Grab everything after the last '/' character.
|
||||
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
|
||||
|
||||
# Read the 'USE_LOCAL_SOURCE' property from '.config'
|
||||
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE .config | cut -f2 -d'=')"
|
||||
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
|
||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
|
||||
echo "Source bundle $SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
|
||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
|
||||
echo "Source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
|
||||
USE_LOCAL_SOURCE="false"
|
||||
fi
|
||||
|
||||
cd source/overlay
|
||||
cd $MAIN_SRC_DIR/source/overlay
|
||||
|
||||
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
|
||||
# Downloading Links source bundle file. The '-c' option allows the download to resume.
|
||||
echo "Downloading Links source bundle from $DOWNLOAD_URL"
|
||||
wget -c $DOWNLOAD_URL
|
||||
else
|
||||
echo "Using local Links source bundle $SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||
echo "Using local Links source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||
fi
|
||||
|
||||
# Delete folder with previously extracted Links.
|
@ -2,11 +2,16 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
# Read the 'JOB_FACTOR' property from '.config'
|
||||
JOB_FACTOR="$(grep -i ^JOB_FACTOR .config | cut -f2 -d'=')"
|
||||
JOB_FACTOR="$(grep -i ^JOB_FACTOR $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
|
||||
# Read the 'CFLAGS' property from '.config'
|
||||
CFLAGS="$(grep -i ^CFLAGS .config | cut -f2 -d'=')"
|
||||
CFLAGS="$(grep -i ^CFLAGS $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
|
||||
# Find the number of available CPU cores.
|
||||
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
|
||||
@ -14,7 +19,7 @@ NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
|
||||
# Calculate the number of 'make' jobs to be used later.
|
||||
NUM_JOBS=$((NUM_CORES * JOB_FACTOR))
|
||||
|
||||
cd work/overlay/links
|
||||
cd $MAIN_SRC_DIR/work/overlay/links
|
||||
|
||||
# Change to the Links source directory which ls finds, e.g. 'links-2.12'.
|
||||
cd $(ls -d links-*)
|
||||
@ -46,7 +51,9 @@ make install -j $NUM_JOBS
|
||||
echo "Reducing Links size..."
|
||||
strip -g ../links_installed/bin/* 2>/dev/null
|
||||
|
||||
cp -r ../links_installed/bin $SRC_DIR/work/src/minimal_overlay
|
||||
cp -r ../links_installed/bin \
|
||||
$MAIN_SRC_DIR/work/src/minimal_overlay/rootfs
|
||||
|
||||
echo "Links has been installed."
|
||||
|
||||
cd $SRC_DIR
|
9
src/minimal_overlay/bundles/links/bundle.sh
Executable file
9
src/minimal_overlay/bundles/links/bundle.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
time sh 01_get.sh
|
||||
time sh 02_build.sh
|
||||
|
||||
cd $SRC_DIR
|
||||
|
@ -2,9 +2,14 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
echo "Preparing the Minimal Linux Live utilities folder. This may take a while..."
|
||||
rm -rf work/overlay/mll_utils
|
||||
mkdir -p work/overlay/mll_utils/sbin
|
||||
rm -rf $MAIN_SRC_DIR/work/overlay/mll_utils
|
||||
mkdir -p $MAIN_SRC_DIR/work/overlay/mll_utils/sbin
|
||||
|
||||
echo "Miminal Linux Live utilities folder has been prepared."
|
||||
|
@ -2,12 +2,17 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
if [ ! -d "$SRC_DIR/work/overlay/mll_utils" ] ; then
|
||||
echo "The directory $SRC_DIR/work/overlay/mll_utils does not exist. Cannot continue."
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
if [ ! -d "$MAIN_SRC_DIR/work/overlay/mll_utils" ] ; then
|
||||
echo "The directory $MAIN_SRC_DIR/work/overlay/mll_utils does not exist. Cannot continue."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd work/overlay/mll_utils
|
||||
cd $MAIN_SRC_DIR/work/overlay/mll_utils
|
||||
|
||||
# 'mll-disk-erase' BEGIN
|
||||
|
@ -2,12 +2,17 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
if [ ! -d "$SRC_DIR/work/overlay/mll_utils" ] ; then
|
||||
echo "The directory $SRC_DIR/work/overlay/mll_utils does not exist. Cannot continue."
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
if [ ! -d "$MAIN_SRC_DIR/work/overlay/mll_utils" ] ; then
|
||||
echo "The directory $MAIN_SRC_DIR/work/overlay/mll_utils does not exist. Cannot continue."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd work/overlay/mll_utils
|
||||
cd $MAIN_SRC_DIR/work/overlay/mll_utils
|
||||
|
||||
# 'mll-install' BEGIN
|
||||
|
||||
@ -97,28 +102,30 @@ chmod +rx sbin/mll-install
|
||||
|
||||
# 'mll-install' END
|
||||
|
||||
if [ ! -d "$SRC_DIR/work/syslinux" ] ; then
|
||||
if [ ! -d "$MAIN_SRC_DIR/work/syslinux" ] ; then
|
||||
echo "The installer depends on Syslinux which is missing. Cannot continue."
|
||||
exit 1
|
||||
fi;
|
||||
|
||||
cd $SRC_DIR/work/syslinux
|
||||
cd $MAIN_SRC_DIR/work/syslinux
|
||||
cd $(ls -d syslinux-*)
|
||||
|
||||
cp bios/extlinux/extlinux \
|
||||
$SRC_DIR/work/overlay/mll_utils/sbin
|
||||
mkdir -p $SRC_DIR/work/overlay/mll_utils/opt/syslinux
|
||||
$MAIN_SRC_DIR/work/overlay/mll_utils/sbin
|
||||
mkdir -p $MAIN_SRC_DIR/work/overlay/mll_utils/opt/syslinux
|
||||
cp bios/mbr/mbr.bin \
|
||||
$SRC_DIR/work/overlay/mll_utils/opt/syslinux
|
||||
$MAIN_SRC_DIR/work/overlay/mll_utils/opt/syslinux
|
||||
|
||||
# Big mama hack - find workaround and remove it!!!
|
||||
# Big mama hack - need to find proper workaround!!!
|
||||
# Both syslinux and extlinux are 32-bit executables which require 32-bit libs.
|
||||
mkdir -p $SRC_DIR/work/overlay/mll_utils/lib
|
||||
mkdir -p $SRC_DIR/work/overlay/mll_utils/usr/lib
|
||||
# Possible solution 1 - build 32-bit GLIBC on demand.
|
||||
# Possible solution 2 - drop 32-bit MLL and provide 64-bit with multi-arch.
|
||||
mkdir -p $MAIN_SRC_DIR/work/overlay/mll_utils/lib
|
||||
mkdir -p $MAIN_SRC_DIR/work/overlay/mll_utils/usr/lib
|
||||
cp /lib/ld-linux.so.2 \
|
||||
$SRC_DIR/work/overlay/mll_utils/lib
|
||||
$MAIN_SRC_DIR/work/overlay/mll_utils/lib
|
||||
cp /lib/i386-linux-gnu/libc.so.6 \
|
||||
$SRC_DIR/work/overlay/mll_utils/usr/lib
|
||||
$MAIN_SRC_DIR/work/overlay/mll_utils/usr/lib
|
||||
# Big mama hack - end.
|
||||
|
||||
echo "Minimal Linux Live installer has been generated."
|
22
src/minimal_overlay/bundles/mll_utils/04_install.sh
Executable file
22
src/minimal_overlay/bundles/mll_utils/04_install.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
if [ ! -d "$MAIN_SRC_DIR/work/overlay/mll_utils" ] ; then
|
||||
echo "The directory $MAIN_SRC_DIR/work/overlay/mll_utils does not exist. Cannot continue."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Copy all generated files to the source overlay folder.
|
||||
cp -r $MAIN_SRC_DIR/work/overlay/mll_utils/* \
|
||||
$MAIN_SRC_DIR/work/src/minimal_overlay/rootfs
|
||||
|
||||
echo "All MLL utilities have been installed."
|
||||
|
||||
cd $SRC_DIR
|
||||
|
11
src/minimal_overlay/bundles/mll_utils/bundle.sh
Executable file
11
src/minimal_overlay/bundles/mll_utils/bundle.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
time sh 01_prepare.sh
|
||||
time sh 02_disk_erase.sh
|
||||
time sh 03_installer.sh
|
||||
time sh 04_install.sh
|
||||
|
||||
cd $SRC_DIR
|
||||
|
51
src/minimal_overlay/overlay_build.sh
Executable file
51
src/minimal_overlay/overlay_build.sh
Executable file
@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
if [ "$1" = "" ] ; then
|
||||
# Read the 'OVERLAY_BUNDLES' property from '.config'
|
||||
OVERLAY_BUNDLES="$(grep -i ^OVERLAY_BUNDLES $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
else
|
||||
OVERLAY_BUNDLES=$1
|
||||
fi
|
||||
|
||||
if [ "$OVERLAY_BUNDLES" = "" ] ; then
|
||||
echo "There are no overlay bundles to build."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
time sh overlay_clean.sh
|
||||
|
||||
BUNDLES_LIST="$(echo $OVERLAY_BUNDLES | tr ',' ' ')"
|
||||
|
||||
for BUNDLE in $BUNDLES_LIST
|
||||
do
|
||||
BUNDLE_DIR=$SRC_DIR/bundles/$BUNDLE
|
||||
|
||||
if [ ! -d $BUNDLE_DIR ] ; then
|
||||
echo "Error - cannot find overlay bundle directory '$BUNDLE_DIR'."
|
||||
continue
|
||||
fi
|
||||
|
||||
BUNDLE_SCRIPT=$BUNDLE_DIR/bundle.sh
|
||||
|
||||
if [ ! -f $BUNDLE_SCRIPT ] ; then
|
||||
echo "Error - cannot find overlay bundle script file '$BUNDLE_SCRIPT'."
|
||||
continue
|
||||
fi
|
||||
|
||||
cd $BUNDLE_DIR
|
||||
|
||||
echo "Building overlay bundle '$BUNDLE'..."
|
||||
time sh $BUNDLE_SCRIPT
|
||||
|
||||
cd $SRC_DIR
|
||||
done
|
||||
|
||||
cd $SRC_DIR
|
||||
|
@ -3,17 +3,16 @@
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
echo "Cleaning up the overlay work area. This may take a while..."
|
||||
rm -rf work/overlay
|
||||
mkdir -p work/overlay
|
||||
|
||||
mkdir -p work/src/minimal_overlay
|
||||
rm -rf ../work/overlay
|
||||
|
||||
# -p stops errors if the directory already exists.
|
||||
mkdir -p source/overlay
|
||||
mkdir -p ../work/overlay
|
||||
mkdir -p ../work/src/minimal_overlay/rootfs
|
||||
mkdir -p ../source/overlay
|
||||
|
||||
cd work/src/minimal_overlay
|
||||
cd ../work/src/minimal_overlay/rootfs
|
||||
|
||||
# Remove all previously prepared overlay artifacts.
|
||||
# Remove all previously generated overlay artifacts.
|
||||
for dir in $(ls -d */ 2>/dev/null) ; do
|
||||
rm -rf $dir
|
||||
echo "Overlay folder '$dir' has been removed."
|
13
src/minimal_overlay/rootfs/README
Normal file
13
src/minimal_overlay/rootfs/README
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
This file is located in the folder 'minimal_overlay/rootfs'.
|
||||
You can use this folder to put your own content (files and folders) which will
|
||||
be visible in the root folder of your 'Minimal Linux Live' system, just like
|
||||
this file is visible. The files/folders will override the content in the root
|
||||
folder, so be careful what you put there because you may end up with broken
|
||||
system. If the boot media is writeable, then all changes on the root file system
|
||||
are persisted automatically, so be very careful what you do when you use the
|
||||
overlay support.
|
||||
|
||||
Check the '.config' file in the source folder for more details on the overlay
|
||||
options and how to use them.
|
||||
|
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
time sh overlay_dropbear_01_get.sh
|
||||
time sh overlay_dropbear_02_build.sh
|
||||
|
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
time sh overlay_felix_01_get.sh
|
||||
time sh overlay_felix_02_install.sh
|
||||
|
@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
echo "Removing old Apache Felix artifacts. This may take a while..."
|
||||
rm -rf $SRC_DIR/work/overlay/felix/felix_installed
|
||||
mkdir -p $SRC_DIR/work/overlay/felix/felix_installed/opt/felix
|
||||
mkdir -p $SRC_DIR/work/overlay/felix/felix_installed/bin
|
||||
|
||||
cd $SRC_DIR/work/overlay/felix
|
||||
cd $(ls -d felix-*)
|
||||
|
||||
cat << CEOF > bin/felix-start.sh
|
||||
#!/bin/sh
|
||||
|
||||
cd /opt/felix
|
||||
java -jar bin/felix.jar
|
||||
|
||||
CEOF
|
||||
|
||||
chmod +rx bin/felix-start.sh
|
||||
|
||||
cp -r * $SRC_DIR/work/overlay/felix/felix_installed/opt/felix
|
||||
|
||||
cd $SRC_DIR/work/overlay/felix/felix_installed
|
||||
|
||||
ln -s ../opt/felix/bin/felix-start.sh bin/felix-start
|
||||
|
||||
cp -r $SRC_DIR/work/overlay/felix/felix_installed/* \
|
||||
$SRC_DIR/work/src/minimal_overlay
|
||||
|
||||
echo "Apache Felix has been installed."
|
||||
|
||||
cd $SRC_DIR
|
||||
|
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
time sh overlay_links_01_get.sh
|
||||
time sh overlay_links_02_build.sh
|
||||
|
@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
time sh overlay_mll_utils_01_prepare.sh
|
||||
time sh overlay_mll_utils_02_disk_erase.sh
|
||||
time sh overlay_mll_utils_03_installer.sh
|
||||
time sh overlay_mll_utils_04_install.sh
|
||||
|
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
if [ ! -d "$SRC_DIR/work/overlay/mll_utils" ] ; then
|
||||
echo "The directory $SRC_DIR/work/overlay/mll_utils does not exist. Cannot continue."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Copy all generated files to the source overlay folder.
|
||||
cp -r $SRC_DIR/work/overlay/mll_utils/* \
|
||||
$SRC_DIR/work/src/minimal_overlay
|
||||
|
||||
echo "All utilities have been installed."
|
||||
|
||||
cd $SRC_DIR
|
||||
|
Loading…
x
Reference in New Issue
Block a user