kernel header or kenel source code no exist
时间: 2023-11-28 11:51:05 浏览: 141
If you are trying to compile a program that requires kernel headers or source code, you may need to install them first. On a Linux system, you can typically install the kernel headers by running a command such as:
```
sudo apt-get install linux-headers-$(uname -r)
```
This will install the kernel headers for the currently running kernel version. If you need to install the kernel source code, you can typically do so by running a command such as:
```
sudo apt-get install linux-source
```
Once the headers or source code are installed, you should be able to compile your program.
相关问题
kernel header or kenel source code no exist 但是有安装kernel-devel
如果您需要编译内核模块,您需要安装与您正在运行的内核版本相对应的内核头文件和内核源代码。如果您的系统中没有内核头文件或内核源代码,您可以尝试使用以下命令安装它们:
- 对于 Debian 或 Ubuntu 系统:
```
sudo apt-get install linux-headers-$(uname -r) linux-source
```
- 对于 CentOS 或 Red Hat 系统:
```
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)
```
请注意,在某些情况下,您可能需要手动下载并安装适当版本的内核头文件和源代码。您可以在内核官方网站上找到它们。
kenel log位置
根据引用\[1\]中的信息,kernel log可以通过读取/proc/kmsg或者通过串口来抓取。因此,kernel log的位置可以通过访问/proc/kmsg来获取。
#### 引用[.reference_title]
- *1* [Android使用adb抓完整Log](https://blog.csdn.net/zinss26914/article/details/42233611)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [Kernel Log](https://blog.csdn.net/chen245250566/article/details/105367316)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文