[英]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: 如果您的系统上没有此文件,则可以选择以下方法:
If you have the source the running kernel is built from, the kernel config is the file .config
there. 如果您具有运行内核的构建源,则内核配置为文件
.config
。
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
(不带版本后缀)
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.