Skip to content
Snippets Groups Projects
Commit 8b912276 authored by Pavel Vondruska's avatar Pavel Vondruska
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #3700 passed
build:bullseye:
cache: []
image: debian:bullseye
script:
- ./make.sh
artifacts:
paths:
- build/*
make.sh 0 → 100755
#!/bin/bash
set -x
# Nastaveni promennych, pokud je SINVERSION zakomentovana, pokusime se odhadnout nejnovejsi
export DEBIAN_FRONTEND=noninteractive
export DEBEMAIL="Pavel Vondruska <vondruska@cesnet.cz>"
# 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
# Instalace buildovacich veci a zavislosti
apt update -qqq
apt install -yqqq git devscripts build-essential wget
mkdir -p nvidia-driver/{DEBIAN,opt/nvidia-driver}
NVERSION=${NVERSION:-525.105.17}
wget http://us.download.nvidia.com/tesla/${NVERSION}/NVIDIA-Linux-x86_64-${NVERSION}.run -P nvidia-driver/opt/nvidia-driver
cat > nvidia-driver/DEBIAN/control <<EOcontrol
Package: nvidia-driver
Version: ${NVERSION}-1~deb${VERSION_ID}u1
Architecture: amd64
Maintainer: Pavel Vondruska <vondruska@cesnet.cz>
Installed-Size: 1143
Priority: optional
Homepage: http://www.nvidia.com
Description: NVIDIA Driver
This package contains NVIDIA driver installer
EOcontrol
cat > nvidia-driver/DEBIAN/postinst <<EOpostinst
#!/bin/sh
/opt/nvidia-driver/NVIDIA-Linux-x86_64-${NVERSION}.run -s --dkms
EOpostinst
cat > nvidia-driver/DEBIAN/prerm <<EOprerm
#!/bin/sh
/opt/nvidia-driver/NVIDIA-Linux-x86_64-${NVERSION}.run --uninstall
EOprerm
chmod +x nvidia-driver/DEBIAN/postinst nvidia-driver/DEBIAN/prerm nvidia-driver/opt/nvidia-driver/NVIDIA-Linux-x86_64-${NVERSION}.run
dpkg-deb -b nvidia-driver nvidia-driver_${NVERSION}-1~deb${VERSION_ID}u1_amd64.deb
mkdir build
mv *.deb build/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment