22.02.2016 15:46, Carlos E. R. пишет:
On 2016-02-22 09:00, Hans de Faber wrote:
Op 21-02-16 20:02, Carlos E. R. schreef:
On 2016-02-20 06:43, Andrei Borzenkov wrote:
Well, it would be useful to check that search was successful and if not, just echo this to inform user, instead of attempting to boot that will likely hang anyway. Like
if search ... ; then chainloader else echo Could not find this OS instance, will not boot sleep 10 fi I like this. I will use this method.
Well, this syntax is causing me problems.
First, prior to getting the menu printed on the screen, I get a few lines about something not found (I'm writing from yesterday memories), and finally, the message "Could not find this OS instance", a delay, then it prints the menu.
On some of the menu entries that I know should fail (I intentionally wrote the wrong uuid, for testing), I get the message, then the wait, and then a prompt to press any key. Thus the delay is not needed, I think.
I also notice that it searches the floppy drive (yes, I do have a floppy drive in this machine), despite having "--no-floppy". This causes long delays.
--no-floppy skips devices with name fd0, fd1, etc. What devices are listed in GRUB CLI (command ls)
I just noticed an error on the "custom.cfg" file, as I was going to post the file:
menuentry '2:1 - Main (uuid)' { insmod part_msdos insmod ext2 set root='hd2,msdos2' if search search --no-floppy --fs-uuid --set=root 5135ab82-1374-4c30-b9d0-4b56d6d6d6c6 ; then
Why second "search"? Syntax is compatible with UNIX shell, "if" is followed by command; second "search" here is interpreted by command "search" and results in error.