grub.cfg is generated automatically from the content of the /etc/default/grub file and the /etc/grub.d directory. You should modify or add to those files to configure GRUB 2. After making changes, you must explicitly rebuild the grub.cfg file by typing the update-grub command. https://geek-university.com/linux/grub-version-2/