dresden-elektronik / raspbee2-rtc

RTC kernel module builder for RaspBee II
BSD 3-Clause "New" or "Revised" License
21 stars 2 forks source link

Make fails on 64bit bullseye #19

Closed pinakighatak closed 9 months ago

pinakighatak commented 2 years ago

I updated to 64-bit bullseye and the make fails. Any help ?

checking deb package dependencies...
i2c-tools
build-essential
raspberrypi-kernel-headers
build rtc module...
make -C /lib/modules/5.10.90-v8+/build M=/home/pi/raspbee2-rtc-master modules
make[1]: *** /lib/modules/5.10.90-v8+/build: No such file or directory.  Stop.
make: *** [Makefile:17: build] Error 2
rautesamtr commented 2 years ago
make[1]: *** /lib/modules/5.10.90-v8+/build: No such file or directory.  Stop.

Check if you have the correct kernel headers installed.

ChrisHae commented 2 years ago

You can use https://github.com/RPi-Distro/rpi-source to download the newest kernel headers.

Please respond if this helped. I should then add this to the installation manual.

numanx11 commented 2 years ago

You can use https://github.com/RPi-Distro/rpi-source to download the newest kernel headers.

Please respond if this helped. I should then add this to the installation manual.

I've tested the solution you've suggested but it's still failing.

root@raspberrypi:/home/pi/raspbee2-rtc-master# make
checking deb package dependencies...
i2c-tools
build-essential
raspberrypi-kernel-headers
build rtc module...
make -C /lib/modules/5.15.21-v8+/build M=/home/pi/raspbee2-rtc-master modules
make[1]: Entering directory '/home/pi/linux-60652604154e70aeac81fb6155fd9d15dc39daaf'
  MODPOST /home/pi/raspbee2-rtc-master/Module.symvers
ERROR: modpost: "cpu_hwcap_keys" [/home/pi/raspbee2-rtc-master/rtc-pcf85063.ko] undefined!
ERROR: modpost: "arm64_const_caps_ready" [/home/pi/raspbee2-rtc-master/rtc-pcf85063.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:134: /home/pi/raspbee2-rtc-master/Module.symvers] Error 1
make[2]: *** Deleting file '/home/pi/raspbee2-rtc-master/Module.symvers'
make[1]: *** [Makefile:1783: modules] Error 2
make[1]: Leaving directory '/home/pi/linux-60652604154e70aeac81fb6155fd9d15dc39daaf'
make: *** [Makefile:17: build] Error 2
Jan-V2 commented 1 year ago

i got the same directory not found error, but in my case an update, and a reboot fixed the problem it appears to be related to the $KVERSION variable not being set correctly, so not a problem with this project. i'm on kernel version 5.15.56-v8+

i did not get the get the follow up error the 2 other users got, and the driver installed correctly.

christianwarmuth commented 1 year ago

Agree with @johnvanderholt. This is not a problem with this project.

This did the trick for me.

sudo sed -i 's/^kernel=/#kernel=/' /boot/config.txt
sudo reboot

Found here

Did the trick for me as the uname -r giving still back the old kernel version for which the folder does not exist.

ChrisHae commented 1 year ago

Thanks for the hint.

stheinen commented 1 year ago

Hello, I had an issue with the kernel version as well.

"uname -r" gives "5.15.61-v7l+". Kernel build support is only available for "5.15.76-v7l+" on my system. I solved the issue by creating a symlink:

sudo ln -s /lib/modules/5.15.76-v7l+ /lib/modules/5.15.61-v7l+

felix-exon commented 1 year ago

I am having the same issue:

pi@raspberrypi:~/raspbee2-rtc $ make
checking deb package dependencies...
i2c-tools
build-essential
raspberrypi-kernel-headers
build rtc module...
make -C /lib/modules/6.1.25-v8+/build M=/home/pi/.local/share/Trash/files/raspbee2-rtc modules
make[1]: *** /lib/modules/6.1.25-v8+/build: No such file or directory.  Stop.
make: *** [Makefile:15: build] Error 2

KV: 6.1.25-v8+ Model: B4

soundylinz commented 10 months ago

I have the same problem:

checking deb package dependencies...
i2c-tools
build-essential
raspberrypi-kernel-headers
build rtc module...
make -C /lib/modules/6.1.53-v8+/build M=/home/pi/raspbee2-rtc-master modules
make[1]: *** /lib/modules/6.1.53-v8+/build: No such file or directory.  Stop.
make: *** [Makefile:17: build] Error 2

Is there any solution? I've tried all above, but nothing helps... :-(

ChrisHae commented 10 months ago

uname -r gives your kernel version and if you look into the directory there must be a build directory like this: image

If there is no build folder you may have to restart the pi after installing raspberrypi-kernel-headers via apt. If the build folder is in another kernel directory in /lib/modules/...

