diff options
Diffstat (limited to 'x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild')
-rw-r--r-- | x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild | 16 |
1 files changed, 16 insertions, 0 deletions
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 +} |