ppp-sync/rocm.sh

49 lines
1.3 KiB
Bash
Raw Normal View History

2023-08-24 15:46:51 +02:00
#! /bin/bash
set -e
2023-08-24 19:41:42 +02:00
# Give correct perms to Apt version checker
chmod 755 ./ppp
2023-08-24 15:46:51 +02:00
# ROCm MIRROR
mkdir -p ./output/rocm
cd ./output/rocm
2023-08-24 19:32:13 +02:00
# temp
apt update
apt upgrade -y
# end of temp
2023-08-24 19:41:42 +02:00
#Get rid of Pika sources to prevent conflicts
2023-08-24 19:26:03 +02:00
rm -rf /etc/apt/sources.list.d/pika*
rm -rf /etc/apt/preferences.d/*pika*
2023-08-24 19:41:42 +02:00
# Get ROCm pool
echo 'deb [arch=amd64 trusted=yes] https://repo.radeon.com/rocm/apt/5.6 jammy main' | sudo tee /etc/apt/sources.list.d/rocm.list
apt update -y
apt download $(../../ppp https://ppa.pika-os.com/dists/lunar/rocm/binary-amd64/Packages http://repo.radeon.com/rocm/apt/5.6/dists/jammy/main/binary-amd64/Packages | tr '\n' ' ') -y
2023-08-24 15:46:51 +02:00
# Return to ROCm MIRROR
cd ../
mkdir -p ./output
find . -name \*.deb -exec cp -vf {} ./output \;
# Sign the packages
2023-08-24 16:02:06 +02:00
dpkg-sig --sign builder ./output/*.deb
2023-08-24 15:46:51 +02:00
# Pull down existing ppa repo db files etc
2023-08-24 16:02:06 +02:00
rsync -azP --exclude '*.deb' ferreo@direct.pika-os.com:/srv/www/pikappa/ ./output/repo
2023-08-24 15:46:51 +02:00
# Check if the rocm component exists
2023-08-24 16:02:06 +02:00
if cat ./output/repo/conf/distributions | grep Components: | grep rocm
then
true
else
sed -i "s#Components:#Components: rocm#" ./output/repo/conf/distributions
fi
2023-08-24 15:46:51 +02:00
# Add the new package to the repo
2023-08-24 16:02:06 +02:00
reprepro -C rocm -V --basedir ./output/repo/ includedeb lunar ./output/*.deb
2023-08-24 15:46:51 +02:00
# Push the updated ppa repo to the server
2023-08-24 16:02:06 +02:00
rsync -azP ./output/repo/ ferreo@direct.pika-os.com:/srv/www/pikappa/