From b5cc961df3546188647e309229f27a6ac7364a15 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Mon, 13 Nov 2017 22:11:33 +0100 Subject: [PATCH 01/27] Added dropbear startup script --- src/minimal_overlay/bundles/dropbear/02_build.sh | 2 ++ src/minimal_overlay/bundles/dropbear/20_dropbear.sh | 3 +++ 2 files changed, 5 insertions(+) create mode 100755 src/minimal_overlay/bundles/dropbear/20_dropbear.sh diff --git a/src/minimal_overlay/bundles/dropbear/02_build.sh b/src/minimal_overlay/bundles/dropbear/02_build.sh index a0df2e8e4..5eb2605d4 100755 --- a/src/minimal_overlay/bundles/dropbear/02_build.sh +++ b/src/minimal_overlay/bundles/dropbear/02_build.sh @@ -77,6 +77,8 @@ cp -r $DESTDIR/etc $ROOTFS cp -r $DESTDIR/usr/bin $ROOTFS/usr cp -r $DESTDIR/usr/sbin $ROOTFS/usr cp -r $DESTDIR/lib $ROOTFS +mkdir -p "$ROOTFS/etc/autorun" +install -m 0755 "$SRC_DIR/20_dropbear.sh" "$ROOTFS/etc/autorun/" echo "Dropbear has been installed." diff --git a/src/minimal_overlay/bundles/dropbear/20_dropbear.sh b/src/minimal_overlay/bundles/dropbear/20_dropbear.sh new file mode 100755 index 000000000..8358bec69 --- /dev/null +++ b/src/minimal_overlay/bundles/dropbear/20_dropbear.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo "starting dropbear ssh server" +dropbear From dd1c6251ac35f36b5320036290db3799d85d20a2 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Mon, 13 Nov 2017 22:21:28 +0100 Subject: [PATCH 02/27] Added kexec-tools --- src/.config | 5 +++ .../bundles/kexec-tools/01_get.sh | 40 +++++++++++++++++++ .../bundles/kexec-tools/02_build.sh | 37 +++++++++++++++++ .../bundles/kexec-tools/bundle.sh | 8 ++++ 4 files changed, 90 insertions(+) create mode 100755 src/minimal_overlay/bundles/kexec-tools/01_get.sh create mode 100755 src/minimal_overlay/bundles/kexec-tools/02_build.sh create mode 100755 src/minimal_overlay/bundles/kexec-tools/bundle.sh diff --git a/src/.config b/src/.config index d3ece837e..ec9db290f 100644 --- a/src/.config +++ b/src/.config @@ -110,6 +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 kexec-tools source bundles here: +# +# https://www.kernel.org/pub/linux/utils/kernel/kexec/ +## +KEXEC_TOOLS_SOURCE_URL=http://kernel.org/pub/linux/utils/kernel/kexec/kexec-tools-2.0.15.tar.xz #################################################### diff --git a/src/minimal_overlay/bundles/kexec-tools/01_get.sh b/src/minimal_overlay/bundles/kexec-tools/01_get.sh new file mode 100755 index 000000000..8ae9b1d3a --- /dev/null +++ b/src/minimal_overlay/bundles/kexec-tools/01_get.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i KEXEC_TOOLS_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=') + +# Grab everything after the last '/' character. +ARCHIVE_FILE=${DOWNLOAD_URL##*/} +echo "ARCHIVE_FILE='${ARCHIVE_FILE}'" +# 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 the kexec-tools bundle file. The '-c' option allows the download to resume. + echo "Downloading kexec-tools source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local kexec-tools source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted kexec-tools. +echo "Removing kexec-tools work area. This may take a while..." +rm -rf $WORK_DIR/overlay/kexec-tools +mkdir $WORK_DIR/overlay/kexec-tools + +# Extract kexec-tools to folder 'work/overlay/kexec-tools'. +# Full path will be something like 'work/overlay/kexec-tools/kexec-tools-2.0.15'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/kexec-tools + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/kexec-tools/02_build.sh b/src/minimal_overlay/bundles/kexec-tools/02_build.sh new file mode 100755 index 000000000..1a811eb13 --- /dev/null +++ b/src/minimal_overlay/bundles/kexec-tools/02_build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/kexec-tools + +DESTDIR="$PWD/kexec-tools_installed" + +# Change to the kexec-tools source directory which ls finds, e.g. 'kexec-tools-2.0.15'. +cd $(ls -d kexec-tools-*) + +echo "Preparing kexec-tools work area. This may take a while..." +make -j $NUM_JOBS clean +rm -rf $DESTDIR + +echo "Building kexec-tools..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr \ + --without-lzama + +make -j $NUM_JOBS + +make -j $NUM_JOBS install DESTDIR="$DESTDIR" + +echo "Reducing kexec-tools size..." +strip -g $DESTDIR/usr/bin/* \ + $DESTDIR/usr/lib/* 2>/dev/null + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" +mkdir -p $ROOTFS/usr/ +cp -r $DESTDIR/usr/* $ROOTFS/usr/ + +echo "kexec-tools has been installed." + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/kexec-tools/bundle.sh b/src/minimal_overlay/bundles/kexec-tools/bundle.sh new file mode 100755 index 000000000..db41a1610 --- /dev/null +++ b/src/minimal_overlay/bundles/kexec-tools/bundle.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +./01_get.sh +./02_build.sh + +cd $SRC_DIR From f34ce08263f75ca4bef2f5b61b1356d63278572d Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 13 Nov 2017 17:19:42 -0500 Subject: [PATCH 03/27] Update .config --- src/.config | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/.config b/src/.config index d3ece837e..5e2e64305 100644 --- a/src/.config +++ b/src/.config @@ -73,6 +73,12 @@ FELIX_SOURCE_URL=http://archive.apache.org/dist/felix/org.apache.felix.main.dist # LUA_SOURCE_URL=https://www.lua.org/ftp/lua-5.3.4.tar.gz +# You can find the latest nano source bundles here: +# +# https://nano-editor.org/download.php +# +NANO_SOURCE_URL=https://nano-editor.org/dist/v2.8/nano-2.8.7.tar.xz + # You can find the latest ncurses archives here: # # https://ftp.gnu.org/pub/gnu/ncurses/ @@ -194,6 +200,7 @@ COPY_SOURCE_ISO=true # openjdk - installs Open JDK. All operations are automated. # felix - Apache Felix OSGi framework. # mll_utils - set of executable utilities (mll-*). +# nano - GNU nano is an enhanced clone of the Pico text editor # ncurses - "GUI-like" API that runs within a terminal emulator # lua - scripting language # static_get - portable binaries for Linux (http://s.minos.io) @@ -205,7 +212,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,nano,lua,static_get,cf_cli,ncurses,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 From 011faddb747160d44f16f77517200346c91cb283 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 13 Nov 2017 17:20:35 -0500 Subject: [PATCH 04/27] Update README --- src/README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/README b/src/README index 5db6a2088..494384b92 100644 --- a/src/README +++ b/src/README @@ -72,6 +72,8 @@ Currently available overlay bundles: * Lua - The Lua Scripting Language 5.3. Requires ~ 800kb additional space. Use the "lua" command to run an interactive lua interpreter +* nano - GNU nano is an enhanced clone of the Pico text editor + * 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 From 595bed2dde76c8c53d8651461b6fe9938dc37536 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 13 Nov 2017 17:21:46 -0500 Subject: [PATCH 05/27] Update 02_build.sh --- src/minimal_overlay/bundles/ncurses/02_build.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/minimal_overlay/bundles/ncurses/02_build.sh b/src/minimal_overlay/bundles/ncurses/02_build.sh index f1bfef294..dfe151ca1 100755 --- a/src/minimal_overlay/bundles/ncurses/02_build.sh +++ b/src/minimal_overlay/bundles/ncurses/02_build.sh @@ -25,13 +25,17 @@ echo "Configuring Ncurses..." ./configure \ --prefix=/usr \ --with-termlib \ - --with-shared \ --with-terminfo-dirs=/lib/terminfo \ --with-default-terminfo-dirs=/lib/terminfo \ --without-normal \ --without-debug \ --without-cxx-binding \ --with-abi-version=5 \ + --enable-widec \ + --enable-pc-files \ + --with-shared \ + CPPFLAGS=-I$PWD/ncurses/widechar \ + LDFLAGS=-L$PWD/lib \ CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE" \ CPPFLAGS="-P" @@ -47,6 +51,13 @@ make -j $NUM_JOBS echo "Installing ncurses..." make -j $NUM_JOBS install DESTDIR=$DESTDIR +# Symnlink wide character libraries +cd $DESTDIR/usr/lib +ln -s libncursesw.so.5 libncurses.so.5 +ln -s libncurses.so.5 libncurses.so +ln -s libtinfow.so.5 libtinfo.so.5 +ln -s libtinfo.so.5 libtinfo.so + echo "Reducing ncurses size..." strip -g $DESTDIR/usr/bin/* @@ -57,4 +68,3 @@ cp -r $DESTDIR/usr/* $ROOTFS echo "ncurses has been installed." cd $SRC_DIR - From 651f6905c70b201c4fb929db1e60ebcf39b98b0d Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 13 Nov 2017 17:22:47 -0500 Subject: [PATCH 06/27] Create 01-get.sh --- src/minimal_overlay/bundles/nano/01-get.sh | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/minimal_overlay/bundles/nano/01-get.sh diff --git a/src/minimal_overlay/bundles/nano/01-get.sh b/src/minimal_overlay/bundles/nano/01-get.sh new file mode 100644 index 000000000..daae2653a --- /dev/null +++ b/src/minimal_overlay/bundles/nano/01-get.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i NANO_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 nano source bundle file. The '-c' option allows the download to resume. + echo "Downloading nano source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local nano source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted nano. +echo "Removing nano work area. This may take a while..." +rm -rf $WORK_DIR/overlay/nano +mkdir $WORK_DIR/overlay/nano + +# Extract nano to folder 'work/overlay/nano'. +# Full path will be something like 'work/overlay/nano/nano-2.8.7'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/nano + +cd $SRC_DIR From 0a16fc08bda31ca9ecdc1e44fdfc076db47b82f0 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 13 Nov 2017 17:23:08 -0500 Subject: [PATCH 07/27] Rename 01-get.sh to 01_get.sh --- src/minimal_overlay/bundles/nano/{01-get.sh => 01_get.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/minimal_overlay/bundles/nano/{01-get.sh => 01_get.sh} (100%) diff --git a/src/minimal_overlay/bundles/nano/01-get.sh b/src/minimal_overlay/bundles/nano/01_get.sh similarity index 100% rename from src/minimal_overlay/bundles/nano/01-get.sh rename to src/minimal_overlay/bundles/nano/01_get.sh From 4dedabf93d86fcca9f11c67adc575604af454c14 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 13 Nov 2017 17:23:47 -0500 Subject: [PATCH 08/27] Create 02_build.sh --- src/minimal_overlay/bundles/nano/02_build.sh | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/minimal_overlay/bundles/nano/02_build.sh diff --git a/src/minimal_overlay/bundles/nano/02_build.sh b/src/minimal_overlay/bundles/nano/02_build.sh new file mode 100644 index 000000000..b63a4208a --- /dev/null +++ b/src/minimal_overlay/bundles/nano/02_build.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/nano + +DESTDIR="$PWD/nano_installed" + +# Change to the nano source directory which ls finds, e.g. 'nano-2.8.7'. +cd $(ls -d nano-*) + +echo "Preparing nano work area. This may take a while..." +make -j $NUM_JOBS clean + +rm -rf $DESTDIR + +echo "Configuring nano..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr + --disable-utf8 \ + CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE" + +echo "Building nano..." +make -j $NUM_JOBS + +echo "Installing nano..." +make -j $NUM_JOBS install DESTDIR=$DESTDIR + +echo "Reducing nano size..." +strip -g $DESTDIR/usr/bin/* + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" + +cp -r $DESTDIR/* $ROOTFS + +echo "nano has been installed." + +cd $SRC_DIR From 198617643aa8617a809e85a8a33aa7a641ae47bb Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 13 Nov 2017 17:24:34 -0500 Subject: [PATCH 09/27] Create bundle.sh --- src/minimal_overlay/bundles/nano/bundle.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/minimal_overlay/bundles/nano/bundle.sh diff --git a/src/minimal_overlay/bundles/nano/bundle.sh b/src/minimal_overlay/bundles/nano/bundle.sh new file mode 100644 index 000000000..db41a1610 --- /dev/null +++ b/src/minimal_overlay/bundles/nano/bundle.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +./01_get.sh +./02_build.sh + +cd $SRC_DIR From 1bd557d52730cc29054ea085576d7bc06cc100cb Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 13 Nov 2017 18:06:11 -0500 Subject: [PATCH 10/27] File permissions --- src/minimal_overlay/bundles/nano/01_get.sh | 0 src/minimal_overlay/bundles/nano/02_build.sh | 0 src/minimal_overlay/bundles/nano/bundle.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/minimal_overlay/bundles/nano/01_get.sh mode change 100644 => 100755 src/minimal_overlay/bundles/nano/02_build.sh mode change 100644 => 100755 src/minimal_overlay/bundles/nano/bundle.sh diff --git a/src/minimal_overlay/bundles/nano/01_get.sh b/src/minimal_overlay/bundles/nano/01_get.sh old mode 100644 new mode 100755 diff --git a/src/minimal_overlay/bundles/nano/02_build.sh b/src/minimal_overlay/bundles/nano/02_build.sh old mode 100644 new mode 100755 diff --git a/src/minimal_overlay/bundles/nano/bundle.sh b/src/minimal_overlay/bundles/nano/bundle.sh old mode 100644 new mode 100755 From 17665b1de70ca064b55a35a0c309040bbf3c3e27 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Tue, 14 Nov 2017 15:21:46 +0100 Subject: [PATCH 11/27] Moved /etc/msg/welcome.txt to /etc/motd This way the welcome message is displayed when you login using ssh or telnet --- src/minimal_rootfs/etc/inittab | 8 ++++---- src/minimal_rootfs/etc/{msg/welcome.txt => motd} | 0 2 files changed, 4 insertions(+), 4 deletions(-) rename src/minimal_rootfs/etc/{msg/welcome.txt => motd} (100%) diff --git a/src/minimal_rootfs/etc/inittab b/src/minimal_rootfs/etc/inittab index 59135d948..dc098e98e 100644 --- a/src/minimal_rootfs/etc/inittab +++ b/src/minimal_rootfs/etc/inittab @@ -7,12 +7,12 @@ ::shutdown:echo -e "\n \\e[1mSee you soon!\\e[0m\n" ::shutdown:sleep 1 ::ctrlaltdel:/sbin/reboot -::once:cat /etc/msg/welcome.txt +::once:cat /etc/motd ::respawn:/bin/cttyhack /bin/sh -tty2::once:cat /etc/msg/welcome.txt +tty2::once:cat /etc/motd tty2::respawn:/bin/sh -tty3::once:cat /etc/msg/welcome.txt +tty3::once:cat /etc/motd tty3::respawn:/bin/sh -tty4::once:cat /etc/msg/welcome.txt +tty4::once:cat /etc/motd tty4::respawn:/bin/sh diff --git a/src/minimal_rootfs/etc/msg/welcome.txt b/src/minimal_rootfs/etc/motd similarity index 100% rename from src/minimal_rootfs/etc/msg/welcome.txt rename to src/minimal_rootfs/etc/motd From e5686fe352121d225bbbaae29ec04642b1155960 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Tue, 14 Nov 2017 11:25:51 -0500 Subject: [PATCH 12/27] Clean up .config and README --- src/.config | 68 ++++++++++++++++++++++++++--------------------------- src/README | 50 +++++++++++++++++++-------------------- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/.config b/src/.config index 8c2c372ca..23f091f50 100644 --- a/src/.config +++ b/src/.config @@ -41,11 +41,11 @@ SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.0 # # ##################################################################### -# You can find the latest Links source bundles here: +# You can find the latest Cloud Foundry CLI binary here: # -# http://links.twibright.com +# http://github.com/cloudfoundry/cli # -LINKS_SOURCE_URL=http://links.twibright.com/download/links-2.14.tar.bz2 +CLOUD_FOUNDRY_CLI_URL=http://cli.run.pivotal.io/stable?release=linux64-binary&source=github # You can find the latest Dropbear source bundles here: # @@ -67,6 +67,18 @@ FELIX_SOURCE_URL=http://archive.apache.org/dist/felix/org.apache.felix.main.dist #JAVA_ARCHIVE=/absolute/path/to/java.archive.tar.gz #JAVA_ARCHIVE=/home/ivan/Downloads/jdk-9_linux-x64_bin.tar.gz +# You can find the latest kexec-tools source bundles here: +# +# https://www.kernel.org/pub/linux/utils/kernel/kexec/ +# +KEXEC_TOOLS_SOURCE_URL=http://kernel.org/pub/linux/utils/kernel/kexec/kexec-tools-2.0.15.tar.xz + +# You can find the latest Links source bundles here: +# +# http://links.twibright.com +# +LINKS_SOURCE_URL=http://links.twibright.com/download/links-2.14.tar.bz2 + # You can find the latest Lua source bundes here: # # https://www.lua.org/ftp/ @@ -85,6 +97,12 @@ NANO_SOURCE_URL=https://nano-editor.org/dist/v2.8/nano-2.8.7.tar.xz # NCURSES_SOURCE_URL=https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz +# You can find the latest Open JDK archives here: +# +# http://jdk.java.net/9 +# +OPENJDK_URL=http://download.java.net/java/GA/jdk9/9/binaries/jdk-9+181_linux-x64_bin.tar.gz + # You can find the latest static-get shell script here: # # http://s.minos.io/s @@ -92,18 +110,6 @@ NCURSES_SOURCE_URL=https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz # STATIC_GET_SOURCE_URL=http://s.minos.io/s -# You can find the latest Cloud Foundry CLI binary here: -# -# http://github.com/cloudfoundry/cli -# -CLOUD_FOUNDRY_CLI_URL=http://cli.run.pivotal.io/stable?release=linux64-binary&source=github - -# You can find the latest Open JDK archives here: -# -# http://jdk.java.net/9 -# -OPENJDK_URL=http://download.java.net/java/GA/jdk9/9/binaries/jdk-9+181_linux-x64_bin.tar.gz - # You can find the latest util_linux archives here: # # https://www.kernel.org/pub/linux/utils/util-linux/ @@ -116,12 +122,6 @@ 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 kexec-tools source bundles here: -# -# https://www.kernel.org/pub/linux/utils/kernel/kexec/ -## -KEXEC_TOOLS_SOURCE_URL=http://kernel.org/pub/linux/utils/kernel/kexec/kexec-tools-2.0.15.tar.xz - #################################################### # # @@ -199,26 +199,26 @@ COPY_SOURCE_ISO=true # Currently available overlay software: # # glibc_full - all core GNU C libraries (useful if other software is included). -# links - text browser for the web. +# cf_cli - CLoud Foundry CLI (command line interface). +# dhcp - DHCP and DNS functionality. # dropbear - SSH server and client. -# java - installs Oracle's JRE or JDK. Manual preparations are required. -# openjdk - installs Open JDK. All operations are automated. # felix - Apache Felix OSGi framework. +# java - installs Oracle's JRE or JDK. Manual preparations are required. +# links - text browser for the web. +# lua - scripting language. # mll_utils - set of executable utilities (mll-*). -# nano - GNU nano is an enhanced clone of the Pico text editor -# ncurses - "GUI-like" API that runs within a terminal emulator -# lua - scripting language -# static_get - portable binaries for Linux (http://s.minos.io) -# cf_cli - CLoud Foundry CLI (command line interface) -# nweb - simple mini http server -# dhcp - DHCP and DNS functionality -# util_linux - standard package distributed by the Linux Kernel Organization. +# nano - simple command-line text editor with on-screen shortcuts.git +# ncurses - "GUI-like" API that runs within a terminal emulator. +# nweb - simple mini http server. +# openjdk - installs Open JDK. All operations are automated. +# static_get - portable binaries for Linux (http://s.minos.io). +# util_linux - set of executable utilities distributed by the Linux Kernel Org. # zlib - DEFLATE compression/decompression library. # # Refer to the README file for more information. # -#OVERLAY_BUNDLES=glibc_full,links,dropbear,java,felix,mll_utils,nano,lua,static_get,cf_cli,ncurses,util_linux,nweb,dhcp -#OVERLAY_BUNDLES=dhcp,glibc_full,zlib,openjdk,felix,links +#OVERLAY_BUNDLES=glibc_full,cf_cli,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,zlib +#OVERLAY_BUNDLES=glibc_full,dhcp,felix,links,openjdk,zlib # 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/README b/src/README index 494384b92..d4ac800e4 100644 --- a/src/README +++ b/src/README @@ -27,16 +27,7 @@ Currently available overlay bundles: This overlay bundle depends on the GLIBC build process. -* ZLIB - Software library used for data compression. - - This overlay bundle is self sufficient and doesn't require other - overlay bundles. - -* Links - text based browser. Requires ~1MB additional space. Use the - "links" command to activate the browser. - - This overlay bundle is self sufficient and doesn't require other - overlay bundles. +* dhcp - DHCP and DNS functionality to connect to the Internet. * Dropbear - SSH server/client. Requires ~1MB additional space. The build process creates user 'root' with password 'toor'. These are @@ -47,6 +38,11 @@ Currently available overlay bundles: This overlay bundle requires GLIBC. +* Felix OSGi - Apache Felix OSGi framework. Requires ~2MB additional space. Use + the "felix-start" command to run the Apache Felix OSGi framework. + + This overlay bundle requires JRE or JDK. + * JRE / JDK - Oracle's JRE or JDK. Requires ~366MB additional space for JDK. This overlay bundle requires some manual preparation steps. Refer to the "JAVA_ARCHIVE" property in the ".config" file for more @@ -54,14 +50,16 @@ Currently available overlay bundles: This overlay bundle requires GLIBC. JDK 9 requires ZLIB. +* Links - Text based browser. Requires ~1MB additional space. Use the + "links" command to activate the browser. + * Open JDK - The open source JDK. No need for manual steps. This overlay bundle requires GLIBC and ZLIB. -* Felix OSGi - Apache Felix OSGi framework. Requires ~2MB additional space. Use - the "felix-start" command to run the Apache Felix OSGi framework. - - This overlay bundle requires JRE or JDK. +* Lua - The Lua Scripting Language 5.3. Requires ~ 800kb additional + space. Use the "lua" command to run an interactive lua + interpreter. * MLL Utils - Set of experimental shell scripts (mll-*.sh) which provide additional functionality, e.g. installer and useful tools. @@ -69,24 +67,26 @@ Currently available overlay bundles: This overlay bundle is currently experimental and its build process depends on the host machine. -* Lua - The Lua Scripting Language 5.3. Requires ~ 800kb additional - space. Use the "lua" command to run an interactive lua interpreter +* nano - Simple command-line text editor with on-screen shortcuts. -* nano - GNU nano is an enhanced clone of the Pico text editor + This overlay bundle requires ncurses. -* ncurses - 'GUI-like' API that runs within a terminal emulator +* 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 - '-net nic,model=e1000 -net user,hostfwd=tcp::8080-:80' to 'cmd' in qemu.sh +* 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 the qemu.sh file. -* dhcp - DHCP and DNS functionality - -* util_linux - util-linux is a standard package distributed by the Linux Kernel - Organization similar to busybox or GNU Core Utils. +* util_linux - Set of executable utilities distributed by the Linux Kernel + similar to busybox or GNU Core Utils. Some packages in this overlay bundle require ncurses. +* ZLIB - Software library used for data compression. + + ### ### ### I only provide the build scripts. It's entirely up to you to configure and From a11ffb64f526527c28513547559416f230a75568 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Tue, 14 Nov 2017 16:14:52 -0500 Subject: [PATCH 13/27] Removed hardcoded CFLAGS --- src/minimal_overlay/bundles/nano/02_build.sh | 5 ++--- src/minimal_overlay/bundles/ncurses/02_build.sh | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/minimal_overlay/bundles/nano/02_build.sh b/src/minimal_overlay/bundles/nano/02_build.sh index b63a4208a..9480712e5 100755 --- a/src/minimal_overlay/bundles/nano/02_build.sh +++ b/src/minimal_overlay/bundles/nano/02_build.sh @@ -18,9 +18,8 @@ rm -rf $DESTDIR echo "Configuring nano..." CFLAGS="$CFLAGS" ./configure \ - --prefix=/usr - --disable-utf8 \ - CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE" + --prefix=/usr \ + LDFLAGS=-L$WORK_DIR/overlay/ncurses/ncurses_installed/usr/include echo "Building nano..." make -j $NUM_JOBS diff --git a/src/minimal_overlay/bundles/ncurses/02_build.sh b/src/minimal_overlay/bundles/ncurses/02_build.sh index dfe151ca1..3362c6a6a 100755 --- a/src/minimal_overlay/bundles/ncurses/02_build.sh +++ b/src/minimal_overlay/bundles/ncurses/02_build.sh @@ -22,7 +22,7 @@ sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in # Configure Ncurses echo "Configuring Ncurses..." -./configure \ +CFLAGS="$CFLAGS" ./configure \ --prefix=/usr \ --with-termlib \ --with-terminfo-dirs=/lib/terminfo \ @@ -36,7 +36,6 @@ echo "Configuring Ncurses..." --with-shared \ CPPFLAGS=-I$PWD/ncurses/widechar \ LDFLAGS=-L$PWD/lib \ - CFLAGS="-Os -s -fno-stack-protector -U_FORTIFY_SOURCE" \ CPPFLAGS="-P" # Most configuration switches are from AwlsomeAlex @@ -68,3 +67,4 @@ cp -r $DESTDIR/usr/* $ROOTFS echo "ncurses has been installed." cd $SRC_DIR + From cbdaa63284ae61964c6862bf4299fa517ab94761 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Tue, 14 Nov 2017 16:28:58 -0500 Subject: [PATCH 14/27] Add coreutils overlay bundle --- src/.config | 9 +++- src/README | 2 + .../bundles/coreutils/01_get.sh | 41 +++++++++++++++++++ .../bundles/coreutils/02_build.sh | 38 +++++++++++++++++ .../bundles/coreutils/bundle.sh | 9 ++++ 5 files changed, 98 insertions(+), 1 deletion(-) create mode 100755 src/minimal_overlay/bundles/coreutils/01_get.sh create mode 100755 src/minimal_overlay/bundles/coreutils/02_build.sh create mode 100755 src/minimal_overlay/bundles/coreutils/bundle.sh diff --git a/src/.config b/src/.config index 23f091f50..b04a47495 100644 --- a/src/.config +++ b/src/.config @@ -47,6 +47,12 @@ SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.0 # CLOUD_FOUNDRY_CLI_URL=http://cli.run.pivotal.io/stable?release=linux64-binary&source=github +# You can find the latest coreutils source bundles here: +# +# http://ftp.gnu.org/gnu/coreutils/ +# +COREUTILS_SOURCE_URL=http://ftp.gnu.org/gnu/coreutils/coreutils-8.28.tar.xz + # You can find the latest Dropbear source bundles here: # # http://matt.ucc.asn.au/dropbear/dropbear.html @@ -200,6 +206,7 @@ COPY_SOURCE_ISO=true # # glibc_full - all core GNU C libraries (useful if other software is included). # cf_cli - CLoud Foundry CLI (command line interface). +# coreutils - set of commonly used GNU executable utilities. # dhcp - DHCP and DNS functionality. # dropbear - SSH server and client. # felix - Apache Felix OSGi framework. @@ -217,7 +224,7 @@ COPY_SOURCE_ISO=true # # Refer to the README file for more information. # -#OVERLAY_BUNDLES=glibc_full,cf_cli,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,zlib +#OVERLAY_BUNDLES=glibc_full,cf_cli,coreutils,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,zlib #OVERLAY_BUNDLES=glibc_full,dhcp,felix,links,openjdk,zlib # This property enables the standard penguin boot logo in the upper left corner diff --git a/src/README b/src/README index d4ac800e4..b726fb841 100644 --- a/src/README +++ b/src/README @@ -27,6 +27,8 @@ Currently available overlay bundles: This overlay bundle depends on the GLIBC build process. +* coreutils - set of commonly used GNU executable utilities. + * dhcp - DHCP and DNS functionality to connect to the Internet. * Dropbear - SSH server/client. Requires ~1MB additional space. The build diff --git a/src/minimal_overlay/bundles/coreutils/01_get.sh b/src/minimal_overlay/bundles/coreutils/01_get.sh new file mode 100755 index 000000000..9576e211f --- /dev/null +++ b/src/minimal_overlay/bundles/coreutils/01_get.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i COREUTILS_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 coreutils source bundle file. The '-c' option allows the download to resume. + echo "Downloading coreutils source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local coreutils source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted coreutils. +echo "Removing coreutils work area. This may take a while..." +rm -rf $WORK_DIR/overlay/coreutils +mkdir $WORK_DIR/overlay/coreutils + +# Extract coreutils to folder 'work/overlay/coreutils'. +# Full path will be something like 'work/overlay/coreutils/coreutils-8.28'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/coreutils + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/coreutils/02_build.sh b/src/minimal_overlay/bundles/coreutils/02_build.sh new file mode 100755 index 000000000..a8d22973d --- /dev/null +++ b/src/minimal_overlay/bundles/coreutils/02_build.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/coreutils + +DESTDIR="$PWD/coreutils_installed" + +# Change to the coreutils source directory which ls finds, e.g. 'coreutils-8.28'. +cd $(ls -d coreutils-*) + +echo "Preparing coreutils work area. This may take a while..." +make -j $NUM_JOBS clean + +rm -rf $DESTDIR + +echo "Configuring coreutils..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr + +echo "Building coreutils..." +make -j $NUM_JOBS + +echo "Installing coreutils..." +make -j $NUM_JOBS install DESTDIR=$DESTDIR + +echo "Reducing coreutils size..." +strip -g $DESTDIR/usr/bin/* + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" + +cp -r $DESTDIR/* $ROOTFS + +echo "coreutils has been installed." + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/coreutils/bundle.sh b/src/minimal_overlay/bundles/coreutils/bundle.sh new file mode 100755 index 000000000..6284178ab --- /dev/null +++ b/src/minimal_overlay/bundles/coreutils/bundle.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +time sh 01_get.sh +time sh 02_build.sh + +cd $SRC_DIR + From 116ef1db4b57c4ec16f80021bc3d482659382dd1 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Tue, 14 Nov 2017 17:18:48 -0500 Subject: [PATCH 15/27] Update bundle.sh --- src/minimal_overlay/bundles/coreutils/bundle.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/minimal_overlay/bundles/coreutils/bundle.sh b/src/minimal_overlay/bundles/coreutils/bundle.sh index 6284178ab..cbf2c5338 100755 --- a/src/minimal_overlay/bundles/coreutils/bundle.sh +++ b/src/minimal_overlay/bundles/coreutils/bundle.sh @@ -1,9 +1,8 @@ -#!/bin/sh +#!/bin/bash SRC_DIR=$(pwd) -time sh 01_get.sh -time sh 02_build.sh +./01_get.sh +./02_build.sh cd $SRC_DIR - From a6b10861d17df36ea2e954cd4f022052d1e5aba5 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Tue, 14 Nov 2017 17:19:15 -0500 Subject: [PATCH 16/27] Update 01_get.sh --- src/minimal_overlay/bundles/coreutils/01_get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/minimal_overlay/bundles/coreutils/01_get.sh b/src/minimal_overlay/bundles/coreutils/01_get.sh index 9576e211f..dd879e455 100755 --- a/src/minimal_overlay/bundles/coreutils/01_get.sh +++ b/src/minimal_overlay/bundles/coreutils/01_get.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash SRC_DIR=$(pwd) From 7f915ed17c1fd458dbc49ca21cf3b49d9b61c246 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Wed, 15 Nov 2017 16:44:40 +0100 Subject: [PATCH 17/27] Added kbd overlay bundle --- src/.config | 8 +++- src/minimal_overlay/bundles/kbd/01_get.sh | 53 +++++++++++++++++++++ src/minimal_overlay/bundles/kbd/02_build.sh | 44 +++++++++++++++++ src/minimal_overlay/bundles/kbd/bundle.sh | 9 ++++ 4 files changed, 113 insertions(+), 1 deletion(-) create mode 100755 src/minimal_overlay/bundles/kbd/01_get.sh create mode 100755 src/minimal_overlay/bundles/kbd/02_build.sh create mode 100755 src/minimal_overlay/bundles/kbd/bundle.sh diff --git a/src/.config b/src/.config index 23f091f50..5d0b950eb 100644 --- a/src/.config +++ b/src/.config @@ -67,6 +67,11 @@ FELIX_SOURCE_URL=http://archive.apache.org/dist/felix/org.apache.felix.main.dist #JAVA_ARCHIVE=/absolute/path/to/java.archive.tar.gz #JAVA_ARCHIVE=/home/ivan/Downloads/jdk-9_linux-x64_bin.tar.gz +# You can find the latest kbd source bundles here: +# +# http://www.kbd-project.org/ +# +KBD_SOURCE_URL=https://www.kernel.org/pub/linux/utils/kbd/kbd-2.0.4.tar.gz # You can find the latest kexec-tools source bundles here: # # https://www.kernel.org/pub/linux/utils/kernel/kexec/ @@ -204,6 +209,7 @@ COPY_SOURCE_ISO=true # dropbear - SSH server and client. # felix - Apache Felix OSGi framework. # java - installs Oracle's JRE or JDK. Manual preparations are required. +# kbd - keyboard utilities # links - text browser for the web. # lua - scripting language. # mll_utils - set of executable utilities (mll-*). @@ -217,7 +223,7 @@ COPY_SOURCE_ISO=true # # Refer to the README file for more information. # -#OVERLAY_BUNDLES=glibc_full,cf_cli,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,zlib +#OVERLAY_BUNDLES=glibc_full,cf_cli,dhcp,dropbear,felix,java,kbd,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,zlib #OVERLAY_BUNDLES=glibc_full,dhcp,felix,links,openjdk,zlib # This property enables the standard penguin boot logo in the upper left corner diff --git a/src/minimal_overlay/bundles/kbd/01_get.sh b/src/minimal_overlay/bundles/kbd/01_get.sh new file mode 100755 index 000000000..9ca1a541d --- /dev/null +++ b/src/minimal_overlay/bundles/kbd/01_get.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i KBD_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 kbd source bundle file. The '-c' option allows the download to resume. + echo "Downloading kbd source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local kbd source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted kbd. +echo "Removing kbd work area. This may take a while..." +rm -rf $WORK_DIR/overlay/kbd +mkdir $WORK_DIR/overlay/kbd + +# Extract kbd to folder 'work/overlay/kbd'. +# Full path will be something like 'work/overlay/kbd/kbd-2.04'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/kbd + +cd "$WORK_DIR/overlay/kbd" + +cd $(ls -d kbd-*) + +# rename keymaps with the same name +mv data/keymaps/i386/qwertz/cz{,-qwertz}.map +mv data/keymaps/i386/olpc/es{,-olpc}.map +mv data/keymaps/i386/olpc/pt{,-olpc}.map +mv data/keymaps/i386/dvorak/no{,-dvorak}.map +mv data/keymaps/i386/fgGIod/trf{,-fgGIod}.map +mv data/keymaps/i386/colemak/{en-latin9,colemak}.map + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/kbd/02_build.sh b/src/minimal_overlay/bundles/kbd/02_build.sh new file mode 100755 index 000000000..af6337f17 --- /dev/null +++ b/src/minimal_overlay/bundles/kbd/02_build.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/kbd + +DESTDIR="$PWD/kbd_installed" + +# Change to the kbd source directory which ls finds, e.g. 'kbd-2.04'. +cd $(ls -d kbd-*) + +echo "Preparing kbd work area. This may take a while..." +make -j $NUM_JOBS clean +rm -rf $DESTDIR + +echo "Configuring kbd..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr + +echo "Building kbd..." +make -j $NUM_JOBS + +echo "Installing kbd..." +make -j $NUM_JOBS install DESTDIR="$DESTDIR" + +echo "Reducing kbd size..." +strip -g \ + $DESTDIR/usr/bin/* \ + $DESTDIR/usr/sbin/* \ + $DESTDIR/lib/* + +ROOTFS=$WORK_DIR/src/minimal_overlay/rootfs + +mkdir -p $ROOTFS/usr +cp -r "$DESTDIR/usr/bin" \ + "$DESTDIR/usr/share" \ + "$ROOTFS/usr/" + +echo "kbd has been installed." + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/kbd/bundle.sh b/src/minimal_overlay/bundles/kbd/bundle.sh new file mode 100755 index 000000000..3935ced35 --- /dev/null +++ b/src/minimal_overlay/bundles/kbd/bundle.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +SRC_DIR=$(pwd) + +./01_get.sh +./02_build.sh + +cd $SRC_DIR + From af02d2cd642adf3bba49f2de8ad117faaabe543a Mon Sep 17 00:00:00 2001 From: bauen1 Date: Wed, 15 Nov 2017 16:53:49 +0100 Subject: [PATCH 18/27] Fixed a workaround in kbd --- src/minimal_overlay/bundles/kbd/01_get.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/minimal_overlay/bundles/kbd/01_get.sh b/src/minimal_overlay/bundles/kbd/01_get.sh index 9ca1a541d..f9cefc5df 100755 --- a/src/minimal_overlay/bundles/kbd/01_get.sh +++ b/src/minimal_overlay/bundles/kbd/01_get.sh @@ -42,12 +42,13 @@ cd "$WORK_DIR/overlay/kbd" cd $(ls -d kbd-*) # rename keymaps with the same name -mv data/keymaps/i386/qwertz/cz{,-qwertz}.map -mv data/keymaps/i386/olpc/es{,-olpc}.map -mv data/keymaps/i386/olpc/pt{,-olpc}.map -mv data/keymaps/i386/dvorak/no{,-dvorak}.map -mv data/keymaps/i386/fgGIod/trf{,-fgGIod}.map -mv data/keymaps/i386/colemak/{en-latin9,colemak}.map +mv data/keymaps/i386/qwertz/cz.map data/keymaps/i386/qwertz/cz-qwertz.map +mv data/keymaps/i386/olpc/es.map data/keymaps/i386/olpc/es-olpc.map +mv data/keymaps/i386/olpc/pt.map data/keymaps/i386/olpc/pt-olpc.map +mv data/keymaps/i386/dvorak/no.map data/keymaps/i386/dvorak/no-dvorak.map +mv data/keymaps/i386/fgGIod/trf.map data/keymaps/i386/fgGIod/trf-fgGIod.map +mv data/keymaps/i386/colemak/en-latin9.map data/keymaps/i386/colemak/colemak.map + cd $SRC_DIR From 2440070def36607cc91bda79fb96aa5ec890035a Mon Sep 17 00:00:00 2001 From: bauen1 Date: Wed, 15 Nov 2017 16:57:07 +0100 Subject: [PATCH 19/27] Disabled vlock of the kbd bundle as it requires PAM to build --- src/minimal_overlay/bundles/kbd/02_build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/minimal_overlay/bundles/kbd/02_build.sh b/src/minimal_overlay/bundles/kbd/02_build.sh index af6337f17..204323b5a 100755 --- a/src/minimal_overlay/bundles/kbd/02_build.sh +++ b/src/minimal_overlay/bundles/kbd/02_build.sh @@ -17,7 +17,9 @@ rm -rf $DESTDIR echo "Configuring kbd..." CFLAGS="$CFLAGS" ./configure \ - --prefix=/usr + --prefix=/usr \ + --disable-vlock +# vlock requires PAM echo "Building kbd..." make -j $NUM_JOBS From 9ba79b854e2914a24f4b877ee8ecc968bc432299 Mon Sep 17 00:00:00 2001 From: bauen1 Date: Wed, 15 Nov 2017 17:03:19 +0100 Subject: [PATCH 20/27] Added the kbd overlay bundle to the README --- src/README | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/README b/src/README index d4ac800e4..fbe48eef9 100644 --- a/src/README +++ b/src/README @@ -50,6 +50,11 @@ Currently available overlay bundles: This overlay bundle requires GLIBC. JDK 9 requires ZLIB. +* kbd - Keyboard utilities and keymaps, you can for example load + a german keyboard layout: + + loadkeys de + * Links - Text based browser. Requires ~1MB additional space. Use the "links" command to activate the browser. From 04ecdb96ec2e589a8cc32c105cc389cf36670e6b Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Wed, 15 Nov 2017 12:55:00 -0500 Subject: [PATCH 21/27] Add vim bundle --- src/.config | 9 ++- src/README | 6 ++ src/minimal_overlay/bundles/vim/01_get.sh | 41 ++++++++++++++ src/minimal_overlay/bundles/vim/02_build.sh | 61 +++++++++++++++++++++ src/minimal_overlay/bundles/vim/bundle.sh | 9 +++ 5 files changed, 125 insertions(+), 1 deletion(-) create mode 100755 src/minimal_overlay/bundles/vim/01_get.sh create mode 100755 src/minimal_overlay/bundles/vim/02_build.sh create mode 100755 src/minimal_overlay/bundles/vim/bundle.sh diff --git a/src/.config b/src/.config index 23f091f50..aa769f654 100644 --- a/src/.config +++ b/src/.config @@ -116,6 +116,12 @@ STATIC_GET_SOURCE_URL=http://s.minos.io/s # UTIL_LINUX_SOURCE_URL=https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-2.31.tar.gz +# You can find the latest vim source bundles here: +# +# https://github.com/vim/vim/releases +# +VIM_SOURCE_URL=https://github.com/vim/vim/archive/v8.0.1298.tar.gz + # You can find the latest ZLIB source bundles here: # # http://zlib.net @@ -213,11 +219,12 @@ COPY_SOURCE_ISO=true # openjdk - installs Open JDK. All operations are automated. # static_get - portable binaries for Linux (http://s.minos.io). # util_linux - set of executable utilities distributed by the Linux Kernel Org. +# vim - an advanced text editor. # zlib - DEFLATE compression/decompression library. # # Refer to the README file for more information. # -#OVERLAY_BUNDLES=glibc_full,cf_cli,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,zlib +#OVERLAY_BUNDLES=glibc_full,cf_cli,dhcp,dropbear,felix,java,links,lua,mll_utils,nano,ncurses,nweb,static_get,util_linux,vim,zlib #OVERLAY_BUNDLES=glibc_full,dhcp,felix,links,openjdk,zlib # This property enables the standard penguin boot logo in the upper left corner diff --git a/src/README b/src/README index d4ac800e4..8a92d1d34 100644 --- a/src/README +++ b/src/README @@ -84,6 +84,12 @@ Currently available overlay bundles: Some packages in this overlay bundle require ncurses. +* vim - An advanced text editor that seeks to provide the power of + the de-facto Unix editor 'Vi', with a more complete feature + set. + + This package will create symlinks on top of vi. + * ZLIB - Software library used for data compression. diff --git a/src/minimal_overlay/bundles/vim/01_get.sh b/src/minimal_overlay/bundles/vim/01_get.sh new file mode 100755 index 000000000..2a3369e2a --- /dev/null +++ b/src/minimal_overlay/bundles/vim/01_get.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i VIM_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 vim source bundle file. The '-c' option allows the download to resume. + echo "Downloading vim source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local vim source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted vim. +echo "Removing vim work area. This may take a while..." +rm -rf $WORK_DIR/overlay/vim +mkdir $WORK_DIR/overlay/vim + +# Extract vim to folder 'work/overlay/vim'. +# Full path will be something like 'work/overlay/vim/vim-8.0.1298'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/vim + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/vim/02_build.sh b/src/minimal_overlay/bundles/vim/02_build.sh new file mode 100755 index 000000000..20a7c8c1a --- /dev/null +++ b/src/minimal_overlay/bundles/vim/02_build.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/vim + +DESTDIR="$PWD/vim_installed" + +# Change to the vim source directory which ls finds, e.g. 'vim-8.0.1298'. +cd $(ls -d vim-*) + +echo "Preparing vim work area. This may take a while..." +make -j $NUM_JOBS clean + +rm -rf $DESTDIR + +echo "Setting vimrc location..." +echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h + +echo "Configuring vim..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr + +echo "Building vim..." +make -j $NUM_JOBS + +echo "Installing vim..." +make -j $NUM_JOBS install DESTDIR=$DESTDIR + +echo "Generating vimrc..." +mkdir -p $DESTDIR/etc +cat > $DESTDIR/etc/vimrc << "EOF" +" Begin /etc/vimrc + +set nocompatible +set backspace=2 +set mouse=r +syntax on +set background=dark + +" End /etc/vimrc +EOF + +echo "Symlinking vim to vi..." +ln -sv vim $DESTDIR/usr/bin/vi +mkdir -p $DESTDIR/bin +ln -sv vim $DESTDIR/bin/vi + +echo "Reducing vim size..." +strip -g $DESTDIR/usr/bin/* + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" + +cp -r $DESTDIR/* $ROOTFS + +echo "vim has been installed." + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/vim/bundle.sh b/src/minimal_overlay/bundles/vim/bundle.sh new file mode 100755 index 000000000..ffd32c002 --- /dev/null +++ b/src/minimal_overlay/bundles/vim/bundle.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +./01_get.sh +./02_build.sh + +cd $SRC_DIR + From 46d7102136653098cd64424593c22750bb7b6047 Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Wed, 15 Nov 2017 21:07:57 +0200 Subject: [PATCH 22/27] Removed the sample line with all overlay bundles. The overlay bundles are well described now and there is sample line which provides the users with some hints how to use this functionality. --- src/.config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/.config b/src/.config index 03907bc2b..2e3b2d13b 100644 --- a/src/.config +++ b/src/.config @@ -237,7 +237,9 @@ COPY_SOURCE_ISO=true # # Refer to the README file for more information. # -#OVERLAY_BUNDLES=glibc_full,cf_cli,coreutils,dhcp,dropbear,felix,java,kbd,links,lua,mll_utils,nano,ncurses,nweb,openjdk,static_get,util_linux,vim,zlib +# The line below is sample which provides Open JDK, Apache Felix and Links. +# There is also DHCP/DNS functionality provided by the 'dhcp' overlay bundle. +# #OVERLAY_BUNDLES=glibc_full,dhcp,felix,links,openjdk,zlib # This property enables the standard penguin boot logo in the upper left corner From 171899ead13a17efe2daf78d6b6bc6f0344b8a85 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Wed, 15 Nov 2017 17:07:42 -0500 Subject: [PATCH 23/27] Add fio bundle --- src/.config | 7 ++++ src/README | 4 ++ src/minimal_overlay/bundles/fio/01_get.sh | 41 +++++++++++++++++++++ src/minimal_overlay/bundles/fio/02_build.sh | 38 +++++++++++++++++++ src/minimal_overlay/bundles/fio/bundle.sh | 9 +++++ 5 files changed, 99 insertions(+) create mode 100755 src/minimal_overlay/bundles/fio/01_get.sh create mode 100755 src/minimal_overlay/bundles/fio/02_build.sh create mode 100755 src/minimal_overlay/bundles/fio/bundle.sh diff --git a/src/.config b/src/.config index 2e3b2d13b..022f48fac 100644 --- a/src/.config +++ b/src/.config @@ -65,6 +65,12 @@ DROPBEAR_SOURCE_URL=http://matt.ucc.asn.au/dropbear/releases/dropbear-2017.75.ta # FELIX_SOURCE_URL=http://archive.apache.org/dist/felix/org.apache.felix.main.distribution-5.6.8.tar.gz +# You can find the latest fio source bundles here: +# +# https://github.com/axboe/fio/releases +# +FIO_SOURCE_URL=https://github.com/axboe/fio/archive/fio-3.2.tar.gz + # You need to manually download Oracle's JRE or JDK and set the property with # the absolute path to the downloaded archive. Example: # @@ -221,6 +227,7 @@ COPY_SOURCE_ISO=true # dhcp - DHCP and DNS functionality. # dropbear - SSH server and client. # felix - Apache Felix OSGi framework. +# fio - I/O load generator. # java - installs Oracle's JRE or JDK. Manual preparations are required. # kbd - keyboard utilities # links - text browser for the web. diff --git a/src/README b/src/README index 673b12652..8654250da 100644 --- a/src/README +++ b/src/README @@ -45,6 +45,10 @@ Currently available overlay bundles: This overlay bundle requires JRE or JDK. +* fio - I/O load generator that can simulate a wide variety of workloads + on RAM or disks. fio is essential for troubleshooting data + bottlenecks. + * JRE / JDK - Oracle's JRE or JDK. Requires ~366MB additional space for JDK. This overlay bundle requires some manual preparation steps. Refer to the "JAVA_ARCHIVE" property in the ".config" file for more diff --git a/src/minimal_overlay/bundles/fio/01_get.sh b/src/minimal_overlay/bundles/fio/01_get.sh new file mode 100755 index 000000000..d02590fb0 --- /dev/null +++ b/src/minimal_overlay/bundles/fio/01_get.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i FIO_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 fio source bundle file. The '-c' option allows the download to resume. + echo "Downloading fio source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local fio source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted fio. +echo "Removing fio work area. This may take a while..." +rm -rf $WORK_DIR/overlay/fio +mkdir $WORK_DIR/overlay/fio + +# Extract fio to folder 'work/overlay/fio'. +# Full path will be something like 'work/overlay/fio/fio-3.2'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/fio + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/fio/02_build.sh b/src/minimal_overlay/bundles/fio/02_build.sh new file mode 100755 index 000000000..d41153eca --- /dev/null +++ b/src/minimal_overlay/bundles/fio/02_build.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/fio + +DESTDIR="$PWD/fio_installed" + +# Change to the fio source directory which ls finds, e.g. 'fio-3.2'. +cd $(ls -d fio-*) + +echo "Preparing fio work area. This may take a while..." +make -j $NUM_JOBS clean + +rm -rf $DESTDIR + +echo "Configuring fio..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr + +echo "Building fio..." +make -j $NUM_JOBS + +echo "Installing fio..." +make -j $NUM_JOBS install DESTDIR=$DESTDIR + +echo "Reducing fio size..." +strip -g $DESTDIR/usr/bin/* + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" + +cp -r $DESTDIR/* $ROOTFS + +echo "fio has been installed." + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/fio/bundle.sh b/src/minimal_overlay/bundles/fio/bundle.sh new file mode 100755 index 000000000..ffd32c002 --- /dev/null +++ b/src/minimal_overlay/bundles/fio/bundle.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +./01_get.sh +./02_build.sh + +cd $SRC_DIR + From 497721addd0a8186cd080468e34a644bb7481d6f Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Wed, 15 Nov 2017 17:14:46 -0500 Subject: [PATCH 24/27] Add libevent bundle --- src/.config | 7 ++++ src/README | 4 ++ .../bundles/libevent/01_get.sh | 41 +++++++++++++++++++ .../bundles/libevent/02_build.sh | 37 +++++++++++++++++ .../bundles/libevent/bundle.sh | 9 ++++ 5 files changed, 98 insertions(+) create mode 100755 src/minimal_overlay/bundles/libevent/01_get.sh create mode 100755 src/minimal_overlay/bundles/libevent/02_build.sh create mode 100755 src/minimal_overlay/bundles/libevent/bundle.sh diff --git a/src/.config b/src/.config index 2e3b2d13b..c25068120 100644 --- a/src/.config +++ b/src/.config @@ -84,6 +84,12 @@ KBD_SOURCE_URL=https://www.kernel.org/pub/linux/utils/kbd/kbd-2.0.4.tar.gz # KEXEC_TOOLS_SOURCE_URL=http://kernel.org/pub/linux/utils/kernel/kexec/kexec-tools-2.0.15.tar.xz +# You can find the latest libevent archives here: +# +# https://github.com/libevent/libevent/releases/ +# +LIBEVENT_SOURCE_URL=https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz + # You can find the latest Links source bundles here: # # http://links.twibright.com @@ -223,6 +229,7 @@ COPY_SOURCE_ISO=true # felix - Apache Felix OSGi framework. # java - installs Oracle's JRE or JDK. Manual preparations are required. # kbd - keyboard utilities +# libevent - event notification library. # links - text browser for the web. # lua - scripting language. # mll_utils - set of executable utilities (mll-*). diff --git a/src/README b/src/README index 673b12652..a78a43144 100644 --- a/src/README +++ b/src/README @@ -57,6 +57,10 @@ Currently available overlay bundles: loadkeys de +* libevent - event notification library API provides a mechanism to execute a + callback function when a specific event occurs on a file + descriptor or after a timeout has been reached. + * Links - Text based browser. Requires ~1MB additional space. Use the "links" command to activate the browser. diff --git a/src/minimal_overlay/bundles/libevent/01_get.sh b/src/minimal_overlay/bundles/libevent/01_get.sh new file mode 100755 index 000000000..79beb6988 --- /dev/null +++ b/src/minimal_overlay/bundles/libevent/01_get.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i LIBEVENT_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 libevent source bundle file. The '-c' option allows the download to resume. + echo "Downloading libevent source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local libevent source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted libevent. +echo "Removing libevent work area. This may take a while..." +rm -rf $WORK_DIR/overlay/libevent +mkdir $WORK_DIR/overlay/libevent + +# Extract libevent to folder 'work/overlay/libevent'. +# Full path will be something like 'work/overlay/libevent/libevent-2.1.8-stable'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/libevent + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/libevent/02_build.sh b/src/minimal_overlay/bundles/libevent/02_build.sh new file mode 100755 index 000000000..3360ed45b --- /dev/null +++ b/src/minimal_overlay/bundles/libevent/02_build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/libevent + +DESTDIR="$PWD/libevent_installed" + +# Change to the libevent source directory which ls finds, e.g. 'libevent-2.1.8-stable'. +cd $(ls -d libevent-*) + +echo "Preparing libevent work area. This may take a while..." +make -j $NUM_JOBS clean + +rm -rf $DESTDIR + +echo "Configuring libevent..." +CFLAGS="$CFLAGS" ./configure + +echo "Building libevent..." +make -j $NUM_JOBS + +echo "Installing libevent..." +make -j $NUM_JOBS install DESTDIR=$DESTDIR + +echo "Reducing libevent size..." +strip -g $DESTDIR/usr/bin/* + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" + +cp -r $DESTDIR/usr/local/* $ROOTFS + +echo "libevent has been installed." + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/libevent/bundle.sh b/src/minimal_overlay/bundles/libevent/bundle.sh new file mode 100755 index 000000000..ffd32c002 --- /dev/null +++ b/src/minimal_overlay/bundles/libevent/bundle.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +./01_get.sh +./02_build.sh + +cd $SRC_DIR + From b455e18eef18d5fcf30cd1fe2ee83906a6b0ee12 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Thu, 16 Nov 2017 12:06:30 -0500 Subject: [PATCH 25/27] Add stress bundle --- src/.config | 7 ++++ src/README | 4 ++ src/minimal_overlay/bundles/stress/01_get.sh | 41 +++++++++++++++++++ .../bundles/stress/02_build.sh | 38 +++++++++++++++++ src/minimal_overlay/bundles/stress/bundle.sh | 9 ++++ 5 files changed, 99 insertions(+) create mode 100755 src/minimal_overlay/bundles/stress/01_get.sh create mode 100755 src/minimal_overlay/bundles/stress/02_build.sh create mode 100755 src/minimal_overlay/bundles/stress/bundle.sh diff --git a/src/.config b/src/.config index b13145492..7628b6da3 100644 --- a/src/.config +++ b/src/.config @@ -133,6 +133,12 @@ OPENJDK_URL=http://download.java.net/java/GA/jdk9/9/binaries/jdk-9+181_linux-x64 # STATIC_GET_SOURCE_URL=http://s.minos.io/s +# You can find the latest stress archives here: +# +# https://people.seas.harvard.edu/~apw/stress/ +# +STRESS_SOURCE_URL=https://people.seas.harvard.edu/~apw/stress/stress-1.0.4.tar.gz + # You can find the latest util_linux archives here: # # https://www.kernel.org/pub/linux/utils/util-linux/ @@ -245,6 +251,7 @@ COPY_SOURCE_ISO=true # nweb - simple mini http server. # openjdk - installs Open JDK. All operations are automated. # static_get - portable binaries for Linux (http://s.minos.io). +# stress - CPU and RAM load generator. # util_linux - set of executable utilities distributed by the Linux Kernel Org. # vim - an advanced text editor. # zlib - DEFLATE compression/decompression library. diff --git a/src/README b/src/README index d96b286ee..b63b32837 100644 --- a/src/README +++ b/src/README @@ -94,6 +94,10 @@ Currently available overlay bundles: '-net nic,model=e1000 -net user,hostfwd=tcp::8080-:80' to 'cmd' in the qemu.sh file. +* stress - simple workload generator. Imposes a configurable amount of CPU, + memory, I/O, and disk stress on the system. stress is useful for + troubleshooting CPU and RAM. + * util_linux - Set of executable utilities distributed by the Linux Kernel similar to busybox or GNU Core Utils. diff --git a/src/minimal_overlay/bundles/stress/01_get.sh b/src/minimal_overlay/bundles/stress/01_get.sh new file mode 100755 index 000000000..c355eba02 --- /dev/null +++ b/src/minimal_overlay/bundles/stress/01_get.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +# Grab everything after the '=' character. +DOWNLOAD_URL=$(grep -i STRESS_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 stress source bundle file. The '-c' option allows the download to resume. + echo "Downloading stress source bundle from $DOWNLOAD_URL" + wget -c $DOWNLOAD_URL +else + echo "Using local stress source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE" +fi + +# Delete folder with previously extracted stress. +echo "Removing stress work area. This may take a while..." +rm -rf $WORK_DIR/overlay/stress +mkdir $WORK_DIR/overlay/stress + +# Extract stress to folder 'work/overlay/stress'. +# Full path will be something like 'work/overlay/stress/stress-1.0.4'. +tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/stress + +cd $SRC_DIR + diff --git a/src/minimal_overlay/bundles/stress/02_build.sh b/src/minimal_overlay/bundles/stress/02_build.sh new file mode 100755 index 000000000..6c1598a64 --- /dev/null +++ b/src/minimal_overlay/bundles/stress/02_build.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +. ../../common.sh + +cd $WORK_DIR/overlay/stress + +DESTDIR="$PWD/stress_installed" + +# Change to the stress source directory which ls finds, e.g. 'stress-1.0.4'. +cd $(ls -d stress-*) + +echo "Preparing stress work area. This may take a while..." +make -j $NUM_JOBS clean + +rm -rf $DESTDIR + +echo "Configuring stress..." +CFLAGS="$CFLAGS" ./configure \ + --prefix=/usr + +echo "Building stress..." +make -j $NUM_JOBS + +echo "Installing stress..." +make -j $NUM_JOBS install DESTDIR=$DESTDIR + +echo "Reducing stress size..." +strip -g $DESTDIR/usr/bin/* + +ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs" + +cp -r $DESTDIR/* $ROOTFS + +echo "stress has been installed." + +cd $SRC_DIR diff --git a/src/minimal_overlay/bundles/stress/bundle.sh b/src/minimal_overlay/bundles/stress/bundle.sh new file mode 100755 index 000000000..ffd32c002 --- /dev/null +++ b/src/minimal_overlay/bundles/stress/bundle.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +SRC_DIR=$(pwd) + +./01_get.sh +./02_build.sh + +cd $SRC_DIR + From 5528005736864a846e5a180891b3a6bae2dc8421 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Thu, 16 Nov 2017 12:29:10 -0500 Subject: [PATCH 26/27] Add script to generate overlay_bundle template --- src/generate_bundle_skel.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 src/generate_bundle_skel.sh diff --git a/src/generate_bundle_skel.sh b/src/generate_bundle_skel.sh new file mode 100755 index 000000000..da6cfafc2 --- /dev/null +++ b/src/generate_bundle_skel.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Generate basic template for a new overlay package + +# Rename the package and package version variables and run this script to +# generate a new overlay template + +package=test +ver=2.1 + +packcaps=${package^^} + +echo "Generating new overlay bundle template for $package..." + +cp -r minimal_overlay/bundles/coreutils minimal_overlay/bundles/$package +sed -i "s/.*Full path.*/# Full path will be something like \'work\/overlay\/$package\/$package-$ver\'./" minimal_overlay/bundles/$package/01_get.sh +sed -i "s/.*Extract coreutils.*/# Extract coreutils to folder \'work\/overlay\/$package\'./" minimal_overlay/bundles/$package/01_get.sh +sed -i "s/.*source directory which.*/# Change to the coreutils source directory which ls finds, e.g. \'$package-$ver\'./" minimal_overlay/bundles/$package/02_build.sh +sed -i "s/COREUTILS/$packcaps/g" minimal_overlay/bundles/$package/01_get.sh +sed -i "s/COREUTILS/$packcaps/g" minimal_overlay/bundles/$package/02_build.sh +sed -i "s/coreutils/$package/g" minimal_overlay/bundles/$package/01_get.sh +sed -i "s/coreutils/$package/g" minimal_overlay/bundles/$package/02_build.sh + +echo "Created new overlay bundle for $package." +echo "Update .config with source location and a brief description." +echo "Update README with package description and dependencies." From ec6c3a3b81c434296bcf5e1f449467ff2ebdda99 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Thu, 16 Nov 2017 13:10:02 -0500 Subject: [PATCH 27/27] Separated 01_get and 02_build changes --- src/generate_bundle_skel.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/generate_bundle_skel.sh b/src/generate_bundle_skel.sh index da6cfafc2..0a28a3f26 100755 --- a/src/generate_bundle_skel.sh +++ b/src/generate_bundle_skel.sh @@ -13,12 +13,14 @@ packcaps=${package^^} echo "Generating new overlay bundle template for $package..." cp -r minimal_overlay/bundles/coreutils minimal_overlay/bundles/$package + sed -i "s/.*Full path.*/# Full path will be something like \'work\/overlay\/$package\/$package-$ver\'./" minimal_overlay/bundles/$package/01_get.sh sed -i "s/.*Extract coreutils.*/# Extract coreutils to folder \'work\/overlay\/$package\'./" minimal_overlay/bundles/$package/01_get.sh -sed -i "s/.*source directory which.*/# Change to the coreutils source directory which ls finds, e.g. \'$package-$ver\'./" minimal_overlay/bundles/$package/02_build.sh sed -i "s/COREUTILS/$packcaps/g" minimal_overlay/bundles/$package/01_get.sh -sed -i "s/COREUTILS/$packcaps/g" minimal_overlay/bundles/$package/02_build.sh sed -i "s/coreutils/$package/g" minimal_overlay/bundles/$package/01_get.sh + +sed -i "s/.*source directory which.*/# Change to the coreutils source directory which ls finds, e.g. \'$package-$ver\'./" minimal_overlay/bundles/$package/02_build.sh +sed -i "s/COREUTILS/$packcaps/g" minimal_overlay/bundles/$package/02_build.sh sed -i "s/coreutils/$package/g" minimal_overlay/bundles/$package/02_build.sh echo "Created new overlay bundle for $package."