Install A New Arch Linux Kernel: Grub & SystemD Boot

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
typically when using arch linux i and most people are going to install the linux kernel what i mean is the linux kernel in the package titled linux but there are various other reasons why you might want to pick a different kernel like the zen kernel the lts kernel the get kernel hardened whatever other kernel you might want to use the sake of my sanity i'm going to be using a kernel from the stable repo something like zen hard and lts one of those basically because i don't want to wait three hours to compile the kernel and i can't guarantee that all of the packages available in the aur are going to work i'll leave my video linked on the kernels available on arch in the description down below and wherever on the screen links go nowadays and once you've selected which kernel you want to use let's talk about how we actually use it first thing we need to do is actually install the kernel now the naming scheme between the standard repos and the aur is shared which does make it easier and anything in the author isn't using the correct naming scheme look you probably shouldn't be using anyway because it probably has other problems to begin with so the naming scheme is linux dash the name of the kernel so if i want zen that is going to be linux dash zen let's go and install that and make sure i put my password incorrectly there we go now it's going to go and install it and honestly if you're using grub you're pretty much done even with systemd boot there's only one extra step you need to do so with grub once this is installed we need to go and regenerate our grub config to make sure that the kernel is actually being detected that can be done with sudo grub dash mk config makes you spell it correctly dash o and then send that to the location of your grub cfg so that is slash boot slash grub slash grub dot cfg now what you're going to notice is because the package manager puts the kernel in the correct location grub finds an extra kernel that being in my case the zen kernel and it's like um i guess i should do something with this and it generates the files needed to actually load from that kernel now systemd boot you will need to do this bit manually back when you first set up systemd boot you would have made a loader file for your kernel that would have been in slash boot slash loader slash entries and you probably called it arch.conf but the name doesn't actually matter as long as it's dot conf now what we're going to be doing is making an exact loan of this but modifying it a bit to make it work with the new kernel pretty much all we need to do is modify the line that says linux and the second line in there that says init rd if we just go and copy the file that's a good place to start just to keep it in line with what we're doing i'm going to call it arch zen but the name ultimately does not really matter pretty much all we need to modify is firstly the title you don't want it to be the exact same title as the other thing in your list i'm going to call it arch linux zen then we need to modify the linux line so this is going to depend on what kernel you're using but for the zen kernel it is vm linus dash linux dash zen then for the init rd line that is going to be a knit ram fs dash linux dash zen dot img it's probably gonna be the same thing for lts but lts instead and hardened for the hardened kernel but be sure to check with the kernel you're actually using and then once that's done there's no extra command you need to run just go and save the file and then you can go and do a reboot and everything should be working inside your system boot list the option is going to be there and assuming we didn't make a mistake as you can see zen is now there if we select that it should now just go and boot into the zen kernel everything is good and just to be extra sure inside my tty here as you can see it says dash zen 5.15.2.0 dash is one dash z i don't know why it's name like that but it's very clearly the zen kernel there are other things you can do with systemd boot if you want to check out the documentation but for now that's all we need technically you can uninstall the original kernel you're using and just rely on that new kernel i would highly highly suggest against doing that unless your storage is extremely limited or you don't want to spend an extra minute or two while actually updating your system do not do that because if something goes wrong with that new kernel you sort of want to have that full back with the main stable kernel which should always be working and this is especially true if you've compiled your own kernel or got something from the aur i cannot guarantee that those are always going to be working especially if you're doing yourself i don't know how good you are compiling your kernel you might have just completely broke something now while you're technically done i would not recommend stopping there so do you use the nvidia drivers do you need optimus support do you use virtualbox do you use v4l do you use anything that needs an external kernel module so these external kernel modules are loaded through a system called dkms or dynamic kernel module support these are for any modules not shipped inside the kernel source tree now unless the new kernel you're using actually comes with one of those modules which in some cases it might for example with zen that has a bunch of extra things not in the stable source tree you may run into some problems in some cases apps might be completely broken what you need to do instead is make sure you install the linux kernel headers this is basically an api for modules outside of the kernel tree to actually call against to interact with all of the fun kernel stuff so you probably already have a headers package installed that being linux dash headers but the linux headers you use because all of these kernels are going to be different in various different ways need to be the headers made specifically for that kernel the typical naming scheme even in the aur is linux dash kernel name dash headers so in the case of linux zen that would be linux dash zen dash headers and this assuming i put my password incorrect should give us exactly what we want so in the case of the hardened kernel that would be linux dash hardened headers in the lts kernel that would be linux-lts-headers so on and so forth now any kernel modules you are using with the previous kernel you might notice they're still no longer working so that's because the new kernel does not know those modules actually exist and they only exist in reference to the previous kernel you're using probably the stable kernel so to address that in my case i'm using v302 lootback dkms and virtualbox host dkms i just reinstall them and then let the package manager put them in the places they need to be even though we got grub set up earlier to work with other kernels it's still not set up perfectly to work with other kernels one of the problems it has is when you open up grub it's gonna say arch linux everything else there's just like an option there to open up a sub menu that shows you all of the other options that's really annoying to work with so let's actually go and fix that so the first thing i'd recommend doing obviously after you go into your grub config is go and disable an option in here called grub underscore disable underscore sub menu setting this to y why is it set to y and not yes i don't know that's what the grub dev decided to do also go and set grub default equal to saved what this is going to do is grub is going to default to picking the last saved option but this by itself actually isn't going to do anything because grub actually doesn't save any options what you need to do is go and add another option that is going to be grub underscore save default setting this to true inside of quote marks and then it's actually going to save the option and every time you reopen grub whatever the last thing you selected was is going to be the default option in my case that's stable right now but while i was testing out zen that would have been zen and then once you've saved that you need to go and regenerate the grub config again using the exact same command we used earlier honestly i probably should have only done this once but if anyone stopped at that initial point in the video because they didn't really care about the rest then they would have missed it so either way the config is now generated and the sub menu is going to be shown properly and all of your new kernels are now there at the end of the day using the standard kernel is going to get you through your day with the exception of really weird hardware that doesn't work properly with i know there are some laptops out there that definitely have that problem but for most people using desktop systems it doesn't matter but if you want to go and explore some of the other kernels out there it is kind of fun it is kind of fun to see hey is this kernel actually useful or is this just like marketing hype telling you oh this kind of is great speaking of that i do have some stuff planned about the zen kernel um whenever i get around to doing my dedicated zen video yeah i've got some things to say about zen so that's going to be pretty much it for me if you found this video useful and you want to go and support my channel and become one of these amazing people over here please go check out my patreon subscribers only bear paid link in the description down below i've got a podcast called tech over t available basically anywhere i've got a gaming channel called broader option plays where i live stream twice a week upload about five or so youtube shorts and this channel is also available over on odyssey that's gonna be it for me this video took like two hours to record and i'm out [Applause] [Music]
Info
Channel: Brodie Robertson
Views: 27,806
Rating: undefined out of 5
Keywords: brodie robertson, arch linux, linux kernel, arch linux kernel, best linux kernel, arch linux best kernel, linux zen kernel, linux zen kernel arch, linux lts kernel, linux lts kernel arch, linux stable kernel, linux hardened kernel, linux hardened kernel arch, brodie robertson linux, brodie robertson arch linux, best linux kernel for gaming, new to linux, linux tutorial, linux guide, grub, systemd boot, grub add kernel, grub add boot entry, systemd boot add entry
Id: 7_d4QHXwIKo
Channel Id: undefined
Length: 10min 32sec (632 seconds)
Published: Thu Dec 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.