r/bedrocklinux • u/Sushtee • 21d ago
How to determine which stratum provides the kernel ?
Hi everyone,
I've been working on a simple bash script aiming to improve the practicability of having an Nvidia GPU while using bedrock.
The goal is to allow to automatically sync the version of the userpace drivers (in strata where they're installed) with the kernel driver's version - which has already been realized.
I'm still missing the method to determine which stratum is providing the kernel. It would be even better if I could get the stratum providing the kernel drivers, but directly using the kernel for that would work as using Nvidia kernel drivers provided by another stratum than the one providing the kernel doesn't seem to really work as of the current Bedrock.
Thanks for any help
2
u/Fun-Zucchini280 20d ago
they dont do this. /boot and /lib/modules are global so brl which just says "global", just ask each stratum's package manager who owns a kernel file instead
f=/lib/modules/$(uname -r)/modules.builtin for s in $(brl list); do strat -r "$s" sh -c ' pacman -Qqo "$0" || dpkg -S "$0" || rpm -qf "$0" || xbps-query -o "$0" ' "$f" >/dev/null 2>&1 && echo "$s" done
the stratum that prints is the kernel provider and as for the nvidia module use f=$(modinfo -n nvidia) finally if it was built with dkms no package owns it so check dkms status per stratum, brl which --pid 1 also gives the init stratum which is usually (not always) the same one
2
u/ParadigmComplex founder and lead developer 20d ago
I've put some thought onto this a ways back with the same intent of helping automate the nVidia driver coordination, but I couldn't come up with a good, general solution. If anyone does I'd also be very interested in it. I think adding it as a flag to
brl whichwould make a lot of sense.