eive-obsw/scripts/create-sw-update.sh
Robin Mueller 9d440838e9
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
set correct owner for SW update procedure
2022-09-26 18:40:31 +02:00

35 lines
849 B
Bash
Executable File

#!/bin/bash
cmake --build . -j
source create-version-file.sh
if [ ! -f eive-obsw-stripped ]; then
echo "No file eive-obsw-stripped found. Please ensure you are in the "
echo "build folder and the OBSW was built properly"
exit 1
fi
if [ ! -f obsw_version.txt ]; then
echo "No OBSW version file found."
echo "You can use the create-version-file.sh script to create it"
exit 1
fi
mkdir update-archive
cp eive-obsw-stripped update-archive
cp obsw_version.txt update-archive
cd update-archive
sudo chown root:root eive-obsw-stripped
sudo chown root:root obsw_version.txt
cmd="tar -cJvf eive-sw-update.tar.xz eive-obsw-stripped obsw_version.txt"
echo "Running command ${cmd} to generate compressed SW update archive."
eval ${cmd}
cp eive-sw-update.tar.xz ..
cd ..
rm -rf update-archive
echo "Generated eive-sw-update.tar.xz update archive."