Compiling a custom kernel will not ensure a faster computer but it’s fun and you may end up with a smaller kernel package. Sooner or later it will give you headaches.

Enabling AMDGPU for my desktop’s Sea Islands Card

At the time of writing the lastest version of the kernel is 4.7-rc3. I decided I would compile 4.6.2 since it wasn’t in the testing repository yet.

I use yay as an AUR package manager but it should be similar for almost all package managers.

1
yay -S linux-mainline

Uncomment make xconfig (requires qt4) and make sure your MAKEFLAGS are set to -j$(nproc) or compiling will take a very long time (check /etc/makepkg.conf). After the patches are applied xconfig will open.

Check Enable amdgpu support for CIK parts and go through the options unticking hardware you know you don’t have/use. Then just save and file->exit the program (an exit code different than EXIT_SUCCESS crashes the build process). The kernel will be compliled along with the its headers and docs.

Post install, it may be necessary to edit the bootloader’s entries to include vmlinux-mainline and initramfs-mainline.
Once the new kernel is set up, it’s time configure the new graphics driver. Arch Wiki’s page on AMDGPU contains all of the information necessary.

After reboot lsmod and lspci -v will show amdgpu loaded.

Debloating “laptop gone server”’s kernel

This config produced a 40Mb kernel which is about half of the size of the regular kernel packaged in the core repository.
Unfortunately I disabled a lot of ethernet options including the driver that allows docker to create a bridge connection. So, although the system was able to run nginx natively, its docker containers were not so lucky.

Removed:

  • All sound drivers
  • The horrible pcspkr module
  • Intel CPU support
  • AMDGPU and radeon support
  • Deadline scheduler
  • Most ethernet drivers
  • Industrial IO drivers
  • Touchpad and most HID device support

Resulting in this config file.