LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices



Reply
 
Search this Thread
Old 07-22-2009, 06:33 PM   #1
maxkukartsev
LQ Newbie
 
Registered: Apr 2009
Distribution: Gentoo, Arch, Slackware
Posts: 22

Rep: Reputation: 16
Grub shell does not work like a shell at all


Hello all,

The problem I'm having is referred to as "broken grub tab completion". Looking for solutions I've come across a lot of complaints about this but no solutions.

I am using Fedora 11, and have experienced this problem on Fedora 10 as well.

I am referring to GRUB launched from an interactive login shell, not in its native environment when it boots up.
  1. I open the GNOME Terminal (bash)
  2. Launch grub
  3. Press [TAB] - A list of commands should display but does not, the cursor simply goes left
  4. Type root (hd0,0)
  5. Press [UP] - GRUB should return me to the previous command "root (hd0,0)" but does not, instead it types "^[[A", apparently the literal interpretation of the [UP] key

So here is the general problem. GRUB is supposed to act like a shell and handle the [TAB] completion and [UP]/[DOWN] keystrokes properly, but does not, and handles them LITERALLY.

On Ubuntu, this is not a problem. GRUB works as expected.


What is going on?


Thanks for your help.

Last edited by maxkukartsev; 07-22-2009 at 06:34 PM.
 
Old 07-22-2009, 06:54 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Here's what GRUB tells me when I start it:
Code:
GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub>
What does Fedora give you?
 
Old 07-22-2009, 06:59 PM   #3
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,084

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336
Here is my grub prompt in new fed11 lxde
as user
and as root
Code:
[bz@Fedora-11 ~]$ grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> quit
quit
[bz@Fedora-11 ~]$ su
Password: 
su: incorrect password
[bz@Fedora-11 ~]$ su
Password: 
[root@Fedora-11 bz]# grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub>
 
Old 07-22-2009, 08:04 PM   #4
maxkukartsev
LQ Newbie
 
Registered: Apr 2009
Distribution: Gentoo, Arch, Slackware
Posts: 22

Original Poster
Rep: Reputation: 16
Thanks for the quick reply.

GRUB on Fedora displays the same text as you posted:

Code:
[liveuser@localhost ~]$ grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> quit
quit
[liveuser@localhost ~]$ su
[root@localhost liveuser]# grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> quit
quit
[root@localhost liveuser]#
I came across a bug report which seems to address the GRUB shell scrolling: https://bugzilla.redhat.com/show_bug.cgi?id=134442

Therefore I did this:
Code:
[root@localhost liveuser]# echo $TERM
xterm
[root@localhost liveuser]# export TERM=gnome
[root@localhost liveuser]# echo $TERM
gnome
[root@localhost liveuser]# grub
With no change in the behavior of the GRUB shell whatsoever.
 
Old 07-23-2009, 10:20 PM   #5
maxkukartsev
LQ Newbie
 
Registered: Apr 2009
Distribution: Gentoo, Arch, Slackware
Posts: 22

Original Poster
Rep: Reputation: 16
Anyone else having this problem?

So for everyone else who installed x86 Fedora 11 (GNOME version), the GRUB shell works like it should? It interprets the TAB character correctly?
 
Old 07-24-2009, 06:57 PM   #6
maxkukartsev
LQ Newbie
 
Registered: Apr 2009
Distribution: Gentoo, Arch, Slackware
Posts: 22

Original Poster
Rep: Reputation: 16
Talking Problem solved

The problem was apparently lack of the NCurses library.

I decided to rebuild GRUB-0.97, so I downloaded grub-0.97.tar.gz from ftp://alpha.gnu.org/gnu/grub/, and while executing the ./configure script I had the messages:

Code:
checking for wgetch in -lncurses... no
checking ncurses/curses.h usability... no
checking ncurses/curses.h presence... no
checking for ncurses/curses.h... no
checking ncurses.h usability... no
checking ncurses.h presence... no
checking for ncurses.h... no
checking curses.h usability... no
checking curses.h presence... no
checking for curses.h... no
But this did not give me errors. The ./configure script must've left the ncurses library out of the build process. When compiled I launched GRUB, I experienced the same broken shell behavior.

I installed package ncurses-devel and ran ./configure again, and it found the ncurses header files. After compiling and running GRUB, it worked like it is supposed to!

So, I think that on Fedora 11 32-bit, the installed GRUB-0.97 was compiled without ncurses
 
Old 07-26-2009, 06:55 AM   #7
Escher
LQ Newbie
 
Registered: Jul 2009
Posts: 5

Rep: Reputation: 1
thanks maxkukartsev, that enables tab completion in a grub shell for me too, I wonder why they disable it in the default build?

Strangely, it works fine if you run a grub command prompt at boot time.

Otherwise I would have suggested that they needed to reduce the size of the grub binary due to the static linking requirement (grub must be linked against glibc-static since no dynamic libs are available at boot time)

Perhaps there should be a separate grub-shell command, which is dynamically linked against all the libs.
 
Old 07-27-2009, 01:39 AM   #8
maxkukartsev
LQ Newbie
 
Registered: Apr 2009
Distribution: Gentoo, Arch, Slackware
Posts: 22

Original Poster
Rep: Reputation: 16
Hi Escher,

Glad to hear this helped you out.

Quote:
Originally Posted by Escher View Post
Strangely, it works fine if you run a grub command prompt at boot time.
Yeah, so basically this means that native GRUB and Linux GRUB are independent from each other. I think that because the native GRUB doesn't have the benefits of Linux' shell framework, it implements I/O a little differently, and may be the cause of the different behaviors.

Quote:
Originally Posted by Escher View Post
Perhaps there should be a separate grub-shell command, which is dynamically linked against all the libs.
Maybe the developers chose to have only a static Linux GRUB program because they wanted to keep it similar to the native GRUB program?

Quote:
Originally Posted by Escher View Post
I wonder why they disable it in the default build?
Yeah, I'm dumbfounded at why NCurses was not statically linked into Fedora 11/10 from the start, as it is on other distributions such as Ubuntu.

Best regards,
Max Kukartsev
 
  


Reply

Tags
completion, grub, shell, tab


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run root privileged Linux command as normal user via shell shell tcegrid Linux - Newbie 1 06-23-2008 04:38 PM
LXer: Shell tip: Set the shell prompt and themes in Linux Terminal LXer Syndicated Linux News 0 06-12-2007 04:02 AM
how to edit grub.conf from grub shell during booting pashaikh Linux - Security 1 06-27-2006 06:01 AM
I made a shortcut to a shell script and it is using default shell icon... shlinux Linux - Software 2 04-20-2006 07:29 AM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 10:20 AM


All times are GMT -5. The time now is 02:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration