How to compile linux kernel subdirectory? - linux

I want to compile linux kernel subdirectory just like this:
make M=drivers/staging/comedi/
Unfortunately when I do this I get this error:
ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.
Makefile:648: include/config/auto.conf: Nie ma takiego pliku ani katalogu
make: *** [Makefile:719: include/config/auto.conf] Błąd 1
It may be fixed by this command:
make oldconfig
After executing it, I have to press enter for 2 minutes to select the default options everywhere, and then I get this error anyway:
AR drivers/staging/comedi//built-in.a
WARNING: Symbol version dump "Module.symvers" is missing.
Modules may not have dependencies or modversions.
MODPOST drivers/staging/comedi//Module.symvers
/bin/sh: scripts/mod/modpost: Nie ma takiego pliku ani katalogu
make[1]: *** [scripts/Makefile.modpost:111: drivers/staging/comedi//Module.symvers] Błąd 127
make: *** [Makefile:1701: modules] Błąd 2
I have seen many times in the videos people just building a subdirectory with one make M=somedir command. Why doesn't it work for me?

Related

Yocto autotools do_compile fails

I have created a recipe in my custom layer like this:
SUMMARY = "Mednafen is a portable, utilizing OpenGL and SDL, argument(command-line)-driven multi-system emulator."
HOMEPAGE = "https://mednafen.github.io/"
SRC_URI = "https://mednafen.github.io/releases/files/${PN}-${PV}.tar.xz"
SRC_URI[md5sum] = "7be60dd12edf8d61537f5598957e2884"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
DEPENDS += " zlib libsndfile1 libsdl2"
LICENSE = "GPL-2.0"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
S = "${WORKDIR}/${PN}"
inherit autotools-brokensep gettext
But when I try to create a minimal image I get this error message:
ERROR: mednafen-1.27.1-r0 do_compile: oe_runmake failed
ERROR: mednafen-1.27.1-r0 do_compile: Execution of '/home/cihan/Desktop/yocto/poky/build/tmp/work/aarch64-poky-linux/mednafen/1.27.1-r0/temp/run.do_compile.14150' failed with exit code 1:
Making all in po
make[1]: Entering directory '/home/cihan/Desktop/yocto/poky/build/tmp/work/aarch64-poky-linux/mednafen/1.27.1-r0/mednafen/po'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/cihan/Desktop/yocto/poky/build/tmp/work/aarch64-poky-linux/mednafen/1.27.1-r0/mednafen/po'
Making all in intl
make[1]: Entering directory '/home/cihan/Desktop/yocto/poky/build/tmp/work/aarch64-poky-linux/mednafen/1.27.1-r0/mednafen/intl'
make[1]: *** No rule to make target 'libgnuintl.#INTL_LIBTOOL_SUFFIX_PREFIX#a', needed by 'all-no-yes'. Stop.
make[1]: Leaving directory '/home/cihan/Desktop/yocto/poky/build/tmp/work/aarch64-poky-linux/mednafen/1.27.1-r0/mednafen/intl'
Makefile:452: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
WARNING: /home/cihan/Desktop/yocto/poky/build/tmp/work/aarch64-poky-linux/mednafen/1.27.1-r0/temp/run.do_compile.14150:1 exit 1 from 'exit 1'
ERROR: Logfile of failure stored in: /home/cihan/Desktop/yocto/poky/build/tmp/work/aarch64-poky-linux/mednafen/1.27.1-r0/temp/log.do_compile.14150
Can you tell me what am I doing wrong? Btw, I work on dunfell branch and thank you for your replies.
It is always better to use ready-made recipes instead of handling all the dependencies, building options, patches...etc by your self. The mednafen recipe for dunfell branch is defined here under meta-game-emulators:
https://layers.openembedded.org/layerindex/recipe/132957/
You need to clone this layer and add it to your bblayers, then try to rebuild again. if you need another version of mednafen (particularly 1.27.1 mentioned in your question) then try to use the recipe for version 1.24.3 as the base for your custom recipe. This will make things easier for you.

building custom minimal linux from source.with cross compiling toolchain,etc.error fixdep.o.cmd:1:missing separator. Stop--Makefile error or something

I cross compiled toolchain now building linux kernel. I followed this page
https://www.linuxjournal.com/content/diy-build-custom-minimal-linux-distribution-source
So I compiled all the tools including gcc, etc. When I reached compiling linux-4.16.3 kernel, with this command
make ARCH=${LJOS_ARCH} CROSS_COMPILE=${LJOS_TARGET}- INSTALL_MOD_PATH=${LJOS}
I got following error
root#this:/home/ubuntu/source/linux-4.16.3# CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CHK include/generated/bounds.h
CHK include/generated/timeconst.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
DESCEND objtool
Makefile:49: warning: overriding recipe for target '/home/ubuntu/source/linux-4.16.3/tools/objtool/'
Makefile:46: warning: ignoring old recipe for target '/home/ubuntu/source/linux-4.16.3/tools/objtool/'
/home/ubuntu/source/linux-4.16.3/tools/objtool/.fixdep.o.cmd:1: *** missing separator. Stop.
make[3]: *** [Makefile:43: /home/ubuntu/source/linux-4.16.3/tools/objtool/fixdep-in.o] Error 2
make[2]: *** [/home/ubuntu/source/linux-4.16.3/tools/build/Makefile.include:4: fixdep] Error 2
make[1]: *** [Makefile:63: objtool] Error 2
make: *** [Makefile:1687: tools/objtool] Error 2
Now apparently it looks like the makefile in /home/ubuntu/source/linux-4.16.3/tools/objtool/ has something wrong at line line 43,and line 63
OR while running the scripts/checksyscalls.sh it struck with something that causing problem. Like something that the scrip is doing but that command not found I am completely clueless what might causing problem. No idea. In the link above the author downloaded busybox, so I believe it had something that needed to be installed but I didnt.
I like someone please explain what the error means and why is this causing
Thanks for help...

PULP SDK build process

I'm new to this website and it is the first time I've worked with the RISC-V processor. I'm following the tutorial of the PULP SDK build process "https://github.com/pulp-platform/pulp-sdk".
But, I'm blocked at the stage of SDK build when I tape the command "$ make all" and I can't understand what's mean these errors.
Below the errors:
sdk:json-tools:build: make all install
make[1]: Entering directory '/home/pulp/project/pulpissimo/pulp-sdk/json-tools'
#### Building in /home/pulp/project/pulpissimo/pulp-sdk/build/sdk/json-tools
#### Release type is RelWithDebInfo
#### Installing to /home/pulp/project/pulpissimo/pulp-sdk/pkg/sdk/dev/install/ws
( cd /home/pulp/project/pulpissimo/pulp-sdk/build/sdk/json-tools ; make all VERBOSE=0 )
make[2]: Entering directory '/home/pulp/project/pulpissimo/pulp-sdk/build/sdk/json-tools'
make[2]: *** No rule to make target 'all'. Stop.
make[2]: Leaving directory '/home/pulp/project/pulpissimo/pulp-sdk/build/sdk/json-tools'
Makefile:46: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/pulp/project/pulpissimo/pulp-sdk/json-tools'
Reached EOF with exit status 2
FATAL ERROR: the command 'build' has failed
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 255
Thank you in advance
Have you selected the target as advised in the documentation before running make all?
By running source configs/pulpissimo.sh for example.
I selected the target as advised in the documentation before running make all. In fact, it was a Vivado cmake problem that starts automatically when I run the make all command and it's an old version of cmake.
I solved this problem by uncommenting the line source /opt/Xilinx/Vivado/2018.3/settings64.sh. The day I need to launch Vivado I have to run this line on the command line in the terminal.

make oldconfig error 1

I built my kernel using fedpkg local (which took 6 hours and I hope I don't have to repeat the process)
Now when I try to use the command "make oldconfig" it returns with the following error
Makefile: 10: recipe for target 'oldconfig' failed
make: *** [oldconfig] Error 1
Can somebody tell me what this means and how to resolve it?

Cross-Compile Kernel Module - error fixdep : no such file or directory

I am trying to cross-compile a TP-Link module for ARM920T of which the
details are following -
Module Source - $HOME/Desktop/ashish/TL-WN725N_V2_150911/Driver/
Toolchain Path - /usr/local/3.4/arm-linux-uclibc/bin/arm-linux-uclibc-gcc
I have exported path for my toolchain using -
export PATH=$PATH:/usr/local/3.4/arm-linux-uclibc/bin
I am running the following from the top level kernel source directory
($HOME/lhotse/products/p101/sw/branches/release4.X/kernel/linux-2.6.8.1)
of my target system
make ARCH=arm CROSS_COMPILE=arm-linux-uclibc- M=/home/gauravmittal/Desktop/ashish/TL-WN725N_V2_150911/Driver/ modules
The command throwing the following error -
"******************************************"
"NO SKRC,we will use default KSRC"
"******************************************"
CC [M] /home/gauravmittal/Desktop/ashish/TL-WN725N_V2_150911/Driver/core/rtw_cmd.o
mv: cannot stat
`/home/gauravmittal/Desktop/ashish/TL-WN725N_V2_150911/Driver/core/.tmp_rtw_cmd.o':
No such file or directory
make[2]: *** [/home/gauravmittal/Desktop/ashish/TL-WN725N_V2_150911/Driver/core/rtw_cmd.o]
Error 1
make[1]: *** [_module_/home/gauravmittal/Desktop/ashish/TL-WN725N_V2_150911/Driver]
Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-23-generic'
make: *** [modules] Error 2
When I do a just make on the top level driver directory, it successfully
creates a .ko file for me and I am able to install the module on my
workstion (running on kernel 2.6.24-23-generic), but couldn't find
where am I going wrong during cross-compiling the same.
Just that I am not able to understand how to move forward, as
relatively new to Embedded Development, any kind of help would be
appreciated.
EDIT 2 :
Started things from scratch again.
I have downloaded the linux source compatible to by target (linux-2.6.8.1) and have included the module source in linux-2.6.8.1/drivers/net/wireless/tplink
I have also copied the content of Kconfig from module source directory under wireless Kconfig to get it appearing in the make menuconfig menu. I did a make menuconfig and enabled the option for the same.
Now I did
make ARCH=arm CROSS_COMPILE=arm-linux-uclibc- KSRC=/usr/src/linux-headers-2.6.24.23-generic/ M=${PWD}/drivers/net/wireless/tplink/ modules
The output is as under -
CC [M] /home/gauravmittal/Desktop/ashish/linux-2.6.8.1/drivers/net/wireless/tpwifi/core/rtw_cmd.o
fixdep: /home/gauravmittal/Desktop/ashish/linux-2.6.8.1/drivers/net/wireless/tpwifi/core/.rtw_cmd.o.d:
No such file or directory
make[1]: *** [/home/gauravmittal/Desktop/ashish/linux-2.6.8.1/drivers/net/wireless/tpwifi/core/rtw_cmd.o]
Error 2
make: *** [_module_/home/gauravmittal/Desktop/ashish/linux-2.6.8.1/drivers/net/wireless/tpwifi]
Error 2
I have tried searching a lot on the Internet but could not fix this. I am stuck at this from long..any help would be greatly appreciated.

Resources