This is for cross-linking other grub.cfg files into your booted grub.cfg file. This is useful for maintaining/modularizing independent grub.cfg files. There are 2 ways to do it:
prefix environment variableconfigfile command (direct reading)The first method is to use the prefix environment variable. First you search the UUID using search.fs_uuid command. Then you set prefix variable and perform normal command to load.
insmod search_fs_uuidsearch.fs_uuid <UUID> rootset prefix=($root)/boot/grubnormalAnother way is to read the config file directly after setting the prefix variable. Then, we use configfile to read the configuration file directly. This is the more common implementation compared to normal command:
search.fs_label grub rootif [ -e /boot/grub/example/test1.cfg ]; then set prefix=($root)/boot/grub configfile /boot/grub/example/test1.cfgelse if [ -e /boot/grub/example/test2.cfg ]; then set prefix=($root)/boot/grub configfile /boot/grub/example/test2.cfg else echo "Could not find an example configuration file!" fifiThat's all about embedding multiple grub.cfg.