Grub-customizer fails to save

Not too sure why however when I want to modify all my boot options then it seems to fail to save it:

And I can’t even run update-grub anymore as I am getting issues:

Generating grub configuration file ...
Found background: /usr/share/endeavouros/splash.png
Found linux image: /boot/vmlinuz-linux-xanmod
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-xanmod.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img
Found linux image: /boot/vmlinuz-linux-xanmod
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-xanmod.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
Adding boot menu entry for UEFI Firmware Settings ...
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 213
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a 

What does line 213 say in /boot/grub/grub.cfg?

Grub-customizer is notoriously problematic and known for breaking Grub configs; it is best to avoid using it if you can.

1 Like

That’s weird it only goes up to line 205.

Yeah maybe I should, never had issues in the past don’t know why they have screwed something up now!

Ah gotcha, perhaps it is line 213 of the file it is trying to make.

The image you posted references “/boot/grub/grub.cfg.new”–do you have that file?

It doesn’t exist after running:

ls -l /boot/grub/grub.cfs.new
ls: cannot access '/boot/grub/grub.cfs.new': No such file or directory

Sorry, I typo’d that one–it should be .cfg (not .cfs).

1 Like

image

I assume this ^M is what is causing this issue?

Is there like a backup original file of this by any chance?

I think those are carriage returns–I would suppose those would not be in the final version of the file.

The actual error might be caused by the end of the “if” statement, with nothing written for the “then” of it. I’m not sure about that, just it doesn’t look right (it seems like something is supposed to be on that empty line).

This person ran into the same issue, on the same line: Sudo grub-mkconfig -o /boot/grub/grub.cfg does not work They were also using Grub-customizer. It was line 277 in their case, but I checked and it’s the same fi that’s throwing the error.

if [ "$grub_platform" = "efi" ]; then
	fwsetup --is-supported
	if [ "$?" = 0 ]; then

	fi
fi

I think the best thing to do would be to file a bug report as they mentioned in the note you posted.

As for getting Grub straightened out, try removing Grub-customizer for now and see if you can at least get through an update-grub so you have a good config file to boot off of.

I didn’t realise you needed something inside an if statement.

Ok I will do this thanks :slight_smile:

That actually seemed to have solved my issue. But how does removing grub-customizer fix it though? I mean I thought it writes to some file or something and me removing it also removes the file?

Maybe you don’t, I’m not sure; I was only trying to come up with a theory why it is failing on that line, which is only a fi.

Grub is meant to honor files stored in /etc/grub.d/. Grub-customizer works by adding in some configs into that directory to achieve whatever it is you are trying to do. That file it is crashing on (/etc/grub.d/49_uefi-firmware_proxy), I don’t even have that file on my system.

It seems that when you uninstall it, thankfully it takes down the extra configs it has set up.

1 Like

I would suggest you to restore your Grub environment to some pre-grub-customizer state first.

Then if you want to use Grub Customizer, that’s your choice.

You could make a comparison of the content of /etc/grub.d pre and post Grub Customizer to see what changes it does to the file and folders in there.

Noteworthy is the fact that it does (or it should) make a backup of the /etc/grub.d in some folder before applying the changes.

You could do the following to restore your Grub:

sudo mv /etc/grub.d /etc/grub.d.gc
sudo pacman -S grub
sudo grub-mkconfig -o /boot/grub/grub.cfg
2 Likes

@unix_lover

Any progress on this issue?

Moral of the story …
Don’t use grub customizer! :laughing:

3 Likes

It’s like saying to someone who has cut himself with a knife: Don’t use a knife!

Most of the issues I have seen with Grub Customizer are user-related.

They tend to uninstall the program without restoring /etc/grub.d to the the state prior to using the software not being aware of the changes that have been made to the grub files.

That folder gets actually backed up by Grub Customizer itself :wink:

1 Like

I’ve never liked grub customizer much but to each their own. Have fun! :wink:

I am not saying that I like it or use it. It is not a question of like or dislike.

I am just saying that this piece of software seems to have got a bad reputation mostly because those who use it don’t know or don’t care to know how it works and how it modifies the Grub environment.

When they are left with a broken Grub after they have used and uninstalled the program they tend to blame the tool. It’s easier that way :wink:

2 Likes

I know when my Windows doesn’t boot it’s broken. :rofl:

Moral of the story …
Don’t use Windows!
:sweat_smile:

Or don’t break them!