Trouble Configuring Linux Kernel - linux

I am trying to recompile the Linux kernel, but before I do this, I need to configure it. I use the following command to try to do this:
make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- gconfig
where arm-xilinx-linux-gnueabi- is the prefix of the version of gcc I'm using. Unfortunately, instead of popping up the configuration window, this gives me the message:
make: *** No rule to make target `gconfig'. Stop.
Does anyone know what the problem is?

Is anyone of make xconfig, make gconfig and make menuconfig working?
I guess you aren't on the right kernel directory.
Please read this again: HOWTO compile linux kernel

Related

Makefile: No such file or directory & No rule to make target, while compiling Linux kernel

I just download a linux kernel, add some systemcalls and then try to compile it.
While I use "make mrproper" and "menuconfig" it happened:
root#krasus-virtual-machine:/home/krasus/lib1/linux-5.19.10# make mrproper
Makefile:1022: scripts/Makefile.extrawarn: No such file or directory
make: *** No rule to make target "scripts/Makefile.extrawarn". Stop.
root#krasus-virtual-machine:/home/krasus/lib1/linux-5.19.10# make menuconfig
Makefile:611: scripts/Makefile.compiler: No such file or directory
make: *** No rule to make target "scripts/Makefile.compiler". Stop.
My vmware version is ubuntu 20.04.5 LTS with kernel 5.15.0-48,
The version of the kernel I'm compiling is linux-5.19.10.
I would really appreciate if you can give me some help, I've tried a lot but nothing worked, and now I'm crazzy about it.
Please forgive my poor English.

error message "-mrecord-mcount" when cross-compile out of kernel module

I'm trying to build an out-of-kernel module and cross-compile it.
So, I'm working on VM, Ubuntu, and I upgraded the running kernel to 5.15.6.
Now, I'm trying to cross-compile my very simple "Hello world" module.
Its Makefile is simply:
obj-m += yanivModule.o
and the building command is:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /lib/modules/5.15.6/build/ M=$PWD modules
and I keep running into this error message:
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mrecord-mcount’; did you mean ‘-frecord-marker=4’?
Does anyone know what "-mrecord-mcount" means how to fix it?
I tried to disable the "CONFIG_FTRACE_MCOUNT_RECORD" and "CONFIG_HAVE_FTRACE_MCOUNT_RECORD" configuration flag as I read somewhere it might be related (and by name it actually might be), but it didn't solve the error.
I'm kind of lost here since in the tutorial video I'm following, it's done with no issues at all.
Update:
I managed to fix the issue, but I'm not sure why it got fixed that way, and why the way I described before didn't work.
I downloaded the kernel of beaglebone board from github:
https://github.com/beagleboard/linux/tree/5.10
and then built it using:
make ARCH=arm bb.org_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- C /home/.../beaglebone-linux-5.10/ M=$PWD modules
and only then, building the module, when -C is the new downloaded kernel tree - has succeeded with no issues.
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/.../beaglebone-linux-5.10/ M=$PWD modules
So now, I'm left with 2 questions:
What, step fixed the issue and what was missing from the previous way I tried? was it using the bb.org_defconfig configuration file?
Why this bb.org_defconfig configuration file is missing from the latest Linux kernel source tree?

Arch Linux: make - no such file or directory

I have a problem by compiling a driver (WLAN-dongle Edimax ac600).
I´m using an Archlinux on my raspberry-pi and want to install my dongle for 5Ghz. During comiling the driver I get this message. I tried to install the linux-headers without success. (in other threads it will be a solution)
Here is my output of make:
[root#raspberry_pi_1 rtl8812AU]# make make ARCH=arm CROSS_COMPILE= -C
/lib/modules/4.9.43-1-ARCH/build M=/root/rtl8812AU modules make[1]:
*** /lib/modules/4.9.43-1-ARCH/build: No such file or directory. Stop. make: *** [Makefile:1576: modules] Error 2
I found out that my pi has a two-arch...-directories:
4.9.43-1-ARCH/
4.9.51-1-ARCH/
Only the second one has the build directory...
How can I fix the problem?!
thanks a lot,
a Linux noob...
[Reputation is too low to post comment]
Use uname -r to make sure which version of the kernel you use.
If it's 4.9.43 : you have newer version of the kernel and this confuse your installer. You should reboot on the 51 one
If it's 4.9.51 : You messed up your installation step and are trying to compile for an old target. You should review the compilation process and change every mention of the 4.9.43 to 4.9.51 since it's the version you use.
If you upgrade your kernel, you may have to rebuild the thing again (You may like to have script in the future ;) ) with the new kernel version.

Can't figure out how to compile Linux kernel module

I have been trying to figure out how to compile a kernel module. I started with http://www.tldp.org/LDP/lkmpg/2.6/lkmpg.pdf to learn. I then found Compiling a kernel module, header problems, makefile problems to get my makefile going. After running make. I get the following output:
Building target module 2.6 kernel.
PLEASE IGNORE THE "Overriding SUBDIRS" WARNING
make -C /lib/modules/2.6.32-431.el6.i686/build SUBDIRS=/root/kerntest/hello modules
make[1]: Entering directory `/usr/src/kernels/2.6.32-431.20.3.el6.i686'
Building modules, stage 2.
MODPOST 1 modules
make[1]: Leaving directory `/usr/src/kernels/2.6.32-431.20.3.el6.i686'
I see the .ko file, but don't see any kernel messages showing the module was activated. I also checked in /lib/modules/2.6.32-431.20.3.el6.i686/extra but there is nothing there. I also tried 'dmesg' and 'lsmod' but didn't see it.
Can anyone point me in the right direction?
I am trying this on CentOS 6.5
You need to actually load the module into the kernel after compiling by using insmod or modprobe :)

`missing-syscalls' error during kernel compilation

