Dmy*_*o O 4 kernel arch-linux configuration
我正在使用带有自定义内核的 Arch Linux 存储为/boot/vmlinuz-linux1. 我想要的某些功能在其中不起作用,但也有一个/boot/vmlinuz-linux内核可以使这些功能起作用。如何.config从第二个vmlinuz文件中检索内核配置文件,以便在文本编辑器中将其与第一个内核的配置进行比较?
据我所知,.config 只有当您使用配置选项CONFIG_IKCONFIG(在配置菜单中作为 entry 提供General setup > Kernel .config support)编译它时,才能从内核中提取配置文件。这是该配置选项的文档:
CONFIG_IKCONFIG:
This option enables the complete Linux kernel ".config" file
contents to be saved in the kernel. It provides documentation
of which kernel options are used in a running kernel or in an
on-disk kernel. This information can be extracted from the kernel
image file with the script scripts/extract-ikconfig and used as
input to rebuild the current kernel or to build another kernel.
It can also be extracted from a running kernel by reading
/proc/config.gz if enabled (below).
Run Code Online (Sandbox Code Playgroud)
最后一句指的是一个额外的配置选项CONFIG_IKCONFIG_PROC,它使您可以通过proc伪文件系统中的文件访问正在运行的内核的配置。
如果您的内核尚未使用 编译CONFIG_IKCONFIG,我认为您无法轻松检索其配置。否则就这么简单
gunzip /proc/config.gz > .config
Run Code Online (Sandbox Code Playgroud)
如果CONFIG_IKCONFIG_PROC已被选中并且您当前正在运行/boot/vmlinuz-linux内核,或者
scripts/extract-ikconfig /boot/vmlinuz-linux
Run Code Online (Sandbox Code Playgroud)
该脚本extract-ikconfig与内核源代码一起位于文件夹scripts.