Page 1 of 1
Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement
Posted: Fri Jan 25, 2019 7:17 pm
by beardedgeek72
See title.
I multiboot MX 18, Manjaro and Windows, and unfortunately the GRUB menu gets... created randomly, it seems.
When rearranging entries to my liking in the /etc/grub.d/ folder I came across a bug that makes the memtest entries generate an empty "if" statement which of course causes an error and the grub.cfg to never update.
DuckDucking (

) I found one entry on Ubuntu's forums about this. The workaround was easy, go into the /etc/grub.d/memtest file and add a pointless ":" in the if statement so it never turns out "empty". Then it worked.
Again, not sure if this is a bug you are interested in, or if it should be reported to Debian?
Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement
Posted: Fri Jan 25, 2019 8:32 pm
by Stevo
If MX is controlling the GRUB entries and not Manjaro, you could install grub-customizer and see if the same bug occurs when using it to reorder the entries.
Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement
Posted: Sat Jan 26, 2019 8:51 am
by fehlix
beardedgeek72 wrote: Fri Jan 25, 2019 7:17 pm
I multiboot MX 18, Manjaro and Windows, and unfortunately the GRUB menu gets... created randomly, it seems.
When rearranging entries to my liking in the /etc/grub.d/ folder I came across a bug that makes the memtest entries generate an empty "if" statement which of course causes an error and the grub.cfg to never update.
Would you mind sharing with us your findings. It might well be a bug, but note
those scripts are fairly complex, as it reuquires a lot of bash tricks to understand
and also a fair amount of how grub is working.
What I suggest, would be:
show the current list of files within /etc/grub.d with this command:
And do also indicate or post the changes you made.
Might be also worth to post the generated grub.cfg within /boot/grub
Regardig this "GRUB menu gets... created randomly" we might also sort this out later.
Please note: Do put any text-listings or scripts within code brackets like this one: [
code] put text here [/code]
Thanks

Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement
Posted: Sat Jan 26, 2019 9:08 am
by asqwerth
Stevo wrote: Fri Jan 25, 2019 8:32 pm
If MX is controlling the GRUB entries and not Manjaro, you could install grub-customizer and see if the same bug occurs when using it to reorder the entries.
Don't forget though that if you use MX (or other distros apart from Arch) to generate main grub, the initrd line that is generated for Manjaro may not be complete. It should be something like:
Code: Select all
initrd /boot/intel-ucode.img /boot/initramfs-4.19-x86_64.img
with both a ucode bit and the kernel .img bit.
Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement
Posted: Sat Jan 26, 2019 10:05 am
by beardedgeek72
Part of it might be that I tried to reorder a grub that well... Arch doesn't like. I let Manjaro's grub handle the booting anyway since (as happens often, and is not a bug per se) Manjaro suddenly decided to not play along anymore and kernel panicked unless using the fallback option in MX's grub menu.
ANyway, the issue above still stands if you don't multiboot with Manjaro.
I will link you the original article I found on the subject that allowed me to solve it, it explains it better than I do.
I also misremembered, I found this explanation on stackexchange.
https://unix.stackexchange.com/question ... -memtest86
Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement
Posted: Sat Jan 26, 2019 10:27 am
by fehlix
The link referes to "proxifiedScripts", which somehow reminds me on Grub Customizer.
Those proxified scripts are not standard installes, which come with debian GRUB packages.
So I fear the "bug" you mentioned has to do with those proxy script,
either created by Grub Customizer or from somewehre else.
HTH
