Comment 38 for bug 1097570

Revision history for this message
Bin Li (binli) wrote :

Now in Lenovo's laptop, we still meet this issue on trusty(14.04.2).

 I delete the grub.cfg in recovery partition, after that it will enter grub shell.
 from the result, I thought the $prefix is zero or not exist.

grub> cat (memdisk)/grub.cfg

if [ -z "$prefix" -o ! -e "$prefix" ]; then
        if ! search --file --set=root /.disk/info; then
                search --file --set=root /.disk/mini-info
        fi
        set prefix=($root)/boot/grub
fi
if [ -e $prefix/$platform/grub.cfg ]; then
        source $prefix/$platform/grub.cfg
else
        source $prefix/grub.cfg
fi

The file debian/build-efi-images of package grub2-2.02.

Grub executed the "search --file --set=root /.disk/info" first, try to find out the "root". Because .disk/info was exist on USB stick and HDD0 Partition2, so the result included 2 results. But the USB stick was the first. So the grub.cfg on USB stick was loaded and the system was booted from USB stick.