How to add custom kernel options in v4.1?

Hi All

tl:dr I would like to know how to replicate the following modification using the new unified EFI boot scheme of ver 4.1. ( With Qubes v4.0.4 I manaually added “i915.enable_psr=0” to the kernel parameter line of xen.cfg and it fixed my problem). I can’t figure out how to achieve the same with ver4.1 boot process.

More Details:
I have been using Qubes v4.0.4 on a Dell 7490 without any problems since overcoming a screen freezing issue mid 2021 (full details and solution here). My solution with v4.0.4 was to manually edit xen.cfg from a linux live USB to add the following parameter the kernel options “i915.enable_psr=0”. I only needed to do it once per dom0 kernel update and it ran fine.

After doing a clean install of ver4.1, my PC locking up problem is back which is not surprising if the xen configuration doesn’t use the option described above. So I just need to add it again, but the boot process has changed to a unified EFI structure as described by icequbes1 at the end of this thread here.

I believe the right way to do this is to invoke the simple editor “e” option and make edits during the new v4.1 Qubes boot process, but it is not obvious to me at what level of the heirarchy I should traverse before pressing “e”,… and when editing, what syntax is added and where, in order to influence the kernel options.

Using a linuxlive usb to explore the qubes v4.1 installation, I took a look at the autogenerated /EFI/qubes/grub.cfg file, and can see references to customization by editing the /etc/grub.d/40_custom file. I believe this file is in the Luks encrypted partition accessible after booting into Qubes, however I don’t get 20 seconds in that enviornment before the PC freezes and I have to reboot.

Any guidance/thoughts on the syntax and where/how to edit the start up process to add my custom kernel option?

… or where I might find some online docs that might be able to help?

Thanks for any answers/pointers.

While I’m not sure why you didn’t just edit grub to add that parameter to kernel and then recreated it, it should be similar with UEFI too.

Anyway, you should note that enabling this parameter produces warning that can be found in journalctl

dom0:kernel: Setting dangerous option enable_psr - tainting kernel

for which Linus Torvalds thinks it’s bogus, as it looks like

P.S. Since I’m interested in it myself, may I ask for what purpose you use this parameter?

1 Like

Hi enmus Thanks for the reply.

With v4.0.4 I could see a line in the xen.cfg file that was specific to the kernel and containing other parameters. So making edits there was simply a case of adding the “i915.enable_psr=0” to the existing parameter line and it worked. It was kind of intuitive.

With this new set up in V4.1,…why I didn’t edit the config directly was because the grub.cfg file starts off by saying don’t edit this file as it is autogenerated. …I have had past experience of a NAS boot configuration process where the config file was created afresh every boot process thus making direct modifications redundant unless you found and edited the source files read by the startup script. i guess it is different for this config. Thanks for nudging me in right direction.

Also, it is not intuitive for me on where to add the parameter within the grub.cfg file. At the bottom of the file is a section that talks about customizing the menu options and not kernel params. Not quite sure if/how it should be added. Any pointers appreciated. Thanks

To answer your closing question I use the parameter to stop the laptop freezing and forcing a power cycle. there is something with the i915 + Dell + qubes that causes random freezes. On the 7490 none of the BIOS power controls have an impact, only the above kernel parameter change. On the Dell 6420 I had a similar experience but could mitigate with BIOS changes without the above kernel parameter change

You have to edit the file /etc/default/grub, you should be editing GRUB_CMDLINE_LINUX line. After editing:
Rebuild grub config sudo grub2-mkconfig -o /boot/grub2/grub.cfg then
Rebuild initrd sudo dracut -f

/etc/default/grub
GRUB_CMDLINE_LINUX=“…quiet i915.enable_psr=0”

then, as @bungali pointed out you can rebuild

Thanks enmus and bungali. That worked.

Am now up and running again.

You are welcome. You may consider to mark @bungali’s post as solution so it could help other users too.

Sorry if bumping such an old thread is rude, I just want to leave this here to help anyone else who had my problem.
I found this post while trying to apply kernel options on my UEFI install, and it did not work when copying the instructions here verbatim because UEFI installs use a different grub.cfg.
I posted my solution for UEFI custom kernel options here.
Basically you do the same process that was outlined here, but you output the config file to /boot/efi/EFI/qubes/grub.cfg instead.

2 Likes

Thank you!