I know that GRUB kernel boot parameters, for example panic=-1
can be added by sudo nano /etc/default/grub
and then sudo update-grub
.
My application comes with a setup.sh
shell script that sets everything up for the user, as I want it to be able to be used by the non-technically minded user. Anyway, a driver called intel_pstate
makes my app not work, so on devices where intel_pstate
is detected, I want the setup.sh
file to add intel_pstate=disable
to the kernel boot parameters/boot line.
I really don't want to have to tell users to edit the boot parameters themselves, and am looking for a way to, in shell script code, add intel_pstate=disable
to the boot parameters while maintaining the existing boot parameters.
What I've already tried
- Use this code (in a sudo bash shell):
cat /etc/default/grub > grub_bkp
echo "intel_pstate=disable" >> grub_bkp
echo gurb_bkp > /etc/default/grub
- This doesn't work, take the following /etc/default/grub file for example:
GRUB_OTHER_STUFF=1
...
GRUB_CMDLINE_LINUX_DEFAULT='panic=-1 init=/my/cool/file.sh'
- After my script is done with it, it will look like the following, not successfully applying the kernel boot parameter:
GRUB_OTHER_STUFF=1
...
GRUB_CMDLINE_LINUX_DEFAULT='panic=-1 init=/my/cool/file.sh'
intel_pstate=disable
Thank you so much for your help! :)
GRUB_CMDLINE_LINUX_DEFAULT='
with this:GRUB_CMDLINE_LINUX_DEFAULT='intel_pstate=disable
it should work as intended. Look intosed
.sed
was a thing before. Do you want to write this up as an answer so you can get reputation from upvote and accept?/etc/default/grub
that explains the purpose of disabling pstate so anyone editing that file understands why that parameter is there and what the consequences of removing it are.