From 8291fe00be20a7e70b4ce5e8f2501bdf9d6292dc Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" <83735213+CosmicFusion@users.noreply.github.com> Date: Thu, 24 Aug 2023 20:26:03 +0300 Subject: [PATCH] --- external-sys76.sh | 34 ++++++++++++++++++++++++++++++++++ rocm.sh | 28 ++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 external-sys76.sh diff --git a/external-sys76.sh b/external-sys76.sh new file mode 100644 index 0000000..49b7d70 --- /dev/null +++ b/external-sys76.sh @@ -0,0 +1,34 @@ +#! /bin/bash +set -e + +# External Sys76 PPA MIRROR +mkdir -p ./output/rocm +cd ./output/rocm +# Get External Sys76 PPA pool +echo 'deb [trusted=yes] https://ppa.launchpadcontent.net/system76-dev/pre-stable/ubuntu lunar main' | sudo tee /etc/apt/sources.list.d/sys76.list +apt update -y +apt download -y +# Return to External Sys76 PPA MIRROR +cd ../ +mkdir -p ./output +find . -name \*.deb -exec cp -vf {} ./output \; + +# Sign the packages +dpkg-sig --sign builder ./output/*.deb + +# Pull down existing ppa repo db files etc +rsync -azP --exclude '*.deb' ferreo@direct.pika-os.com:/srv/www/pikappa/ ./output/repo + +# Check if the rocm component exists +if cat ./output/repo/conf/distributions | grep Components: | grep rocm +then + true +else + sed -i "s#Components:#Components: rocm#" ./output/repo/conf/distributions +fi + +# Add the new package to the repo +reprepro -C rocm -V --basedir ./output/repo/ includedeb lunar ./output/*.deb + +# Push the updated ppa repo to the server +rsync -azP ./output/repo/ ferreo@direct.pika-os.com:/srv/www/pikappa/ diff --git a/rocm.sh b/rocm.sh index 5a15190..a8a05c2 100644 --- a/rocm.sh +++ b/rocm.sh @@ -4,11 +4,31 @@ set -e # ROCm MIRROR mkdir -p ./output/rocm cd ./output/rocm -# 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 +# Get package list from ROCm Pool wget http://repo.radeon.com/rocm/apt/5.6/dists/jammy/main/binary-amd64/Packages -apt download $(cat ./Packages | grep "Package: " | awk '{print $2}' | tr '\n' ' ') -y +# Get rid of Pika sources to prevent conflicts +rm -rf /etc/apt/sources.list.d/pika* +rm -rf /etc/apt/preferences.d/*pika* + +for i in $(cat ./Packages | grep "Package: " | awk '{print $2}') +do + # Get ROCm pool from pika + echo 'deb [arch=amd64 trusted=yes] https://ppa.pika-os.com/ lunar rocm' | sudo tee /etc/apt/sources.list.d/rocm-pika.list + apt update -y + apt-cache show $i | grep Version: > ./$i-pika.txt + rm -rf /etc/apt/sources.list.d/rocm-pika.list + # 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-cache show $i | grep Version: > ./$i-repo.txt + if [[ $(cat ./$i-pika.txt ) == $(cat ./$i-repo.txt ) ]] + then + true + else + echo $i >> pkglist.txt + fi +done +apt download $(cat ./pkglist.txt | tr '\n' ' ') -y # Return to ROCm MIRROR cd ../ mkdir -p ./output