pkg-nvidia-pikaos-kernel-mo.../main.sh

38 lines
2.5 KiB
Bash
Raw Normal View History

2023-09-02 14:38:27 +02:00
#! /bin/bash
2023-09-04 22:21:00 +02:00
DRIVER=525
2023-09-02 14:38:27 +02:00
2023-09-02 15:34:52 +02:00
chmod +x ./nvidia-pikaos-kernel-module/get_pwd.sh
2023-09-02 15:33:40 +02:00
echo "$(apt-cache show nvidia-driver-$DRIVER | grep Version: | head -n1 | cut -f2 -d":" | cut -f1,2,3 -d"." | cut -f1 -d"-" | tr -d ' ')" > ./nvidia-pikaos-kernel-module/DRIVER
echo "$(apt-cache show kernel-pika | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3,4 -d"-" | tr -d ' ')" > ./nvidia-pikaos-kernel-module/KERNEL
2023-09-04 22:21:00 +02:00
echo "$(apt-cache show nvidia-kernel-source-525 | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ')" > ./nvidia-pikaos-kernel-module/DRIVER_VERSION
2023-09-02 15:33:40 +02:00
cd ./nvidia-pikaos-kernel-module
2023-09-02 21:57:32 +02:00
echo -e "nvidia-pikaos-kernel-module ($(cat ./DRIVER)-$(cat ./KERNEL)-99pika5.lunar) lunar; urgency=medium\n\n * New Release\n\n -- Ward Nakchbandi <hotrod.master@hotmail.com> Sat, 01 Oct 2022 14:50:00 +0200" > debian/changelog
2023-09-02 14:38:27 +02:00
2023-09-02 21:57:32 +02:00
echo -e "Source: nvidia-pikaos-kernel-module\nSection: graphics\nPriority: optional\nMaintainer: Ward Nakchbandi <hotrod.master@hotmail.com>\nStandards-Version: 4.6.1\nBuild-Depends: debhelper-compat (= 13), linux-image-$(cat ./KERNEL), linux-headers-$(cat ./KERNEL), dkms, fakeroot\nRules-Requires-Root: no\n\nPackage: nvidia-$(cat ./KERNEL)-module-$DRIVER\nArchitecture: linux-any\nDepends: linux-image-$(cat ./KERNEL), linux-headers-$(cat ./KERNEL), $(apt-cache show nvidia-dkms-$DRIVER | grep Depends: | head -n1 | cut -f2 -d":")\nConflicts: nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nProvides: nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nReplaces: nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nDescription: Prebuilt Nvidia module for PikaOS kernel\n\nPackage: nvidia-pika-kernel-module-$DRIVER\nArchitecture: linux-any
Depends: nvidia-$(cat ./KERNEL)-module-$DRIVER $(echo '(= ${binary:Version})')\nDescription: DKMS NVIDIA PLACEHOLDER" > ./debian/control
2023-09-02 22:03:49 +02:00
echo -e "usr\netc" > ./debian/nvidia-$(cat ./KERNEL)-module-$DRIVER.install
2023-09-02 15:33:40 +02:00
2023-09-02 15:49:27 +02:00
echo -e "DRIVER=$(cat ./DRIVER)\nKERNEL=$(cat ./KERNEL)\nVERSION=$(cat ./DRIVER_VERSION)\nMK_WORKDIR=$(env | grep -w "PWD" | cut -c5-)\nCARCH=x86_64" > ./Makefile
cat ./Makefiletmp >> ./Makefile
2023-09-02 15:44:58 +02:00
2023-09-02 15:33:40 +02:00
DEBIAN_FRONTEND=noninteractive
2023-09-02 14:38:27 +02:00
# Get build deps
apt-get build-dep ./ -y
2023-09-02 16:32:17 +02:00
apt download nvidia-kernel-source-$DRIVER -y
dpkg-deb -x ./nvidia-kernel-source-$DRIVER*.deb /
2023-09-02 16:35:04 +02:00
apt download nvidia-dkms-$DRIVER -y
dpkg-deb -x ./nvidia-dkms-$DRIVER*.deb /
2023-09-02 14:38:27 +02:00
# Build package
2023-09-02 16:18:27 +02:00
dpkg-buildpackage --no-sign
echo 'DKMS MAKEFILE LOG:'
2023-09-02 16:22:00 +02:00
cat ./nvidia/$(cat ./DRIVER)/$(cat ./KERNEL)/x86_64/log/make.log || cat ./nvidia/$(cat ./DRIVER)/build/make.log
2023-09-02 14:38:27 +02:00
# Move the debs to output
cd ../
mkdir -p ./output
mv ./*.deb ./output/