commit
54800aa7c2
@ -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.
|
||||
|
@ -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.
|
||||
|
||||
|
41
src/minimal_overlay/bundles/stress/01_get.sh
Executable file
41
src/minimal_overlay/bundles/stress/01_get.sh
Executable file
@ -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
|
||||
|
38
src/minimal_overlay/bundles/stress/02_build.sh
Executable file
38
src/minimal_overlay/bundles/stress/02_build.sh
Executable file
@ -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
|
9
src/minimal_overlay/bundles/stress/bundle.sh
Executable file
9
src/minimal_overlay/bundles/stress/bundle.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
./01_get.sh
|
||||
./02_build.sh
|
||||
|
||||
cd $SRC_DIR
|
||||
|
Loading…
x
Reference in New Issue
Block a user