I was working on some scripts that we have to build a small-time Linux OS that we produce at work. I found a bug in the scripts. We were building a kernel module against the wrong set of kernel headers.
What makes this interesting is that the kernel module built fine, so the script simply copied it to the location under /lib/modules/ that corresponded with the kernel that we intended to build against, not the one we actually built against. The script then ran depmod.
In this scenario (which is obviously wrong), what should the expected behavior be?