Building a Custom Kernel on Arch Linux
Вставка
- Опубліковано 1 жов 2024
- This tutorial demonstrates how to download the latest kernel sources, configure your custom kernel, build it, and finally install it onto your Arch Linux based system. We focus specifically on the process of building the kernel, but we also take a brief look at configuring kernel features as well.
Please post any questions you have in the comments and I will do my best to help.
Very useful video!
Now I am running my own custom kernel.
Thanks!
This is a really nice learning resource, thanks!
Thanks for the feedback!
thank you, wonderful support for me :-)
You’re very welcome. Glad to help 😊
Thanks for the video! What I did wrong was I didn't create the initramfs file but I didn't see other people do it so I thought I didn't need to
Generally for a lot of systems you don't need one lol
how often would you recommend updating the kernel? I assume I could save my configuration file and apply that to a new potential kernel as often as I want to update..?
This works. I had a problem on Lenovo legion 7 16IAX7 with no sound on internal speakers. After a several days of trying to fix it I found a patch for the kernel and your video. So following the steps from the video I patched the kernel and speakers (to my very surprise) began play sound! Thanx a lot!
Btw, I used make with -j24 and all worked well. Took about 10 minutes to build the kernel
I need help pulling this off. I’m sure I’m trying to use the same patch as you did. Once I’m done and try and load kernel it won’t mount Hdd
@@mikeroenne8344 how did you apply the patch, I remember, on the moment I did it, the patch was already too outdated to apply it atomatically. So I manually changed rows of code as it was in the patch (just in kernel there is slightly different lines of code that needed to be changed). One more thing to mention, I patched the kernel 7 months ago, nowadays the patch may not work at all
I found a script relating to patch on bugzilla. Legion patch by camron but than it didn’t finish right. And I used this vid to complete. I had such high hopes 😢 I guess it was for kernel 6.2 and all
For the most part I use nobara because it has all the legion patches built in. Minus sound. I wouldn’t even no where to begin with nobara. Making a custom kernel and manually adding and replace lines
Outstanding video.
Thank you very much!
file not found: fsck.btrfs
what's the deal? i enabled btrfs support, if that's the problem
EDIT: you need to install btrfs-progs when installing the kernel on a btrfs filesystem (also you need linux-headers as well to compile the modules correctly).
this video is a hidden treasure
It stuck on loading initial ramdisk
Hello, great video.
I have questions:
My current amd kernel (I have intel-i5-13500 and RX6700xt) does not show my cpu temp (in kde widget and sensors command), I see its missing CORETEMP module.
Based on your video I found out its coretemp module is not set (CONFIG_SENSORS_CORETEMP).
Do I need to get the source and build it with this update in config?
or
Can I modify existing kernel (installed linux-amd) with CORETEMP set? also should it be 'm' or 'y'?
What about the corresponding Linux headers? Old, existing headers are now basically the interface to that new kernel
Thanks,it really helped me
For some reason, this didn't work for me. everything compiles fine, but I have a black screen when I boot with the new kernel
Did you make significant changes to the kernel in menuconfig?
My first thing to check would be to make sure you copied your original config to use as a starting point. Secondly, be very careful you don’t need anything you’re removing. It’s difficult to say what may have gone wrong in your exact situation, but just a couple of ideas.
Your initrd should be -100MB, if it’s around 800MB you should strip unneeded symbols
After updating kernel i have to repatch it again? or changes will be present?
Thank you for make this very detailed step by step instruction video with explanation. It deserves more likes.
can i make both debian and arch packges i know i can use 1 after other like make -j4 && make deb-pkg but can i make both at the same time because i have like a slow laptop
Why did you comment the configuration related to debugging rather than choose no N
You can do either to be honest. It’s your personal preference. Using an N is probably better practice since it explicitly defines the value.
how can i remove this custom kernel?
If you install another kernel via pacman such as the LTS kernel, that should replace your custom kernel.
I installed gentoo a bit ago and wanted to see about compiling my own kernel on arch and wow it is a lot more annoying to do this on arch then gentoo
Gentoo was designed to be a source based distribution. Most Arch users won’t need to compile the kernel themselves.
@@LinuxMate i know but still its so much more hassle free
did you use genkernel on gentoo? its super easy on there that way but i think youre also supposed to do it this way on there too
@@morganb900 i used genkernel but i had also used it without gen kernel either way it was easier then that lol
Do you use artix ?
I have used Artix in the past and I believe it was what I was running when I recorded this video. It’s a nice distribution, particularly if you’re looking for a distro that provides systemd alternatives.
When using "make modules_install -j8" I'm getting the following error massage:
`sed: can't read modules.order: No such file or directory
make: *** [Makefile:1425: _modinst_] Error 2`
Do you know what's the problem?
Try doing a “make V=1 all” before running make modules_install. Also maybe try using -j4 instead of -j8. Sometimes using too many cores for kernel compilation can cause problems.
Make sure you have the cpio package! I had problems running "make modules_install", then came here and tried to run "make V=1 all" but couldn't... so I searched and I found a forum entry in the Arch Forums and they talked about this cpio package... I installed it and now make V=1 is running flawlessly! I have to wait for it to finish although for the make modules_install... I wish you luck!
@@camaradamanuel5025 I installed the cpio package but it is also giving me the same error, do you have the link or other solutions?
@@LinuxMate Thank you for the answer! Unfortunately, UA-cam is fucking retarded and the notification for comment replys were off so I didn't knew about that.
@@LinuxMate I don't know if you are seeing this but now the boot process stacks when saying "loading ramdisk". Any ideas?
0.278
ouyeah? Build custom kernel on Arch and after that rebuild all packages with new kernel headers. Very idiotic action under every precompiled Linuxes.
The only things that need rebuilding with kernel headers are external modules like nvidia driver or some other out-of-mainline driver, and that is already done by DKMS automatically on each kernel update - i see no problem here, why are you complaining?
@@LekKitEva I just leave it here "equery d -D gentoo-sources".
@@vit.c.195 I know that libc depends on kernel headers, but that doesn't mean you acually need to recompile it. Any issue regarding gentoo i may be unaware off, but in most distro switching kernels / switching to custom kernel doesn't require any further tinkering (the userspace part is completely separated)
@@LekKitEva There is such thing as "consistency" which is "true" if all packages are BUILD together accordingly to dependencies. If it not - system is INCONSISTENT. Just like that. Whatever whoever think that is need (or not) to be recompiled. Precompiled package managers have no idea about changes on installed files from binary packages. Their only can check names and versions in dependencies. This provide illusion that everything is OK if dependencies are satisfying... but is not if files compiled from custom sources with custom configuration. So it's most stupid idea to compile something from source code and use standard package manager in same place. Except user end packages on which depend nothing. But on kernel depend EVERYTHING.
@@vit.c.195 There isn't such thing as "kernel dependency", kernel has a stable syscall API and multiple kernels can be installed and changed on boot time, the distro may be even installed without the kernel (chroot installation, containers), or the kernel may be removed (tho it will not boot, the userspace part is still fine)
You are right about the package manager consistency where every piece of software on the system must be known to the package manager to prevent conflicts, garbage files, etc and what is shown in the video is not 100% correct (better approach would be making a PKGBUILD and installing the new kernel as a normal package), but there is very little harm from doing that as the kernel is pretty much self-contained and the only "dependency" userspace imposes is that the kernel is actually working. Also, Gentoo (for example) does not even list kernel as package and approach there is the same as shown in video (compile, copy to /boot, update grub cfg) and you're ready to go