mkproject: add support for platform variants
This commit adds basic support for platform variants. The script does not make any sanity check on the variant name. It's user's responsibility to use the correct variant for the platform. https://jira.digi.com/browse/DEL-435 Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
parent
80f7892306
commit
69afa07596
|
|
@ -35,9 +35,14 @@ Usage: source ${SCRIPTNAME} [OPTIONS]
|
||||||
|
|
||||||
-l list available platforms
|
-l list available platforms
|
||||||
-p <platform> select platform for the project
|
-p <platform> select platform for the project
|
||||||
|
-v <variant> select platform variant
|
||||||
|
|
||||||
Available platforms: ${AVAILABLE_PLATFORMS}
|
Available platforms: ${AVAILABLE_PLATFORMS}
|
||||||
|
|
||||||
|
See platform include files for supported variant names:
|
||||||
|
|
||||||
|
${SCRIPTPATH}/sources/meta-digi/meta-digi-arm/conf/machine/include/<platform>.inc
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,6 +77,10 @@ do_mkproject() {
|
||||||
sed -i -e "/^#BB_NUMBER_THREADS =/cBB_NUMBER_THREADS = \"${NCPU}\"" \
|
sed -i -e "/^#BB_NUMBER_THREADS =/cBB_NUMBER_THREADS = \"${NCPU}\"" \
|
||||||
-e "/^#PARALLEL_MAKE =/cPARALLEL_MAKE = \"-j ${NCPU}\"" \
|
-e "/^#PARALLEL_MAKE =/cPARALLEL_MAKE = \"-j ${NCPU}\"" \
|
||||||
${PROJECTPATH}/conf/local.conf
|
${PROJECTPATH}/conf/local.conf
|
||||||
|
if [ -n "${variant}" ]; then
|
||||||
|
sed -i -e "/^MACHINE_VARIANT =/cMACHINE_VARIANT = \"${variant}\"" \
|
||||||
|
${PROJECTPATH}/conf/local.conf
|
||||||
|
fi
|
||||||
unset NCPU
|
unset NCPU
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -94,10 +103,11 @@ AVAILABLE_PLATFORMS="$(echo $(ls -1 ${CONFIGPATH}/*/local.conf.sample | sed -e '
|
||||||
# The script needs to be sourced (not executed) so make sure to
|
# The script needs to be sourced (not executed) so make sure to
|
||||||
# initialize OPTIND variable for getopts.
|
# initialize OPTIND variable for getopts.
|
||||||
OPTIND=1
|
OPTIND=1
|
||||||
while getopts "lp:" c; do
|
while getopts "lp:v:" c; do
|
||||||
case "${c}" in
|
case "${c}" in
|
||||||
l) list_platforms="y";;
|
l) list_platforms="y";;
|
||||||
p) platform="${OPTARG}";;
|
p) platform="${OPTARG}";;
|
||||||
|
v) variant="${OPTARG}";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
@ -118,4 +128,4 @@ fi
|
||||||
|
|
||||||
# clean-up all variables (so the script can be re-sourced)
|
# clean-up all variables (so the script can be re-sourced)
|
||||||
unset AVAILABLE_PLATFORMS GREEN NONE OLD_PROJECT PROJECTPATH RED SCRIPTNAME SCRIPTPATH
|
unset AVAILABLE_PLATFORMS GREEN NONE OLD_PROJECT PROJECTPATH RED SCRIPTNAME SCRIPTPATH
|
||||||
unset list_platforms platform
|
unset list_platforms platform variant
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue