Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement

Report Bugs, Issues and non- package Requests
Message
Author
beardedgeek72
Posts: 12
Joined: Sun Dec 23, 2018 3:54 am

Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement

#1 Post 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?

User avatar
Stevo
Developer
Posts: 14632
Joined: Fri Dec 15, 2006 7:07 pm

Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement

#2 Post 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.

User avatar
fehlix
Developer
Posts: 12734
Joined: Wed Apr 11, 2018 5:09 pm

Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement

#3 Post 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:

Code: Select all

ls -l /etc/grub.d
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
:puppy:

User avatar
asqwerth
Developer
Posts: 7962
Joined: Sun May 27, 2007 5:37 am

Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement

#4 Post 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.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

beardedgeek72
Posts: 12
Joined: Sun Dec 23, 2018 3:54 am

Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement

#5 Post 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

User avatar
fehlix
Developer
Posts: 12734
Joined: Wed Apr 11, 2018 5:09 pm

Re: Not sure if this is a bug for MX or Debian. Re-ordering Grub menu causes syntax error due to empty if statement

#6 Post by fehlix »

beardedgeek72 wrote: Sat Jan 26, 2019 10:05 am 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.
https://unix.stackexchange.com/question ... -memtest86
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
:puppy:

Post Reply

Return to “Bugs and Non-Package Requests Forum”