Redesigned the overlay build process - now it is more flexible. Updated property read process - now only properties in the beginning of the line are used.

This commit is contained in:
Ivan Davidov 2016-05-20 21:28:54 +03:00
parent 4d1d176fbf
commit ad683263a6
17 changed files with 62 additions and 27 deletions

View File

@ -114,15 +114,23 @@ COPY_SOURCE_ROOTFS=true
# the property in order to disable it.
COPY_SOURCE_ISO=true
# This flag defines whether to build additional overlay software which will be
# placed in the 'work/src/minimal_overlay' folder. This software will be visible
# and fully usable after boot. The default is 'false'. Note that if you set this
# to 'true' and you are using sparse image file for the overlay structure then
# most probably something will go wrong because the additional overlay software
# This property defines one or more additional overlay software pieces which
# will be generated and placed in the 'work/src/minimal_overlay' folder. These
# software pieces will be visible and fully usable after boot. By default this
# property is disabled because the build process for all overlay software is
# host specific and may not work out of the box. Note that if you build any
# overlay software and you are using sparse image file for the overlay structure
# then most probably something will go wrong because the overlay software
# requires more than 1MB free space. The solution is to use folder overlay or to
# edit the script 'xx_generate_iso.sh' and set it to create sparse image file
# with bigger size.
BUILD_OVERLAY_SOFTWARE=false
#
# Currently available overlay software:
#
# links - text browser
# dropbear - SSH server and client
#
#OVERLAY_SOFTWARE=links,dropbear
# This property enables the standard penguin boot logo in the upper left corner
# of the screen. The property is used in 'xx_build_kernel.sh'. The default value

View File

@ -5,13 +5,13 @@ echo "*** GET KERNEL BEGIN ***"
SRC_DIR=$(pwd)
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=')
DOWNLOAD_URL=$(grep -i ^KERNEL_SOURCE_URL .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 .config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/$ARCHIVE_FILE ] ; then
echo "Source bundle $SRC_DIR/source/$ARCHIVE_FILE is missing and will be downloaded."

View File

@ -14,7 +14,7 @@ echo "Preparing kernel work area..."
make mrproper
# Read the 'USE_PREDEFINED_KERNEL_CONFIG' property from '.config'
USE_PREDEFINED_KERNEL_CONFIG="$(grep -i USE_PREDEFINED_KERNEL_CONFIG $SRC_DIR/.config | cut -f2 -d'=')"
USE_PREDEFINED_KERNEL_CONFIG="$(grep -i ^USE_PREDEFINED_KERNEL_CONFIG $SRC_DIR/.config | cut -f2 -d'=')"
if [ "$USE_PREDEFINED_KERNEL_CONFIG" = "true" -a ! -f $SRC_DIR/minimal_config/kernel.config ] ; then
echo "Config file $SRC_DIR/minimal_config/kernel.config does not exist."
@ -46,7 +46,7 @@ else
sed -i "s/.*CONFIG_FB_VESA.*/CONFIG_FB_VESA=y/" .config
# Read the 'USE_BOOT_LOGO' property from '.config'
USE_BOOT_LOGO="$(grep -i USE_BOOT_LOGO $SRC_DIR/.config | cut -f2 -d'=')"
USE_BOOT_LOGO="$(grep -i ^USE_BOOT_LOGO $SRC_DIR/.config | cut -f2 -d'=')"
if [ "$USE_BOOT_LOGO" = "true" ] ; then
sed -i "s/.*CONFIG_LOGO_LINUX_CLUT224.*/CONFIG_LOGO_LINUX_CLUT224=y/" .config

View File

@ -5,13 +5,13 @@ echo "*** GET GLIBC BEGIN ***"
SRC_DIR=$(pwd)
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i GLIBC_SOURCE_URL .config | cut -f2 -d'=')
DOWNLOAD_URL=$(grep -i ^GLIBC_SOURCE_URL .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 .config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/$ARCHIVE_FILE ] ; then
echo "Source bundle $SRC_DIR/source/$ARCHIVE_FILE is missing and will be downloaded."

View File

@ -5,13 +5,13 @@ echo "*** GET BUSYBOX BEGIN ***"
SRC_DIR=$(pwd)
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i BUSYBOX_SOURCE_URL .config | cut -f2 -d'=')
DOWNLOAD_URL=$(grep -i ^BUSYBOX_SOURCE_URL .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 .config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/$ARCHIVE_FILE ] ; then
echo "Source bundle $SRC_DIR/source/$ARCHIVE_FILE is missing and will be downloaded."

View File

@ -20,7 +20,7 @@ echo "Preparing BusyBox work area. This may take a while..."
make distclean
# Read the 'USE_PREDEFINED_BUSYBOX_CONFIG' property from '.config'
USE_PREDEFINED_BUSYBOX_CONFIG="$(grep -i USE_PREDEFINED_BUSYBOX_CONFIG $SRC_DIR/.config | cut -f2 -d'=')"
USE_PREDEFINED_BUSYBOX_CONFIG="$(grep -i ^USE_PREDEFINED_BUSYBOX_CONFIG $SRC_DIR/.config | cut -f2 -d'=')"
if [ "$USE_PREDEFINED_BUSYBOX_CONFIG" = "true" -a ! -f $SRC_DIR/minimal_config/busybox.config ] ; then
echo "Config file $SRC_DIR/minimal_config/busybox.config does not exist."

