I couldn't find a reliable way to do something like this:

if drive_exists_p (hd1); then
  menuentry_to_chainload_drive (hd1)
fi

Where the missing piece is the pseudo-command "drive_exists_p", which has a 
zero return when the device exists.

The "probe --driver" command sort of does the job, but it prints error messages 
and causes a "Press any key to continue..." prompt when the device doesn't 
exist.

The idea is having automatically (dis)appearing menu entries to chainload 
devices that may be (un)plugged, which is useful in an environment where USB 
thumb drives are frequently used as boot devices.

The test command with -e or -d doesn't work unless the device contains a 
filesystem that GRUB can read.

Am I missing something, or is this something that can't be done without 
extending GRUB?

By the way, is this sort of message appropriate for this mailing list?
I'd hate to be spamming the list with offtopic queries.

-- 
João Ricardo Sares Teles de Matos
[email protected]

Administração de Sistemas da Rede das Novas Licenciaturas
Instituto Superior Técnico

web: https://www.rnl.ist.utl.pt
email: [email protected]
telefone: +351 218 41 77 71


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Help-grub mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-grub

Reply via email to