3
votes

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.

5
So that people know you've found the solution, take your third edit, paste it in as an answer and click the 'Accept' checkmark.Arthur Shipkowski
Will do, thanks for the help!wliao

5 Answers

2
votes

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!

0
votes

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.

0
votes

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!

0
votes

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

0
votes

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!