diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-09-12 02:40:58 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-09-12 02:40:58 +0100 |
commit | 556db31c58f1c348b67502fa72fb1688b5a8390f (patch) | |
tree | d3c2a973b22fc2427b2357b81fab6e07ebe44d0d /x11-drivers | |
parent | 3743bcd68178aca34e27c3f71431a4e496a6ef9b (diff) |
x11-drivers/nvidia-drivers : trigger initramfs rebuild postinstall and/or postremove
Diffstat (limited to 'x11-drivers')
3 files changed, 48 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r9.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r9.ebuild index 721729c0..bdf740c4 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r9.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r9.ebuild @@ -309,6 +309,12 @@ documentation that is installed alongside this README." newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl"' } +_dracut_initramfs_regen() { + if [ -x $(which dracut) ]; then + dracut -N -f --no-hostonly-cmdline + fi +} + pkg_preinst() { # set video group id based on live system (bug #491414) local g=$(egetent group video | cut -d: -f3) @@ -317,6 +323,10 @@ pkg_preinst() { } pkg_postinst() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi + readme.gentoo_print_elog ewarn ewarn "Be warned/reminded that the 390.xx branch reached end-of-life and" @@ -328,3 +338,9 @@ pkg_postinst() { ewarn "Note that there is no plans to patch in support for kernels branches" ewarn "newer than 6.1.x which will be supported upstream until December 2026." } + +pkg_postrm() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi +} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild index 3e3bac4b..e9e45d49 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild @@ -287,6 +287,12 @@ documentation that is installed alongside this README." newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"' } +_dracut_initramfs_regen() { + if [ -x $(which dracut) ]; then + dracut -N -f --no-hostonly-cmdline + fi +} + pkg_preinst() { # set video group id based on live system (bug #491414) local g=$(egetent group video | cut -d: -f3) @@ -295,6 +301,10 @@ pkg_preinst() { } pkg_postinst() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi + readme.gentoo_print_elog if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then @@ -303,3 +313,9 @@ pkg_postinst() { ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi } + +pkg_postrm() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi +} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild index 8fd26de5..5d60b6a8 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild @@ -307,6 +307,12 @@ documentation that is installed alongside this README." newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' } +_dracut_initramfs_regen() { + if [ -x $(which dracut) ]; then + dracut -N -f --no-hostonly-cmdline + fi +} + pkg_preinst() { # set video group id based on live system (bug #491414) local g=$(egetent group video | cut -d: -f3) @@ -315,6 +321,10 @@ pkg_preinst() { } pkg_postinst() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi + readme.gentoo_print_elog if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then @@ -323,3 +333,9 @@ pkg_postinst() { ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi } + +pkg_postrm() { + if [ $(stat -c %d:%i /) == $(stat -c %d:%i /proc/1/root/.) ]; then + _dracut_initramfs_regen + fi +} |