These are the steps I am doing to compile the linux source on my machine :
1. Copy the config file from /boot to /usr/src/kernels/2.6.29.4-167.fc11.i586/ directory
2. make oldconfig
3. make
Step 3 fails with the following error :
make[1]: *** No rule to make target `missing-syscalls'. Stop.
Compiling on a x86 box.
Any suggestions ?
Please feel free to close this question if it does not belong here.
As archaic as it may sound it appears that currently in order to get kernel source on a system you have to manually select the source you want. One supposes that people don't build kernels as often as they used to and of course you may want to develop a kernel that does not match the version that you are running..
So for example I wanted to install VBox on my CentOS 6.2 box and while most kernel modules can be compiled without complete sources this update failed.
So I found this wiki page:
http://wiki.centos.org/HowTos/I_need_the_Kernel_Source
It doesn't list 6.2 and the naming conventions have changed on the final directory name so to get the 6.2 kernel source you go to http://vault.centos.org/6.2/updates/Source/ and select the version you want. If you want source for a different version go to http://vault.centos.org/ and navigate from there.
The docs recommend against doing an rpm-build on the kernel sources.
Make a new config file. Maybe the old one isn't working?
I have not been able to answer why this error happens :
Step 3 fails with the following error : make[1]: *** No rule to make target `missing-syscalls'. Stop.
But I was able to compile the vanilla version fine, without the above error.
I asked the same question on serverfault as well, which has a more detailed explanation of the steps taken : https://serverfault.com/questions/61354/missing-syscalls-error-during-kernel-compilation
since kernel 3.x.x this message appears if trying to build external modules having only single Makefile prepared.
Instead, according to this manual,
splitting into Kbuild (where all the source files are listed, example):
obj-m := module_source.c
and simple Makefile (having only default make directive, example):
default:
$(MAKE) -C $(KDIR) M=$$PWD
will solve the problem.
just in case, external module build directive would be following:
make -C <kernel source path> -M=<module source folder>
example: make -C . -M=extra/

Resources