Set variant during image build

This commit is contained in:
Bob Mottram 2016-05-28 13:42:50 +01:00
parent e97db260a7
commit a83bf3e8ca
3 changed files with 7 additions and 2 deletions

View File

@ -362,7 +362,8 @@ make $IMAGE_TYPE \
WIFI_TYPE="$WIFI_TYPE" \
WIFI_PASSPHRASE="$WIFI_PASSPHRASE" \
WIFI_HOTSPOT="$WIFI_HOTSPOT" \
WIFI_NETWORKS_FILE="$WIFI_NETWORKS_FILE"
WIFI_NETWORKS_FILE="$WIFI_NETWORKS_FILE" \
VARIANT="$VARIANT"
if [ ! "$?" = "0" ]; then
echo $'Build failed'

View File

@ -35,6 +35,8 @@ COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
PROJECT_REPO="https://github.com/bashrc/${PROJECT_NAME}"
VARIANT='full'
# username created by default within a debian image
GENERIC_IMAGE_USERNAME='fbone'
@ -230,7 +232,6 @@ create_generic_image() {
if [[ $GENERIC_IMAGE == "no" ]]; then
return
fi
VARIANT="full"
if [ $CONFIG_FILENAME ]; then
if [[ "$CONFIG_FILENAME" == *"mesh.cfg"* ]]; then
VARIANT="mesh"
@ -888,6 +889,7 @@ initialise_mesh() {
if [[ $VARIANT != "mesh" || $DEBIAN_INSTALL_ONLY != "no" ]]; then
return
fi
mesh_firewall
mesh_avahi
mesh_batman

View File

@ -62,6 +62,7 @@ export WIFI_TYPE
export WIFI_PASSPHRASE
export WIFI_HOTSPOT
export WIFI_NETWORKS_FILE
export VARIANT
# Locate vmdebootstrap program fetched in Makefile
basedir=`pwd`
@ -183,6 +184,7 @@ sudo sed -i "s|WIFI_TYPE=.*|WIFI_TYPE=\"${WIFI_TYPE}\"|g" $TEMP_CUSTOMISE
sudo sed -i "s|WIFI_PASSPHRASE=.*|WIFI_PASSPHRASE=\"${WIFI_PASSPHRASE}\"|g" $TEMP_CUSTOMISE
sudo sed -i "s|WIFI_HOTSPOT=.*|WIFI_HOTSPOT=\"${WIFI_HOTSPOT}\"|g" $TEMP_CUSTOMISE
sudo sed -i "s|WIFI_NETWORKS_FILE=.*|WIFI_NETWORKS_FILE=\"${WIFI_NETWORKS_FILE}\"|g" $TEMP_CUSTOMISE
sudo sed -i "s|VARIANT=.*|VARIANT=\"${VARIANT}\"|g" $TEMP_CUSTOMISE
echo $"starting $VMDEBOOTSTRAP"
# Run vmdebootstrap script to create image