diff --git a/src/.config b/src/.config index ea70c9528..4ed4292ea 100644 --- a/src/.config +++ b/src/.config @@ -164,6 +164,7 @@ OVERLAY_TYPE=folder # nweb - simple mini http server. # openjdk - installs Open JDK. All operations are automated. # python - Python3 scripting support (pip and packages optional). +# screen - GNU screen utility to interact with VT100 terminals # static_get - portable binaries for Linux (http://s.minos.io). # stress - CPU and RAM load generator. # util_linux - executable utilities distributed by the Linux Kernel org. diff --git a/src/minimal_overlay/bundles/screen/.config b/src/minimal_overlay/bundles/screen/.config new file mode 100644 index 000000000..a9e700ca6 --- /dev/null +++ b/src/minimal_overlay/bundles/screen/.config @@ -0,0 +1,5 @@ +# You can find the latest screen source bundles here: +# +# https://www.gnu.org/software/screen/ +# +SCREEN_SOURCE_URL=https://ftp.gnu.org/gnu/screen/screen-4.8.0.tar.gz diff --git a/src/minimal_overlay/bundles/screen/01_get.sh b/src/minimal_overlay/bundles/screen/01_get.sh new file mode 100755 index 000000000..c394c305d --- /dev/null +++ b/src/minimal_overlay/bundles/screen/01_get.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +# Read the common configuration properties. +DOWNLOAD_URL=`read_property SCREEN_SOURCE_URL` +USE_LOCAL_SOURCE=`read_property USE_LOCAL_SOURCE` + +# Grab everything after the last '/' character. +ARCHIVE_FILE=${DOWNLOAD_URL##*/} + +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 $MAIN_SRC_DIR/source/overlay + +if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then + # Downloading screen source bundle file. The '-c' option allows the download to resume. + echo "Downloading screen source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local screen source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted screen. +echo "Removing screen work area. This may take a while." +rm -rf $WORK_DIR/overlay/$BUNDLE_NAME +mkdir $WORK_DIR/overlay/$BUNDLE_NAME + +# Extract screen to folder 'work/overlay/screen'. +# Full path will be something like 'work/overlay/screen/screen-4.8.0'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/$BUNDLE_NAME + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/screen/02_build.sh b/src/minimal_overlay/bundles/screen/02_build.sh new file mode 100755 index 000000000..6c11622c2 --- /dev/null +++ b/src/minimal_overlay/bundles/screen/02_build.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +cd $WORK_DIR/overlay/$BUNDLE_NAME + +# Change to the screen source directory which ls finds, e.g. 'screen-4.8.0'. +cd $(ls -d screen-*) + +if [ -f Makefile ] ; then + echo "Preparing '$BUNDLE_NAME' work area. This may take a while." + make -j $NUM_JOBS clean +else + echo "The clean phase for '$BUNDLE_NAME' has been skipped." +fi + +rm -rf $DEST_DIR + +echo "Configuring '$BUNDLE_NAME'." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr + +echo "Building '$BUNDLE_NAME'." +make -j $NUM_JOBS + +echo "Installing '$BUNDLE_NAME'." +make -j $NUM_JOBS install DESTDIR=$DEST_DIR + +echo "Reducing '$BUNDLE_NAME' size." +set +e +strip -g $DEST_DIR/usr/bin/* +set -e + +# With '--remove-destination' all possibly existing soft links in +# '$OVERLAY_ROOTFS' will be overwritten correctly. +cp -r --remove-destination $DEST_DIR/* \ + $OVERLAY_ROOTFS + +echo "Bundle '$BUNDLE_NAME' has been installed." + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/screen/bundle.sh b/src/minimal_overlay/bundles/screen/bundle.sh new file mode 100755 index 000000000..e132bc25f --- /dev/null +++ b/src/minimal_overlay/bundles/screen/bundle.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +./01_get.sh +./02_build.sh + +cd $SRC_DIR