grub2 complains "error: unknown command `terminal'" if terminal_output gfxterm is false

Bug #519358 reported by Colin Ian King
58
This bug affects 10 people
Affects Status Importance Assigned to Milestone
grub
Unknown
Unknown
grub (Ubuntu)
Invalid
Undecided
Unassigned
grub2 (Ubuntu)
Fix Released
Medium
Unassigned
terminal (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: grub-efi-amd64

grub2 on an EFI firmware based machine reports the error message: "error: uknown command `terminal'".

I believe this occurs because "terminal_output gfxterm" fails to initialise (because we cannot probe or set the graphics mode) and then grub2 falls back to trying to be backwardly compatible with terminal.mod that does not support terminal_output by executing the non-existent command "terminal gfxterm".

The offending code is:

   if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi

A possible workaround that stops the error message is:

  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    if terminal gfxterm ; then
      true
    fi
  fi

This seems to fix the problem on an EFI firmware based PC. I hope this does not break the backward compatibility terminal.mod workaround too.

Related branches

tags: added: grub2
tags: added: amd64
Colin Watson (cjwatson)
Changed in terminal (Ubuntu):
status: New → Invalid
Changed in grub (Ubuntu):
status: New → Invalid
Colin Watson (cjwatson)
tags: removed: amd64 grub2
Changed in grub2 (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
TJ (tj) wrote :

This is also occurring on a Sony Vaio PCG-SRX51 (and SRX41) that have regular PC BIOS and intel i815 video chipset. There is no kernel mode-setting with the chipset.

Revision history for this message
Peter Hurley (phurley) wrote :

This bug is more general than the submitter believes. Using grub-pc 1.98-1ubuntu1 on Karmic x86_64, prior to graphics mode change and the display of the boot menu, grub outputs 2 error lines:
  error: unknown command 'terminal'

The indicated workaround does not resolve the issue. I believe this is *not* because the command is being executed, but because a scan/parse of the config file identifies unknown commands. Although the offending statements are in the default /etc/grub.d/00_header file, upstream should fix this in source.

An appropriate upstream fix would be to implement the terminal command as an error echo to use terminal_{input,output} instead.

Changed in grub2 (Ubuntu):
status: Triaged → New
Revision history for this message
Peter Hurley (phurley) wrote :

Sorry, my mistake. Please disregard the above post. It turns out that I had
   GRUB_TERMINAL=gfxterm
in '/etc/default/grub' rather than
   GRUB_TERMINAL_OUTPUT=gfxterm

Steve Langasek (vorlon)
Changed in grub2 (Ubuntu):
status: New → Triaged
Revision history for this message
Michael.S.G (ozfalcon) wrote :

I receive the following on ubuntu server 10.4 rc boot up.

error: no suitable mode found
error: unknown command "terminal"

Being grub2 related, It may also be of note that I am booting from a 2gb Compact Flash (With CF-->IDE adapter).

Revision history for this message
bobp (custom-basses) wrote :

I'm having the same problem with a fresh 10.04 server installation. Its on a P3 box that has an integrated SiS 620 video chipset on the motherboard.

error: no suitable mode found
error: unknown command 'terminal'

It looks like the kernel isn't supporting the video framebuffer.

Revision history for this message
G-Hattinger (gerhard-hattinger) wrote :

Hi all!
After update to 10.04, my ACER TravelMate 290 stops with black screen during boot.
Before it wents black it shows

error: no suitable mode found
error: unknown command 'terminal'

What can I do as an absolute beginner?

Revision history for this message
Chris Wilson (wilseus) wrote :

G-Hattinger: I have exactly the same problem with my Acer Travelmate 243XC, however I don't believe that the two problems you have are related, i.e. the GRUB errors you are getting are NOT what is stopping your OS working; my machine boots the OS OK with those errors.

What I did to work round the black screen problem (which I assume is a Kernel bug stopping the graphics drivers for our laptops working, but that's just a guess) was to pass the string 'xforcevesa' to the kernel on boot-up. The easiest way to do this is when you first install Ubuntu (from the main menu press F6 and add 'xforcevesa' to the end of the line, then ENTER to boot.)

If the OS is already installed then you need to hold down SHIFT when GRUB loads, then you can press E to edit the default menu option, again by adding 'xforcevesa' in the appropriate place. Then, you should be able to log in where you can configure GRUB permanently to do this. Sadly, after searching extensively online, I still have no idea whatsoever how to do this, which is why I ended up reinstalling. (When you enter new options from the CD menu, it seems to remember them after installation.)

This should at least get you up and running but you'll have no 3D.

Revision history for this message
snoolan (steve-noolan) wrote :

I have encountered the same problem after installing the 10.04 LTS release . (Dell Inspiron 500m Laptop)

I reinstalled a Beta version (31/3/10) of 10.04 and got the 2 error messages BUT the Ubuntu Logo came up, then the system proceeded came up!

I did an update to the 10.04 LTS release and the PC ran perfectly all day, until I rebooted it - then same problem (Ubuntu logo, then nothing).

I reinstalled the Beta today, just so I could get some work done and it seems to be running ok.

What is the difference between the Beta version and the Released version?

Revision history for this message
G-Hattinger (gerhard-hattinger) wrote :

@Chris Wilson: Thanks for your hints. It was possible for me to enter GRUB edit but I think it did'nt took my changes. Anyway, if I boot my system with version -20, (latest Update was -22), I can operate it (there are some other error messages during boot - but finally it works).

I hope that there will be a update that fixes the problem in the future.?

Revision history for this message
KLEIN Stéphane (stephane-harobed) wrote :

After update to 10.04, my ACER TravelMate 290 stops with black screen during boot.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.8 KiB)

This bug was fixed in the package grub2 - 1.98+20100804-4ubuntu1

---------------
grub2 (1.98+20100804-4ubuntu1) maverick; urgency=low

  * Resynchronise with Debian. Remaining changes:
    - Adjust for default Ubuntu boot options ("quiet splash").
    - Default to hiding the menu; holding down Shift at boot will show it.
    - Set a monochromatic theme for Ubuntu.
    - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
      recovery mode, quiet option, tweak how memtest86+ is displayed, and
      use UUIDs where appropriate.
    - Fix backslash-escaping in merge_debconf_into_conf.
    - Remove "GNU/Linux" from default distributor string.
    - Add crashkernel= options if kdump and makedumpfile are available.
    - If other operating systems are installed, then automatically unhide
      the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
      if available to check whether Shift is pressed. If it is, show the
      menu, otherwise boot immediately. If keystatus is not available, then
      fall back to a short delay interruptible with Escape.
    - Allow Shift to interrupt 'sleep --interruptible'.
    - Don't display introductory message about line editing unless we're
      actually offering a shell prompt. Don't clear the screen just before
      booting if we never drew the menu in the first place.
    - Remove some verbose messages printed before reading the configuration
      file.
    - Suppress progress messages as the kernel and initrd load for
      non-recovery kernel menu entries.
    - Change prepare_grub_to_access_device to handle filesystems
      loop-mounted on file images.
    - Ignore devices loop-mounted from files in 10_linux.
    - Show the boot menu if the previous boot failed, that is if it failed
      to get to the end of one of the normal runlevels.
    - Handle RAID devices containing virtio components.
    - Don't generate /boot/grub/device.map during grub-install or
      grub-mkconfig by default.
    - Adjust upgrade version checks for Ubuntu.
    - Don't display "GRUB loading" unless Shift is held down.
    - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate
      our backport of the grub-doc split.
    - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
    - Look for .mo files in /usr/share/locale-langpack as well, in
      preference.
    - Make sure GRUB_TIMEOUT isn't quoted unnecessarily.
    - Probe all devices in 'grub-probe --target=drive' if
      /boot/grub/device.map is missing.
    - Adjust hostdisk id for hard disks, allowing grub-setup to use its
      standard workaround for broken BIOSes.
    - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
    - Use qemu rather than qemu-system-i386.
    - Extend the EFI version of grub-install to be able to install into an
      EFI System Partition mounted on /boot/efi in a location that complies
      with the EFI specification.
    - Upgrade the installed core image when upgrading grub-efi-ia32 or
      grub-efi-amd64, although only if /boot/efi/EFI/ubuntu already exists.
    - Make grub-efi-ia32 and grub-efi-amd64 depend on efibootmgr so that
      grub-install...

Read more...

Changed in grub2 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.