eive-obsw/scripts/create-sw-update.sh

35 lines
849 B
Bash
Raw Normal View History

2022-09-26 11:12:41 +02:00
#!/bin/bash
2022-09-26 11:31:29 +02:00
cmake --build . -j
source create-version-file.sh
if [ ! -f eive-obsw-stripped ]; then
2022-09-26 11:12:41 +02:00
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
2022-09-26 11:31:29 +02:00
if [ ! -f obsw_version.txt ]; then
2022-09-26 11:12:41 +02:00
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
2022-09-26 11:31:29 +02:00
cmd="tar -cJvf eive-sw-update.tar.xz eive-obsw-stripped obsw_version.txt"
echo "Running command ${cmd} to generate compressed SW update archive."
2022-09-26 11:12:41 +02:00
eval ${cmd}
cp eive-sw-update.tar.xz ..
cd ..
rm -rf update-archive
2022-09-26 11:31:29 +02:00
echo "Generated eive-sw-update.tar.xz update archive."