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/ncurses/02_build.sh b/src/minimal_overlay/bundles/ncurses/02_build.sh index f1ad8ea88..6db401188 100755 --- a/src/minimal_overlay/bundles/ncurses/02_build.sh +++ b/src/minimal_overlay/bundles/ncurses/02_build.sh @@ -30,6 +30,7 @@ CFLAGS="$CFLAGS" ./configure \ --with-default-terminfo-dirs=/lib/terminfo \ --without-normal \ --without-debug \ + --without-ada \ --without-cxx-binding \ --with-abi-version=6 \ --enable-widec \ diff --git a/src/minimal_overlay/bundles/passwd/.config b/src/minimal_overlay/bundles/passwd/.config new file mode 100644 index 000000000..e69de29bb diff --git a/src/minimal_overlay/bundles/passwd/01_create.sh b/src/minimal_overlay/bundles/passwd/01_create.sh new file mode 100755 index 000000000..e2c21f27e --- /dev/null +++ b/src/minimal_overlay/bundles/passwd/01_create.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +mkdir -p $DEST_DIR/etc +echo 'root::0:0:Superuser:/:/bin/sh' > $DEST_DIR/etc/passwd + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/passwd/02_install.sh b/src/minimal_overlay/bundles/passwd/02_install.sh new file mode 100755 index 000000000..76f139c8a --- /dev/null +++ b/src/minimal_overlay/bundles/passwd/02_install.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +# 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/passwd/bundle.sh b/src/minimal_overlay/bundles/passwd/bundle.sh new file mode 100755 index 000000000..6de9d4e15 --- /dev/null +++ b/src/minimal_overlay/bundles/passwd/bundle.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +. ../../common.sh + +./01_create.sh +./02_install.sh + +cd $SRC_DIR 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..3b95d009d --- /dev/null +++ b/src/minimal_overlay/bundles/screen/02_build.sh @@ -0,0 +1,50 @@ +#!/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 -I${OVERLAY_ROOTFS}/include" \ +LDFLAGS="$LDFLAGS -L${OVERLAY_ROOTFS}/lib -L${OVERLAY_ROOTFS}/usr/lib" \ + ./configure --prefix=/usr + +# Remove the dependency to libutempter as it is +# not available on the target system. +echo "Patching configuration of '$BUNDLE_NAME'." +sed -i 's|-lutempter||g' Makefile +sed -i 's|#define HAVE_UTEMPTER 1||g' config.h + +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 diff --git a/src/minimal_overlay/bundles/screen/bundle_deps b/src/minimal_overlay/bundles/screen/bundle_deps new file mode 100644 index 000000000..dc120960f --- /dev/null +++ b/src/minimal_overlay/bundles/screen/bundle_deps @@ -0,0 +1,3 @@ +ncurses +passwd +libxcrypt