meta-digi: improve mkproject script
Some minor enhancements to mkproject script: * Add 'conf-notes' files with DEY specific information. This is shown when you create the project or when you reload the environment in an already created project. * Create a 'dey-setup-environment' script in the project's folder that allows to reload the environment in a new terminal. * Remove the PATH variable tweaking. This was needed in older versions of Yocto, where the PATH kept growing each time you reloaded the environment, but it has been fixed in poky, so there is no need to do the same in our mkproject script. https://jira.digi.com/browse/DEL-1150 Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
parent
c9b82ed477
commit
a014ca4c09
|
|
@ -0,0 +1,11 @@
|
||||||
|
Digi Embedded Yocto provides two target images:
|
||||||
|
|
||||||
|
* dey-image-minimal: command line busybox-based image
|
||||||
|
|
||||||
|
This image does not support the X11 window system so in order to build
|
||||||
|
it you need to add the following line to the project's conf/local.conf:
|
||||||
|
|
||||||
|
DISTRO_FEATURES_remove = "x11"
|
||||||
|
|
||||||
|
* dey-image-graphical: graphical X11-based image with SATO theme
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
Digi Embedded Yocto provides two target images:
|
||||||
|
|
||||||
|
* dey-image-minimal: command line busybox-based image
|
||||||
|
|
||||||
|
This image does not support the X11 window system so in order to build
|
||||||
|
it you need to add the following line to the project's conf/local.conf:
|
||||||
|
|
||||||
|
DISTRO_FEATURES_remove = "x11"
|
||||||
|
|
||||||
|
* dey-image-graphical: graphical X11-based image with SATO theme
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
Digi Embedded Yocto provides two target images:
|
||||||
|
|
||||||
|
* dey-image-minimal: command line busybox-based image
|
||||||
|
|
||||||
|
This image does not support the X11 window system so in order to build
|
||||||
|
it you need to add the following line to the project's conf/local.conf:
|
||||||
|
|
||||||
|
DISTRO_FEATURES_remove = "x11"
|
||||||
|
|
||||||
|
* dey-image-graphical: graphical X11-based image with SATO theme
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
Digi Embedded Yocto provides two target images:
|
||||||
|
|
||||||
|
* dey-image-minimal: command line busybox-based image
|
||||||
|
|
||||||
|
This image does not support the X11 window system so in order to build
|
||||||
|
it you need to add the following line to the project's conf/local.conf:
|
||||||
|
|
||||||
|
DISTRO_FEATURES_remove = "x11"
|
||||||
|
|
||||||
|
* dey-image-graphical: graphical X11-based image with SATO theme
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
Digi Embedded Yocto provides two target images:
|
||||||
|
|
||||||
|
* dey-image-minimal: command line busybox-based image
|
||||||
|
|
||||||
|
This image does not support the X11 window system so in order to build
|
||||||
|
it you need to add the following line to the project's conf/local.conf:
|
||||||
|
|
||||||
|
DISTRO_FEATURES_remove = "x11"
|
||||||
|
|
||||||
|
* dey-image-graphical: graphical X11-based image with SATO theme
|
||||||
|
|
||||||
|
|
@ -30,6 +30,16 @@ MKP_CONFIGPATH="${MKP_SCRIPTPATH}/sources/meta-digi/sdk/config"
|
||||||
# Blacklist platforms (not officially supported in a DEY release)
|
# Blacklist platforms (not officially supported in a DEY release)
|
||||||
MKP_BLACKLIST_PLATFORMS=""
|
MKP_BLACKLIST_PLATFORMS=""
|
||||||
|
|
||||||
|
MKP_SETUP_ENVIRONMENT='#!/bin/bash
|
||||||
|
|
||||||
|
if [ "${BASH_SOURCE}" = "${0}" ]; then
|
||||||
|
printf "\\n[ERROR]: This script needs to be sourced\\n\\n"
|
||||||
|
else
|
||||||
|
cd $(dirname ${BASH_SOURCE})
|
||||||
|
. %s/sources/poky/oe-init-build-env .
|
||||||
|
fi
|
||||||
|
'
|
||||||
|
|
||||||
## Local functions
|
## Local functions
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
@ -81,17 +91,18 @@ do_mkproject() {
|
||||||
source ${MKP_SCRIPTPATH}/sources/poky/oe-init-build-env .
|
source ${MKP_SCRIPTPATH}/sources/poky/oe-init-build-env .
|
||||||
unset TEMPLATECONF
|
unset TEMPLATECONF
|
||||||
|
|
||||||
# Remove possible duplicated entries in PATH (due to re-sourcing the script)
|
# New project
|
||||||
export PATH=$(printf ${PATH} | awk -v RS=: '{if (!arr[$0]++) {printf("%s%s", !ln++ ? "" : ":", $0) }}')
|
|
||||||
|
|
||||||
# Customize project if just created
|
|
||||||
if [ -z "${MKP_OLD_PROJECT}" ]; then
|
if [ -z "${MKP_OLD_PROJECT}" ]; then
|
||||||
|
# Customize project
|
||||||
chmod 644 ${MKP_PROJECTPATH}/conf/bblayers.conf ${MKP_PROJECTPATH}/conf/local.conf
|
chmod 644 ${MKP_PROJECTPATH}/conf/bblayers.conf ${MKP_PROJECTPATH}/conf/local.conf
|
||||||
sed -i -e "s,##DIGIBASE##,${MKP_SCRIPTPATH}/sources,g" ${MKP_PROJECTPATH}/conf/bblayers.conf
|
sed -i -e "s,##DIGIBASE##,${MKP_SCRIPTPATH}/sources,g" ${MKP_PROJECTPATH}/conf/bblayers.conf
|
||||||
if [ -n "${MKP_VARIANT+x}" ]; then
|
if [ -n "${MKP_VARIANT+x}" ]; then
|
||||||
sed -i -e "/^MACHINE_VARIANT =/cMACHINE_VARIANT = \"${MKP_VARIANT}\"" \
|
sed -i -e "/^MACHINE_VARIANT =/cMACHINE_VARIANT = \"${MKP_VARIANT}\"" \
|
||||||
${MKP_PROJECTPATH}/conf/local.conf
|
${MKP_PROJECTPATH}/conf/local.conf
|
||||||
fi
|
fi
|
||||||
|
# Create dey-setup-environment script
|
||||||
|
printf "${MKP_SETUP_ENVIRONMENT}" "${MKP_SCRIPTPATH}" > ${MKP_PROJECTPATH}/dey-setup-environment
|
||||||
|
chmod +x ${MKP_PROJECTPATH}/dey-setup-environment
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,6 +148,16 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# clean-up all variables (so the script can be re-sourced)
|
# clean-up all variables (so the script can be re-sourced)
|
||||||
unset MKP_AVAILABLE_PLATFORMS MKP_BLACKLIST_PLATFORMS MKP_GREEN MKP_LIST_PLATFORMS \
|
unset MKP_AVAILABLE_PLATFORMS \
|
||||||
MKP_NONE MKP_OLD_PROJECT MKP_PLATFORM MKP_PROJECTPATH MKP_RED MKP_SCRIPTNAME \
|
MKP_BLACKLIST_PLATFORMS \
|
||||||
MKP_SCRIPTPATH MKP_VARIANT
|
MKP_GREEN \
|
||||||
|
MKP_LIST_PLATFORMS \
|
||||||
|
MKP_NONE \
|
||||||
|
MKP_OLD_PROJECT \
|
||||||
|
MKP_PLATFORM \
|
||||||
|
MKP_PROJECTPATH \
|
||||||
|
MKP_RED \
|
||||||
|
MKP_SCRIPTNAME \
|
||||||
|
MKP_SCRIPTPATH \
|
||||||
|
MKP_SETUP_ENVIRONMENT \
|
||||||
|
MKP_VARIANT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue