Custom kernel build

Turns out that building a custom kernel for ArchLinux isn’t as easy as it seems. Just changing $pkgver in the official PKGBUILD doesn’t work, because it doesn’t fetch the sources from the official git tree, but from a clone on github. Here’s how to do it as of 2021-07-31:

  1. Change pkgbase to e.g. linux-ryzen
  2. Change pkgver to the version you want to compile

Then change the sources array to:

"$_srcname::git+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git#tag=v${pkgver}"

This will clone the stable source tree HEAD. To checkout a specific version, add the following to prepare() after cd $_srcname:

echo "Checking out $_srctag"
git checkout "v${pkgver}"

If you want to save some time, remove make htmldocs from build() and the equivalent from pkgname() at the bottom.

Share and enjoy!

Ryzen, Part 5

Well, well, well, after 71 days uptime the system can be considered stable:

Disabling the C6-sleep-state did it:

zenstates.py --c6-disable

Since last reboot the spectre/meltdown disaster happened. DKMS didn’t work any more, because archlinux updated gcc to 7.3 with retpoline support, so it blatantly refused to compile the nvidia module with a different compiler than the kernel was compiled with. That wasn’t really a problem, because X still restarted properly.

But there were other problems like systemd asking for passwords when it shouldn’t, dbus out of date and so on. Well, that’s what you get when running a rolling distribution. So I thought it was time to schedule a kernel re-compile and a reboot.

The re-compile was harder than expected. To put it short:

  • When following the official documentation, do the checkout in an empty directory
  • edit prepare() to do make oldconfig and make menuconfig in this order
  • Don’t forget to uncomment and change pkgbase to linux-ryzen!
  • Don’t makpkg -s on an encrypted volume 🙂
  • If DKMS complains about a compiler mismatch on pacman -U, do IGNORE_CC_MISMATCH=1 pacman -U …

After a successful reboot I decided to install the fallow 16 GB of ram I initially purchased, since RAM timings weren’t really the problem. Now I have a workstation with whopping 32GB RAM:

# free -m 
       total        used        free...
Mem:   32167        5521        8478...
Swap:  16382           0       16382

I kept the RCU_* setting, so let’s see how it turns out. Keeping fingers crossed!

The whole SheBang!