starnight / LoRa

LoRa device driver as a kernel module
Other
131 stars 58 forks source link

make file not working #20

Open sahilsoni1 opened 3 years ago

sahilsoni1 commented 3 years ago

make make -C /lib/modules/5.4.51-v7l+/build M=/home/pi/sahilsoni/lora/LoRa/LoRa modules make[1]: /lib/modules/5.4.51-v7l+/build: No such file or directory. Stop. make: [Makefile:8: all] Error 2

Doom4535 commented 3 years ago

I'm assuming this is from a build on a raspberry pi? Do you have the correct kernel headers installed?

  1. Reboot to ensure the current kernel is the installed kernel
    systemctl reboot
  2. If you might upgrade in the future/aren't trying to stick to a specific kernel version, upgrade to the latest kernel and reboot (we want to obtain the correct kernel headers and build against your installed kernel)
    sudo apt update && sudo apt upgrade
    systemctl reboot

    Obtain RPi Kernel Source

    Install RPi-Source utility program to get the kernel source

    # Dependencies
    sudo apt install git bc bison flex libssl-dev
    sudo apt install libncurses5-dev
    # Download and install
    sudo wget https://raw.githubusercontent.com/RPi-Distro/rpi-source/master/rpi-source -O /usr/local/bin/rpi-source && sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-update

    Obtain the Kernel:

    mkdir -p ~/RPiKernel
    rpi-source -d ~/RPiKernel