summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Campello2024-01-16 15:56:23 -0300
committerMarcel Campello2024-01-16 15:56:23 -0300
commit330969930c2240ba242cba762fd3c367e97e4f0e (patch)
tree42ebfeada31260d18179da33445c1480e8b66d2b
downloadaur-330969930c2240ba242cba762fd3c367e97e4f0e.tar.gz
Version 1.0.0
-rw-r--r--.SRCINFO15
-rw-r--r--.gitignore9
-rw-r--r--PKGBUILD20
-rw-r--r--nvidia-pacman-hook.install5
-rw-r--r--nvidia.hook15
5 files changed, 64 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..63de029cc62f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = nvidia-pacman-hook
+ pkgdesc = Update initramfs after a NVIDIA driver upgrade.
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://wiki.archlinux.org/title/NVIDIA#pacman_hook
+ install = nvidia-pacman-hook.install
+ arch = any
+ license = GPL
+ optdepends = NVIDIA-MODULE: it is the only reason to install this package
+ source = nvidia.hook
+ source = nvidia-pacman-hook.install
+ sha256sums = 0e9934103e63e59c401125ab62434dc86ffbb4395071e79088598ddf8be6fc14
+ sha256sums = c9458319b13e58806a90d87c7972bbc305bd2efccc2bbbdaac933887dfb29b8d
+
+pkgname = nvidia-pacman-hook
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..de4cd78e2168
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+# Ignore everything...
+*
+
+# but these files.
+!.gitignore
+!PKGBUILD
+!.SRCINFO
+!nvidia.hook
+!nvidia-pacman-hook.install
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c1036e207eb5
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,20 @@
+# Maintainer: Marcel Campello <marcel@prafrentex.com.br>
+pkgname=nvidia-pacman-hook
+pkgver=1.0.0
+pkgrel=1
+pkgdesc='Update initramfs after a NVIDIA driver upgrade.'
+arch=('any')
+url='https://wiki.archlinux.org/title/NVIDIA#pacman_hook'
+license=('GPL')
+optdepends=('NVIDIA-MODULE: it is the only reason to install this package')
+source=('nvidia.hook'
+ "${pkgname}.install")
+sha256sums=('0e9934103e63e59c401125ab62434dc86ffbb4395071e79088598ddf8be6fc14'
+ 'c9458319b13e58806a90d87c7972bbc305bd2efccc2bbbdaac933887dfb29b8d')
+install="${pkgname}.install"
+
+package() {
+ cd "${srcdir}"
+
+ install nvidia.hook -t "${pkgdir}/etc/pacman.d/hooks" -Dm 0644
+}
diff --git a/nvidia-pacman-hook.install b/nvidia-pacman-hook.install
new file mode 100644
index 000000000000..0f5bed222aae
--- /dev/null
+++ b/nvidia-pacman-hook.install
@@ -0,0 +1,5 @@
+post_install () {
+ echo ">>>"
+ echo ">>> Make sure the Target package set in this hook is the one you have installed."
+ echo ">>>"
+}
diff --git a/nvidia.hook b/nvidia.hook
new file mode 100644
index 000000000000..620cfa88405b
--- /dev/null
+++ b/nvidia.hook
@@ -0,0 +1,15 @@
+[Trigger]
+Operation=Install
+Operation=Upgrade
+Operation=Remove
+Type=Package
+Target=nvidia
+Target=linux
+# Change the linux part above and in the Exec line if a different kernel is used
+
+[Action]
+Description=Update NVIDIA module in initcpio
+Depends=mkinitcpio
+When=PostTransaction
+NeedsTargets
+Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'