diff --git a/src/.config b/src/.config index d7d4f54ac..a7dba1f73 100644 --- a/src/.config +++ b/src/.config @@ -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 diff --git a/src/01_get_kernel.sh b/src/01_get_kernel.sh index b6cf209c2..8366f07d7 100755 --- a/src/01_get_kernel.sh +++ b/src/01_get_kernel.sh @@ -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." diff --git a/src/02_build_kernel.sh b/src/02_build_kernel.sh index 07a5d5a1e..5d2e09a0c 100755 --- a/src/02_build_kernel.sh +++ b/src/02_build_kernel.sh @@ -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 diff --git a/src/03_get_glibc.sh b/src/03_get_glibc.sh index 6bd042d77..c65fdb850 100755 --- a/src/03_get_glibc.sh +++ b/src/03_get_glibc.sh @@ -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." diff --git a/src/06_get_busybox.sh b/src/06_get_busybox.sh index dfe3b9e74..f1daa8e12 100755 --- a/src/06_get_busybox.sh +++ b/src/06_get_busybox.sh @@ -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." diff --git a/src/07_build_busybox.sh b/src/07_build_busybox.sh index 38e64075d..5a2fdf509 100755 --- a/src/07_build_busybox.sh +++ b/src/07_build_busybox.sh @@ -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." diff --git a/src/09_generate_rootfs.sh b/src/09_generate_rootfs.sh index 20e71aee9..e8485fe97 100755 --- a/src/09_generate_rootfs.sh +++ b/src/09_generate_rootfs.sh @@ -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 diff --git a/src/11_get_syslinux.sh b/src/11_get_syslinux.sh index f841f8cb0..baa8f3d1c 100755 --- a/src/11_get_syslinux.sh +++ b/src/11_get_syslinux.sh @@ -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." diff --git a/src/12_generate_iso.sh b/src/12_generate_iso.sh index 0c633770d..b44825459 100755 --- a/src/12_generate_iso.sh +++ b/src/12_generate_iso.sh @@ -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 diff --git a/src/build_minimal_linux_overlay.sh b/src/build_minimal_linux_overlay.sh index 4decfe703..c96cfe653 100755 --- a/src/build_minimal_linux_overlay.sh +++ b/src/build_minimal_linux_overlay.sh @@ -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 diff --git a/src/overlay_00_clean.sh b/src/overlay_00_clean.sh index a64ec0286..38c913a63 100755 --- a/src/overlay_00_clean.sh +++ b/src/overlay_00_clean.sh @@ -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 diff --git a/src/overlay_dropbear.sh b/src/overlay_dropbear.sh new file mode 100755 index 000000000..3e4f427b9 --- /dev/null +++ b/src/overlay_dropbear.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +sh overlay_dropbear_01_get.sh +sh overlay_dropbear_02_build.sh + diff --git a/src/overlay_03_get_dropbear.sh b/src/overlay_dropbear_01_get.sh similarity index 100% rename from src/overlay_03_get_dropbear.sh rename to src/overlay_dropbear_01_get.sh diff --git a/src/overlay_04_build_dropbear.sh b/src/overlay_dropbear_02_build.sh similarity index 100% rename from src/overlay_04_build_dropbear.sh rename to src/overlay_dropbear_02_build.sh diff --git a/src/overlay_links.sh b/src/overlay_links.sh new file mode 100755 index 000000000..7b8809f81 --- /dev/null +++ b/src/overlay_links.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +sh overlay_links_01_get.sh +sh overlay_links_02_build.sh + diff --git a/src/overlay_01_get_links.sh b/src/overlay_links_01_get.sh similarity index 100% rename from src/overlay_01_get_links.sh rename to src/overlay_links_01_get.sh diff --git a/src/overlay_02_build_links.sh b/src/overlay_links_02_build.sh similarity index 100% rename from src/overlay_02_build_links.sh rename to src/overlay_links_02_build.sh