corrections for install script
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2022-05-06 15:38:50 +02:00
parent 9383a6088b
commit bacce95881
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
init_dir=$(pwd)
build_dir=cmake-build-release-q7s build_dir=cmake-build-release-q7s
obsw_root="" obsw_root=""
q7s_yocto_dir="q7s-yocto" q7s_yocto_dir="q7s-yocto"
@ -9,9 +10,12 @@ yocto_obsw_path="yocto/meta-eive/recipes-core/eive-obsw/files"
yocto_watchdog_path="yocto/meta-eive/recipes-support/eive-obsw-watchdog/files" yocto_watchdog_path="yocto/meta-eive/recipes-support/eive-obsw-watchdog/files"
obsw_bin_name="eive-obsw-stripped" obsw_bin_name="eive-obsw-stripped"
watchdog_bin_name="eive-watchdog-stripped" watchdog_bin_name="eive-watchdog-stripped"
obsw_target_name="eive-obsw"
watchdog_target_name="eive-watchdog"
if [ ! -z ${EIVE_OBSW_ROOT} ]; then if [ ! -z ${EIVE_OBSW_ROOT} ]; then
cd ${EIVE_OBSW_ROOT} cd ${EIVE_OBSW_ROOT}
obsw_root=$(pwd)
elif [ -d ${build_dir} ]; then elif [ -d ${build_dir} ]; then
obsw_root=${build_dir} obsw_root=${build_dir}
: :
@ -27,7 +31,7 @@ yocto_root=""
if [ -d ../${q7s_package_path} ]; then if [ -d ../${q7s_package_path} ]; then
cd ../${q7s_package_path} cd ../${q7s_package_path}
yocto_root=$(pwd) yocto_root=$(pwd)
elif [ -d ../${q7s_yocto_dir} ] elif [ -d ../${q7s_yocto_dir} ]; then
cd ../${q7s_yocto_dir} cd ../${q7s_yocto_dir}
yocto_root=$(pwd) yocto_root=$(pwd)
fi fi
@ -37,26 +41,27 @@ if [ -z ${yocto_root} ]; then
fi fi
cd ${obsw_root} cd ${obsw_root}
if [ ! -d ${build_dir} ]; then if [ ! -d ${build_dir} ]; then
echo "No Q7S Release binary folder ${build_dir} found. Exiting" echo "No Q7S Release binary folder ${build_dir} found. Exiting"
exit 1 exit 1
fi fi
if [ ! -f ${obsw_bin_name} ]; then if [ ! -f ${build_dir}/${obsw_bin_name} ]; then
echo "No EIVE OBSW binary found to intall to yocto" echo "No EIVE OBSW binary found to intall to yocto"
else else
cp_cmd="cp $(pwd)/${obsw_bin_name} ${yocto_root}/${yocto_obsw_path}/eive-obsw" cp_cmd="cp $(pwd)/${build_dir}/${obsw_bin_name} ${yocto_root}/${yocto_obsw_path}/${obsw_target_name}"
echo "Executing ${cp_cmd}" echo "Executing: ${cp_cmd}"
eval ${cp_cmd} eval ${cp_cmd}
echo "Installed EIVE OBSW into yocto repository successfully" echo "Installed EIVE OBSW into yocto repository successfully"
fi fi
if [ ! -f ${watchdog_bin_name} ]; then if [ ! -f ${build_dir}/${watchdog_bin_name} ]; then
echo "No EIVE Watchdog found to intall to yocto" echo "No EIVE Watchdog found to intall to yocto"
else else
cp_cmd="cp $(pwd)/${watchdog_bin_name} ${yocto_root}/${yocto_obsw_path}/eive-obsw" cp_cmd="cp $(pwd)/${build_dir}/${watchdog_bin_name} ${yocto_root}/${yocto_obsw_path}/${watchdog_target_name}"
echo "Executing ${cp_cmd}" echo "Executing: ${cp_cmd}"
eval ${cp_cmd} eval ${cp_cmd}
echo "Installed EIVE watchdog into yocto repository successfully" echo "Installed EIVE watchdog into yocto repository successfully"
fi fi
cd ${init_dir}