bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #18826] Patch to accept number keys (0-9) at boot menu


From: Reed Hedges
Subject: [bug #18826] Patch to accept number keys (0-9) at boot menu
Date: Thu, 18 Jan 2007 22:29:18 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-1)

URL:
  <http://savannah.gnu.org/bugs/?18826>

                 Summary: Patch to accept number keys (0-9) at boot menu
                 Project: GNU GRUB
            Submitted by: fool
            Submitted on: Thursday 01/18/2007 at 22:29
                Category: User Interface
                Severity: Major
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Reed Hedges
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: CVS ("Legacy" grub)
         Reproducibility: None
         Planned Release: 

    _______________________________________________________

Details:


This change adds a check at the menu for number keys (0-9), and selects and
continues using the corresponding entry if pressed. 

I made this change so I could operate the grub menu with a hacked up
specialized keyboard that only has a few keys.  I thought it might also be
useful to others making other special purpose systems such as kiosks or
"embedded" systems; or just as a shortcut that saves a keystroke.


~/grub$ cvs diff -u
cvs diff: Diffing .
Index: ChangeLog
===================================================================
RCS file: /sources/grub/grub/ChangeLog,v
retrieving revision 1.641
diff -u -r1.641 ChangeLog
--- ChangeLog   10 Sep 2006 07:26:09 -0000      1.641
+++ ChangeLog   18 Jan 2007 22:19:49 -0000
@@ -1,3 +1,9 @@
+2007-01-18  Reed Hedges  <address@hidden>
+       * stage2/stage2.c: At the menu, accept number keys (0-9) to select
and boot
+       corresponding entries.
+       * docs/grub.texi: Mention new menu keys in manual.
+
+
 2006-09-10  Pavel Roskin  <address@hidden>

        * netboot/natsemi.c: Fix compile error with gcc 4.1.1.  Cast
cvs diff: Diffing debian
cvs diff: Diffing docs
Index: docs/grub.texi
===================================================================
RCS file: /sources/grub/grub/docs/grub.texi,v
retrieving revision 1.85
diff -u -r1.85 grub.texi
--- docs/grub.texi      24 Jun 2006 14:40:02 -0000      1.85
+++ docs/grub.texi      18 Jan 2007 22:19:50 -0000
@@ -1996,7 +1996,8 @@

 Basically, the menu interface provides a list of @dfn{boot entries} to
 the user to choose from. Use the arrow keys to select the entry of
-choice, then press @key{RET} to run it.  An optional timeout is
+choice, then press @key{RET} to run it.  You can also use the numbers
address@hidden through @key{9} to select and run an entry. An optional timeout 
is
 available to boot the default entry (the first one if not set), which is
 aborted by pressing any key.

cvs diff: Diffing e2fs_stage1_5
cvs diff: Diffing fat_stage1_5
cvs diff: Diffing ffs_stage1_5
cvs diff: Diffing grub
cvs diff: Diffing lib
cvs diff: Diffing netboot
cvs diff: Diffing shared_src
cvs diff: Diffing stage1
cvs diff: Diffing stage2
Index: stage2/stage2.c
===================================================================
RCS file: /sources/grub/grub/stage2/stage2.c,v
retrieving revision 1.47
diff -u -r1.47 stage2.c
--- stage2/stage2.c     5 May 2006 22:06:31 -0000       1.47
+++ stage2/stage2.c     18 Jan 2007 22:19:51 -0000
@@ -478,6 +478,24 @@
                }
              print_entries (3, 12, first_entry, entryno, menu_entries);
            }
+    else if(c >= '0' && c <= '9')
+    {
+      c -= '0';  /* now c contains the decimal value of the number instead
of ASCII */
+      if(c < num_entries)
+      {
+        if(current_term->flags & TERM_DUMB)
+        {
+          entryno = c;
+        }
+        else
+        {
+          print_entry(4+entryno, 0, get_entry(menu_entries,
first_entry+entryno, 0));
+          entryno = c;
+          print_entry(4+entryno, 1, get_entry(menu_entries,
first_entry+entryno, 0));
+        }
+        break;   /* Leave menu */
+      }
+    }

          if (config_entries)
            {
cvs diff: Diffing stage2_debug
cvs diff: Diffing util





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?18826>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]