Need help about recompiling linux kernel

patrick_spoons

New Member
Credits
28
Hi Everyone,

i need help about recompiling kali linux kernel on a Raspberry pi 4.
The version of my kernel is:
Code:
4.19.118-Re4son-v8l+
First i downloaded from https://www.kernel.org/, i chose the version:
Code:
4.19.155
After the download, i created a folder called kernel and i run:
Code:
tar -xaf linux-4.19.155.tar.xz
to unzip the file.

So, i used make menuconfig to custom my own kernel and after that i run the following command:
Code:
sudo make -j 4 && sudo make modules_install -j 4 && sudo make install -j 4
I got an error:
Code:
The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

make: *** [Makefile:1321: modules_install] Error 1
Please, can anyone help me ??
 
Last edited:


Condobloke

Well-Known Member
Credits
16,026
G'day patrick, and Welcome to linux.org

Sadly, recompiling a kernel is not my cup of tea....way out of my league.....

However, I am sure some kind soul, way more knowledgeable than I will come along ....hopefully shortly.

I will just list a few names of other members here....that will let them know that help is needed here. With a bit of luck, one of them will have the requisite knowledge.

@KGIII
@f33dm3bits
@Nelson Muntz
@JasKinasis
@dos2unix
 

captain-sensible

Well-Known Member
Credits
14,907
Last time I played with compiling I put unpacked source on Desktop I used ncurses I started easy with slower steps.i copied over existing config and just started with "make " as normal user.your basically using root with sudo. Also your jumping in running more than one command at same time is it just a newer kernel you want ?if so use existing config
 

captain-sensible

Well-Known Member
Credits
14,907
i'm having a quick look while waiting for bathroom to be free. It might not help you, but for those that want to begin playing

I got that kernel linux-4.19.155.tar.xz , no need to create any directory since on uppacking you get a directory called linux-4.19.155

i went to my slackware boot looking for any kernel config i found config-generic-5.4.12.x64 had look inside :
Code:
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.4.12 Kernel Configuration
#

#
# Compiler: gcc (GCC) 9.2.0
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90200
CONFIG_CLANG_VERSION=0
CONFIG_CC_CAN_LINK=y
CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_CC_HAS_ASM_INLINE=y

yep that will do. I copied it over to linux-4.19.155 directory and renamed it to .config

from a terminal I ran:

$ (i.e as nrmal user) menu config

//gui comes up saved and exited.

Then

$ make

//its running off to shower !
 

Attachments

f33dm3bits

Gold Member
Gold Supporter
Credits
25,629
I have never really had the need to compile a kernel but I just tried it as in how it was explained in the kali documentation and I didn't run into any problems.
 

captain-sensible

Well-Known Member
Credits
14,907
mine is still compiling. I will have to come back with the outcome. But if someone wants to play with compiling a kernel. A lot can be done on the Desktop using terminal not as root and that at this location you can play without doing harm. The first step to play, i would suggest would be to get the kernel source of the same kernel you are using, pass to source folder a .config got from boot of your system. See how you can go with compiling the kernel from source , that way you can not cause harm, but can see if your system has the tools to do it such as play using ncurses i.e menu config . Have a look inside config. I will post mine here for the really nerdy !
 

Attachments

Last edited:

captain-sensible

Well-Known Member
Credits
14,907
i successfully got a vmlinux , after circa 3.25 hours. Now waiting for wife and kids to dress before going out so will hang on , now its running drivers.

Got no errors: I then tried

bash-5.0$ make bzImage
CALL scripts/checksyscalls.sh
DESCEND objtool
CHK include/generated/compile.h
Kernel: arch/x86/boot/bzImage is ready (#1)
bash-5.0$

[/CODE]
I don't want to further with this , but best to go step by step.
Linux from scratch would likely be best doc source of info

but next would be something like:
make modules
make modules_install
make install


then ..mkinitramfs

then grub
Linux from scratch would likely be best doc source of info.

Welcome comments from others..
 
Last edited:
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top