Patch and compile kernel procedure

I am pretty sure I wrote this post two days ago but now I can’t find it… anyway…

I need to patch a kernel in order to make audio work on a Lenovo 300e Treeya Chromebook, acording to the script here: https://github.com/WeirdTreeThing/chromebook-linux-audio

I am following these instructions:

But when I reach “Make initial RAM file system” part, I am confused, because instructions are for mkinitcpio but EndeavourOS uses dracut. How should I do it? Can I skip this part?

Then, I am also not sure how to procede in adding the bootloader entry, as EndeavourOS uses sytemd-boot, not GRUB. How should I do it? I can’t find a clear explanation anywhere.

Thanks!

Are you aware of the Chrome OS devices in the Arch Wiki and specifically the section about fixing audio on one of those devices ? They list three different approaches,which are specific to the CPUs Chromebooks usually ship with.

That might be an easier approach than to compile a custom kernel, as that would take definitely a not insignificant amount of time on a Chrome device.

Yes, they offer solutions to baytrail, apollolake and Haswell Intel CPUs, but mine is a Stoney Ridge AMD one.

Are you using grub or systemd-boot?

systemd-boot

The best way is to copy the arch package and then create patch that has your changes and modify it into the PKGBUILD. Then build and install the package. That is the cleanest and easiest to maintain. If you do that, everything will just work automatically.


If you would prefer to do it all manually, then ignore all the instructions for copying files to /boot. Ensure the kernel is installed to /usr/lib/modules/<kernel>/vmlinuz

Then run sudo reinstall-kernels

Every time you manually to update the kernel, you will need to run kernel-remove and then reinstall-kernels

thanks!

Do you know if I can find a guide on how to copy the arch package, create the patch and modify it into the PKGBUILD? or links that may help me?

Anyway, I screwed my EndeavourOS boot with this so now I am trying with Debian

thanks!

git clone https://gitlab.archlinux.org/archlinux/packaging/packages/linux.git

The PKGBUILD automatically pulls in anything from the source directory named *.patch so you only need to add a patch to the sources and change the pkgbase to be something like linux-custom. Then you should be able to install it alongside the normal kernel so you can have both in case it doesn’t work.