From 90724be5fdcd3f40aa0f1cd5e1325f82de9100ce Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Sun, 17 Mar 2024 17:25:10 +0300 Subject: [PATCH] new structure --- .github/workflows/{release.yml => 535.yml} | 4 +- .../workflows/{release_slow.yml => 545.yml} | 10 +- .github/workflows/550.yml | 52 +++++++++ 535.sh | 100 ++++++++++++++++++ 545.sh | 100 ++++++++++++++++++ main.sh => 550.sh | 42 ++++++++ linux-nvidia-modules/debian/postinst | 17 --- linux-nvidia-modules/debian/postrm | 17 --- 8 files changed, 302 insertions(+), 40 deletions(-) rename .github/workflows/{release.yml => 535.yml} (93%) rename .github/workflows/{release_slow.yml => 545.yml} (86%) create mode 100644 .github/workflows/550.yml create mode 100755 535.sh create mode 100755 545.sh rename main.sh => 550.sh (71%) diff --git a/.github/workflows/release.yml b/.github/workflows/535.yml similarity index 93% rename from .github/workflows/release.yml rename to .github/workflows/535.yml index 5a509e5..bded96c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/535.yml @@ -1,4 +1,4 @@ -name: PikaOS Package Release +name: PikaOS Package Release (Build 545 module for latest kernel) on: workflow_dispatch: @@ -36,7 +36,7 @@ jobs: run: apt-get update -y - name: Build Package - run: ./main.sh + run: ./545.sh - name: Release Package run: ./release.sh diff --git a/.github/workflows/release_slow.yml b/.github/workflows/545.yml similarity index 86% rename from .github/workflows/release_slow.yml rename to .github/workflows/545.yml index aa0189d..bded96c 100644 --- a/.github/workflows/release_slow.yml +++ b/.github/workflows/545.yml @@ -1,11 +1,13 @@ -name: PikaOS Package Release (On Slow github servers) +name: PikaOS Package Release (Build 545 module for latest kernel) on: - workflow_dispatch + workflow_dispatch: + schedule: + - cron: '25 2 * * *' jobs: build: - runs-on: ubuntu:latest + runs-on: self-hosted container: image: ghcr.io/pikaos-linux/pika-package-container:latest volumes: @@ -34,7 +36,7 @@ jobs: run: apt-get update -y - name: Build Package - run: ./main.sh + run: ./545.sh - name: Release Package run: ./release.sh diff --git a/.github/workflows/550.yml b/.github/workflows/550.yml new file mode 100644 index 0000000..abd4759 --- /dev/null +++ b/.github/workflows/550.yml @@ -0,0 +1,52 @@ +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: ./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 }} + diff --git a/535.sh b/535.sh new file mode 100755 index 0000000..6b81b51 --- /dev/null +++ b/535.sh @@ -0,0 +1,100 @@ +#! /bin/bash +DRIVER=535 + +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) 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)-100pika6" + +echo -e "linux-nvidia-modules ("$VERSION") pikauwu; urgency=medium\n\n * New Release\n\n -- Ward Nakchbandi Sat, 01 Oct 2022 14:50:00 +0200" > debian/changelog + +if echo $VERSION | grep "$(cat ./pika_nvidia.txt)" +then + echo "driver already built" + exit 0 +fi + +echo -e "Source: linux-nvidia-modules\nSection: graphics\nPriority: optional\nMaintainer: Ward Nakchbandi \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/ diff --git a/545.sh b/545.sh new file mode 100755 index 0000000..7c10eb5 --- /dev/null +++ b/545.sh @@ -0,0 +1,100 @@ +#! /bin/bash +DRIVER=545 + +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) 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)-100pika6" + +echo -e "linux-nvidia-modules ("$VERSION") pikauwu; urgency=medium\n\n * New Release\n\n -- Ward Nakchbandi Sat, 01 Oct 2022 14:50:00 +0200" > debian/changelog + +if echo $VERSION | grep "$(cat ./pika_nvidia.txt)" +then + echo "driver already built" + exit 0 +fi + +echo -e "Source: linux-nvidia-modules\nSection: graphics\nPriority: optional\nMaintainer: Ward Nakchbandi \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/ diff --git a/main.sh b/550.sh similarity index 71% rename from main.sh rename to 550.sh index 65e6327..d1a9061 100755 --- a/main.sh +++ b/550.sh @@ -39,6 +39,48 @@ 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 diff --git a/linux-nvidia-modules/debian/postinst b/linux-nvidia-modules/debian/postinst index e538165..e69de29 100644 --- a/linux-nvidia-modules/debian/postinst +++ b/linux-nvidia-modules/debian/postinst @@ -1,17 +0,0 @@ -#! /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 diff --git a/linux-nvidia-modules/debian/postrm b/linux-nvidia-modules/debian/postrm index 8ab6f8a..e69de29 100644 --- a/linux-nvidia-modules/debian/postrm +++ b/linux-nvidia-modules/debian/postrm @@ -1,17 +0,0 @@ -#! /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