Closed joeg1484 closed 5 years ago
Also, is that the proper way to modify the grub.conf file? Should we rather modify the /etc/default/grub and then running grub2-mkconfig -o $grub_cfg ?
This is not necessary to run a grub mkconfig for that kind of minor change. I know that debian or ubuntu are usually updating the grub conf when a change is made, even a minor.
By the other hand, if your are running on EFI make config again could be required.
Here you can change /boot/grub2/grub.cfg
path in sed command by $grub_cfg
, I obviuously forgot to change at last fix.
Thinking it's needed also to detect if EFI is active or not and then run mkconfig. I need to figure out how to do that (I've no EFI on any machine).
I send the fix today, tell me if it's enough or if grub2-mkconfig is finally required.
So I was looking at the code after running the command and getting this error:
nvidia-prime-select query sed: can't read /boot/grub2/grub.cfg: No such file or directory
(Im using EFI) at on line 89 and 91 it looks like the script isnt using the previous grub_cfg var:if [ $modeset_check -gt 0 ]; then sed -Eni -e "s|(linux.*$boot_key.*ro) (nvidia-drm.modeset=[0-9])(.*)$|\1 $modset\3|g;p" /boot/grub2/grub.cfg else sed -Eni -e "s|(linux.*$boot_key.*ro)(.*)$|\1 $modset \2|g;p" /boot/grub2/grub.cfg fi
Should the path at the end be $grub_cfg ?