linux-kernel - 如何解决内核配置无效的问题
问题描述
我正在尝试构建模块。
但这里有一些问题。
错误:内核配置无效。缺少 include/generated/autoconf.h 或 include/config/auto.conf。在内核 src 上运行“make oldconfig && make prepare”来修复它。
警告:缺少符号版本转储 ./Module.symvers;模块将没有依赖项和修改版本。`
这是我的makefile
ifeq ($(KERNELRELEASE),)
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
.PHONY: modules modules_install clean
else
# called from kernel build system: just declare what our modules are
obj-m := hello.o hellop.o seq.o jit.o jiq.o sleepy.o complete.o \
silly.o faulty.o kdatasize.o kdataalign.o
endif
我尝试像这样构建:
export KERNELDIR=/path/to/extern/linux/source
make
我怎么解决这个问题?
解决方案
好的,所以我会尝试重新安装 linux-headers。告诉我这是否有效!或者如果没有!
在终端中(大概是bash):
需要root权限!
如果你不是root:
sudo apt install --reinstall linux-headers-$(uname -r)
sudo reboot
# 或者现在:添加一个now
如果您已经是 root:
apt install --reinstall linux-headers-$(uname -r)
然后reboot
# 或现在:添加一个now
如果你得到它找不到任何包,(或类似的)(来自apt)尝试并重apt update
试上述。
我不知道这是否有任何帮助,但是 - 检查/var/log/kern.log
任何消息
推荐阅读
- jquery - Ajax 无法接收所有 JSON 数组
- oracle - 使用Oracle11g客户端连接Oracle19C Server
- stata - 如何在没有 SSC 包的情况下执行滚动窗口计算
- c# - 无法在 Visual Studio 2019 for Mac 上运行 .NET Core 3.1 测试项目
- r - 是否可以以图像格式刮表
- c# - 实体框架 6.4 在表上复制数据库名称,例如:DatabaseName.DatabaseName.TableName
- python - 在 Dask Dataframe 上使用 set_index() 并写入 parquet 会导致内存爆炸
- kotlin - Ktor - 使用协程发布未处理的错误
- express - 将带有 OIDC 的快速服务器部署到 Azure 应用服务时出现端口错误
- java - 26. 从有序数组中删除重复项 - Java