then you could try any of the solutions the other users posted to change the directory to the directory with the build folder. Or you can edit the Makefile and set the KVERSION variable directly to the kernel version that contains the build folder.

I'm not sure but I think the kernel-headers that you can download via apt are always a little bit behind the actual kernel version. So it could be after a some time they catch up with the newest version.

soundylinz commented 9 months ago

uname -r

6.1.53-v8+

ls -l /lib/modules/6.1.53-v8+/

total 2620
drwxr-xr-x 11 root root   4096 Sep 15 00:08 kernel
-rw-r--r--  1 root root 621955 Sep 15 00:08 modules.alias
-rw-r--r--  1 root root 648904 Sep 15 00:08 modules.alias.bin
-rw-r--r--  1 root root  15735 Sep 15 00:08 modules.builtin
-rw-r--r--  1 root root      0 Sep 15 00:08 modules.builtin.alias.bin
-rw-r--r--  1 root root  17558 Sep 15 00:08 modules.builtin.bin
-rw-r--r--  1 root root  90568 Sep 15 00:08 modules.builtin.modinfo
-rw-r--r--  1 root root 233055 Sep 15 00:08 modules.dep
-rw-r--r--  1 root root 312560 Sep 15 00:08 modules.dep.bin
-rw-r--r--  1 root root    384 Sep 15 00:08 modules.devname
-rw-r--r--  1 root root  69167 Sep 15 00:08 modules.order
-rw-r--r--  1 root root    949 Sep 15 00:08 modules.softdep
-rw-r--r--  1 root root 290531 Sep 15 00:08 modules.symbols
-rw-r--r--  1 root root 352819 Sep 15 00:08 modules.symbols.bin

sudo apt install raspberrypi-kernel-headers

raspberrypi-kernel-headers is already the newest version (1:1.20230405-1).

The last kernel with "build" directory is

drwxr-xr-x 3 root root 4096 Sep 14 21:40 6.1.53-v7l+

If i try to edit the Makefile:

checking deb package dependencies...
i2c-tools
build-essential
raspberrypi-kernel-headers
build rtc module...
make -C /lib/modules/6.1.21-v7l+/build M=/home/pi/raspbee2-rtc-master modules
make[1]: Entering directory '/usr/src/linux-headers-6.1.21-v7l+'
  CC [M]  /home/pi/raspbee2-rtc-master/rtc-pcf85063.o
In file included from ./include/linux/types.h:6,
                 from ./include/linux/of.h:14,
                 from ./include/linux/clk-provider.h:9,
                 from /home/pi/raspbee2-rtc-master/rtc-pcf85063.c:12:
./include/uapi/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory
    5 | #include <asm/types.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:250: /home/pi/raspbee2-rtc-master/rtc-pcf85063.o] Error 1
make[1]: *** [Makefile:2012: /home/pi/raspbee2-rtc-master] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.21-v7l+'
make: *** [Makefile:18: build] Error 2

Do you have any idea how to compile it with success?

EDIT:

Unfortunately I didn't have any success with https://github.com/RPi-Distro/rpi-source either.

ChrisHae commented 9 months ago

Yeah, changing the build directory in the Makefile is probably not the right idea. You need the v8+ kernel for the RPI4. When searching the internet I found many people with the same problem. And it seems the problem is when you update the kernel with rpi-update.

So this user solved it by re-install raspberrypi-kernel:

https://stackoverflow.com/questions/75216940/how-to-install-raspberry-pi-kernel-headers-of-which-version-matches-with-uname

Others used https://github.com/RPi-Distro/rpi-source to download the correct kernel-headers.

In this older discussion it is mentioned that only the newest kernel-headers are available and older ones are deleted from the apt repository. That means you should update your kernel to the latest version:

https://forums.raspberrypi.com/viewtopic.php?t=310741

I'm not very firm with that kernel problematic myself. I would proably just install a fresh Raspberyy Pi OS Image.

soundylinz commented 9 months ago
  1. https://stackoverflow.com/questions/75216940/how-to-install-raspberry-pi-kernel-headers-of-which-version-matches-with-uname

Unfortunately, this method didn't change anything.

  1. https://github.com/RPi-Distro/rpi-source

...neither.

I'm afraid I'll have to wait until there are updates. :-(

deConz also runs without RTC, or can I expect negative consequences?

ChrisHae commented 9 months ago

deCONZ does not need the RTC. The RTC is just a bonus if the electricity cut /blackout and the gateway is not connected to the internet. Then it helps to keep the correct time. If the gateway is connected to the internet there is no need for an RTC at all. And the main functions of the gateway does not need the correct time at all.

ChrisHae commented 9 months ago

I'm now closing this thread because the missing/ incorrect kernel headers for raspberry pi OS are not directly related to this repository. If someone else have this problem check one of the solution proposals in this thread or search the internet for "wrong raspberrypi-kernel-headers version"