Building for a KVER which is different from kernel release of host building the kmod fails during make install:
STEP 13/14: RUN make install KVER=${KVER} KMODVER=${KMODVER}
sudo install -v -m 755 spkut /bin/
sudo: unable to send audit message: Operation not permitted
'spkut' -> '/bin/spkut'
sudo install -v -m 755 -d /lib/modules/4.18.0-305.49.1.el8_4.x86_64/
sudo: unable to send audit message: Operation not permitted
sudo install -v -m 644 simple-kmod.ko /lib/modules/4.18.0-305.49.1.el8_4.x86_64/simple-kmod.ko
sudo: unable to send audit message: Operation not permitted
'simple-kmod.ko' -> '/lib/modules/4.18.0-305.49.1.el8_4.x86_64/simple-kmod.ko'
sudo install -v -m 644 simple-procfs-kmod.ko /lib/modules/4.18.0-305.49.1.el8_4.x86_64/simple-procfs-kmod.ko
sudo: unable to send audit message: Operation not permitted
'simple-procfs-kmod.ko' -> '/lib/modules/4.18.0-305.49.1.el8_4.x86_64/simple-procfs-kmod.ko'
sudo depmod -a
sudo: unable to send audit message: Operation not permitted
depmod: ERROR: could not open directory /lib/modules/4.18.0-348.12.2.el8_5.x86_64: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
make: *** [Makefile:26: install] Error 1
Error: error building at STEP "RUN make install KVER=${KVER} KMODVER=${KMODVER}": error while running runtime: exit status 2
Building for a KVER which is different from kernel release of host building the kmod fails during make install:
KVER = 4.18.0-305.49.1.el8_4.x86_64 uname -r = 4.18.0-348.12.2.el8_5.x86_64