From a70f4bd170eef73a2cddacefef5d24cebdb46ba4 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Tue, 14 Nov 2017 15:38:23 +0100 Subject: [PATCH 1/5] Added dialog bundle --- src/.config | 6 ++- src/minimal_overlay/bundles/dialog/01_get.sh | 40 ++++++++++++++++++ .../bundles/dialog/02_build.sh | 41 +++++++++++++++++++ src/minimal_overlay/bundles/dialog/bundle.sh | 9 ++++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100755 src/minimal_overlay/bundles/dialog/01_get.sh create mode 100755 src/minimal_overlay/bundles/dialog/02_build.sh create mode 100755 src/minimal_overlay/bundles/dialog/bundle.sh diff --git a/src/.config b/src/.config index d3ece837e..85a50a57b 100644 --- a/src/.config +++ b/src/.config @@ -110,7 +110,11 @@ UTIL_LINUX_SOURCE_URL=https://www.kernel.org/pub/linux/utils/util-linux/v2.31/ut # ZLIB_SOURCE_URL=http://zlib.net/zlib-1.2.11.tar.xz - +# You can find the latest dialog source bundles here: +# +# http://invisible-island.net/dialog/ +# +DIALOG_SOURCE_URL=ftp://ftp.invisible-island.net/dialog/dialog-1.3-20170509.tgz #################################################### # # diff --git a/src/minimal_overlay/bundles/dialog/01_get.sh b/src/minimal_overlay/bundles/dialog/01_get.sh new file mode 100755 index 000000000..b6f3e00e0 --- /dev/null +++ b/src/minimal_overlay/bundles/dialog/01_get.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i DIALOG_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 $MAIN_SRC_DIR/.config | cut -f2 -d'=')" + +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 dialog source bundle file. The '-c' option allows the download to resume. + echo "Downloading dialog source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local dialog source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted dialog. +echo "Removing dialog work area. This may take a while..." +rm -rf $WORK_DIR/overlay/dialog +mkdir $WORK_DIR/overlay/dialog + +# Extract dialog to folder 'work/overlay/dialog'. +# Full path will be something like 'work/overlay/dialog/dialog-1.3-20170509'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/dialog + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/dialog/02_build.sh b/src/minimal_overlay/bundles/dialog/02_build.sh new file mode 100755 index 000000000..2eaf91962 --- /dev/null +++ b/src/minimal_overlay/bundles/dialog/02_build.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/dialog + +DESTDIR="$PWD/dialog_installed" + +# Change to the dialog source directory which ls finds, e.g. 'dialog-1.3-20170509'. +cd $(ls -d dialog-*) + +echo "Preparing dialog work area. This may take a while..." +make -j $NUM_JOBS clean + +rm -rf $DESTDIR + +# Configure dialog +echo "Configuring dialog..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr \ + --with-ncursesw + +echo "Building dialog..." +make -j $NUM_JOBS + +echo "Installing dialog..." +make -j $NUM_JOBS install DESTDIR=$DESTDIR + +echo "Reducing dialog size..." +strip -g $DESTDIR/usr/bin/* + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" + +cp -r $DESTDIR/usr/* $ROOTFS + +echo "dialog has been installed." + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/dialog/bundle.sh b/src/minimal_overlay/bundles/dialog/bundle.sh new file mode 100755 index 000000000..3935ced35 --- /dev/null +++ b/src/minimal_overlay/bundles/dialog/bundle.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +./01_get.sh +./02_build.sh + +cd $SRC_DIR + From 0149ee2313f7a1fb2d530f1d1222ba32ad3930fc Mon Sep 17 00:00:00 2001 From: bauen1 Date: Tue, 14 Nov 2017 15:40:20 +0100 Subject: [PATCH 2/5] Added documentation for the dialog bundle --- src/.config | 3 ++- src/README | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/.config b/src/.config index 85a50a57b..f0a32f21a 100644 --- a/src/.config +++ b/src/.config @@ -199,6 +199,7 @@ COPY_SOURCE_ISO=true # felix - Apache Felix OSGi framework. # mll_utils - set of executable utilities (mll-*). # ncurses - "GUI-like" API that runs within a terminal emulator +# dialog - shell scripting for ncurses # lua - scripting language # static_get - portable binaries for Linux (http://s.minos.io) # cf_cli - CLoud Foundry CLI (command line interface) @@ -209,7 +210,7 @@ COPY_SOURCE_ISO=true # # Refer to the README file for more information. # -#OVERLAY_BUNDLES=glibc_full,links,dropbear,java,felix,mll_utils,lua,static_get,cf_cli,ncurses,util_linux,nweb,dhcp +#OVERLAY_BUNDLES=glibc_full,links,dropbear,java,felix,mll_utils,lua,static_get,cf_cli,ncurses,dialog,util_linux,nweb,dhcp #OVERLAY_BUNDLES=dhcp,glibc_full,zlib,openjdk,felix,links # This property enables the standard penguin boot logo in the upper left corner diff --git a/src/README b/src/README index 5db6a2088..bfbb32f7d 100644 --- a/src/README +++ b/src/README @@ -74,6 +74,10 @@ Currently available overlay bundles: * ncurses - 'GUI-like' API that runs within a terminal emulator +* dialog - shell scripting library for ncurses + + This overlay bundle requires ncurses + * nweb - nweb is a very small and easy to use webserver, it is run automatically on port 80 to portforward port 80 from the guest (minimal) to port 8080 on the host add '-net nic,model=e1000 -net user,hostfwd=tcp::8080-:80' to 'cmd' in qemu.sh From f9e772420b3554ab24d4ec66630af2ee7c7111f0 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Thu, 16 Nov 2017 20:19:50 +0100 Subject: [PATCH 3/5] Fixed the dialog overlay bundle --- src/minimal_overlay/bundles/dialog/02_build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/minimal_overlay/bundles/dialog/02_build.sh b/src/minimal_overlay/bundles/dialog/02_build.sh index 2eaf91962..29fdb8f74 100755 --- a/src/minimal_overlay/bundles/dialog/02_build.sh +++ b/src/minimal_overlay/bundles/dialog/02_build.sh @@ -19,8 +19,7 @@ rm -rf $DESTDIR # Configure dialog echo "Configuring dialog..." CFLAGS="$CFLAGS" ./configure \ - --prefix=/usr \ - --with-ncursesw + --prefix=/usr echo "Building dialog..." make -j $NUM_JOBS From a31939f63b878195630237851e03652acd1bee6b Mon Sep 17 00:00:00 2001 From: bauen1 Date: Thu, 16 Nov 2017 20:33:38 +0100 Subject: [PATCH 4/5] Added ncurses back to the README --- src/README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/README b/src/README index b8e8aee46..317230c0c 100644 --- a/src/README +++ b/src/README @@ -90,6 +90,8 @@ Currently available overlay bundles: This overlay bundle requires ncurses. +* ncurses - "GUI-like" API that runs within a terminal emulator. + * nweb - nweb is a very small and easy to use webserver, it is run automatically on port 80. To portforward port 80 from the guest (minimal) to port 8080 on the host add From 4365dc7a28778a83dbc754f0addc99969979d2f6 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Thu, 16 Nov 2017 23:18:14 +0100 Subject: [PATCH 5/5] Latenight coding fixes --- src/.config | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/.config b/src/.config index 1d74b137e..df73420c1 100644 --- a/src/.config +++ b/src/.config @@ -157,14 +157,11 @@ VIM_SOURCE_URL=https://github.com/vim/vim/archive/v8.0.1298.tar.gz # ZLIB_SOURCE_URL=http://zlib.net/zlib-1.2.11.tar.xz -<<<<<<< HEAD # You can find the latest dialog source bundles here: # # http://invisible-island.net/dialog/ # DIALOG_SOURCE_URL=ftp://ftp.invisible-island.net/dialog/dialog-1.3-20170509.tgz -======= ->>>>>>> 54800aa7c24ba11aedb448524c0314c75104bcc3 #################################################### # #