kmods-via-containers / kvc-simple-kmod

MIT License
0 stars 19 forks source link

ERROR: could not open directory /lib/modules/4.18.0-348.12.2.el8_5.x86_64: No such file or directory #1

Open jimmy-scott opened 1 year ago

jimmy-scott commented 1 year ago

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

KVER = 4.18.0-305.49.1.el8_4.x86_64 uname -r = 4.18.0-348.12.2.el8_5.x86_64

jimmy-scott commented 1 year ago

The root cause in the Makefile of the ${KMODVER}.tar.gz being fetched (running depmod without version). This change will fix that:

  < sudo depmod -a
  > sudo depmod -a $(KVER)