eive-obsw/scripts/install-obsw-yocto.sh
Robin Mueller fe4315666b
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
added helper script for yocto installation
- Installs compiled binaries into yocto repo for rootfs rebuild
2022-05-06 15:27:56 +02:00

63 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
build_dir=cmake-build-release-q7s
obsw_root=""
q7s_yocto_dir="q7s-yocto"
q7s_package_path="q7s-package/${q7s_yocto_dir}"
yocto_obsw_path="yocto/meta-eive/recipes-core/eive-obsw/files"
yocto_watchdog_path="yocto/meta-eive/recipes-support/eive-obsw-watchdog/files"
obsw_bin_name="eive-obsw-stripped"
watchdog_bin_name="eive-watchdog-stripped"
if [ ! -z ${EIVE_OBSW_ROOT} ]; then
cd ${EIVE_OBSW_ROOT}
elif [ -d ${build_dir} ]; then
obsw_root=${build_dir}
:
elif [ -d ../${build_dir} ]; then
cd ..
obsw_root=$(pwd)
else
echo "No way into the EIVE OBSW Root folder found. Exiting"
exit 1
fi
yocto_root=""
if [ -d ../${q7s_package_path} ]; then
cd ../${q7s_package_path}
yocto_root=$(pwd)
elif [ -d ../${q7s_yocto_dir} ]
cd ../${q7s_yocto_dir}
yocto_root=$(pwd)
fi
if [ -z ${yocto_root} ]; then
echo "No yocto directory found. Exiting"
exit 1
fi
cd ${obsw_root}
if [ ! -d ${build_dir} ]; then
echo "No Q7S Release binary folder ${build_dir} found. Exiting"
exit 1
fi
if [ ! -f ${obsw_bin_name} ]; then
echo "No EIVE OBSW binary found to intall to yocto"
else
cp_cmd="cp $(pwd)/${obsw_bin_name} ${yocto_root}/${yocto_obsw_path}/eive-obsw"
echo "Executing ${cp_cmd}"
eval ${cp_cmd}
echo "Installed EIVE OBSW into yocto repository successfully"
fi
if [ ! -f ${watchdog_bin_name} ]; then
echo "No EIVE Watchdog found to intall to yocto"
else
cp_cmd="cp $(pwd)/${watchdog_bin_name} ${yocto_root}/${yocto_obsw_path}/eive-obsw"
echo "Executing ${cp_cmd}"
eval ${cp_cmd}
echo "Installed EIVE watchdog into yocto repository successfully"
fi