I have a bootable usb flash drive with grub2 handling booting of ISOs (mostly different spins of Ubuntu). I am editing the menu.cfg myself and have my own script to update grub because I don't want to waste time using external tools.
I would like to hide 64-bit ISOs on a 32-bit system, so that I can't make the mistake of trying to boot an incompatible ISO.
Is it possible for grub2 to detect whether the processor is x64 or i386 and display a different menu (or preferably enable/disable some menu options) accordingly?
Edit: I'm aware of the grub2 CLI command
cpuid -l, to check for long mode, but I'm not sure if or how that can be used in menu.cfg.