In the previous lesson, you have learned how to change GRUB2 boot parameters while your
system is booting.
But if there is an option that you want to get permanently in there, you can change the
configuration file.
To change boot options, you edit the file etc.default.grub.
In RHEL 9.2, the GRUB2 configuration file has the line GRUB2 enable BLS-CFG.
This BLS-CFG means that the effective configuration is obtained from configuration files in the
boot-slash-loader directory.
And you should edit the configuration file for your kernel version.
And next, write the changes to slash-boot-slash-grub2-slash-grub.cfg.
And in order to do so, you can use GRUB2-mkconfig-o-slash-boot-slash-grub2-slash-grub.cfg.
Let me show you.
So let me show you etc.default.grub, which is the main input file.
And in etc.default.grub, you can see this enable BLS-CFG is true.
Now this option means that if you make changes here, the changes will be ignored.
Now if you don't want to remember what to do for this BLS-CFG, there's also another
trick.
And the other trick is just to remove the line GRUB enable BLS-CFG.
And then you are free to make your changes here.
Like the GRUB CMD line Linux, feel free to remove RHDB and QUITE to the end of the line.
But if that is not what you want to do, then go to slash-boot-slash-loader.
And in there, you will find entries.
And in these entries, you will find an entry for your current kernel.
So this is the one.
So I need to add it, d87-6 etc.
And there we can see all these options again.
And here in these options, I can remove this RHDB and QUITE.
So here I'm going to remove RHDB and QUITE.
And then I save my changes.
Now you might wonder what is the benefit of this approach.
Well, the benefit of this approach is that you can easily make changes that are specific
for one kernel version only and not for all kernel versions.
Now, once you are done, you use grub2-mkconfig-o slash-boot-slash-grub2-slash-grub.cfg.
Because slash-boot-slash-grub2-slash-grub.cfg is the main configuration file,
but that's a managed configuration file.
It can be automatically updated while you update your system.
So you should never manually edit it.
Always write your changes from the etc default grub and related files
to this main configuration file using grub2-mkconfig.
So now we want to see if it works.
And how are we going to do that?
Well, there is one option only, and that is to reboot.
So now the system is coming up again.
I don't need to see grub.
What I need to see is this.
This is proof that the RHDB and QUITE have successfully
been removed from my default kernel.