Compare commits

..

30 Commits
main ... 535

Author SHA1 Message Date
Ward Nakchbandi (Cosmic Fusion)
19b1023f34
Update main.sh 2024-02-03 16:34:50 +03:00
Ward Nakchbandi (Cosmic Fusion)
e95d467bc9
Update main.sh 2024-02-02 00:06:31 +03:00
Ward Nakchbandi (Cosmic Fusion)
25177827b8
Update postrm 2024-02-02 00:04:01 +03:00
Ward Nakchbandi (Cosmic Fusion)
62ecaf6d0a
Update postinst 2024-02-02 00:03:50 +03:00
Ward Nakchbandi (Cosmic Fusion)
3b5bbadd10
Update main.sh 2024-01-28 22:30:48 +03:00
Ward Nakchbandi (Cosmic Fusion)
d37183350c
Update main.sh 2024-01-28 22:27:32 +03:00
Ward Nakchbandi (Cosmic Fusion)
82953e99e1
Update main.sh 2024-01-28 22:23:15 +03:00
Ward Nakchbandi (Cosmic Fusion)
668b6351de
Update main.sh 2024-01-28 22:10:32 +03:00
Ward Nakchbandi (Cosmic Fusion)
7e374b15bd
Update main.sh 2024-01-28 22:06:27 +03:00
Ward Nakchbandi (Cosmic Fusion)
e98e82418c
Update main.sh 2024-01-28 22:05:38 +03:00
Ward Nakchbandi (Cosmic Fusion)
ad1b0a92fc
Update main.sh 2024-01-28 22:01:11 +03:00
Ward Nakchbandi (Cosmic Fusion)
ef78270dd0
Update main.sh 2024-01-28 21:45:21 +03:00
Ward Nakchbandi (Cosmic Fusion)
99370134de
Update main.sh 2024-01-28 21:04:22 +03:00
Ward Nakchbandi (Cosmic Fusion)
6a7a39fe12
Update main.sh 2024-01-28 20:59:25 +03:00
Ward Nakchbandi (Cosmic Fusion)
ebf7fb6d0f
Update main.sh 2024-01-28 20:47:23 +03:00
Ward Nakchbandi (Cosmic Fusion)
41475bcf39
Update main.sh 2024-01-28 20:46:46 +03:00
Ward Nakchbandi (Cosmic Fusion)
1b74798f26
Update main.sh 2024-01-28 20:45:33 +03:00
Ward Nakchbandi (Cosmic Fusion)
f265fbd788
Update main.sh 2024-01-28 20:15:47 +03:00
Ward Nakchbandi (Cosmic Fusion)
1fec952d9a
Update main.sh 2024-01-28 20:05:43 +03:00
Ward Nakchbandi (Cosmic Fusion)
d4587b7cb0
Update release.yml 2024-01-28 20:00:09 +03:00
Ward Nakchbandi (Cosmic Fusion)
0988efda7d
Update main.sh 2024-01-27 00:01:26 +03:00
Ward Nakchbandi (Cosmic Fusion)
63cd7650f0
Update main.sh 2024-01-26 23:29:47 +03:00
Ward Nakchbandi (Cosmic Fusion)
174e32f099
Update main.sh 2024-01-26 23:22:43 +03:00
Ward Nakchbandi (Cosmic Fusion)
d42e08d723
Update main.sh 2023-11-12 19:08:35 +03:00
Ward Nakchbandi (Cosmic Fusion)
1009603dd9
Update postrm 2023-11-12 19:07:55 +03:00
Ward Nakchbandi (Cosmic Fusion)
ebe3fe0345
Update main.sh 2023-11-07 16:42:46 +03:00
Ward Nakchbandi (Cosmic Fusion)
8aef0df260
Update main.sh 2023-11-07 16:27:21 +03:00
Ward Nakchbandi (Cosmic Fusion)
4eef5480dc
Update Makefiletmp 2023-11-07 16:07:58 +03:00
Ward Nakchbandi (Cosmic Fusion)
2c1616e192
Update Makefiletmp 2023-11-07 15:58:05 +03:00
Ward Nakchbandi (Cosmic Fusion)
469dcd104b
Update main.sh 2023-11-07 15:57:33 +03:00
10 changed files with 43 additions and 483 deletions

View File

