On Thu, Jun 20, 2019 at 1:34 AM aleiphoenix . <aleiphoe...@gmail.com> wrote: > > On Thu, Jun 20, 2019 at 1:30 PM aleiphoenix . <aleiphoe...@gmail.com> wrote: > > See some ebuilds like > > x11-drivers/nvidia-drivers/nvidia-drivers-430.14.ebuild > > > > if use kernel_linux && kernel_is ge 5 2; then > > ewarn "Gentoo supports kernels which are supported by > > NVIDIA" > > ewarn "which are limited to the following kernels:" > > ewarn "<sys-kernel/gentoo-sources-5.2" > > ewarn "<sys-kernel/vanilla-sources-5.2" > > ewarn "" > > ewarn "You are free to utilize epatch_user to provide > > whatever" > > ewarn "support you feel is appropriate, but will not > > receive" > > ewarn "support as a result of those changes." > > ewarn "" > > ewarn "Do not file a bug report about this." > > ewarn "" > > fi > > > > You could die there :) > > Sorry about the typo, I mean you could use "die" there. >
This will block installing the package if the kernel is invalid, but will not block installing an invalid kernel later. Also, this needs to be done in an appropriate phase. You probably want to use a blocker for something like this, though portage doesn't always handle these well, and kernels are also a bit different as packages go. A blocker is just a dependency with an ! operator. Note that this blocks installing that kernel package, not running that kernel, which is why kernel dependences tend to be expressed differently. Personally, in situations where I'm very dependent on kernel series I just run upstream kernels. Gentoo barely patches its kernels so unless you REALLY need the gentoo patches it is pretty trivial to just sync from the stable repo and pull the appropriate branch for a longterm series. I do this for zfs, and have done it in the past for btrfs, and would do this anytime I needed to pin a particular kernel series. You would lose the benefit of any Gentoo QA, but IMO that benefits you mainly to the degree that you run typical packages, and you're already deviating from the script. If your package is in-tree and depends on kernel version you could file a bug to address this in some way. If it is in an overlay then you're on your own. -- Rich