Select Git revision
make.sh 3.15 KiB
#!/bin/bash
set -x
# Nastaveni promennych
export DEBIAN_FRONTEND=noninteractive
# Nacteni promennych o bezicim systemu vcetne verzi
. /etc/os-release
# Od Debian 11 Bullseye ma debian-security trochu jinou cestu, abychom mohli pouzit heredoc, rozskocime si pres funkci
function get_debian_security() {
if [ "${VERSION_ID}" -lt "11" ]; then echo "${VERSION_CODENAME}/updates"; else echo "${VERSION_CODENAME}-security"; fi
}
# Vygenerovani sources.list podle verze Debianu
cat > /etc/apt/sources.list << EOSOURCES
deb http://ftp.zcu.cz/pub/linux/debian ${VERSION_CODENAME} main contrib non-free
deb http://ftp.zcu.cz/pub/linux/debian ${VERSION_CODENAME}-updates main contrib non-free
deb http://ftp.zcu.cz/pub/linux/debian-security $(get_debian_security) main contrib non-free
deb-src http://ftp.zcu.cz/pub/linux/debian ${VERSION_CODENAME} main contrib non-free
deb-src http://ftp.zcu.cz/pub/linux/debian ${VERSION_CODENAME}-updates main contrib non-free
deb-src http://ftp.zcu.cz/pub/linux/debian-security $(get_debian_security) main contrib non-free
EOSOURCES
#echo 'deb [trusted=yes] https://repo.metacentrum.cz/ ${VERSION_CODENAME} main pilot' >> /etc/apt/sources.list
# Instalace buildovacich veci a zavislosti
apt update -qqq
PACKAGES="linux-image-amd64 linux-headers-amd64"
if [ "${VERSION_ID}" -eq "11" ]; then
PACKAGES="$(apt search linux-headers-5.10.0- 2>/dev/null | grep -Po "linux-headers-\K\d+\.\d+\.\d+\-\d+\-amd64" | sort -u | while read v; do echo "linux-image-$v linux-headers-$v"; done | paste -s -d ' ')"
fi
apt install -yqqq git devscripts build-essential module-assistant gpg wget ${PACKAGES}
#m-a -l $(dpkg -l | grep -Po "linux-image-\K\d+.*\-amd64" | paste -s -d ',') a-b openafs > /dev/null 2>&1
m-a -l 5.10.0-23-amd64 a-b openafs > /dev/null 2>&1
cp /usr/src/openafs-modules-*_amd64.deb .
VER_PKG=$(ls -1 /usr/src/openafs-modules-*_amd64.deb | tail -1 | grep -Po ".*\+\K[^_]+")
VER_KER=$(ls -1 /usr/src/openafs-modules-*_amd64.deb | tail -1 | grep -Po "modules\-\K[^_]+")
./make_pkg ${VER_PKG} ${VER_KER}
mkdir build
mv *.deb build/
cp -v generate-release.sh build/
cd build
dpkg-scanpackages . /dev/null > Packages
gzip -9k Packages
./generate-release.sh > Release
export GNUPGHOME=$PWD
export GPG_TTY=$(tty)
mkdir -p private-keys-v1.d
gpg --list-keys
wget --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN_PASS}" https://gitlab.cesnet.cz/api/v4/projects/702%2Fprovoz%2Fopenafs-module-debian-private/repository/files/pgp-key.public/raw?ref=master -O pgp-key.public
wget --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN_PASS}" https://gitlab.cesnet.cz/api/v4/projects/702%2Fprovoz%2Fopenafs-module-debian-private/repository/files/pgp-key.private/raw?ref=master -O pgp-key.private
cat pgp-key.private | gpg --import --pinentry-mode=loopback --passphrase "$PASS"
gpg --list-keys
cat Release | gpg --default-key gitlab --digest-algo SHA256 --cert-digest-algo SHA256 --pinentry-mode=loopback --passphrase "$PASS" -abs > Release.gpg
cat Release | gpg --default-key gitlab --digest-algo SHA256 --cert-digest-algo SHA256 --pinentry-mode=loopback --passphrase "$PASS" -abs --clearsign > InRelease
rm -vrf private-keys-v1.d pubring.kbx trustdb.gpg pgp-key.private pubring.kbx~ generate-release.sh