@ -1,52 +0,0 @@
name: PikaOS Package Release (Build 550 module for latest kernel)
on:
workflow_dispatch:
# schedule:
# - cron: '25 2 * * *'
jobs:
build:
runs-on: self-hosted
container:
image: ghcr.io/pikaos-linux/pika-package-container:latest
volumes:
- /proc:/proc
options: --privileged -it
steps:
- uses: actions/checkout@v3
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
if_key_exists: replace
- name: Update apt cache
run: apt-get update -y
- name: Build Package
run: chmod +x ./550.sh && ./550.sh
- name: Release Package
run: ./release.sh
- name: Purge cache
uses: strrife/cloudflare-chunked-purge-action@master
env:
# Zone is required by both authentication methods
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
PURGE_URLS: ${{ vars.PURGE_URLS }}

View File

@ -1,52 +0,0 @@
name: PikaOS Package Release (Build 555 module for latest kernel)
on:
workflow_dispatch:
# schedule:
# - cron: '25 2 * * *'
jobs:
build:
runs-on: self-hosted
container:
image: ghcr.io/pikaos-linux/pika-package-container:latest
volumes:
- /proc:/proc
options: --privileged -it
steps:
- uses: actions/checkout@v3
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
if_key_exists: replace
- name: Update apt cache
run: apt-get update -y
- name: Build Package
run: chmod +x ./555.sh && ./555.sh
- name: Release Package
run: ./release.sh
- name: Purge cache
uses: strrife/cloudflare-chunked-purge-action@master
env:
# Zone is required by both authentication methods
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
PURGE_URLS: ${{ vars.PURGE_URLS }}

View File

@ -1,9 +1,9 @@
name: PikaOS Package Release (Build 535 module for latest kernel)
name: PikaOS Package Release
on:
workflow_dispatch:
# schedule:
# - cron: '25 2 * * *'
schedule:
- cron: '25 2 * * *'
jobs:
build:
@ -36,7 +36,7 @@ jobs:
run: apt-get update -y
- name: Build Package
run: chmod +x ./535.sh && ./535.sh
run: ./main.sh
- name: Release Package
run: ./release.sh

View File

@ -1,13 +1,11 @@
name: PikaOS Package Release (Build 545 module for latest kernel)
name: PikaOS Package Release (On Slow github servers)
on:
workflow_dispatch:
# schedule:
# - cron: '25 2 * * *'
workflow_dispatch
jobs:
build:
runs-on: self-hosted
runs-on: ubuntu:latest
container:
image: ghcr.io/pikaos-linux/pika-package-container:latest
volumes:
@ -36,7 +34,7 @@ jobs:
run: apt-get update -y
- name: Build Package
run: chmod +x ./545.sh && ./545.sh
run: ./main.sh
- name: Release Package
run: ./release.sh

106
545.sh
View File

