netmodule-wireless-linux/nwl-init-build-env

36 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
# This script is used to setup the OE Build Environment
# Normally this is called as '. ./nwl-init-build-env <builddir>'
# On some shell, we can get the path of this script when sources. Otherwise we
# use the current directory as a fallback
if [ -z "$PRODUCT_ROOT" ]; then
if [ -n "$BASH_SOURCE" ]; then
PRODUCT_ROOT=$(dirname "$BASH_SOURCE")
elif [ -n "$ZSH_NAME" ]; then
PRODUCT_ROOT=$(dirname "$0")
else
PRODUCT_ROOT="$(pwd)"
fi
fi
# Get a non relative path to the root directory
PRODUCT_ROOT=$(readlink -f "${PRODUCT_ROOT}")
# CoreOS init settings
COREOS_ROOT="${PRODUCT_ROOT}/coreos"
TEMPLATECONF="${PRODUCT_ROOT}/templates"
# Call the coreos-init-build-env scripts of CoreOS
. "${COREOS_ROOT}/coreos-init-build-env" "${1:-$PRODUCT_ROOT/build}"
# From here the scripts and functions defined by CoreOS and
# OpenEmbedded-Core are available
# Add support for ##PRODUCTS_LAYERSDIR## inside of bblayer template
coreos-bblayers-envsub PRODUCT_LAYERSDIR "${PRODUCT_ROOT}/layers"
# Add the scripts directory of the product to the path
coreos_path_add "${PRODUCT_ROOT}/scripts"