ppp-sync/pigeon-intel.sh

56 lines
2.0 KiB
Bash
Executable File

#! /bin/bash
set -e
# Give correct perms to Apt version checker
chmod 755 ./ppp
# Get Intel pool
mkdir -p ./output-temp
cd ./output-temp
../ppp https://ppa.pika-os.com/dists/pika/pigeon/binary-amd64/Packages https://repositories.intel.com/gpu/ubuntu/dists/noble/unified/binary-amd64/Packages https://repositories.intel.com/gpu/ubuntu/ ./
# Delete Unwanted Packages or failure points with ppp
rm -rfv ./intel-i915-dkms_*.deb
rm -rfv ./libdrm*.deb
rm -rfv ./*va*.deb
rm -rfv ./*mesa*.deb
rm -rfv ./intel-gsc*.deb
rm -rfv ./libmetee*.deb
# Check if any updates have been downloaded
if [ $(ls ./ | wc -l) -lt 1 ]; then
echo "Repos are synced"
exit 0
fi
# Use apt to download weird packages that fail with ppp
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu noble unified" | tee /etc/apt/sources.list.d/intel-gpu-noble.list
apt update
apt download -y intel-gsc intel-gsc-dev libmetee-dev libmetee intel-gpu-mesa3d intel-gpu-mesa3d-dev
# Patch Downloaded Packages control files
PACKAGE_VER_APPEND=$(apt show intel-level-zero-gpu 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ')
for i in ./*.deb
do
mkdir $i-tmp
dpkg-deb -R $i $i-tmp
sed "s#-$(echo $PACKAGE_VER_APPEND | cut -d '-' -f2-)##g" -i $i-tmp/DEBIAN/control
cat $i-tmp/DEBIAN/control | grep Version: | head -n1 | cut -d":" -f2- | tr -d ' ' > $i-version
sed -i "s#$(cat $i-version)#$(cat $i-version)+pigeon$(date +"%Y%m%d")#g" $i-tmp/DEBIAN/control
sed -e s"#(=#(>=#"g -i $i-tmp/DEBIAN/control
dpkg-deb -b $i-tmp $i+pigeon$(date +"%Y%m%d")-fixed.deb
done
cd ../
# Move patched packages to output
mkdir -p ./output/
mv -v ./output-temp/*-fixed.deb ./output/
# send debs to server
rsync -azP --include './' --include '*.deb' --exclude '*' ./output/ ferreo@direct.pika-os.com:/srv/www/pigeon-incoming/