function scan_disk { # Scan the disk and create a menuentry to boot it if it contains a linux # install disk=$1 if [ -e $disk/etc/lsb-release ]; then probe -s uuid -u $disk source $disk/etc/lsb-release menuentry "$DISTRIB_ID $DISTRIB_RELEASE $disk" $disk $uuid { set root=$2 linux /vmlinuz root=UUID=$3 initrd /initrd.img } fi } # Load modules insmod all_video insmod gfxterm insmod png insmod regexp insmod part_gpt insmod part_msdos # Set up display set gfxmode=auto terminal_output gfxterm background_image /boot/grub/splash.png loadfont /boot/grub/unicode.pf2 # Scan all disks except for current root for disk in (*) do if [ "$disk" != "(${root})" ]; then scan_disk $disk fi done # Create menuentry for installer probe -s uuid -u ${root} menuentry "Boot Installer" $uuid { linux /vmlinuz root=UUID=$2 initrd /initrd.img } set default=0 set timeout=50