Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scarthgap #333

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions build/barys
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ LOGFILE=`pwd`/`basename "$0"`.log
MACHINES=
BITBAKEARGS=
EXIT_CODE=0
USE_OLD_SYNTAX=yes
NEW_SYNTAX_RELEASES=("honister" "kirkstone")
USE_OLD_SYNTAX=no
OLD_SYNTAX_RELEASES=(pyro rocko sumo thud warrior dunfell)


function help {
echo
Expand Down Expand Up @@ -430,13 +431,23 @@ if [ "x$REMOVEBUILD" == "xyes" ]; then
rm -rf $SCRIPTPATH/../../$BUILD_DIR
fi

BALENA_MACHINE_LAYER=$(ls ${SCRIPTPATH}/../../layers/meta-balena*/conf/samples/bblayers.conf.sample | awk -F'/' '{print $(NF-3)}')
LAYERSCONF_PATH=$(find "${SCRIPTPATH}/../../layers/meta-balena"* -name bblayers.conf.sample)
if [ "$(dirname LAYERSCONF_PATH)" = "samples" ]; then
BALENA_MACHINE_LAYER=$(echo "${LAYERSCONF_PATH}" | awk -F'/' '{print $(NF-3)}')
else
BALENA_MACHINE_LAYER=$(echo "${LAYERSCONF_PATH}" | awk -F'/' '{print $(NF-4)}')
fi

# Configure build

$SCRIPTPATH/generate-conf-notes.sh $SCRIPTPATH/../../layers/${BALENA_MACHINE_LAYER}/conf/ ${DEVICE_TYPES_JSONS}

export TEMPLATECONF=${SCRIPTPATH}/../../layers/${BALENA_MACHINE_LAYER}/conf/samples
export TEMPLATECONF="$(dirname ${LAYERSCONF_PATH})"
# scarthgap expects templates to be contained in a subdirectory inside templates/
if [ -d "${TEMPLATECONF}/default" ]; then
TEMPLATECONF="${TEMPLATECONF}/default"
fi

source ${SCRIPTPATH}/../../layers/poky/oe-init-build-env ${SCRIPTPATH}/../../${BUILD_DIR}
if [ "x$DEVELOPMENT_IMAGE" == "xyes" ]; then
sed -i "s/.*OS_DEVELOPMENT =.*/OS_DEVELOPMENT = \"1\"/g" conf/local.conf
Expand Down Expand Up @@ -474,16 +485,14 @@ for pair in $ADDITIONAL_VARIABLES; do
done

DEVICE_LAYER_CONF=$(ls ${SCRIPTPATH}/../../layers/meta-balena-*/conf/layer.conf)
if [[ -d "${SCRIPTPATH}/../../layers/meta-balena/meta-balena-${NEW_SYNTAX_RELEASES[0]}" ]]; then
for poky_release in ${NEW_SYNTAX_RELEASES[@]}; do
if ls "${SCRIPTPATH}/../../layers/meta-balena/meta-*-${OLD_SYNTAX_RELEASES[0]}" >/dev/null 2>&1; then
for poky_release in "${OLD_SYNTAX_RELEASES[@]}"; do
if grep -q -i "LAYERSERIES_COMPAT.*$poky_release" ${DEVICE_LAYER_CONF}; then
log "Release $poky_release already supported by device integration layer, will not revert meta-balena-common syntax."
USE_OLD_SYNTAX=no
log "Release $poky_release not supported by device integration layer, will revert meta-balena-common syntax."
USE_OLD_SYNTAX=yes
break;
fi
done
else
USE_OLD_SYNTAX=no
fi

if [ "$USE_OLD_SYNTAX" == "yes" ]; then
Expand Down
Loading