From 342acce49cc2cf56a5977fa01c5825fe5c16d927 Mon Sep 17 00:00:00 2001 From: mayfrost Date: Sat, 13 Oct 2018 21:13:11 +0000 Subject: [PATCH] Update KERNEL.md --- KERNEL.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/KERNEL.md b/KERNEL.md index 605d4b1..f9bf4d5 100644 --- a/KERNEL.md +++ b/KERNEL.md @@ -103,20 +103,22 @@ __NOTE__: Remember to save the configuration if you are using menuconfig to gene ## COMPILATION Can take minutes to hours. Have a cup of tea or coffee while you wait to compile. -__NOTE__: The __-j\__ flag, where __\__ is the number of cores +1, __IS OPTIONAL__ and only goes if you have a processor with multiple cores. If you install __ccache__ (__THIS IS OPTIONAL__) you can speed up subsequent compilations by including __CC="ccache gcc"__ after the __-j\__ flag. +__NOTE__: The __-j\__ flag, where __\__ is the number of cores, __IS OPTIONAL__ and only goes if you have a processor with multiple cores. A trick to get the cores automatically is by including __$(nproc)__ instead of the number. If you install __ccache__ (__THIS IS OPTIONAL__) you can speed up subsequent compilations by including __CC="ccache gcc"__ after the __-j\__ flag. `make -j ` -And with ccache. +With ccache. `make -j CC="ccache gcc" ` +With ccache and nproc. +`make -j $(nproc) CC="ccache gcc" ` For compilation you have two options, __OPTION A__ is the easiest and is a single command. __OPTION B__ is here for didactic purposes. ### OPTION A: One command Compile and move everything to its place. The "__all__" flag makes modules AND the __bzImage__ at the same time (replaces "__bzImage__" and "__modules__" flags). -`make -j all modules_install install` +`make -j $(nproc) all modules_install install` ### OPTION B: One by one * If your configuration does not contain answers for all of the options, especially if they are new and not currently included in your running kernel, you will need to answer the prompts for these options. -`make -j bzImage` +`make -j $(nproc) bzImage` * __OPTION B1__: Copy the new kernel to __/boot__. `cp arch//boot/bzImage /boot/vmlinuz` @@ -131,7 +133,7 @@ __NOTE__: The __vmlinuz__ can be any name but that exact name has to be added to ### BUILD MODULES Module files end with the __.ko__ file extension. They are individual files for each question you answered __M__ during kernel configuration. The object code is linked against your freshly built kernel as separate modules. Questions answered __Y__ were integrated into the kernel (__vmlinuz__), and for questions answered __N__ they were skipped (not compiled). * To compile modules. -`make -j modules` +`make -j $(nproc) modules` * Copy generated kernel modules to __/lib/modules//__. `make modules_install`