使用当前已加载的模块(硬加载,内置)配置linux内核 [英] configuring linux kernel with (hard-loaded, built in) currently loaded modules
问题描述
我想在我的Debian/Sid/x86-64上从源代码构建一个最新的Linux内核(例如,2017年9月末的4.13.4),并将所有(或大多数)当前已加载的模块配置为在新版本中硬构建内核.
I want to build from source a recent Linux kernel (e.g. 4.13.4 in end of september 2017) on my Debian/Sid/x86-64 with all (or most) currently loaded modules configured as hard-built in the new kernel.
(我相信我在某个地方读过类似的东西,但是不记得在哪里也找不到它)
可能是某些make configfromloadedmodules
(但是,它当然不是configfromloadedmodules
makefile目标,而是我不容易找到的其他目标).
It would be some make configfromloadedmodules
(but of course it is not exactly configfromloadedmodules
makefile target, but some other target that I did not easily find).
也就是说,对于大多数(理想情况下)所有当前加载的模块(由make config
为每个模块回答Y
(而不是m
).时间,给我一些足够的东西.config
;但我不希望所有驱动程序(甚至是我不使用且当前未加载的驱动程序)都内置一个blo肿的内核.
That is, for most (ideally all) currently loaded modules (as given by lsmod
) it would answer Y
(not m
) for each of them at make config
time and give me some good enough .config
; but I don't want a bloated kernel with all drivers -even those that I don't use and which are not currently loaded- built in.
是否存在,或者我可能已经阅读了实验内核的某些愿望或某些非标准功能?
Does that exist, or was what I have probably read some wish or some non standard feature of experimental kernels?
这样可以避免出现任何initrd
问题,并为我提供适合我的硬件和习惯的内核.
This would avoid any initrd
thing and give me a kernel suited for my hardware and habits.
当前内核是标准的Debian版本4.12.0-2-amd64
,因此我有它的/boot/config-4.12.0-2-amd64
(因此,我想在那里自动将CONFIG
xxx =m
替换为CONFIG
xxx =y
)当前加载的模块,例如lsmod
给出的.)
The current kernel is a standard Debian one 4.12.0-2-amd64
, so I have its /boot/config-4.12.0-2-amd64
(so I want to automatize the replacement of CONFIG
xxx=m
with CONFIG
xxx=y
there, according to the currently loaded modules, e.g. as given by lsmod
).
另请参见此答案;我仍然相信设备树对于Linux并不是必不可少的,但是它们是一个有用的便利.
See also this answer; I still believe that device trees are not essential to Linux, but they are a useful convenience.
我的问题的一个近变种是如何轻松配置一个适合我的计算机和硬件以及设置的内核,而没有ìnitrd
,没有任何模块(例如,有CONFIG_MODULES=n
)并且没有(或很少有)无用的驱动程序,它们可以和我当前的Debian内核一样好用.
A near variant of my question is how to easily configure a kernel, suited to my computer and hardware and set-up, without ìnitrd
, without any modules (e.g. with CONFIG_MODULES=n
) and without (or with very few) useless drivers, which would work as nicely as my current Debian kernel.
推荐答案
我相信,您应该阅读有关" make localmodconfig "和" make localyesconfig "的知识,并使用其中一个根据您的要求.
I believe, you should read about "make localmodconfig" and "make localyesconfig" and use one as per your requirement.
This, This and This are helpful links.
这篇关于使用当前已加载的模块(硬加载,内置)配置linux内核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!