尝试将 adxl345 编译为 4.4.54-ti-r93 内核中的模块但出现错误

Trying to compile adxl345 as a module in 4.4.54-ti-r93 kernel but get error

我从最新的镜像站点下载了下面的 debian 镜像

Debian 8.7 2017-03-19 4GB SD LXQT 

我已经连接了一个 adxl345 加速度计,并且使用用户 space 工具它工作正常。 现在我正在尝试附加一个内核驱动程序,即在 adxl345 中。我把源文件放在

/home/debian/Desktop/adxl345

并发布了make。 我得到这个错误

root@beaglebone:/home/debian/Desktop/adxl345# make
make -C /lib/modules/4.4.54-ti-r93/build M=/home/debian/Desktop/adxl345 modules
make[1]: *** /lib/modules/4.4.54-ti-r93/build: No such file or directory.  Stop.
Makefile:13: recipe for target 'default' failed
make: *** [default] Error 2

我查了

root@beaglebone:/lib/modules/4.4.54-ti-r93# ls 
extra          modules.builtin  modules.devname  modules.symbols.bin
kernel         modules.builtin.bin  modules.order
modules.alias      modules.dep      modules.softdep
modules.alias.bin  modules.dep.bin  modules.symbols

没有构建目录。我尝试更新内核头文件

sudo apt-get install linux-headers-linux-headers-4.4.54-ti-r93

但是它说

E: Unable to locate package linux-headers-linux-headers-4.4.54-ti-r93

我将如何构建驱动程序?

我没有更新缓存

sudo apt-get 更新

更新后,我们可以在 /lib/modules 查看 会有一个构建目录。 现在应该正在建设中。