On Wed, Jul 25, 2018 at 12:54:39PM -0400, Giles Orr via talk wrote: > There's probably a GRUB-specific mailing list or forum, but I thought I > would try here first ... > > GRUB has a DSL ( https://en.wikipedia.org/wiki/Domain-specific_language ) > that looks a lot like shell scripting. Most people never see it as it's > used to generate the menus we use at boot-time and they see only the menus, > but it can do some interesting things - particularly when you're dealing > with multi-boot USB sticks. Here's a simple but slightly useful example: > > function cpuinfo { > # only able to determine: 32/64 bit, and is it PAE > echo "GRUB's ability to analyse processors is limited, we can only tell > you:" > if cpuid -p; then > pae_assessment="PAE" > else > pae_assessment="NO PAE" > fi > if cpuid -l; then > echo "64-bit processor, $pae_assessment" > else > echo "32-bit processor, $pae_assessment" > fi > } > > But it has some nasty limitations that are frustrating me: > - no pipes > - no command substitution > - no file globbing
Actually it does file globbing if you load the regexp module. Apparently this works: insmod regexp for i in /boot/*; do echo $i; done Or: grub> ls /boot/* error: file `/boot/*' not found. grub> insmod regexp grub> ls /boot/* unicode.pf2 i386-pc/ locale/ fonts/ grubenv grub.cfg config-4.16.0-2-amd64 ... -- Len Sorensen --- Talk Mailing List [email protected] https://gtalug.org/mailman/listinfo/talk
