1 Star 0 Fork 0

OpenNuvoton / MA35D1_Yocto-v3.1.3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
init-build-env 4.64 KB
一键复制 编辑 原始数据 按行查看 历史
schung 提交于 2024-01-02 17:34 . Add MA35H0 platform
#!/bin/sh
CWD=`pwd`
PROGNAME="init-build-env"
usage()
{
echo -e "
Usage: MACHINE=<machine> DISTRO=<distro> source $PROGNAME <build-dir>
Usage: source $PROGNAME <build-dir>
<machine> machine name
<distro> distro name
<build-dir> build directory
The first usage is for creating a new build directory. In this case, the
script creates the build directory <build-dir>, configures it for the
specified <machine> and <distro>, and prepares the calling shell for running
bitbake on the build directory.
The second usage is for using an existing build directory. In this case,
the script prepares the calling shell for running bitbake on the build
directory <build-dir>. The build directory configuration is unchanged.
Examples:
- To create a new Yocto build directory:
$ MACHINE=ma35d1-evb DISTRO=nvt-ma35d1 source $PROGNAME build
- To use an existing Yocto build directory:
$ source $PROGNAME build
"
}
clean_up()
{
unset EULA LIST_MACHINES VALID_MACHINE
unset CWD TEMPLATES SHORTOPTS LONGOPTS ARGS PROGNAME
unset generated_config updated
unset MACHINE SDKMACHINE DISTRO OEROOT
}
# get command line options
SHORTOPTS="h"
LONGOPTS="help"
ARGS=$(getopt --options $SHORTOPTS \
--longoptions $LONGOPTS --name $PROGNAME -- "$@" )
# Print the usage menu if invalid options are specified
if [ $? != 0 -o $# -lt 1 ]; then
usage && clean_up
return 1
fi
eval set -- "$ARGS"
while true;
do
case $1 in
-h|--help)
usage
clean_up
return 0
;;
--)
shift
break
;;
esac
done
if [ "$(whoami)" = "root" ]; then
echo "ERROR: do not use the BSP as root. Exiting..."
fi
if [ ! -e $1/conf/local.conf.sample ]; then
build_dir_setup_enabled="true"
else
build_dir_setup_enabled="false"
fi
if [ "$build_dir_setup_enabled" = "true" ] && [ -z "$MACHINE" ]; then
usage
echo -e "ERROR: You must set MACHINE when creating a new build directory."
clean_up
return 1
fi
if [ -z "$SDKMACHINE" ]; then
SDKMACHINE='i686'
fi
if [ "$build_dir_setup_enabled" = "true" ] && [ -z "$DISTRO" ]; then
usage
echo -e "ERROR: You must set DISTRO when creating a new build directory."
clean_up
return 1
fi
OEROOT=$PWD/sources/poky
if [ -e $PWD/sources/oe-core ]; then
OEROOT=$PWD/sources/oe-core
fi
. $OEROOT/oe-init-build-env $CWD/$1 > /dev/null
# if conf/local.conf not generated, no need to go further
if [ ! -e conf/local.conf ]; then
clean_up && return 1
fi
# Clean up PATH, because if it includes tokens to current directories somehow,
# wrong binaries can be used instead of the expected ones during task execution
export PATH="`echo $PATH | sed 's/\(:.\|:\)*:/:/g;s/^.\?://;s/:.\?$//'`"
#Runing Xvfb :99 for using nu-eclipse to compie m4 bps
if ! pgrep Xvfb
then
Xvfb ":99" &> /dev/null &
fi
generated_config=
if [ "$build_dir_setup_enabled" = "true" ]; then
mv conf/local.conf conf/local.conf.sample
grep -v '^#\|^$' conf/local.conf.sample > conf/local.conf
# Generate the local.conf based on the Yocto default
TEMPLATES=$CWD/sources/meta-ma35d1/base/
if [[ "$DISTRO" == *"nvt-ma35d0"* ]]; then
TEMPLATES=$CWD/sources/meta-ma35d0/base/
echo MACHINE_FEATURES_append = \" optee \" >> conf/local.conf
elif [[ "$DISTRO" == *"nvt-ma35h0"* ]]; then
TEMPLATES=$CWD/sources/meta-ma35h0/base/
else
echo MACHINE_FEATURES_append = \" optee \" >> conf/local.conf
fi
cat >> conf/local.conf <<EOF
DL_DIR ?= "\${BSPDIR}/downloads/"
EOF
# Change settings according environment
sed -e "s,MACHINE ??=.*,MACHINE ??= '$MACHINE',g" \
-e "s,SDKMACHINE ??=.*,SDKMACHINE ??= '$SDKMACHINE',g" \
-e "s,DISTRO ?=.*,DISTRO ?= '$DISTRO',g" \
-i conf/local.conf
cp $TEMPLATES/* conf/
for s in $HOME/.oe $HOME/.yocto; do
if [ -e $s/site.conf ]; then
echo "Linking $s/site.conf to conf/site.conf"
ln -s $s/site.conf conf
fi
done
generated_config=1
fi
cat <<EOF
Welcome to Nuvoton Community BSP
The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
meta-toolchain
meta-toolchain-sdk
nvt-image-qt5
EOF
if [ -n "$generated_config" ]; then
cat <<EOF
Your build environment has been configured with:
MACHINE=$MACHINE
DISTRO=$DISTRO
EOF
else
echo "Your configuration files at $1 have not been touched."
fi
clean_up
C
1
https://gitee.com/OpenNuvoton/MA35D1_Yocto-v3.1.3.git
git@gitee.com:OpenNuvoton/MA35D1_Yocto-v3.1.3.git
OpenNuvoton
MA35D1_Yocto-v3.1.3
MA35D1_Yocto-v3.1.3
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891