What's the correct way to install kernel sources?

asked 2015-07-04 07:21:22 +0300

V10lator gravatar image

updated 2015-07-04 07:22:12 +0300

What I do right now:

  1. Mount some storage to /home/nemo/rpmbuild (in this case a nfs storage) to have enough space.
  2. Download and extract sailfish-1.1.6.27-oss.tar.bz2
  3. move kernel-adaptation-sbj/kernel-adaptation-sbj-3.4.106.20150416.1.tar.bz2 to /home/nemo/rpmbuild/SOURCES/
  4. Put this spec file to /home/nemo/rpmbuild/SPECS/kernel-adaptation-sbj.spec (it's a slight modification of the original spec file).
  5. Do `rpmbuild -bb /home/nemo/rpmbuild/SPECS/kernel-adaptation-sbj.spec
  6. When rpmbuild does build the kernel stop it (ctrl + C).
  7. Copy /home/nemo/rpmbuild/BUILD/kernel-adaptation-sbj-3.4.106.20150416.1 to /usr/src/linux-3.4.106.20150416.1 (or better: onto a larger share, nfs storage in that example, and symlink it).
  8. Do cd /usr/src/linux-3.4.106.20150416.1 && make -j3

Now you might ask why I'm stopping rpmbuild at step 6 and doing manual things instead of letting it finish and installing kernel-adaptation-sbj-devel. The reason for this is that the created rpm does contain the /usr/src/linux-3.4.106.20150416.1 folder but inside of it various files are missing. I tried to copy these files from an Android kernel source but that's just a never ending ghost hunting, so I decided to go my hackish route instead.

Now I'm pretty sure I'm doing something wrong at the first 5 steps and there's a way more simple way (which involves letting rpmbuild finish and installing the created rpm) but I can't figure it out. Any hints?

edit retag flag offensive close delete

Comments

1

@Violator : As described here https://together.jolla.com/question/97779/need-help-with-kernel-source/

If you build on phone you drop the CROSS_COMPILE bit.

So just extract the tarball, cd in the dir, make sbj_defconfig and then make. (Unless the tarball is somehow messed up ofc)

Philippe De Swert ( 2015-07-04 18:21:26 +0300 )edit