Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 584850 - sys-boot/grub-2.02_beta2-r9: grub2-mkconfig does not allow serial_usb0 as terminal
Summary: sys-boot/grub-2.02_beta2-r9: grub2-mkconfig does not allow serial_usb0 as ter...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-02 14:02 UTC by Horst Prote
Modified: 2022-09-16 23:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Horst Prote 2016-06-02 14:02:11 UTC
With

GRUB_TERMINAL_INPUT="usb_keyboard0 serial_usb0 console"
GRUB_TERMINAL_OUTPUT="serial_usb0 console"
GRUB_SERIAL_COMMAND="sleep --verbose --interruptible 1; serial --speed=115200 usb0"
GRUB_PRELOAD_MODULES="nativedisk ehci ohci uhci usb usbserial_ftdi"

in /etc/default/grub you get:

# grub2-mkconfig -o /boot/grub/grub.cfg
Invalid output terminal "serial_usb0 console"

This can be fixed by changing /usr/sbin/grub2-mkconfig from

for x in ${GRUB_TERMINAL_OUTPUT}; do
    case "x${x}" in
        xgfxterm) ;;
        xconsole | xserial | xofconsole | xvga_text)
            # make sure all our children behave in conformance with ascii..
            export LANG=C;;
        *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;;
    esac
done

to (note the appended * after xserial)

for x in ${GRUB_TERMINAL_OUTPUT}; do
    case "x${x}" in
        xgfxterm) ;;
        xconsole | xserial* | xofconsole | xvga_text)
            # make sure all our children behave in conformance with ascii..
            export LANG=C;;
        *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;;
    esac
done

But now the GRUB_SERIAL_COMMAND isn't added to grub.cfg because of the following lines
in /etc/grub.d/00_header

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

After changing these lines to

for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
    case "x${x}" in
    xgfxterm) gfxterm=1;;
    xserial*) serial=1;;
    esac
done

now

# grub2-mkconfig -o /boot/grub/grub.cfg

creates a valid and working config.
Comment 1 Mike Gilbert gentoo-dev 2016-06-02 17:05:10 UTC
Please report this issue upstream.

https://www.gnu.org/software/grub/grub-bugs.html
Comment 2 Horst Prote 2016-06-02 17:25:16 UTC
Upstream bug is https://savannah.gnu.org/bugs/index.php?48102