Files
meta-bsp-imx8mm/tools/setup-user-env
T
Kirill Kapranov 8ad802d717 meta: Add optee option to setup-user-env
OPTEE OS, being a 32-bit system  doesn't work satisfactorily on RAM extends
beyond 4G limit, what corresponds the RAM size more than 3G. In order to keep
the build working on all the possible DRAM variants, the default choice for
OPTTE is _no_.

Signed-off-by: Kirill Kapranov <kirill.kapranov@compulab.co.il>
2021-05-01 22:57:47 +03:00

77 lines
1.6 KiB
Bash
Executable File

#!/bin/bash -xv
user_local_conf=$(mktemp --dry-run --tmpdir=/tmp userXXX)
local_conf="conf/local.conf"
chrome=( yes no )
cfg_chrome() {
if [[ $1 == "yes" ]];then
cat << EOP >> ${user_local_conf}
# Add Chromium
IMAGE_INSTALL_append = \\
"\${@bb.utils.contains('DISTRO_FEATURES', 'wayland', ' chromium-ozone-wayland', \\
bb.utils.contains('DISTRO_FEATURES', 'x11', ' chromium-x11', \\
'', d), d)}"
EOP
fi
}
optee=( yes no )
cfg_optee() {
if [[ $1 == "yes" ]];then
cat << EOP >> ${user_local_conf}
MACHINE_FEATURES_append += " optee "
EOP
fi
}
rootfs=( ro rw )
cfg_rootfs() {
if [[ $1 == "ro" ]];then
cat << EOP >> ${user_local_conf}
IMAGE_FEATURES += "read-only-rootfs"
EOP
fi
}
declare -A ARRAYNAME=( [chrome]="yes" [rootfs]="rw" [optee]="no" )
cat << EOG
--- Users' Configurations started ---
EOG
for ARRAY in ${!ARRAYNAME[@]}; do
select_string='default '
eval array=\${${ARRAY}[@]}
for value in ${array[@]}; do
select_string+=${value}" "
done # for value
PS3="${ARRAY} configuration [ ${ARRAYNAME[${ARRAY}]} ] (Ctrl^C -- exit) : "
select i in $select_string; do
[[ -z ${i} ]] && echo "Invalid option -(" || case $i in
default)
break
;;
*)
ARRAYNAME[${ARRAY}]=${i}
break
;;
esac
done # select
done # for ARRAY
for ARRAY in ${!ARRAYNAME[@]}; do
command -v cfg_${ARRAY} &>/dev/null
[[ $? -eq 0 ]] && cfg_${ARRAY} ${ARRAYNAME[${ARRAY}]}
done
if [[ -f ${local_conf} ]] && [[ -f ${user_local_conf} ]];then
cat << EOH >> ${local_conf}
# Users' Configurations
EOH
cat ${user_local_conf} >> ${local_conf}
rm -f ${user_local_conf}
fi