Can't compile kernel 4.19.122 from git source

I will check it later.

thank you… i will wait for ur answer

Finally I compiled it.
I will write down here steps.
first of all

apt-get update
apt-get install build-essential git libncurses5-dev 
git clone https://github.com/osmc/osmc.git

Note: I’m doing it with root user if you are using standart user add ‘sudo’ before every line.

For changing kernel drivers edited “rbp2-000-add-kernel-config.patch” (for Rbp2 or 3) (for beginners if you add lines or remove lines you have to correct line count in patch file. its in first few lines)

*For Crosscompile you need to do

cd osmc/toolchains/armv7-toolchain-osmc
make
dpkg -i *.deb
cd …/…/…

before next step you need “libcrypto.a” and “libcrypto.so.1.1”( in my case they are missing) you can find them "/usr/lib/arm-linux-gnueabihf " and copy them to “/opt/osmc-tc/armv7-toolchain-osmc/lib/arm-linux-gnueabihf” and run this code

ln -s /opt/osmc-tc/armv7-toolchain-osmc/lib/arm-linux-gnueabihf/libcrypto.so.1.1 /opt/osmc-tc/armv7-toolchain-osmc/lib/arm-linux-gnueabihf/libcrypto.so

and also need openssl compiled from source because apt package has missing files like “configuration.h” and “opensslconf.h”
for compiling Openssl

git clone git://git.openssl.org/openssl.git
cd openssl
./configure
make
make test
make install
cd …

Now u have openssl files in “/usr/include”. You need to copy “openssl” directory to kernel source as quickly as posible before starting compiling progress start after download kernel source. For this reason you may need to copy this directory easy reachable place…

After everythig is ready you can start to compile kernel

cd osmc/packages/kernel-osmc
make rbp2

After started command copy “openssl” directory to “osmc/packages/kernel-osmc/src/kernel-4.19.122/tools/include” directory as quick as posible as I said before.

sometimes (depends on your kernel config) you need to make choices on progress do them and thats all.

After a couple hours (3 hours for me) compiling finishes.
then if you are on target machine (for cross compilers u need to copy them on ur raspberry first)

dpkg -i rbp2-kernel-4.19.122-2-osmc.deb
dpkg -i rbp2-image-4.19.122-2-osmc.deb

Finished…
Just reboot device an use…

I don’t know is there an easiest way but thats how i did.
BTW thank u sam_nazarko for eveything. I tried to explain how I did. May be you can fix this easiest way.

If you are cross-compiling, you don’t need our toolchain.

Sam

Really?
But when i try to compile on ubuntu says cant find on apt for toolchain.
in raspberry automaticly downloads over apt.

what am I missing?
Cross-compiling is compiling for other platforms isnt it?

If you built it on Pi, that isn’t cross compiling.

OK thats what I mean. So where i did wrong ? :thinking:

You didn’t do anything wrong. I tried to compile the (unamended) kernel and had the same error. Clearly, there is a problem with the kernel build system.

Whether you used the term “cross-compile” incorrectly isn’t particularly important. The real question is why the build fails.

This is now solved. A dependency was missing.

Thank u very much :slight_smile: