Kernel compile seems to be longer/larger than reasonably expected?

Asked by Roger Goeb

I have experience with Centos 7, but none with Ubuntu.
I installed what I believe to be the latest version of Ubuntu, and have installed kernel sources (5.8.10).
uname -r returns "5.8.0-44-generic".

My questions is, how do I compile a single version of the kernel specific to the OS I am compiling on?
Currently, my last compile ran 14 hours (initial compile on Centos 7 was 2-4 hours) and the resulting files generated ate up over 20G's of disk space.

I then found this link - https://help.ubuntu.com/community/Kernel/Compile
which contained these instructions -

"to build a specific target, use this command:

fakeroot debian/rules clean
AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-FLAVOUR
Where FLAVOUR is one of the main flavours of the kernel (e.g. generic)"

so I ran -

fakeroot debian/rules clean
sudo AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-generic

I did this and am currently 5 hours into the compile and have increased disk usage by aroungd10G.

Does anyone know what I might be doing wrong? I simply want to compile an original kernel source without any modifications and prove that I can compile and install properly. At that point I can then merge some modifications into the code and watch it blow up.

Thanks in advance,
Roger

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Quote from https://help.ubuntu.com/community/Kernel/Compile#Build_the_Kernel.28s.29

If you have a more than one processor or more than one core, you can speed things up by running concurrent compile commands. Prepend CONCURRENCY_LEVEL=2 for two processors or two cores; replace '2' with whatever number suits your hardware setup (for Gutsy and later, you can alternatively use DEB_BUILD_OPTIONS=parallel=2).

fakeroot debian/rules clean
DEB_BUILD_OPTIONS=parallel=2 AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-generic

Remark: Why do you compile with sudo? sudo is only needed for installing the kernel after building, but should not be used for compiling.

Can you help with this problem?

Provide an answer of your own, or ask Roger Goeb for more information if necessary.

To post a message you must log in.