You are not logged in.

#1 2025-02-19 14:29:03

rupeshforu3
Member
Registered: 2023-01-06
Posts: 90

vannila kernel traditional compilation kernel panic.

Hi I am Rupesh from India and I have brought a new system with AMD Ryzen zen3 5500GT and Asus prime b450 motherboard. I installed Arch Linux Operating System five months back updating, and using it without any problem. I thought to compile vanilla kernel source code optimized for my hardware but failed.

Actually yesterday I have updated my system and installed base-devel meta package and other packages like  xmlto, kmod, inetutils, bc, libelf, git, cpio, perl, tar, xz.

I studied Arch Linux traditional kernel compilation and other guidelines to compile kernel. I tried to follow those steps.


At first I have downloaded kernel source code and from kernel.org

wget [url]https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.13.3.tar.xz[/url]

After that I have downloaded sign file from kernel.org

wget [url]https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.13.3.tar.sign[/url]

I tried to verify integrity of the kernel through the following commands.

unxz linux-6.13.3.tar.xz
gpg --verify linux-6.13.3.tar.sign linux-6.13.3.tar

I received error as public key not found.

I unpacked kernel source code

tar -xvf linux-6.13.3.tar.xz

After that I changed ownership of the directory recursively through the following command.

chown -R $USER:$USER linux-6.13.3

Then I have entered into the extracted directory.

cd linux-6.13.3

Before configuration I have updated cflags as follows

export KCPFLAGS=" -march=znver3 -O2 pipe"
export KCLAGS=" -march=znver3 -O2 pipe"
export CFLAGS=" -march=znver3 -O2 pipe"
export CPFLAGS=" -march=znver3 -O2 pipe"

After that I have created a configuration file which consists of only the modules loaded by old kernel through the following command.

make localmodconfig

I received some questions related to kernel configuration and I have selected default values by entering ENTER key.

After that I entered the following command.

make xconfig

In this gui configuration I done the following changes.

1) I selected amdgpu option to compile as module

2) I have selected the option DISABLE_DEBUG_INFO to Yes

3) I have added the string  _Rupesh to Local_Version

4) I have selected append Local_Version to version to yes

5) I have disabled support for other processors like intel etc except AMD.

6) I have selected powersave in frequency scaling rather than performance.

I have saved and exited the configuration.

After that I issued the following command to make the kernel and modules.

make bzImage modules 

After that I issued the following command to install modules

make modules_install 

After that I have tried to install kernel to /boot through the following command.

make install.

Unfortunately I got the error as

Lilo not found.

So I have copied the bzImage to /boot directory manually through the following command.

cp  arch/x86/boot/bzImage /boot/vmlinuz-linux-6.13.2_Rupesh

After that I have created initramfs image through the following command.

mkinitcpio -k 6.13.2 -g /boot/initramfs-linux-6.13.2_Rupesh.img

I have even copied the System.map file to the boot directory manually through the following commands.

cp System.map /boot/System.map-linux-6.13.2_Rupesh
ln -sf /boot/System.map-6.13.2_Rupesh /boot/System.map

After that I have updated my grub configuration through the following command.

grub-mkconfig -o /boot/grub/grub.cfg

After that I have installed the grub boot loader through the following command.

grub install /dev/nvmen101

I thought everything was done properly but when I tried to boot into the latest kernel I got kernel panic with blue screen.

I am using other Linux Operating Systems like Fedora 41, Debian Linux, Gentoo Linux. I made same things to configure and install the vanilla kernel and succeeded but in Arch Linux I failed.

In other Linux Operating Systems when I issue the command "make install" another tool like dracut is invoked and it takes the responsibility of installation of kernel compiled but in Arch Linux there's no way.

Kindly try to suggest what's wrong I have done and how to compile and install the vanilla kernel.

Regards,
Rupesh.

Offline

#2 2025-02-19 14:55:53

rupeshforu3
Member
Registered: 2023-01-06
Posts: 90

Re: vannila kernel traditional compilation kernel panic.

Can I use directly vannila kernel instead of Arch kernel.

Someone suggested not because Arch kernels consists of a number of patches. Is it true.

Is there any kernel source package available in Pacman repository.

Offline

#3 2025-02-19 14:59:30

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,476

Re: vannila kernel traditional compilation kernel panic.

There are very, very few patches, and they certainly aren't necessary. This is almost certainly a config issue, start with Arch's config.

Edit: patches: https://github.com/archlinux/linux/rele … 13.3-arch1

Last edited by Scimmia (2025-02-19 15:00:49)

Offline

#4 2025-02-19 15:30:29

rupeshforu3
Member
Registered: 2023-01-06
Posts: 90

Re: vannila kernel traditional compilation kernel panic.

Okay can I download the source code.tar.gz from the above link and perform the same steps.

Is there any need to apply the patch provided in the above link.

Is there any tool to automate the process of creating initramfs image, System.map, update grub configuration etc., found in other Linux Operating Systems.

Offline

#5 2025-02-19 15:32:41

rupeshforu3
Member
Registered: 2023-01-06
Posts: 90

Re: vannila kernel traditional compilation kernel panic.

In chatgpt they suggested to use

yay -S linux

But if I use it I think that there is no way to tune configuration for my hardware.

Offline

#6 2025-02-21 09:35:00

rupeshforu3
Member
Registered: 2023-01-06
Posts: 90

Re: vannila kernel traditional compilation kernel panic.

Ok I can understand what you are saying.

Using or compiling distribution kernel source code is preferred than vannila kernel.

I have rectified the error in Arch Linux ie., After compiling and installation of kernel the grub failed to add correct parameters for root initramfs in grub.cfg.

I added manually and at present I am able to boot into the latest kernel.

Offline

Board footer

Powered by FluxBB