Merge pull request #107 from bauen1/dialog

Added Dialog bundle
This commit is contained in:
Ivan Davidov 2017-11-17 00:25:26 +02:00 committed by GitHub
commit 5fd607b630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 99 additions and 0 deletions

View File

@ -157,6 +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
# 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
####################################################
# #
@ -237,6 +242,7 @@ COPY_SOURCE_ISO=true
# cf_cli - CLoud Foundry CLI (command line interface).
# coreutils - set of commonly used GNU executable utilities.
# dhcp - DHCP and DNS functionality.
# dialog - shell scripting for ncurses
# dropbear - SSH server and client.
# felix - Apache Felix OSGi framework.
# fio - I/O load generator.

View File

@ -31,6 +31,10 @@ Currently available overlay bundles:
* dhcp - DHCP and DNS functionality to connect to the Internet.
* dialog - shell scripting library for ncurses
This overlay bundle requires ncurses
* Dropbear - SSH server/client. Requires ~1MB additional space. The build
process creates user 'root' with password 'toor'. These are
sample commands which demonstrate how to use Dropbear:

View File

@ -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

View File

@ -0,0 +1,40 @@
#!/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
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

View File

@ -0,0 +1,9 @@
#!/bin/sh
SRC_DIR=$(pwd)
./01_get.sh
./02_build.sh
cd $SRC_DIR