On Mon, Jan 18, 2010 at 09:17:41PM +0100, Szymon Janc wrote:
> Attached patch makes sleep -i 0 "interruptible".
> It allows to have 0 sleep yet selectable multiboot config
> i.e.
> 
> if sleep --interruptible 0 ; then                                      
>   set timeout=0                                                        
> fi   

> --- grub_orig/grub2-1.98~experimental.20100111.1/commands/sleep.c     
> 2010-01-11 20:01:15.000000000 +0100
> +++ grub/grub2-1.98~experimental.20100111.1/commands/sleep.c  2010-01-18 
> 20:37:56.107189595 +0100
> @@ -44,19 +44,26 @@
>    grub_printf ("%d    ", n);
>  }
>  
> +static int
> +do_check_key_press (void)
> +{
> +  return (grub_checkkey () >= 0
> +      && GRUB_TERM_ASCII_CHAR (grub_getkey ()) == GRUB_TERM_ESC);
> +}

On the PC architecture, you can't check for Escape without having some
kind of delay.  Only modifier keys can be checked instantaneously.

http://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu/lucid/grub2/lucid/annotate/head%3A/debian/patches/951_sleep_shift.diff
has an alternative patch which may be helpful, and links to previous
discussions.

-- 
Colin Watson                                       [cjwat...@ubuntu.com]


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to