命令“make module”不构建所有模块

发布于 2024-11-15 00:08:24 字数 1158 浏览 2 评论 0原文

我运行的是 Fedora 14 64 位。

我从 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 克隆了内核源代码树

大约一周前,我编译并升级了内核,从 2.6.35 到 2.6 .39,一切进展顺利,我所做的一切都非常直接:

make menuconfig
make oldconfig
make -j8
make modules_install && install

然后我添加了一个虚拟系统调用(我在 Robert Love 的《Linux 内核开发》一书中遵循了这一点)并尝试再次编译,它编译了内核很好,但是当我发出:

[root@xps420 Kernel]# make modules
CHK     include/linux/version.h
CHK     include/generated/utsrelease.h
CALL    scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 4 modules

它只制作了4个模块,之前有超过2000个模块。

我认为是我的虚拟系统调用导致了问题,我撤消了所有更改并重试,结果相同。

同样,我采取的步骤是:

make menuconfig
make oldconfig
make -j8
make modules ----> suspicious

我不确定是什么原因造成的。

编辑: 更多信息,我在重新编译之前运行 make clean,但它仍然只生成了 4 个模块。 有一次我确实做了modules_install,并检查了/lib/modules/[ver],只有这4个模块被复制到那里。我应该停在那里,但我还是继续运行 make install,它安装了内核,但无法启动。

编辑: 我刚刚从 kernel.org 下载了稳定版本(2.6.39.1),在执行上述步骤后,发生了同样的事情。这很奇怪。也许我的系统中的某些东西把这个搞砸了:(希望有人已经遇到这个问题并提供一些线索。

I'm running Fedora 14 64 bits.

I cloned the kernel source tree from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

About a week ago I compiled and upgraded the kernel from 2.6.35 to 2.6.39, it went pretty smoothly, all I did was very straight-forward:

make menuconfig
make oldconfig
make -j8
make modules_install && install

Then I added a dummy system call (I was following this with the Linux Kernel Development book by Robert Love) and tried to compile again, it compiled the kernel fine, but when I issued:

[root@xps420 Kernel]# make modules
CHK     include/linux/version.h
CHK     include/generated/utsrelease.h
CALL    scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 4 modules

it only made 4 modules, previously there were over 2000 modules.

I thought it was my dummy system call that was causing the problem, I undid all the changes and tried again, with the same result.

Again, the steps I took were:

make menuconfig
make oldconfig
make -j8
make modules ----> suspicious

I'm not sure what is causing this.

EDIT:
A little more info, I run make clean before recompiling, but it still only made 4 modules.
At one point I did make modules_install, and checked /lib/modules/[ver], only those 4 modules were copied there. I should have stopped there but I went ahead and run make install anyway, it installed the kernel, but was unable to boot with it.

EDIT:
I just downloaded the stable release (2.6.39.1) from kernel.org, after going thru the steps above, the same thing happened. This is strange. Maybe something in my system is screwing this up :( Hopefully someone has run into this and shed some light.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

物价感观 2024-11-22 00:08:24

好吧,在喝了几杯咖啡并进行了大量谷歌搜索之后,我还不知道这一切是如何工作的,但是看起来当我第一次升级内核时,.config 基于正在运行的内核的配置,并且它包含所有需要的模块,因此运行良好?然后不知何故,在后续编译中,几乎所有模块都没有在 .config 中配置(除了上面提到的 4 个)。长话短说,我使用旧的 .config 并运行 menuconfig 进行其他更改,它似乎解决了我的问题。谢谢!

Ok, after several cups of coffee and lots of googling, I don't know how this all works yet, but looks like when I first upgraded the kernel, the .config was based on the running kernel's config and it includes all the needed modules, therefore it ran fine? Then somehow on the subsequent compilations almost all of the modules were not configured in the .config (except the 4 mentioned above). Long story short, I used the old .config and ran menuconfig to make additional changes, it seems to solve my problem. Thanks!

悍妇囚夫 2024-11-22 00:08:24

尝试 make V=1 ... 以获得详细输出。
甚至V=2

Try make V=1 ... for verbose output.
Or even V=2.

江湖彼岸 2024-11-22 00:08:24

如果不执行“make clean”,之前的编译结果仍然存在。只有受您更改的代码影响的模块才会被重建。

If you don't do a "make clean", the previous compilation results are still there. Only modules affected by the code you changed will be rebuilt.

許願樹丅啲祈禱 2024-11-22 00:08:24

也许只有这四个模块依赖于您接触的文件。如果您想确认这一点,请执行 make clean 然后再次尝试构建,看看是否没有再次编译所有模块。当然,时间会更长!

Perhaps only those four modules have a dependency on the files you touched. If you'd like to confirm this, do a make clean and then try building again, and see if you don't get all the modules compiling again. Of course, it'll take a lot longer!

葬﹪忆之殇 2024-11-22 00:08:24

我也遇到了同样的问题,按照wliao的建议解决了。

问题描述:

  1. 前几天我将内核从3.xx(CentOS7内置)升级到了5.0.0;
  2. 今天我准备升级到5.3.0-rc6+;
  3. 在升级之前,我通过 make distclean 进行了全面清理;
  4. makemake module_installmake install 之后,我尝试使用新内核重新启动;
  5. 但启动失败,并显示: 错误:/vmlinuz-5.3.0-rc6+ 签名无效。
  6. 经过很长时间的谷歌搜索,我来到了这里,谢天谢地!

解决步骤:

  1. 从/boot复制现有的配置文件
    cp -p /boot/config-3.10.0-957.27.2.el7.x86_64 .config
    
  2. 通过menuconfig配置附加设置
    make menuconfig
    
  3. 构建
    make -j $(nproc)
    须藤使模块_安装
    须藤进行安装
    
  4. 显示您的新内核版本
    sudo grep ^menuentry /boot/efi/EFI/centos/grub.cfg |剪切-d“'”-f2
    
  5. 设置默认启动内核
    sudo grub2-set-default 'CentOS Linux (5.3.0-rc6+) 7 (Core)'
    
  6. 启动成功!

I encountered the same problem, and solved it by following wliao's advice.

Problem description:

  1. I upgraded kernel to 5.0.0 from 3.x.x(CentOS7 built-in) days ago;
  2. Today, I am going to upgrade it to 5.3.0-rc6+;
  3. Before upgrade, I did a full clean by make distclean;
  4. After make, make modules_install and make install, I tried to reboot with new kernel;
  5. But boot failed with: error: /vmlinuz-5.3.0-rc6+ has invalid signature.
  6. After a long while googling, I came here, thank goodness!

Solving steps:

  1. Copy the existing config file from /boot
    cp -p /boot/config-3.10.0-957.27.2.el7.x86_64 .config
    
  2. Config additional settings by menuconfig
    make menuconfig
    
  3. Build
    make -j $(nproc)
    sudo make modules_install
    sudo make install
    
  4. Show your new kernel version
    sudo grep ^menuentry /boot/efi/EFI/centos/grub.cfg | cut -d "'" -f2
    
  5. Set your default boot kernel
    sudo grub2-set-default 'CentOS Linux (5.3.0-rc6+) 7 (Core)'
    
  6. Boot successfully!
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文