x11-drivers/nvidia-drivers: fix build with USE=-modules

At same time update/shorten comment a bit, esp. to mention that it may
not be included without initramfs regen and this is more of a best
effort solution (thankfully *most* users would include neither modules
on an initramfs and it wouldn't matter).

Fixes: dacc7d5a54
Closes: https://bugs.gentoo.org/940564
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens
2024-09-30 15:25:45 -04:00
parent 3442c74441
commit aefba1ed1e
8 changed files with 56 additions and 48 deletions

View File

@@ -401,12 +401,13 @@ documentation that is installed alongside this README."
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl"'
# Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
# to ensure that the nouveau blacklist is applied
# https://github.com/dracut-ng/dracut-ng/issues/674
# https://bugs.gentoo.org/932781
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
# dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
# our settings are used for bug 932781#c8 and nouveau blacklist if either
# modules are included (however, just best-effort without initramfs regen)
if use modules; then
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
fi
}
pkg_preinst() {

View File

@@ -388,12 +388,13 @@ documentation that is installed alongside this README."
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"'
# Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
# to ensure that the nouveau blacklist is applied
# https://github.com/dracut-ng/dracut-ng/issues/674
# https://bugs.gentoo.org/932781
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
# dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
# our settings are used for bug 932781#c8 and nouveau blacklist if either
# modules are included (however, just best-effort without initramfs regen)
if use modules; then
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
fi
}
pkg_preinst() {

View File

@@ -452,12 +452,13 @@ documentation that is installed alongside this README."
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"'
# Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
# to ensure that the nouveau blacklist is applied
# https://github.com/dracut-ng/dracut-ng/issues/674
# https://bugs.gentoo.org/932781
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
# dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
# our settings are used for bug 932781#c8 and nouveau blacklist if either
# modules are included (however, just best-effort without initramfs regen)
if use modules; then
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
fi
}
pkg_preinst() {

View File

@@ -452,12 +452,13 @@ documentation that is installed alongside this README."
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"'
# Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
# to ensure that the nouveau blacklist is applied
# https://github.com/dracut-ng/dracut-ng/issues/674
# https://bugs.gentoo.org/932781
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
# dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
# our settings are used for bug 932781#c8 and nouveau blacklist if either
# modules are included (however, just best-effort without initramfs regen)
if use modules; then
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
fi
}
pkg_preinst() {

View File

@@ -443,12 +443,13 @@ documentation that is installed alongside this README."
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
# Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
# to ensure that the nouveau blacklist is applied
# https://github.com/dracut-ng/dracut-ng/issues/674
# https://bugs.gentoo.org/932781
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
# dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
# our settings are used for bug 932781#c8 and nouveau blacklist if either
# modules are included (however, just best-effort without initramfs regen)
if use modules; then
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
fi
}
pkg_preinst() {

View File

@@ -442,12 +442,13 @@ documentation that is installed alongside this README."
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
# Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
# to ensure that the nouveau blacklist is applied
# https://github.com/dracut-ng/dracut-ng/issues/674
# https://bugs.gentoo.org/932781
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
# dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
# our settings are used for bug 932781#c8 and nouveau blacklist if either
# modules are included (however, just best-effort without initramfs regen)
if use modules; then
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
fi
}
pkg_preinst() {

View File

@@ -445,12 +445,13 @@ documentation that is installed alongside this README."
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
# Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
# to ensure that the nouveau blacklist is applied
# https://github.com/dracut-ng/dracut-ng/issues/674
# https://bugs.gentoo.org/932781
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
# dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
# our settings are used for bug 932781#c8 and nouveau blacklist if either
# modules are included (however, just best-effort without initramfs regen)
if use modules; then
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
fi
}
pkg_preinst() {

View File

@@ -448,12 +448,13 @@ documentation that is installed alongside this README."
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
# Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
# to ensure that the nouveau blacklist is applied
# https://github.com/dracut-ng/dracut-ng/issues/674
# https://bugs.gentoo.org/932781
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
# dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
# our settings are used for bug 932781#c8 and nouveau blacklist if either
# modules are included (however, just best-effort without initramfs regen)
if use modules; then
echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
"${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
fi
}
pkg_preinst() {