diff --git a/conf/layer.conf b/conf/layer.conf index 084fe25..7a037fd 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -20,4 +20,4 @@ CORE_IMAGE_EXTRA_INSTALL += "${@bb.utils.contains('DISTRO_CODENAME', 'dunfell', HOSTTOOLS += " git-lfs " HOSTTOOLS += " bison " -LAYERSERIES_COMPAT_compulab-bsp-imx8mm = "sumo thud warrior zeus dunfell" +LAYERSERIES_COMPAT_compulab-bsp-imx8mm = "sumo thud warrior zeus dunfell hardknott" diff --git a/scripts/imx-5.10.35-2.0.0_compulab.xml b/scripts/imx-5.10.35-2.0.0_compulab.xml new file mode 100644 index 0000000..311c4c5 --- /dev/null +++ b/scripts/imx-5.10.35-2.0.0_compulab.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/templates/bblayers.conf/bblayers.conf.append b/templates/bblayers.conf/bblayers.conf.append new file mode 100644 index 0000000..669c847 --- /dev/null +++ b/templates/bblayers.conf/bblayers.conf.append @@ -0,0 +1 @@ +BBLAYERS += "${BSPDIR}/sources/meta-bsp-imx8mm" diff --git a/templates/bblayers.conf/bblayers.extra.conf.append b/templates/bblayers.conf/bblayers.extra.conf.append new file mode 100644 index 0000000..90473a5 --- /dev/null +++ b/templates/bblayers.conf/bblayers.extra.conf.append @@ -0,0 +1,8 @@ +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-compulab-bsp/meta-devtool \ +" diff --git a/templates/local.conf/chromium.append b/templates/local.conf/chromium.append new file mode 100644 index 0000000..021b556 --- /dev/null +++ b/templates/local.conf/chromium.append @@ -0,0 +1,7 @@ +#;prompt Add Chromium browser [yes] + +# Add Chromium +IMAGE_INSTALL_append = \ + "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', ' chromium-ozone-wayland', \ + bb.utils.contains('DISTRO_FEATURES', 'x11', ' chromium-x11', \ + '', d), d)}" diff --git a/templates/local.conf/local.conf.append b/templates/local.conf/local.conf.append new file mode 100644 index 0000000..895c075 --- /dev/null +++ b/templates/local.conf/local.conf.append @@ -0,0 +1,6 @@ +LICENSE_FLAGS_WHITELIST = "commercial" +CORE_IMAGE_EXTRA_INSTALL += " cl-uboot cl-deploy cl-stest cl-camera cl-audio " +CORE_IMAGE_EXTRA_INSTALL += " u-boot-compulab-fw-utils " +CORE_IMAGE_EXTRA_INSTALL += " memtester htop iotop tmux iperf3 " +HOSTTOOLS += " git-lfs" +PREFERRED_RPROVIDER_u-boot-fw-utils = "u-boot-imx-fw-utils" diff --git a/templates/local.conf/optee.append b/templates/local.conf/optee.append new file mode 100644 index 0000000..579b6f3 --- /dev/null +++ b/templates/local.conf/optee.append @@ -0,0 +1,2 @@ +#;prompt Enable Trusted Execution Environment optee OS [no] +MACHINE_FEATURES_append += " optee " diff --git a/templates/local.conf/ro_rootfs.append b/templates/local.conf/ro_rootfs.append new file mode 100644 index 0000000..ffd12c6 --- /dev/null +++ b/templates/local.conf/ro_rootfs.append @@ -0,0 +1,3 @@ +#;prompt Read only root FS [no] + +IMAGE_FEATURES += " read-only-rootfs " \ No newline at end of file diff --git a/tools/compulab-setup-env b/tools/compulab-setup-env new file mode 100644 index 0000000..9735286 --- /dev/null +++ b/tools/compulab-setup-env @@ -0,0 +1,59 @@ +#!/bin/bash -e + +MACHINE=${MACHINE:-ucm-imx8m-mini} +DISTRO=${DISTRO:-fsl-imx-xwayland} +EULA=1 +T="../sources/meta-bsp-imx8mm/templates" + +BD=$(cat <<< $@ | awk '$0=$NF') + +# To append a file interactively include in the file the following line: +#;prompt Description of the feature introduced [enabled by default yes/no] +# To disable a file usage add the following line: +#;DISABLE +# Files w/o these lines are to be appended unconditionally + +function interactive_config() +{ + grep "^#;DISABLE" $1 && return 1 + $(sed -ne 's/^#;prompt[[:blank:]]*\(.*\)[[:blank:]]*\[.*$/\1/p' $1) + local prompt=$(sed -ne 's/^#;prompt[[:blank:]]*\(.*\)[[:blank:]]*\[.*$/\1/p' $1) + [[ -z "${prompt}" ]] && return 0 # unconditionally add this file to config + + local opt_def=$(sed -ne 's/^#;prompt.*\[\(.*\)\]/\1/p' $1) + opt_def=${opt_def:-no} + + PS3="$prompt [${opt_def}]?" + + local answer + select answer in yes no default; do + answer=${answer:-$opt_def} + [[ "{answer}" == "default" ]] && answer=${opt_def} + [[ $answer == yes ]] && return 0 || return 1 + done +} + +function add_config_from_file() +{ + if interactive_config $1; then + sed -e '/#;/d' $1 + fi +} + +if [[ -d ${BD} ]];then + +echo "Back to the build environment ${BD}" +. setup-environment ${BD} + +else + +. imx-setup-release.sh $@ + +for _d in ${T}/*; do + _file=$(basename ${_d}) + for _f in ${_d}/*;do + add_config_from_file ${_f} >> conf/${_file} + done; +done +fi + diff --git a/tools/setup-compulab-env b/tools/setup-compulab-env deleted file mode 100755 index 95bf68a..0000000 --- a/tools/setup-compulab-env +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash - -declare -A SUPPORTED_MACHINE=([mcm-imx8m-mini]=1 [ucm-imx8m-mini]=1) -declare -A EXTRA_MACHINE_INSTALL=([ucm-imx8m-mini]='cl-migrate-env') - -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-compulab-bsp/meta-devtool \\ - \${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+=" ${EXTRA_MACHINE_INSTALL[${MACHINE}]}" -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 diff --git a/tools/setup-imx8mm-env b/tools/setup-imx8mm-env deleted file mode 100755 index 1c48117..0000000 --- a/tools/setup-imx8mm-env +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e -MACHINE=${MACHINE:-mcm-imx8m-mini} -DISTRO=${DISTRO:-fsl-imx-xwayland} -EULA=1 - -. imx-setup-release.sh $@ - -declare -a ENVIRONMENT=('../sources/meta-bsp-imx8mm/tools/setup-compulab-env - ../sources/meta-bsp-imx8mm/tools/setup-user-env') - -for env in ${ENVIRONMENT[@]};do - [ -f ${env} ] && FORCE=Yes source ${env} -done diff --git a/tools/setup-user-env b/tools/setup-user-env deleted file mode 100755 index f86e611..0000000 --- a/tools/setup-user-env +++ /dev/null @@ -1,76 +0,0 @@ -#!/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 -