From 76c47fbd98f0665ec4a99e035fb2b37e8a315b88 Mon Sep 17 00:00:00 2001
From: Ivan Davidov <davidov.i@gmail.com>
Date: Mon, 4 Dec 2017 17:45:52 +0200
Subject: [PATCH] Use local configuration (stress).

---
 src/.config                                  | 6 ------
 src/minimal_overlay/bundles/stress/.config   | 5 +++++
 src/minimal_overlay/bundles/stress/01_get.sh | 8 +++-----
 3 files changed, 8 insertions(+), 11 deletions(-)
 create mode 100644 src/minimal_overlay/bundles/stress/.config

diff --git a/src/.config b/src/.config
index bb615f2ce..7af4ebfe2 100644
--- a/src/.config
+++ b/src/.config
@@ -41,12 +41,6 @@ SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.0
 #                                                                   #
 #####################################################################
 
-# 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/
diff --git a/src/minimal_overlay/bundles/stress/.config b/src/minimal_overlay/bundles/stress/.config
new file mode 100644
index 000000000..8c2e4c9dc
--- /dev/null
+++ b/src/minimal_overlay/bundles/stress/.config
@@ -0,0 +1,5 @@
+# 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
diff --git a/src/minimal_overlay/bundles/stress/01_get.sh b/src/minimal_overlay/bundles/stress/01_get.sh
index f403fc702..456868e04 100755
--- a/src/minimal_overlay/bundles/stress/01_get.sh
+++ b/src/minimal_overlay/bundles/stress/01_get.sh
@@ -4,15 +4,13 @@ set -e
 
 . ../../common.sh
 
-# Grab everything after the '=' character.
-DOWNLOAD_URL=$(grep -i STRESS_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
+# Read the common configuration properties.
+DOWNLOAD_URL=`read_property STRESS_SOURCE_URL`
+USE_LOCAL_SOURCE=`read_property USE_LOCAL_SOURCE`
 
 # 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"