@ -1,106 +0,0 @@
#! /bin/bash
DRIVER=545
DRIVER_BUILT=true
echo "$(apt show kernel-pika 2>&1 | grep -v "does not have a stable" | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3,4 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/KERNEL
apt show linux-modules-nvidia-$DRIVER-$(cat ./linux-nvidia-modules/KERNEL) || export DRIVER_BUILT=false && echo "This driver has never been built for this kernel version before."
apt show linux-modules-nvidia-$DRIVER-$(cat ./linux-nvidia-modules/KERNEL) 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ' > ./linux-nvidia-modules/pika_nvidia.txt
rm -rfv /etc/apt/preferences.d/*
echo 'Pin: release c=external' > /etc/apt/preferences.d/0-a
echo 'Pin-Priority: 1000' >> /etc/apt/preferences.d/0-a
echo 'Package: *' >> /etc/apt/preferences.d/0-a
echo 'Pin: release c=ubuntu' >> /etc/apt/preferences.d/0-a
echo 'Pin-Priority: 1000' >> /etc/apt/preferences.d/0-a
apt update -y
apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | cut -f1,2,3 -d"." | cut -f1 -d"-" | tr -d ' ' > ./linux-nvidia-modules/new_nvidia.txt
echo "$(apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | cut -f1,2,3 -d"." | cut -f1 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/DRIVER
echo "$(apt show kernel-pika 2>&1 | grep -v "does not have a stable" | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3,4 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/KERNEL
echo "$(apt show nvidia-kernel-source-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ')" > ./linux-nvidia-modules/DRIVER_VERSION
echo "$(apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ')" > ./linux-nvidia-modules/DRIVER_PIKA
cd ./linux-nvidia-modules
VERSION="$(cat ./DRIVER_VERSION)-$(cat ./KERNEL)-100pika7"
echo -e "linux-nvidia-modules ("$VERSION") pikauwu; urgency=medium\n\n * New Release\n\n -- Ward Nakchbandi <hotrod.master@hotmail.com> Sat, 01 Oct 2022 14:50:00 +0200" > debian/changelog
if [[ $DRIVER_BUILT == true ]]
then
if echo $VERSION | grep "$(cat ./pika_nvidia.txt)"
then
echo "driver already built"
exit 0
fi
fi
echo -e "Source: linux-nvidia-modules\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: linux-modules-nvidia-$DRIVER-$(cat ./KERNEL)\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-6.5.0-pikaos-module-535, nvidia-$(cat ./KERNEL)-module-$DRIVER, "$(apt list 2>/dev/null | cut -d'/' -f1 | grep linux-modules-nvidia | grep $(cat ./KERNEL) | grep -v linux-modules-nvidia-$DRIVER-$(cat ./KERNEL) | sed ':a;N;$!ba;s/\n/, /g')", nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nProvides: linux-modules-nvidia-$(cat ./KERNEL), 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\nDepends: linux-modules-nvidia-$DRIVER-$(cat ./KERNEL) $(echo '(= ${binary:Version})')\nDescription: DKMS NVIDIA PLACEHOLDER" > ./debian/control
echo -e "usr" > ./debian/linux-modules-nvidia-$DRIVER-$(cat ./KERNEL).install
echo "cp -vf /usr/lib/pika/nvidia-$(cat ./DRIVER)-$(cat ./KERNEL)/blacklist-pika-nouveau.conf /etc/modprobe.d/blacklist-pika-nouveau.conf" >> ./debian/postinst
echo "cp -vf /usr/lib/pika/nvidia-$(cat ./DRIVER)-$(cat ./KERNEL)/pika-nvidia.conf /etc/modules-load.d/pika-nvidia.conf" >> ./debian/postinst
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
cat << EOF > ./debian/postinst
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.devname || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.softdep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a "$(cat ./KERNEL)"
# Update initramfs with new module config
update-initramfs -c -k all
EOF
cat << EOF > ./debian/postrm
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.devname || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.softdep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a "$(cat ./KERNEL)"
# Update initramfs with new module config
update-initramfs -c -k all
EOF
DEBIAN_FRONTEND=noninteractive
# Get build deps
apt-get build-dep ./ -y
apt download nvidia-kernel-source-$DRIVER -y
dpkg-deb -x ./nvidia-kernel-source-$DRIVER*.deb /
apt download nvidia-dkms-$DRIVER -y
dpkg-deb -x ./nvidia-dkms-$DRIVER*.deb /
# Build package
dpkg-buildpackage --no-sign
echo 'DKMS MAKEFILE LOG:'
cat ./nvidia/$(cat ./DRIVER)/$(cat ./KERNEL)/x86_64/log/make.log || cat ./nvidia/$(cat ./DRIVER)/build/make.log
# Move the debs to output
cd ../
mkdir -p ./output
mv ./*.deb ./output/

107
550.sh
View File

@ -1,107 +0,0 @@
#! /bin/bash
DRIVER=550
DRIVER_BUILT=true
echo "$(apt show kernel-pika 2>&1 | grep -v "does not have a stable" | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3,4 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/KERNEL
apt show linux-modules-nvidia-$DRIVER-$(cat ./linux-nvidia-modules/KERNEL) || export DRIVER_BUILT=false && echo "This driver has never been built for this kernel version before."
apt show linux-modules-nvidia-$DRIVER-$(cat ./linux-nvidia-modules/KERNEL) 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ' > ./linux-nvidia-modules/pika_nvidia.txt
rm -rfv /etc/apt/preferences.d/*
echo 'Package: *' >> /etc/apt/preferences.d/0-a
echo 'Pin: release c=ubuntu' >> /etc/apt/preferences.d/0-a
echo 'Pin-Priority: 950' >> /etc/apt/preferences.d/0-a
echo 'Package: *' >> /etc/apt/preferences.d/0-a
echo 'Pin: release c=external' >> /etc/apt/preferences.d/0-a
echo 'Pin-Priority: 1000' >> /etc/apt/preferences.d/0-a
apt update -y
apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | cut -f1,2,3 -d"." | cut -f1 -d"-" | tr -d ' ' > ./linux-nvidia-modules/new_nvidia.txt
echo "$(apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | cut -f1,2,3 -d"." | cut -f1 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/DRIVER
echo "$(apt show kernel-pika 2>&1 | grep -v "does not have a stable" | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3,4 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/KERNEL
echo "$(apt show nvidia-kernel-source-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ')" > ./linux-nvidia-modules/DRIVER_VERSION
echo "$(apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ')" > ./linux-nvidia-modules/DRIVER_PIKA
cd ./linux-nvidia-modules
VERSION="$(cat ./DRIVER_VERSION)-$(cat ./KERNEL)-100pika7"
echo -e "linux-nvidia-modules ("$VERSION") pikauwu; urgency=medium\n\n * New Release\n\n -- Ward Nakchbandi <hotrod.master@hotmail.com> Sat, 01 Oct 2022 14:50:00 +0200" > debian/changelog
if [[ $DRIVER_BUILT == true ]]
then
if echo $VERSION | grep "$(cat ./pika_nvidia.txt)"
then
echo "driver already built"
exit 0
fi
fi
echo -e "Source: linux-nvidia-modules\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: linux-modules-nvidia-$DRIVER-$(cat ./KERNEL)\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-6.5.0-pikaos-module-535, nvidia-$(cat ./KERNEL)-module-$DRIVER, "$(apt list 2>/dev/null | cut -d'/' -f1 | grep linux-modules-nvidia | grep $(cat ./KERNEL) | grep -v linux-modules-nvidia-$DRIVER-$(cat ./KERNEL) | sed ':a;N;$!ba;s/\n/, /g')", nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nProvides: linux-modules-nvidia-$(cat ./KERNEL), 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\nDepends: linux-modules-nvidia-$DRIVER-$(cat ./KERNEL) $(echo '(= ${binary:Version})')\nDescription: DKMS NVIDIA PLACEHOLDER" > ./debian/control
echo -e "usr" > ./debian/linux-modules-nvidia-$DRIVER-$(cat ./KERNEL).install
echo "cp -vf /usr/lib/pika/nvidia-$(cat ./DRIVER)-$(cat ./KERNEL)/blacklist-pika-nouveau.conf /etc/modprobe.d/blacklist-pika-nouveau.conf" >> ./debian/postinst
echo "cp -vf /usr/lib/pika/nvidia-$(cat ./DRIVER)-$(cat ./KERNEL)/pika-nvidia.conf /etc/modules-load.d/pika-nvidia.conf" >> ./debian/postinst
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
cat << EOF > ./debian/postinst
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.devname || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.softdep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a "$(cat ./KERNEL)"
# Update initramfs with new module config
update-initramfs -c -k all
EOF
cat << EOF > ./debian/postrm
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.devname || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.softdep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a "$(cat ./KERNEL)"
# Update initramfs with new module config
update-initramfs -c -k all
EOF
DEBIAN_FRONTEND=noninteractive
# Get build deps
apt-get build-dep ./ -y
apt download nvidia-kernel-source-$DRIVER -y
dpkg-deb -x ./nvidia-kernel-source-$DRIVER*.deb /
apt download nvidia-dkms-$DRIVER -y
dpkg-deb -x ./nvidia-dkms-$DRIVER*.deb /
# Build package
dpkg-buildpackage --no-sign
echo 'DKMS MAKEFILE LOG:'
cat ./nvidia/$(cat ./DRIVER)/$(cat ./KERNEL)/x86_64/log/make.log || cat ./nvidia/$(cat ./DRIVER)/build/make.log
# Move the debs to output
cd ../
mkdir -p ./output
mv ./*.deb ./output/

107
555.sh
View File

@ -1,107 +0,0 @@
#! /bin/bash
DRIVER=555
DRIVER_BUILT=true
echo "$(apt show kernel-pika 2>&1 | grep -v "does not have a stable" | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3,4 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/KERNEL
apt show linux-modules-nvidia-$DRIVER-$(cat ./linux-nvidia-modules/KERNEL) || export DRIVER_BUILT=false && echo "This driver has never been built for this kernel version before."
apt show linux-modules-nvidia-$DRIVER-$(cat ./linux-nvidia-modules/KERNEL) 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ' > ./linux-nvidia-modules/pika_nvidia.txt
rm -rfv /etc/apt/preferences.d/*
echo 'Package: *' >> /etc/apt/preferences.d/0-a
echo 'Pin: release c=ubuntu' >> /etc/apt/preferences.d/0-a
echo 'Pin-Priority: 950' >> /etc/apt/preferences.d/0-a
echo 'Package: *' >> /etc/apt/preferences.d/0-a
echo 'Pin: release c=external' >> /etc/apt/preferences.d/0-a
echo 'Pin-Priority: 1000' >> /etc/apt/preferences.d/0-a
apt update -y
apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | cut -f1,2,3 -d"." | cut -f1 -d"-" | tr -d ' ' > ./linux-nvidia-modules/new_nvidia.txt
echo "$(apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | cut -f1,2,3 -d"." | cut -f1 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/DRIVER
echo "$(apt show kernel-pika 2>&1 | grep -v "does not have a stable" | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3,4 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/KERNEL
echo "$(apt show nvidia-kernel-source-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ')" > ./linux-nvidia-modules/DRIVER_VERSION
echo "$(apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ')" > ./linux-nvidia-modules/DRIVER_PIKA
cd ./linux-nvidia-modules
VERSION="$(cat ./DRIVER_VERSION)-$(cat ./KERNEL)-100pika7"
echo -e "linux-nvidia-modules ("$VERSION") pikauwu; urgency=medium\n\n * New Release\n\n -- Ward Nakchbandi <hotrod.master@hotmail.com> Sat, 01 Oct 2022 14:50:00 +0200" > debian/changelog
if [[ $DRIVER_BUILT == true ]]
then
if echo $VERSION | grep "$(cat ./pika_nvidia.txt)"
then
echo "driver already built"
exit 0
fi
fi
echo -e "Source: linux-nvidia-modules\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: linux-modules-nvidia-$DRIVER-$(cat ./KERNEL)\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-6.5.0-pikaos-module-535, nvidia-$(cat ./KERNEL)-module-$DRIVER, "$(apt list 2>/dev/null | cut -d'/' -f1 | grep linux-modules-nvidia | grep $(cat ./KERNEL) | grep -v linux-modules-nvidia-$DRIVER-$(cat ./KERNEL) | sed ':a;N;$!ba;s/\n/, /g')", nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nProvides: linux-modules-nvidia-$(cat ./KERNEL), 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\nDepends: linux-modules-nvidia-$DRIVER-$(cat ./KERNEL) $(echo '(= ${binary:Version})')\nDescription: DKMS NVIDIA PLACEHOLDER" > ./debian/control
echo -e "usr" > ./debian/linux-modules-nvidia-$DRIVER-$(cat ./KERNEL).install
echo "cp -vf /usr/lib/pika/nvidia-$(cat ./DRIVER)-$(cat ./KERNEL)/blacklist-pika-nouveau.conf /etc/modprobe.d/blacklist-pika-nouveau.conf" >> ./debian/postinst
echo "cp -vf /usr/lib/pika/nvidia-$(cat ./DRIVER)-$(cat ./KERNEL)/pika-nvidia.conf /etc/modules-load.d/pika-nvidia.conf" >> ./debian/postinst
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
cat << EOF > ./debian/postinst
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.devname || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.softdep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a "$(cat ./KERNEL)"
# Update initramfs with new module config
update-initramfs -c -k all
EOF
cat << EOF > ./debian/postrm
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.devname || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.softdep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a "$(cat ./KERNEL)"
# Update initramfs with new module config
update-initramfs -c -k all
EOF
DEBIAN_FRONTEND=noninteractive
# Get build deps
apt-get build-dep ./ -y
apt download nvidia-kernel-source-$DRIVER -y
dpkg-deb -x ./nvidia-kernel-source-$DRIVER*.deb /
apt download nvidia-dkms-$DRIVER -y
dpkg-deb -x ./nvidia-dkms-$DRIVER*.deb /
# Build package
dpkg-buildpackage --no-sign
echo 'DKMS MAKEFILE LOG:'
cat ./nvidia/$(cat ./DRIVER)/$(cat ./KERNEL)/x86_64/log/make.log || cat ./nvidia/$(cat ./DRIVER)/build/make.log
# Move the debs to output
cd ../
mkdir -p ./output
mv ./*.deb ./output/

View File

@ -0,0 +1,17 @@
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/*/modules.alias || true
rm -rfv /usr/lib/modules/*/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/*/modules.dep || true
rm -rfv /usr/lib/modules/*/modules.devname || true
rm -rfv /usr/lib/modules/*/modules.symbols || true
rm -rfv /usr/lib/modules/*/modules.alias.bin || true
rm -rfv /usr/lib/modules/*/modules.builtin.bin || true
rm -rfv /usr/lib/modules/*/modules.dep.bin || true
rm -rfv /usr/lib/modules/*/modules.softdep || true
rm -rfv /usr/lib/modules/*/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a
# Update initramfs with new module config
update-initramfs -c -k all

View File

@ -0,0 +1,17 @@
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/*/modules.alias || true
rm -rfv /usr/lib/modules/*/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/*/modules.dep || true
rm -rfv /usr/lib/modules/*/modules.devname || true
rm -rfv /usr/lib/modules/*/modules.symbols || true
rm -rfv /usr/lib/modules/*/modules.alias.bin || true
rm -rfv /usr/lib/modules/*/modules.builtin.bin || true
rm -rfv /usr/lib/modules/*/modules.dep.bin || true
rm -rfv /usr/lib/modules/*/modules.softdep || true
rm -rfv /usr/lib/modules/*/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a || true
# Update initramfs with new module config
update-initramfs -c -k all

View File

@ -1,11 +1,8 @@
#! /bin/bash
DRIVER=535
DRIVER_BUILT=true
echo "$(apt show kernel-pika 2>&1 | grep -v "does not have a stable" | grep Depends: | head -n1 | cut -f2 -d":" | cut -f1 -d"," | cut -f3,4 -d"-" | tr -d ' ')" > ./linux-nvidia-modules/KERNEL
apt show linux-modules-nvidia-$DRIVER-$(cat ./linux-nvidia-modules/KERNEL) || export DRIVER_BUILT=false && echo "This driver has never been built for this kernel version before."
apt show linux-modules-nvidia-$DRIVER-$(cat ./linux-nvidia-modules/KERNEL) 2>&1 | grep -v "does not have a stable" | grep Version: | head -n1 | cut -f2 -d":" | tr -d ' ' > ./linux-nvidia-modules/pika_nvidia.txt
rm -rfv /etc/apt/preferences.d/*
@ -23,18 +20,15 @@ echo "$(apt show nvidia-driver-$DRIVER 2>&1 | grep -v "does not have a stable" |
cd ./linux-nvidia-modules
VERSION="$(cat ./DRIVER_VERSION)-$(cat ./KERNEL)-100pika7"
VERSION="$(cat ./DRIVER_VERSION)-$(cat ./KERNEL)-100pika6"
echo -e "linux-nvidia-modules ("$VERSION") pikauwu; urgency=medium\n\n * New Release\n\n -- Ward Nakchbandi <hotrod.master@hotmail.com> Sat, 01 Oct 2022 14:50:00 +0200" > debian/changelog
if [[ $DRIVER_BUILT == true ]]
then
if echo $VERSION | grep "$(cat ./pika_nvidia.txt)"
then
echo "driver already built"
exit 0
fi
fi
echo -e "Source: linux-nvidia-modules\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: linux-modules-nvidia-$DRIVER-$(cat ./KERNEL)\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-6.5.0-pikaos-module-535, nvidia-$(cat ./KERNEL)-module-$DRIVER, "$(apt list 2>/dev/null | cut -d'/' -f1 | grep linux-modules-nvidia | grep $(cat ./KERNEL) | grep -v linux-modules-nvidia-$DRIVER-$(cat ./KERNEL) | sed ':a;N;$!ba;s/\n/, /g')", nvidia-dkms-$DRIVER (= $(cat DRIVER_VERSION))\nProvides: linux-modules-nvidia-$(cat ./KERNEL), 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\nDepends: linux-modules-nvidia-$DRIVER-$(cat ./KERNEL) $(echo '(= ${binary:Version})')\nDescription: DKMS NVIDIA PLACEHOLDER" > ./debian/control
echo -e "usr" > ./debian/linux-modules-nvidia-$DRIVER-$(cat ./KERNEL).install
@ -45,48 +39,6 @@ echo "cp -vf /usr/lib/pika/nvidia-$(cat ./DRIVER)-$(cat ./KERNEL)/pika-nvidia.co
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
cat << EOF > ./debian/postinst
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.devname || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.softdep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a "$(cat ./KERNEL)"
# Update initramfs with new module config
update-initramfs -c -k all
EOF
cat << EOF > ./debian/postrm
#! /bin/sh
# Reset kernel modules
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.devname || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.alias.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.builtin.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.dep.bin || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.softdep || true
rm -rfv /usr/lib/modules/"$(cat ./KERNEL)"/modules.symbols.bin || true
# Regenerate kernel module configs
depmod -a "$(cat ./KERNEL)"
# Update initramfs with new module config
update-initramfs -c -k all
EOF
DEBIAN_FRONTEND=noninteractive
# Get build deps