mirror of
https://github.com/feyisay07/meta-bsp-imx8mm.git
synced 2026-09-24 14:20:07 +01:00
119 lines
2.9 KiB
Bash
Executable File
119 lines
2.9 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
declare -A SUPPORTED_MACHINE=([mcm-imx8m-mini]=1 [ucm-imx8m-mini]=1)
|
|
|
|
get_meta() {
|
|
if [[ -d ${dir} ]];then
|
|
git -C ${dir} remote update
|
|
git -C ${dir} pull
|
|
else
|
|
git clone ${url} ${branch} ${dir}
|
|
fi
|
|
}
|
|
|
|
get_meta_compulab() {
|
|
dir="../sources/meta-compulab"
|
|
branch="-b devel"
|
|
url="https://github.com/compulab-yokneam/meta-compulab"
|
|
get_meta ${url} ${branch} ${dir}
|
|
}
|
|
|
|
get_meta_compulab_bsp() {
|
|
dir="../sources/meta-compulab-bsp"
|
|
branch="-b master"
|
|
url="https://github.com/compulab-yokneam/meta-compulab-bsp"
|
|
get_meta ${url} ${branch} ${dir}
|
|
}
|
|
|
|
mod_bblayer() {
|
|
# Get CompuLab Main meta layer
|
|
get_meta_compulab
|
|
get_meta_compulab_bsp
|
|
# A mandatory bsp layer: kernel, u-boot, imx-boot
|
|
cat << eof | tee -a ${BBLAYERS_CONF} > /dev/null
|
|
BBLAYERS += " \\
|
|
\${BSPDIR}/sources/meta-compulab \\
|
|
\${BSPDIR}/sources/meta-compulab-bsp/meta-desktop \\
|
|
\${BSPDIR}/sources/meta-compulab-bsp/meta-multimedia \\
|
|
\${BSPDIR}/sources/meta-compulab-bsp/meta-graphics \\
|
|
\${BSPDIR}/sources/meta-compulab-bsp/meta-bsp \\
|
|
\${BSPDIR}/sources/meta-bsp-imx8mm \\
|
|
"
|
|
eof
|
|
}
|
|
|
|
mod_local() {
|
|
# Modify local.conf
|
|
CORE_IMAGE_EXTRA_INSTALL+=" dhcp-client memtester cl-uboot cl-deploy cl-launcher cl-stest cl-camera u-boot-fw-utils imx-gpu-viv-demos"
|
|
CORE_IMAGE_EXTRA_INSTALL+=" htop iotop tmux iperf3 wvdial"
|
|
CORE_IMAGE_EXTRA_INSTALL_ucm-imx8m-mini += " cl-migrate-env"
|
|
IMAGE_FEATURES+=" package-management ssh-server-openssh "
|
|
cat << eof | tee -a ${LOCAL_CONF} > /dev/null
|
|
IMAGE_INSTALL_append += "kernel-devicetree"
|
|
CORE_IMAGE_EXTRA_INSTALL += "${CORE_IMAGE_EXTRA_INSTALL}"
|
|
IMAGE_FEATURES += "${IMAGE_FEATURES}"
|
|
LICENSE_FLAGS_WHITELIST = "commercial"
|
|
PREFERRED_RPROVIDER_u-boot-fw-utils = "u-boot-imx-fw-utils"
|
|
HOSTTOOLS += " git-lfs"
|
|
eof
|
|
}
|
|
|
|
CWD=$(pwd)
|
|
PROGNAME=${BASH_SOURCE[0]}
|
|
[ $(basename -- $BASH_SOURCE) == $(basename -- $0) ] && EXIT="exit" || EXIT="return"
|
|
|
|
if [[ $(id -u) -eq 0 ]]; then
|
|
echo "ERROR: do not use the BSP as root. Exiting..."
|
|
${EXIT}
|
|
fi
|
|
|
|
BBLAYERS_CONF=conf/bblayers.conf
|
|
BB_CL_CONF_DONE=conf/bb_cl_conf.done
|
|
LOCAL_CONF=conf/local.conf
|
|
|
|
if ([ ! -f ${BBLAYERS_CONF} ] || [ ! -f ${LOCAL_CONF} ]);then
|
|
cat << eom
|
|
Warning: Files ${BBLAYERS_CONF} and ${LOCAL_CONF} not found.
|
|
Make sure that the scritp issued at a correct location.
|
|
eom
|
|
${EXIT} 2
|
|
fi
|
|
|
|
[[ -n ${FORCE} ]] && rm -rf ${BB_CL_CONF_DONE}
|
|
|
|
if [ -f ${BB_CL_CONF_DONE} ];then
|
|
cat << eom
|
|
Note: Already issued.
|
|
Nothing to be done.
|
|
eom
|
|
${EXIT} 0
|
|
fi
|
|
|
|
eval $(awk '(/MACHINE|DISTRO/)&&(gsub(/'"'"'/,"")&&($0=$1"="$NF))' ORS=";" ${LOCAL_CONF})
|
|
|
|
if [[ ${SUPPORTED_MACHINE[${MACHINE}]} -ne 1 ]];then
|
|
cat << eom
|
|
${MACHINE} is not in supported machine list.
|
|
Error exit.
|
|
eom
|
|
${EXIT} 0
|
|
fi
|
|
|
|
cat << eom
|
|
Prepare: ${MACHINE}:${DISTRO} ...
|
|
eom
|
|
|
|
mod_bblayer
|
|
mod_local
|
|
|
|
cat << eom
|
|
Note: Files ${BBLAYERS_CONF} and ${LOCAL_CONF} updated successfully.
|
|
eom
|
|
|
|
cat << eom > ${BB_CL_CONF_DONE}
|
|
$(date)
|
|
eom
|
|
|
|
unset IMAGE_FEATURES CORE_IMAGE_EXTRA_INSTALL
|
|
${EXIT} 0
|