How to compile a custom Linux kernel

  Рет қаралды 95,274

DenshiVideo

DenshiVideo

Күн бұрын

Пікірлер: 105
@VDani16
@VDani16 3 жыл бұрын
Wow, It's a lot easier than I thought.
@kentlisius7675
@kentlisius7675 Жыл бұрын
This is the most fascinating part that goes with Linux and I am hooked on making my kernel just for the computer I am using!
@godnyx117
@godnyx117 2 жыл бұрын
Great video! A thing that wasn't mentioned is the options: `make olddefconfig` which creates a new config file based on a previous config file that you have (it may be the previous one you used) and makes sure to give the fill the new values with their default options. From my understanding, this means that, I will not have to always modify the same options every time I build a custom kernel which is nice because I don't want to do that every time. Of course the new values will need configuration (unless I leave their default value) but this makes sense. Also, I've saw another video that talks specifically about building a custom kernel on Arch Linux and before updating the bootloader, he tells about generating an "initial ramdisk" using `mkinitcpio -k -g /boot/initramfs-linux` Of course replace the with the number of the kernel you are using. I don't know if this is needed only for Arch users or if it is needed in general but I just thought to add it here. Edit: Creating an "initial ramdisk" is necessary for Arch Linux even if you don't enable it in the kernel. I'll find how to fix it and I'll update.
@nonnullptrhuman504
@nonnullptrhuman504 2 жыл бұрын
For me generating initial ramdisk is necessary for void linux
@godnyx117
@godnyx117 2 жыл бұрын
@@nonnullptrhuman504 Interesting! It seems that it's the same with Arch Linux as I wasn't able to generate one with successes and my kernel won't boot.
@shrimp_on_internet
@shrimp_on_internet 3 жыл бұрын
Well time to recompile gentoo, see you next week!
@killertigergaming6762
@killertigergaming6762 2 жыл бұрын
Mean while it took 5 minutes for my i3
@shrimp_on_internet
@shrimp_on_internet 2 жыл бұрын
@@killertigergaming6762 sounds like a neat setup
@killertigergaming6762
@killertigergaming6762 2 жыл бұрын
@@shrimp_on_internet indeed it is
@NicolaiNita
@NicolaiNita 2 жыл бұрын
Every time I make changes and recompile it it breaks 🙈 this time with nvidia drivers!
@muIIetman
@muIIetman Жыл бұрын
Well, it's been a year, were you correct on the time or is it still compiling?
@fotografm
@fotografm 3 жыл бұрын
Thank you for that ! It was my first exposure to how to customize the Linux kernel. Looks tempting...
@thecastiel69
@thecastiel69 Жыл бұрын
The Gang Compiles a Kernal
@milky3ay566
@milky3ay566 Жыл бұрын
Thanks for the into. I am compiling it now. See u next month.
@ejbully
@ejbully 2 жыл бұрын
Free should always be run at startup. Verify with uptime. Then run free. A system with higher uptime typically has more resources being utilized. Always run free immediately after boot if using for comparison purposes
@pranaypallavtripathi2460
@pranaypallavtripathi2460 Жыл бұрын
@Eric Banks I totally agree. The first free he ran was after compiling the kernel which itself would have taken about 30min and the second free was immediately after boot. So the comparison isn't quite accurate.
@Bruh-hd4rj
@Bruh-hd4rj 2 жыл бұрын
Uhhh... Everything worked fine until i booted the new kernel. My laptop freezed and i need to reboot it manually to start de old kernel.
@Borsting89
@Borsting89 2 жыл бұрын
this video goes through some important steps that is not addressed in this video kzbin.info/www/bejne/jZq9YWimo62Np68
@JihedCh
@JihedCh 6 ай бұрын
+1 for the always sunny in philadelphia soundtracks
@wheezybackports6444
@wheezybackports6444 3 жыл бұрын
Good extensive guide.
@Kneedragon1962
@Kneedragon1962 3 жыл бұрын
Should also say, your current running Linux has a config file. If you simply want to copy that and use it, that's mostly a safe option. I found, if you copy it and don't ever even open it with the menu-config, you get problems. If you make a copy of it, then open it with menu-config, change nothing, save it, and then run your make / compile with that, it works. At least it works inside a VM. I've had one & only one go at doing this on bare metal in the last 4 years or so, and it didn't load. I had to re-install from scratch. What was the problem? I never found out. I think the problem had something to do with that version of Mint and the version then current of the binary utilities, but I'm half guessing about that. I know I did precisely the same steps on bare metal I'd been doing in the VMs, and it worked flawlessly in them, but when I tried it on the real-steel ... If & when I get my hands on a 16c-32t R9, I will be extremely interested in having another go at it. There's stacks of stuff in the generic kernel now about side_channel_exploit_mitigation, which I would be prepared to simply edit out. I'm not a data centre. No example of exploits using those has yet been reported in the wild, and they're mostly only an issue on Intel processors. If I'm running Linux as a home desktop user, and nobody has ever reported Spectre+Melt Down exploits being used in the wild, I think I'd like that 20% or something performance back. Like Astra-Zenica and blood-clots, it's a chance I'm willing to take.
@pranaypallavtripathi2460
@pranaypallavtripathi2460 Жыл бұрын
Thanks for your advise. Even I tried simply copying existing distro's config file but it did not work. I will try opening it with menu-config next time 👍
@PaullyRobots
@PaullyRobots 2 жыл бұрын
I'm psyched. Definitely gonna fuck w/ this. Viva revolution.
@joeleone6276
@joeleone6276 2 жыл бұрын
Great content and video, but could you slow it down a bit on the next video? It's hard to follow along and work on multiple computers if you're trying to duplicate the steps. Thank you!
@moki4883
@moki4883 26 күн бұрын
Great video!
@Neucher
@Neucher 3 жыл бұрын
isn't lz4 compression faster than zst ?
@xeome5596
@xeome5596 3 жыл бұрын
yes it is but zstd is far more efficient and just a tiny bit slower than lz4
@Neucher
@Neucher 3 жыл бұрын
@@xeome5596 Kernel compression only matters for embedded systems like vending machines.
@anarchy_79
@anarchy_79 Жыл бұрын
I found the music distracting.
@SupermotoZach
@SupermotoZach 4 ай бұрын
I found it relaxing, and I am usually not a fan of background music. I guess its why its called "comfy" guide.
@19440116
@19440116 3 жыл бұрын
Very smart and very quick..
@tan9744
@tan9744 2 жыл бұрын
Hey help plzzzz ! What if I don't perform from 1:40 - 11:50 and do the "make" command?.... Will it take longe time or what?? plzzzz help
@ArvFlash
@ArvFlash 3 ай бұрын
@@tan9744 im probably late, but if you dont dont make a config file it wont work, you can also just open the config menu and save without making changes, tho it wont be guaranteed to work on your hardware then, if you dont want to make your own config, you can also use presets which other people made for your hardware
@dmytropetrenko7556
@dmytropetrenko7556 3 жыл бұрын
це шедевр! Ставлю двадцять чотири вподобайки!
@tan9744
@tan9744 2 жыл бұрын
Hey help plzzzz ! What if I don't perform from 1:40 - 11:50 and do the "make" command?.... Will it take longe time or what?? plzzzz help
@MasterH2005
@MasterH2005 Жыл бұрын
12:17 If you run -j4 instead, will it still compile the kernel? My laptop only has 4 cores.
@Denshi
@Denshi Жыл бұрын
Yep! The number just refers to how many simultaneous compilation processes you run. You can also not use the -j flag at all and compile with a single thread.
@xperience-evolution
@xperience-evolution 2 жыл бұрын
Help please! sudo make modules _install -j16 does not work. It says: sed: modules.order can't be read: File or directory not found make: *** [Makefile:1479: __modinst_pre] Error 2 I have no clue what the Problem is
@xperience-evolution
@xperience-evolution 2 жыл бұрын
@Spada Yes. Someone on linuxquestions tried to help but no success. I stopped. I want to begin from scratch with the latest Kernel. If you know how to do it or know about that specific problem I would love to hear it. (I already wrote a comment 3 hours ago with a link to the linuxquestions forum and my problem. Seems it got deleted).
@tykymba
@tykymba 9 ай бұрын
I tried pacman -S bc
@Jennn
@Jennn Жыл бұрын
Thank you dear!
@ruirosado6289
@ruirosado6289 9 ай бұрын
Hi! Why didn't you create a new initial ramdisk? Did you forget it? I was expecting a "mkinitcpio -p linuxAlex".
@tykymba
@tykymba 9 ай бұрын
could you tell me what he is missing. because I am stuck
@ruirosado6289
@ruirosado6289 9 ай бұрын
@@tykymba Hi! Here's what i saw. As you can see at 13:00, his system's older kernel file is vmlinuz-linux and it's paired initramfs-linux.img. Then, he proceeds by copying the brand new kernel file to /boot, changing it's name to vmlinuz-linuxAlex, and that's ok. However, that new kernel file does not have a corresponding initramfs-linuxAlex.img file. To acomplish that he should have runed "sudo mkinitcpio -p linuxAlex" or "sudo mkinitcpio -P". Only then, after having the new kernel and initramfs files in place, it would be time to run "sudo grub-mkconfig -o /boot/grub/grub.cfg". This command would have added both vmlinuz-linuxAlex and initramfs-linuxAlex.img to grub.cfg. Pairing a newer kernel with an older initramfs can lead to compatibility issues, as the initramfs may not contain the necessary modules and drivers for the newer kernel. In some cases, booting with an older initramfs and newer kernel may result in failure to boot, as the initramfs may not support the newer kernel's requirements. When updating the kernel, in the future, the initramfs may fail due to missing kernel headers for the newer kernel version. Final note: This "mkinitcpio -P" command is an Arch Linux thing. On Debian one should run "sudo update-initramfs -u" (if i'm not mistaken). Sorry for the long and late answer. Good luck!
@ruirosado6289
@ruirosado6289 9 ай бұрын
@a Hi! Somehow my answer to your request was deleted. He should have run "sudo mkinitcpio -P" or "sudo mkinitcpio -p linuxAlex" to generate a "initramfs-linuxAlex.img" to pair it with the new kernel. The Grub config file generation should be the last step. This way, both the new kernel and initramfs files wil be included in that config file. Pairing a new kernel with an older initramfs can lead to a bunch of problems. I hope this helps.
@muhamadzainimansur9624
@muhamadzainimansur9624 Жыл бұрын
is it still relevant to be implemented in 2023?
@herrxerex8484
@herrxerex8484 3 жыл бұрын
goodbye denshi
@MrDombosfi
@MrDombosfi 2 жыл бұрын
Can I compile the custom Linux kernel for embedded devices like this? i.e. risk--v / cortex m0 etc.
@PriestApostate
@PriestApostate Жыл бұрын
How does one find the number of threads on one's system?
@rinkadev945
@rinkadev945 Жыл бұрын
with nproc command
@fuahuahuatime5196
@fuahuahuatime5196 2 жыл бұрын
I think this video can be cutdown a lot. I'm here to learn how to compile a custom linux kernel, not watch a super quick (and long) rundown of features you're disabling. Maybe a more in-depth video of what each field is a separate video would be a really nice compliment to this. 00:00 ~ 1:40 ... 11:50 ~ end.
@tan9744
@tan9744 2 жыл бұрын
Hey help plzzzz ! What if I don't perform from 1:40 - 11:50 and do the "make" command?.... Will it take longe time or what?? plzzzz help
@Ja.KooLit
@Ja.KooLit 3 жыл бұрын
Hi Denshi, thanks for you the video. So I created a custom kernel, copied to boot folder and so on. But it is not adding in the GRUB list when I update the grub. Any suggestions? Thanks
@kyrylmelekhin2667
@kyrylmelekhin2667 3 жыл бұрын
You need to rename vmlinux to vmlinux-5.10 or whatever your version may be. Then Grub will pick it up.
@Ja.KooLit
@Ja.KooLit 3 жыл бұрын
@@kyrylmelekhin2667 Hi. Thanks. Interestingly, my system does not even have vmlinuz. But if I do like what you suggested, it will just overwrite the vmlinuz copied into boot folder. Am I correct or am I missing something?
@kyrylmelekhin2667
@kyrylmelekhin2667 3 жыл бұрын
@@Ja.KooLit Nothing should ever overwrite vmlinuz-(yourcustomversion) when you run grub-mkconfig -o file does it detect your custom kernel? If so then you are done.
@Ja.KooLit
@Ja.KooLit 3 жыл бұрын
@@kyrylmelekhin2667 oh I got what you mean. But on the video, I just copied the generated and named it vmlinuz-(something). Then I run the grub......update, it does not detect my custom kernel.
@Ja.KooLit
@Ja.KooLit 3 жыл бұрын
@@kyrylmelekhin2667 hey man its ok now. I redo it again. It can see. But another problem no display ha ha.. Perhaps I changed too much on the kernel. But mo worries, guess just need to dig more
@user-cq8zg1qz8o
@user-cq8zg1qz8o 2 жыл бұрын
thanks for you the video, but i am have problem i stuck on 'Loading initial ramdisk' how fix that?
@ludovico3716
@ludovico3716 2 жыл бұрын
Same T_T
@drishalballaney
@drishalballaney 3 жыл бұрын
at 13:20 it should have bee arch x86_64 boot bzimage, not x86 iirc
@Denshi
@Denshi 3 жыл бұрын
They are the exact same binary, at least the way I compiled them. I even checked the hashes to be sure.
@drishalballaney
@drishalballaney 3 жыл бұрын
​@@Denshi aah ok, thanks. I was worried for a second there :D
@gto4467
@gto4467 2 жыл бұрын
Hy denshi my custom kernel is showing when i update grub but after restart there is no kernel showing at grub screen what should i do??
@tan9744
@tan9744 2 жыл бұрын
Hey help plzzzz ! What if I don't perform from 1:40 - 11:50 and do the "make" command?.... Will it take longe time or what?? plzzzz help
@gto4467
@gto4467 2 жыл бұрын
@@tan9744 Sorry for late reply ,but No it will not take long time but it will make your kernel more suitable for you hardware special for processor
@tan9744
@tan9744 2 жыл бұрын
@@gto4467 Ok... Nahhh no problem dude ... thanks alot 🙌
@gto4467
@gto4467 2 жыл бұрын
@@tan9744 welcome bruhh
@luigiprovencher
@luigiprovencher 6 ай бұрын
Does this work on a raspberry pi? Like pi 5?
@tomatobros
@tomatobros 3 жыл бұрын
Yeah i'm gonna check my memory usage after i compile tons of shit and check it later, i'm pretty sure there was actually nothing more than 50mb of difference with compiled kernel.
@QuarKSonTV
@QuarKSonTV 3 жыл бұрын
Song title?
@tan9744
@tan9744 2 жыл бұрын
Lol
@gregcooper8647
@gregcooper8647 2 жыл бұрын
how are the steps different if you dont have a grub bootloader?
@Capiosus
@Capiosus Жыл бұрын
You just use a different one by following wiki directions?
@piecaruso97
@piecaruso97 11 ай бұрын
with the fact that i need run many expansion card for various purposes and i often swap them around i think i will just leave everything enabled in the drivers lmao
@jaredlara2850
@jaredlara2850 4 ай бұрын
Good video. Also, .75 speed people
@vizlodunken4952
@vizlodunken4952 2 жыл бұрын
wow i thought that was the scariest thing
@Bricky2021
@Bricky2021 9 ай бұрын
Is that even debian you have here?
@gettriggered_ian3269
@gettriggered_ian3269 3 жыл бұрын
Gentoooooo
@User_1795
@User_1795 3 жыл бұрын
On PS4...!
@mattaertker4783
@mattaertker4783 2 жыл бұрын
When I run make menuconfig, I get errors all over the place. Initially, its this: ld: unknown option: --version ld: unknown linker scripts/Kconfig.include:56: Sorry, this linker is not supported. make[2]: *** [menuconfig] Error 1 make[1]: *** [menuconfig] Error 2 make: *** [__sub-make] Error 2 then if I try and delete the lines causing the error, I get more errors. Do you know why this is, or how to fix it?
@djnikx1
@djnikx1 2 жыл бұрын
Me too..
@robbs96
@robbs96 2 жыл бұрын
@@djnikx1 me three
@maxs.8146
@maxs.8146 Жыл бұрын
Answer from ChatGPT (be careful): The error message "ld: unknown option: --version" suggests that the linker you're using is not supported. It's possible that you have an older version of the linker installed or that you're using a non-standard linker. To fix this issue, you can try specifying a different linker by setting the LD environment variable. For example, if you want to use the GNU linker (ld), you can set the LD variable to /usr/bin/ld like this: export LD=/usr/bin/ld You can add this line to your shell startup file (e.g., ~/.bashrc) so that it's set automatically each time you open a new terminal. If you're still encountering errors after specifying a different linker, it's possible that there's a problem with your toolchain or environment. In that case, you might want to try reinstalling your toolchain or setting up a new environment.
@rectify2003
@rectify2003 5 ай бұрын
Dreadful tutorial for beginners
@chezar1717
@chezar1717 18 күн бұрын
In my country, quite a lot people want to maximize performance by rooting, but the thing is they don't know how, when i tried to learn this things, i actually open device rooting service 😂
@hoboman342
@hoboman342 2 жыл бұрын
fuck wit da musik homie gentoo 4eva
@alurma
@alurma 3 жыл бұрын
Thanks
@xeome5596
@xeome5596 3 жыл бұрын
aye
@code01100
@code01100 Жыл бұрын
you spelled downloads wrong
@daringcuteseal
@daringcuteseal 3 жыл бұрын
hhh why am I watching this in 10 PM
@Zackmortar
@Zackmortar 3 жыл бұрын
denshi you gotta make some new content your channel is dying perhaps somthing more than tutorials and stuff,i wouldnt comment this on most videos but you got potential!
@Domo22xD
@Domo22xD Жыл бұрын
wtf is with background music.
@digitalage2010
@digitalage2010 Жыл бұрын
Did you edit and used lots of cuts while editing or you were just doing it fast?? Don't you know you shouldn't be this fast on such explaining videos??
@aaaaaaaaaaaaaaaaaaaaaaaa305
@aaaaaaaaaaaaaaaaaaaaaaaa305 3 жыл бұрын
hi
@erbenton07
@erbenton07 2 жыл бұрын
Please slow down~! You talk so fast I can't follow you.
@tan9744
@tan9744 2 жыл бұрын
Slow the speed from normal to 0.5x 🥵🥵🥵
@DrKellieOwczarczak
@DrKellieOwczarczak Жыл бұрын
This! I have to speed him up!
@janmussche6815
@janmussche6815 11 ай бұрын
You really think somebody can understand this? You race through the process with the speed of a high speed train. Yeah, people who know this already will be able to follow you, but my guess is you want to teach this to people who don't know it yet. Well, you lost me after a few seconds already. Great job.
@mahkhi7154
@mahkhi7154 6 ай бұрын
How to compile a custom Linux kernel? Your God Has Taught you a Few Things. However, you don't Really Understand Things. VMware ESXi or Microsoft's Hyper-V are Micro Kernels. Xen or Linux or NT OS are Kernels Windows Kernel: Kernel32.Sys. Thats Much bigger than a Kernel. Hypervisors are Bare Metal because of How small the Micro Kernels are. Hypervisors aren't Called Micro Kernels because They don't Provide all the Services a Kernel Does. Its SOLE Job is to Run the Virtual Machine Software. ALL You Know is What You've Been Told. You Memorise and Repeat That, without Understanding.
How Linux Kernel Runs Executables
16:46
Nir Lichtman
Рет қаралды 45 М.
Making Simple Linux Distro from Scratch
11:51
Nir Lichtman
Рет қаралды 206 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 11 МЛН
УДИВИЛ ВСЕХ СВОИМ УХОДОМ!😳 #shorts
00:49
HARD_MMA
Рет қаралды 3,5 МЛН
5 Mistakes to Avoid as a New Linux User
11:49
Learn Linux TV
Рет қаралды 128 М.
Why Compile a Linux Kernel from Source?
13:38
DJ Ware
Рет қаралды 31 М.
Configuring a Custom Linux Kernel (5.6.7-gentoo)
36:18
Mental Outlaw
Рет қаралды 134 М.
QEMU for Linux kernel developers
13:56
Johannes 4GNU_Linux
Рет қаралды 10 М.
They actually DID IT... Linux on SCRATCH
7:20
DenshiVideo
Рет қаралды 344 М.
Windows & macOS can't do this, but Linux can!
15:55
The Linux Experiment
Рет қаралды 953 М.
The Linux Tier List
27:34
Chris Titus Tech
Рет қаралды 1,2 МЛН
How A Steam Bug Deleted Someone’s Entire PC
11:49
Kevin Fang
Рет қаралды 1 МЛН
Building a Custom Kernel on Arch Linux
24:18
Linux Mate
Рет қаралды 27 М.