简体   繁体   English

在Lubuntu的哪里可以找到内核.config文件?

[英]Where would I find the kernel .config file in Lubuntu?

I'm running through the "first kernel patch" tutorial on kernel newbies http://kernelnewbies.org/FirstKernelPatch 我正在浏览有关内核新手的“第一个内核补丁”教程, 网址为http://kernelnewbies.org/FirstKernelPatch。

While running through the tutorial, i've had absolutely no issues what so ever until now, I am at a point where I am setting up my kernel configuration. 在学习本教程的过程中,到目前为止,我绝对没有遇到任何问题,我现在正在设置内核配置。 I've followed the tutorial exactly as shown but the following command: 我已按照显示的内容完全按照本教程进行操作,但是使用了以下命令:

cp /boot/config-'uname -r'* .config

leaves me with the following error message in the terminal: 在终端中给我留下以下错误消息:

cp: cannot stat '/boot/config-uname -r*': No such file or directory

Is there a way I can generate this file without going through the effort of looking for it in the finder? 有没有一种方法可以生成此文件,而无需进行在查找程序中查找文件的工作? I'd rather not go through the thousands of files there are in a kernel, it could take me forever. 我宁愿不要浏览内核中成千上万的文件,这可能要花我一生。

It seems like your tutorial has a quotation error. 看来您的教程中有报价错误。 instead of ' you should be using ` (backtick) 而不是',您应该使用` (反引号)

cp /boot/config-`uname -r`* .config

What it does is execute the command uname -r and place the stdout of the command in place of the command. 它的作用是执行命令uname -r并将命令的stdout放置在命令的位置。 I'd suggest using $(command) instead of `command` since it's more obvious what is going on. 我建议使用$(command)而不是`command`因为这很明显是怎么回事。

cp /boot/config-$(uname -r)* .config

First things first .. You're using simple quotes which is wrong, the command is meant to use backticks (`) -- they will include the output of the command inside them: 首先,您正在使用简单的引号,这是错误的,该命令旨在使用反引号(`)-它们将在其中包含命令的输出:

> uname -r
3.16.1-ck1
> echo /boot/config-`uname -r`
/boot/config-3.16.1-ck1

So this could already solve your problem. 因此,这已经可以解决您的问题。

If this file isn't present on your system, you have some alternatives: 如果您的系统上没有此文件,则可以选择以下方法:

  1. If you have the source the running kernel is built from, the kernel config is the file .config there. 如果您具有运行内核的构建源,则内核配置为文件.config

  2. Although most packaging/installation systems copy the kernel config to /boot/config-`uname -r` , some just copy it to /boot/config (without version suffix) 尽管大多数打包/安装系统都将内核配置复制到/boot/config-`uname -r` ,但有些系统只是将其复制到/boot/config (不带版本后缀)

  3. The kernel can be built to serve it's config in /proc/config.gz (gzip compressed) 可以构建内核以在/proc/config.gz压缩)中提供其配置

If really neither of these succeed, you're out of luck and your only option is get hold of the source package your kernel is built from. 如果这些方法都没有成功,那么您就不走运了,唯一的选择就是获得构建内核的源程序包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在哪里可以找到 Linux ubuntu 中的 kernel.config 文件? - Where would I find the kernel .config file in Linux ubuntu? 我在哪里可以找到足够好的默认配置来编译Linux内核? - where can I find a good enough default config to compile the Linux kernel? 在哪里可以找到Apache-Passenger配置文件? - Where do I find Apache-Passenger config file? 在哪里可以找到包含所有参数的 mysql 配置文件? - Where can I find mysql config file with all parameters? 内核代码:在哪里可以找到以及如何调试内核 - Kernel Code : where can I find and how to debug the kernel 我在哪里可以得到Linux内核的api,可以让我访问内核中的信息 - Where do i get the api for the linux kernel that would let me access information within the kernel 我在哪里可以从内核日志中找到oops信息 - Where could I find the oops info from kernel logs 在Linux内核中的哪里可以找到IRQF_NODELAY标志? - Where can I find IRQF_NODELAY flag in Linux kernel? 哪里可以在linux内核中找到指令地址(PC值)? - Where can I find instruction address(PC value) in linux kernel? 在哪里可以找到内存中的Linux内核文本和LKM? - Where can I find linux kernel text and LKMs in memory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM