Command 'make modules' doesn't build all modules - linux

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.

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!

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.

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!

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

I encountered the same problem, and solved it by following wliao's advice.
Problem description:
I upgraded kernel to 5.0.0 from 3.x.x(CentOS7 built-in) days ago;
Today, I am going to upgrade it to 5.3.0-rc6+;
Before upgrade, I did a full clean by make distclean;
After make, make modules_install and make install, I tried to reboot with new kernel;
But boot failed with: error: /vmlinuz-5.3.0-rc6+ has invalid signature.
After a long while googling, I came here, thank goodness!
Solving steps:
Copy the existing config file from /boot
cp -p /boot/config-3.10.0-957.27.2.el7.x86_64 .config
Config additional settings by menuconfig
make menuconfig
Build
make -j $(nproc)
sudo make modules_install
sudo make install
Show your new kernel version
sudo grep ^menuentry /boot/efi/EFI/centos/grub.cfg | cut -d "'" -f2
Set your default boot kernel
sudo grub2-set-default 'CentOS Linux (5.3.0-rc6+) 7 (Core)'
Boot successfully!

Related

How can I solve stdarg.h No such file or directory while compiling out-of-tree Linux kernel module?

I have an out-of-tree Linux kernel module that I need to compile. When I execute "make" in the kernel module directory I am getting:
"fatal error: stdarg.h: No such file or directory"
Before starting the build I installed the header file based on my Linux distribution.
$sudo apt-get install kernel-headers-$(uname -r)
How can I solve this compilation error? (my distribution is Ubuntu 16.04 with linux-headers-4.15.0-42-generic)
I ran a search of stdarg.h with the "locate" command to see if I can sport the file on the system.
I got:
/usr/include/c++/5/tr1/stdarg.h
/usr/lib/gcc/i686-linux-gnu/5/include/cross-stdarg.h
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h
...
It tells me there is at least one stdarg.h provided by the compiler.
I tried to include the path "/usr/lib/gcc/i686-linux-gnu/5/include" in the kernel module Makefile so stdarg.h can be picked up. It did not work (while building, another reference to stdarg.h in the official kernel header was not being resolved).
I finally created a symlink directly under:
/usr/src/linux-headers-4.15.0-42-generic/include
$sudo ln -s /usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h stdarg.h
This was just enough to solve the compilation issue.
I am wondering if the kernel headers should come with an implementation of stdarg.h by default (that is the first time I encounter this issue). I have also read that the compiler provide one implementation and most of the time it is better to use the compiler version.
Updated note: if the above solution still does not solve the problem:
Before running make again, do a make clean. Do a ls -la in the folder and look for a ".cache.mk" file. If this is still there, remove it and run "make" again. It should solve the problem.
I had the same issue with CentOS 9, and the other answers didn't work for me. Apparently the problem is that in more recent kernels, it shouldn't be <stdarg.h> but <linux/stdarg.h>. With virtualbox guest additions 6.1.34, it correctly checks for kernel with a version of 5.15.0 or more. But my kernel is the 5.14.xx, meaning the include for stdarg.h is wrong.
Solving the issue
Dependencies
Install all the dependencies for the guest edition
gcc make perl kernel-devel kernel-headers bzip2 dkms
Installation
Run the Guest Addition installation like you would normally. It will fail by saying it is unable to compile the kernel modules. That's expected. It will copy all the file we need to the VM disk.
Editing
We now need to edit the erroneous files.
/opt/VBoxGuestAdditions-6.1.34/src/vboxguest-6.1.34/vboxguest/include/iprt/stdarg.h
/opt/VBoxGuestAdditions-6.1.34/src/vboxguest-6.1.34/vboxsf/include/iprt/stdarg.h
On line 48 (may change for different versions), it check for a version of Linux and select the correct header depending on the version. We need to replace if RTLNX_VER_MIN(5,15,0) with if RTLNX_VER_MIN(5,14,0) in both files.
Compile the kernel modules
We can now compile the kernel modules, and the error should be gone.
sudo rcvboxadd quicksetup all
I personally got an error the first time, but then I recompiled without changing anything and it worked.
Remember that it's just a workaround, it may not work with different versions.
If you using Arch Linux with zen-kernel:
sudo CPATH=/usr/src/linux-zen/include/linux vmware-modconfig --console --install-all
I had the same problem with VirtualBox 6.1.0 running archlinux with kernel 6.1.9.
I downloaded VirtualBoxGuestAdditions_7.2.0.iso file from https://download.virtualbox.org/virtualbox/7.0.2/ link(you may select more appropriate to your VirtualBox version) and assigned as an optical drive to virtualbox machine. After start of the system running blkid command on terminal showed the name of CD rom device which was /dev/sr0. then I created iso folder on
/mnt folder
mkdir /mnt/iso
and mounted cd drive to that folder
mount -o loop /dev/sr0 /mnt/iso
after I cd'ed to /mnt/iso
cd /mnt/iso
and manually run VirtualBoxGuestAdditions.run script
sh ./VirtualBoxGuestAdditions.run
which successfully compiled and istalled required virtualbox guest modules.
Now everytime I update kernel version I redo the same procedure. And it work fine.
It also remove old 6.1.0 guest additons folder.

Should I make modules_install install everytime I make a little change to linux kernel

Should I make modules_install install everytime I make a little change to linux kernel ?
For example, If I want to print out the variable in fs/namei.c, the only thing I did was printk(...) should I make modules_install install after I make ?
If the change is in the kernel and not in a kernel module, indeed there is no need to run "make modules_install". If for example the platform is x86_64, it is enough in the example you posted to run "make bzImage" and then "make install". And running "make bzImage" is faster than runnung "make", because when you run "make" you are also building the modules. However, if you changed something that can affect kernel modules, like a header file which they use, than you must run make, and then make modules_install and then make install, so that the change will take effect.
Rami Rosen

