Public bug reported:

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.

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1763151

Title:
  GRUB_TERMINAL=serial ignored

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1763151/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to