GRUB_TERMINAL=serial ignored

Bug #1763151 reported by TJ
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

apt-cache policy grub2-common
grub2-common:
  Installed: 2.02-2ubuntu8
  Candidate: 2.02-2ubuntu8
  Version table:
 *** 2.02-2ubuntu8 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

Setting /etc/default/grub

GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

is ignored by /usr/sbin/update-grub and /usr/sbin/grub-mkconfig

apparently due to /etc/grub.d/00_header only checking:

for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
    if [ xserial = "x$x" ]; then
        serial=1;

and therefore the subsequent generation of the serial command not being performed:

if [ "x$serial" = x1 ]; then
 ...
    echo "${GRUB_SERIAL_COMMAND}"

and thus resulting in:

$ grep -n terminal /boot/grub/grub.cfg
62:terminal_input console
63:terminal_output console

In order to have it work correctly 2 additional assignments are required:

GRUB_TERMINAL=serial
GRUB_TERMINAL_INPUT=serial
GRUB_TERMINAL_OUTPUT=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

GRUB_TERMINAL isn't exported to the scripts in /etc/grub.d/ but is used by /usr/sbin/grub-mkconfig

Surely when it is set and the others aren't it should be copied to them? It seems ridiculous to require 3 variables be set when 1 will do for the default case of having both I/O redirected to a serial port.

As an aside:

Using a cloudimg derived rootfs (used by LXD and others) as the basis for a bootable image creates a file that isn't attributed to any package which forces 'console' even when 'serial' is set

/etc/default/grub.d/50-cloudimg-settings.cfg:

GRUB_TERMINAL=console

This file has to be deleted.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Changed in grub2 (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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