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.

КОМЕНТАРІ • 54

  • @joir2000
    @joir2000 3 роки тому +8

    Very useful video!
    Now I am running my own custom kernel.
    Thanks!

  • @ondrejmach3925
    @ondrejmach3925 3 роки тому +11

    This is a really nice learning resource, thanks!

    • @LinuxMate
      @LinuxMate  3 роки тому +1

      Thanks for the feedback!

  • @gionibegood6950
    @gionibegood6950 3 роки тому +7

    thank you, wonderful support for me :-)

    • @LinuxMate
      @LinuxMate  3 роки тому +1

      You’re very welcome. Glad to help 😊

  • @fancywaifu9821
    @fancywaifu9821 2 роки тому +3

    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

  • @pyrokamileon
    @pyrokamileon 7 місяців тому

    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..?

  • @eidenrid7735
    @eidenrid7735 Рік тому +3

    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

    • @mikeroenne8344
      @mikeroenne8344 11 місяців тому

      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

    • @eidenrid7735
      @eidenrid7735 11 місяців тому

      @@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

    • @mikeroenne8344
      @mikeroenne8344 11 місяців тому

      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

    • @mikeroenne8344
      @mikeroenne8344 11 місяців тому

      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

  • @krozareq
    @krozareq 4 роки тому +5

    Outstanding video.

  • @gassug2
    @gassug2 Рік тому +1

    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).

  • @0xssff
    @0xssff 3 роки тому +2

    this video is a hidden treasure

  • @Simple_OG
    @Simple_OG 2 місяці тому

    It stuck on loading initial ramdisk

  • @kirangeorge8
    @kirangeorge8 10 місяців тому

    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'?

  • @leahblack4417
    @leahblack4417 Рік тому

    What about the corresponding Linux headers? Old, existing headers are now basically the interface to that new kernel

  • @izone6522
    @izone6522 2 роки тому +1

    Thanks,it really helped me

  • @melissali1571
    @melissali1571 2 роки тому +1

    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

    • @zeckma
      @zeckma 2 роки тому

      Did you make significant changes to the kernel in menuconfig?

    • @LinuxMate
      @LinuxMate  2 роки тому

      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.

    • @leahblack4417
      @leahblack4417 Рік тому

      Your initrd should be -100MB, if it’s around 800MB you should strip unneeded symbols

  • @lob06780
    @lob06780 2 роки тому

    After updating kernel i have to repatch it again? or changes will be present?

  • @CmAektP2jxrGAb7
    @CmAektP2jxrGAb7 Рік тому

    Thank you for make this very detailed step by step instruction video with explanation. It deserves more likes.

  • @clerickx1642
    @clerickx1642 3 роки тому

    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

  • @abdallahrashed1947
    @abdallahrashed1947 3 роки тому

    Why did you comment the configuration related to debugging rather than choose no N

    • @LinuxMate
      @LinuxMate  3 роки тому +1

      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.

  • @brunoweiss8237
    @brunoweiss8237 Рік тому

    how can i remove this custom kernel?

    • @LinuxMate
      @LinuxMate  Рік тому

      If you install another kernel via pacman such as the LTS kernel, that should replace your custom kernel.

  • @killertigergaming6762
    @killertigergaming6762 2 роки тому

    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

    • @LinuxMate
      @LinuxMate  2 роки тому

      Gentoo was designed to be a source based distribution. Most Arch users won’t need to compile the kernel themselves.

    • @killertigergaming6762
      @killertigergaming6762 2 роки тому

      @@LinuxMate i know but still its so much more hassle free

    • @morganb900
      @morganb900 Рік тому

      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

    • @killertigergaming6762
      @killertigergaming6762 Рік тому

      @@morganb900 i used genkernel but i had also used it without gen kernel either way it was easier then that lol

  • @angelosdkg
    @angelosdkg 3 роки тому

    Do you use artix ?

    • @LinuxMate
      @LinuxMate  3 роки тому

      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.

  • @godnyx117
    @godnyx117 3 роки тому +1

    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?

    • @LinuxMate
      @LinuxMate  3 роки тому +1

      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.

    • @camaradamanuel5025
      @camaradamanuel5025 3 роки тому +1

      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!

    • @TheGunmaster3d
      @TheGunmaster3d 3 роки тому

      @@camaradamanuel5025 I installed the cpio package but it is also giving me the same error, do you have the link or other solutions?

    • @godnyx117
      @godnyx117 2 роки тому

      @@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.

    • @godnyx117
      @godnyx117 2 роки тому +3

      @@LinuxMate I don't know if you are seeing this but now the boot process stacks when saying "loading ramdisk". Any ideas?

  • @luckypillgrim1913
    @luckypillgrim1913 3 роки тому

    0.278

  • @vit.c.195
    @vit.c.195 4 роки тому

    ouyeah? Build custom kernel on Arch and after that rebuild all packages with new kernel headers. Very idiotic action under every precompiled Linuxes.

    • @LekKitEva
      @LekKitEva 3 роки тому +5

      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?

    • @vit.c.195
      @vit.c.195 3 роки тому

      @@LekKitEva I just leave it here "equery d -D gentoo-sources".

    • @LekKitEva
      @LekKitEva 3 роки тому +1

      @@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)

    • @vit.c.195
      @vit.c.195 3 роки тому

      @@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.

    • @LekKitEva
      @LekKitEva 3 роки тому +1

      @@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