Zum Inhalt springen

Editing Linux kernel parameters with kernelstub

I recently played the gamble of getting a very new processor for my new work laptop, the AMD Ryzen AI 9 HX 370. Even the drivers for Windows seem problematic so I expected there could be some minor hiccups for Linux as well. Luckily the only issue I encountered was one related to the GPU rendering that could be fixed temporarily by updating a kernel parameter. I’m mainly writing this to have a future reference for this kind of change and document some of the things I found out along the way.

Why kernelstub is the safer choice

The simplest way I found to update kernel parameters is by using kernelstub. I remember doing this some years ago without it and I remember the process being a lot more unclear and prone to error, and especially when it comes to this kind of sensitive things I prefer to be on the safe side.

Unlike manually editing boot configurations or directly modifying EFI entries, kernelstub provides a more reliable interface that handles the complexities of modern UEFI boot systems. It automatically updates the correct boot entries and maintains consistency across different boot scenarios.

Basic kernelstub commands

Before making any changes, it’s always good practice to use the --dry-run parameter to see what kernelstub would do without actually applying the changes:

sudo kernelstub -a "parameter_name=value" --dry-run

To add a kernel parameter you can use:

sudo kernelstub -a "parameter_name=value"

For example, to add the AMD GPU debug mask parameter that fixed my rendering issues:

sudo kernelstub -a "amdgpu.dcdebugmask=0x12"

You can verify changes by checking the current configuration:

sudo kernelstub -p

Alternatively, you can directly check the boot configuration file:

sudo cat /boot/efi/loader/entries/Pop_OS-current.conf

To remove a kernel parameter use:

sudo kernelstub -d "parameter_name=value"

After making changes, reboot and test that your system behaves as expected.

Tested using

  • Pop!_OS 22.04 LTS
  • Kernel version: 6.12.10
  • AMD Ryzen™ AI 9 HX 370 processor
  • kernelstub version: 3.1.4

Links

If this guide becomes outdated or if you have any issues with any of the steps, feel free to reach out.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert