Overlay bundles now can have their own '.config' files.
This commit is contained in:
parent
e7bed86b9c
commit
d927196cad
15
src/.config
15
src/.config
@ -41,18 +41,6 @@ SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.0
|
|||||||
# #
|
# #
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# You can find the latest Cloud Foundry CLI binary here:
|
|
||||||
#
|
|
||||||
# http://github.com/cloudfoundry/cli
|
|
||||||
#
|
|
||||||
BOSH_CLI_URL=https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-2.0.45-linux-amd64
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# You can find the latest coreutils source bundles here:
|
# You can find the latest coreutils source bundles here:
|
||||||
#
|
#
|
||||||
# http://ftp.gnu.org/gnu/coreutils/
|
# http://ftp.gnu.org/gnu/coreutils/
|
||||||
@ -273,7 +261,8 @@ OVERLAY_TYPE=folder
|
|||||||
#
|
#
|
||||||
# The default overlay bundles are 'dhcp' and 'mll_source'.
|
# The default overlay bundles are 'dhcp' and 'mll_source'.
|
||||||
#
|
#
|
||||||
OVERLAY_BUNDLES=dhcp,mll_source
|
#OVERLAY_BUNDLES=dhcp,mll_source
|
||||||
|
OVERLAY_BUNDLES=cf_tools
|
||||||
|
|
||||||
# The location where the overlay bundle software will be stored.
|
# The location where the overlay bundle software will be stored.
|
||||||
#
|
#
|
||||||
|
5
src/minimal_overlay/bundles/bosh_cli/.config
Normal file
5
src/minimal_overlay/bundles/bosh_cli/.config
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# You can find the latest BOSH CLI binary here:
|
||||||
|
#
|
||||||
|
# https://bosh.io/docs/cli-v2.html
|
||||||
|
#
|
||||||
|
BOSH_CLI_URL=https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-2.0.45-linux-amd64
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Grab everything after the '=' character.
|
. ../../common.sh
|
||||||
DOWNLOAD_URL=`grep -i ^BOSH_CLI_URL= $CONFIG | cut -f2- -d'=' | xargs`
|
|
||||||
|
|
||||||
# Read the 'USE_LOCAL_SOURCE' property from '.config'
|
# Read the common configuration properties.
|
||||||
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
DOWNLOAD_URL=`read_property BOSH_CLI_URL`
|
||||||
|
USE_LOCAL_SOURCE=`read_property USE_LOCAL_SOURCE`
|
||||||
|
|
||||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/bosh-cli ] ; then
|
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/bosh-cli ] ; then
|
||||||
echo "Shell script '$MAIN_SRC_DIR/source/overlay/bosh-cli' is missing and will be downloaded."
|
echo "Shell script '$MAIN_SRC_DIR/source/overlay/bosh-cli' is missing and will be downloaded."
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
. ../../common.sh
|
||||||
|
|
||||||
echo "Removing old 'BOSH CLI' artifacts. This may take a while."
|
echo "Removing old 'BOSH CLI' artifacts. This may take a while."
|
||||||
rm -rf $DEST_DIR
|
rm -rf $DEST_DIR
|
||||||
mkdir -p $DEST_DIR/opt/$BUNDLE_NAME
|
mkdir -p $DEST_DIR/opt/$BUNDLE_NAME
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
. ../../common.sh
|
|
||||||
|
|
||||||
./01_get.sh
|
./01_get.sh
|
||||||
./02_install.sh
|
./02_install.sh
|
||||||
|
|
||||||
|
5
src/minimal_overlay/bundles/cf_cli/.config
Normal file
5
src/minimal_overlay/bundles/cf_cli/.config
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# 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
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Grab everything after the '=' character.
|
. ../../common.sh
|
||||||
DOWNLOAD_URL=`grep -i ^CLOUD_FOUNDRY_CLI_URL= $CONFIG | cut -f2- -d'=' | xargs`
|
|
||||||
|
|
||||||
# Read the 'USE_LOCAL_SOURCE' property from '.config'
|
# Read the common configuration properties.
|
||||||
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
DOWNLOAD_URL=`read_property CLOUD_FOUNDRY_CLI_URL`
|
||||||
|
USE_LOCAL_SOURCE=`read_property USE_LOCAL_SOURCE`
|
||||||
|
|
||||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/cf-cli.tgz ] ; then
|
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/cf-cli.tgz ] ; then
|
||||||
echo "Shell script $MAIN_SRC_DIR/source/overlay/cf-cli.tgz is missing and will be downloaded."
|
echo "Shell script $MAIN_SRC_DIR/source/overlay/cf-cli.tgz is missing and will be downloaded."
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
. ../../common.sh
|
||||||
|
|
||||||
echo "Removing old 'Cloud Foundry CLI' artifacts. This may take a while."
|
echo "Removing old 'Cloud Foundry CLI' artifacts. This may take a while."
|
||||||
rm -rf $DEST_DIR
|
rm -rf $DEST_DIR
|
||||||
mkdir -p $DEST_DIR/opt/$BUNDLE_NAME
|
mkdir -p $DEST_DIR/opt/$BUNDLE_NAME
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
. ../../common.sh
|
|
||||||
|
|
||||||
./01_get.sh
|
./01_get.sh
|
||||||
./02_install.sh
|
./02_install.sh
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ set -e
|
|||||||
|
|
||||||
export MAIN_SRC_DIR=`realpath --no-symlinks $PWD/../../../`
|
export MAIN_SRC_DIR=`realpath --no-symlinks $PWD/../../../`
|
||||||
export WORK_DIR=$MAIN_SRC_DIR/work
|
export WORK_DIR=$MAIN_SRC_DIR/work
|
||||||
export SRC_DIR=`pwd`
|
export SRC_DIR=`realpath --no-symlinks $PWD`
|
||||||
export OVERLAY_ROOTFS=$WORK_DIR/overlay_rootfs
|
export OVERLAY_ROOTFS=$WORK_DIR/overlay_rootfs
|
||||||
export BUNDLE_NAME=`basename $SRC_DIR`
|
export BUNDLE_NAME=`basename $SRC_DIR`
|
||||||
export DEST_DIR=$WORK_DIR/overlay/$BUNDLE_NAME/${BUNDLE_NAME}_installed
|
export DEST_DIR=$WORK_DIR/overlay/$BUNDLE_NAME/${BUNDLE_NAME}_installed
|
||||||
@ -15,6 +15,41 @@ export CONFIG=$MAIN_SRC_DIR/.config
|
|||||||
export SYSROOT=$WORK_DIR/sysroot
|
export SYSROOT=$WORK_DIR/sysroot
|
||||||
#export SYSROOT_SPECS=$WORK_DIR/sysroot.specs
|
#export SYSROOT_SPECS=$WORK_DIR/sysroot.specs
|
||||||
|
|
||||||
|
# This function reads property from the main '.config' file.
|
||||||
|
# If there is local '.config' file in the current directory
|
||||||
|
# the property value is overridden with the value found in
|
||||||
|
# the local '.config' file, if the property is present there.
|
||||||
|
#
|
||||||
|
# Using () instead of {} for the function body is a POSIX
|
||||||
|
# compliant way to execute subshell and as consequence all
|
||||||
|
# variables in the function will become effectively in local
|
||||||
|
# scope. Note that the 'local' keyword is supported by most
|
||||||
|
# shells but it is not POSIX compliant.
|
||||||
|
read_property() (
|
||||||
|
# The property we are looking for.
|
||||||
|
prop_name=$1
|
||||||
|
|
||||||
|
# The value of the property set initially to empty string.
|
||||||
|
prop_value=
|
||||||
|
|
||||||
|
if [ ! "$prop_name" = "" ] ; then
|
||||||
|
# Search in the main '.config' file.
|
||||||
|
prop_value=`grep -i ^${prop_name}= $CONFIG | cut -f2- -d'=' | xargs`
|
||||||
|
|
||||||
|
if [ -f $SRC_DIR/.config ] ; then
|
||||||
|
# Search in the local '.config' file.
|
||||||
|
prop_value_local=`grep -i ^${prop_name}= $SRC_DIR/.config | cut -f2- -d'=' | xargs`
|
||||||
|
|
||||||
|
if [ ! "$prop_value_local" = "" ] ; then
|
||||||
|
# Override the original value with the local value.
|
||||||
|
prop_value=$prop_value_local
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $prop_value
|
||||||
|
)
|
||||||
|
|
||||||
# Read the 'JOB_FACTOR' property from $CONFIG
|
# Read the 'JOB_FACTOR' property from $CONFIG
|
||||||
export JOB_FACTOR="$(grep -i ^JOB_FACTOR $CONFIG | cut -f2 -d'=')"
|
export JOB_FACTOR="$(grep -i ^JOB_FACTOR $CONFIG | cut -f2 -d'=')"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user