Yocto menuconfig not working

For some reason the menuconfig menu does not come up when I try launching it from my Yocto installation. I am using the Toradex Yocto 1.6 system as is described here http://developer.toradex.com/software-resources/arm-family/linux/board-support-package/openembedded-%28core%29, with my board set to "apalis-t30". When I run either bitbake virtual/kernal -c menuconfig or bitbake linux-toradex -c menuconfig, it executes fine but finishes (without erros) before actually showing anything. Running devshell also gives the same results.
If I just use the kernel sources on their own as is described here http://developer.toradex.com/software-resources/arm-family/linux/board-support-package/build-u-boot-and-linux-kernel-from-source-code, I can get menuconfig open using make nconfig. From the Yocto scripts it appears as if though the exact same kernel sources are being used. If I try adding adding make nconfig to the do_configure_prepend script in the linux-toradex_git.bb file then the commands get stuck stating that the process (I assume menuconfig) is running and then provides a PID for it, but no window or menu is displayed anywhere and the task does not seem to finish.
PS. I am on Fedora 21 64-bit.
EDIT:
I have now checked the default Yocto image and menuconfig comes up fine there. I am assuming that the Toradex BSP is not entirely compatible enough with Yocto for this to work out of the box. I have spoken to Toradex and they have told me that I should instead fork their kernel, modify it the normal way in my own repo and then tell the script to pull from my modified repo. I guess this could work but its a bit of a hassle and I would like to fix their Yocto system. I am assuming that this cannot be to hard as running make nconfig is usually enough, I just can't figure out how to get that command working with bitbake.
This should work fine with the meta-toradex layer. In the local.conf file, comment out the INHERIT += "rm_work" line:
#INHERIT += "rm_work"
Then do a full build of the kernel:
MACHINE=apalis-t30 bitbake virtual/kernel
Then try menuconfig now that all the sources are in place:
MACHINE=apalis-t30 bitbake -c menuconfig virtual/kernel
If you are using Ubuntu, try to reconfigure system shell to bash instead of dash(that is default for Ubuntu):
$ sudo dpkg-reconfigure dash
press "No" when prompted.
Actually I got the same problem few times. In one case shell reconfigure helped me.

make: *** [install] Error 1

I have a problem with installing old software developed in 1995 for Linux.
My operating system is Cent Os. and I got some errors as below when I tried to follow the program instruction. I still do not know what the problems are....
sometimes the clock skew error messages show up but frequently it does not come up.
Waiting for expert's help
igrf]$ make
make: Warning: File igrf' has modification time 98 s in the future
make:igrf' is up to date.
make: warning: Clock skew detected. Your build may be incomplete.
igrf]$ make install
make: Warning: File igrf' has modification time 94 s in the future
install -c /home/hj/master/mag/bin -m 755 ./igrf
install: omitting directory/home/hj/master/mag/bin'
make: * [install] Error 1
Thanks!!
I installed the old version of libpcap-1.0.0 on Ubuntu 18.04 from the source, but this was not successful, as it does not fit my version of Ubuntu and gives a make error: *** [install] Error 1.
Instead this tar.gz archive i used the usual command in the terminal:
sudo apt install libpcap-dev # the problem is solved
It is possible that there is incompatibility of archives to new versions of Ubuntu.
It is also possible to find missing dependencies, check this:
IMPORTANT: There is enough information about this error; please do not post anything unless there is a specific review!
make install --touch
What can i do to help find dependencies. All of these workarounds are specific to one configuration or another. Therefore, it makes sense to track other issues as a separate bug instead of continuing to use one bug report for each issue. To make sure we focus on bugs that affect testers, Q_A_ asks reporters to feel free to post fixes and commits. The answer was very focused on the lack of specific dependencies. It will automatically collect and attach updated debug information to your report. Please add them for the feisty to help muffle the compilation issue. Maybe even backport fixes for the dapper and edgy ones?
Initially when compiling mongoose i used the helper:
make --touch
и был вывод:
touch vc98
touch vc2017
touch mingw
touch mingw++
touch linux
touch fuzzer
touch fuzz
Then i installed the missing dependencies:
sudo apt install fuzz libfuzzer-10-dev ocaml-mingw-w64-x86-64 vc-dev
...and still not all, then i had to use install (using reportdependencies the current behavior is unexpected and unsatisfactory):
I have output for mongoose:
touch linux-libs
touch install
Reportdependencies doesn't handle this very well.
In this case, linux-libs (install is omitted) points to some missing libraries. And this:
sudo apt install liblinux-pid-perl
I had an equivalent problem in the past. It is tied to the timestamps of (some) files. You should try to use the command "touch" on the concerned files. This will update the time stamps of those files.
I hope this will make the trick.

installing gcc 4.2.4

I want to install gcc 4.2.4 on a linux x86_64, intel cpu with 2 cores, in a not default path.
I downloaded the code via svn and configured from a build directory with
../gcc_424/configure --prefix=/scratch/user/local/gcc-424 --with-local-prefix=/scratch/user/local/include
then in the build directory
make
when I run
make install
I get the error
/bin/sh: line 3: cd: ./fixincludes: No such file or directory
I am a little bit lost with what I should do now, any help?
Although untested (because it's fairly old), EasyBuild should be able to build GCC 4.2 without much trouble.
Just use one of the available example easyconfigs for GCC (the non ClooG-PPL ones), adjust the version number, and run the EasyBuild install command specifying that easyconfig file.
No root priveleges required, and EasyBuild takes care of all the nasty stuff.

Resources