View File

@ -27,7 +27,7 @@ cd rootfs
rm -f linuxrc
# Read the 'COPY_SOURCE_ROOTFS' property from '.config'
COPY_SOURCE_ROOTFS="$(grep -i COPY_SOURCE_ROOTFS $SRC_ROOT/.config | cut -f2 -d'=')"
COPY_SOURCE_ROOTFS="$(grep -i ^COPY_SOURCE_ROOTFS $SRC_ROOT/.config | cut -f2 -d'=')"
if [ "$COPY_SOURCE_ROOTFS" = "true" ] ; then
# Copy all prepared source files and folders to '/src'. Note that the scripts

View File

@ -5,13 +5,13 @@ echo "*** GET SYSLINUX BEGIN ***"
SRC_DIR=$(pwd)
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i SYSLINUX_SOURCE_URL .config | cut -f2 -d'=')
DOWNLOAD_URL=$(grep -i ^SYSLINUX_SOURCE_URL .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 .config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $SRC_DIR/source/$ARCHIVE_FILE ] ; then
echo "Source bundle $SRC_DIR/source/$ARCHIVE_FILE is missing and will be downloaded."

View File

@ -29,7 +29,7 @@ mkdir work/isoimage
echo "Prepared new ISO image work area."
# Read the 'COPY_SOURCE_ISO' property from '.config'
COPY_SOURCE_ISO="$(grep -i COPY_SOURCE_ISO .config | cut -f2 -d'=')"
COPY_SOURCE_ISO="$(grep -i ^COPY_SOURCE_ISO .config | cut -f2 -d'=')"
if [ "$COPY_SOURCE_ISO" = "true" ] ; then
# Copy all prepared source files and folders to '/src'. Note that the scripts
@ -41,7 +41,7 @@ else
fi
# Read the 'BUILD_OVERLAY_SOFTWARE' property from '.config'
BUILD_OVERLAY_SOFTWARE="$(grep -i BUILD_OVERLAY_SOFTWARE .config | cut -f2 -d'=')"
BUILD_OVERLAY_SOFTWARE="$(grep -i ^BUILD_OVERLAY_SOFTWARE .config | cut -f2 -d'=')"
if [ "$BUILD_OVERLAY_SOFTWARE" = "true" ] ; then
echo "Generating additional overlay software. This may take a while..."
@ -64,7 +64,7 @@ cp $WORK_KERNEL_DIR/arch/x86/boot/bzImage ./kernel.xz
cp ../rootfs.cpio.xz ./rootfs.xz
# Read the 'OVERLAY_TYPE' property from '.config'
OVERLAY_TYPE="$(grep -i OVERLAY_TYPE $SRC_DIR/.config | cut -f2 -d'=')"
OVERLAY_TYPE="$(grep -i ^OVERLAY_TYPE $SRC_DIR/.config | cut -f2 -d'=')"
if [ "$OVERLAY_TYPE" = "sparse" -a "$(id -u)" = "0" ] ; then
# Use sparse file as storage place. The above check guarantees that the whole

View File

@ -1,8 +1,25 @@
#!/bin/sh
sh overlay_00_clean.sh
sh overlay_01_get_links.sh
sh overlay_02_build_links.sh
sh overlay_03_get_dropbear.sh
sh overlay_04_build_dropbear.sh
# Read the 'OVERLAY_SOFTWARE' property from '.config'
OVERLAY_SOFTWARE="$(grep -i ^OVERLAY_SOFTWARE .config | cut -f2 -d'=')"
if [ "$OVERLAY_SOFTWARE" = "" ] ; then
echo "There is no overlay software to build."
else
sh overlay_00_clean.sh
OVERLAY_PIECES="$(echo $OVERLAY_SOFTWARE | tr ',' ' ')"
for OVERLAY in $OVERLAY_PIECES
do
OVERLAY_SCRIPT=overlay_$OVERLAY.sh
if [ ! -f $OVERLAY_SCRIPT ] ; then
echo "Error - cannot find overlay script file '$OVERLAY_SCRIPT'."
else
echo "Building '$OVERLAY'..."
sh $OVERLAY_SCRIPT
fi
done
fi

View File

@ -20,7 +20,7 @@ for dir in $(ls -d */ 2>/dev/null) ; do
echo "Overlay folder '$dir' has been removed."
done
echo "Ready to continue building the overlay software."
echo "Ready to continue with the overlay software."
cd $SRC_DIR

5
src/overlay_dropbear.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
sh overlay_dropbear_01_get.sh
sh overlay_dropbear_02_build.sh

5
src/overlay_links.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
sh overlay_links_01_get.sh
sh overlay_links_02_build.sh