main/openrc: run depmod -A when merging /lib/modules
This is a followup to !4056 (closed). Wish it had been included there, but I didn't realize this was needed until it was already merged.
Because !4056 (closed) uses overlayfs allows an existing /lib/modules directory to supercede the contents of modloop, it will result in an modules.dep file from modloop being hidden by one that does not contain information about the modules the modloop image provides, which will prevent them from being located. The resolution to this is to run depmod -A
after mounting the overlay.
As an aside, my testing did not previously uncover this issue because the wireguard package depends on linux-(lts|virt|rpi2?). Run-from-RAM systems already have the kernel -- and the associated modloop -- but do not explicitly contain that package. This causes a simple apk add wireguard-rpi2
(for example) to cause the (useless) installation of a new kernel into the tmpfs root, as well as an explicit installation of all the modules, which will run depmod.
I realized this issue yesterday, and fixed it by including linux-rpi2
as an empty dummy package -- which removed all the cruft and duplication, and made my overlay shed 20Mb of weight, but also prevented the depmod call that had prevented all the things from breaking previously.
I also hope to soon open seprate MRs both to fix the lack of a kernel package in the run-from-RAM install and to update modloop to merge the /lib/firmware directory with /lib/modules/firmware when using overlayfs (the problem that forced me to fix that in my own install, therefore uncovering this issue).