Commit 2c8e1a74 authored by David Johnson's avatar David Johnson

Add real hvc0 console support to linux slicefix.

(POWER hvc0 isn't a real serial console, and grub doesn't seem to
see it as one at all.  So we want to append hvc0 to the cmdline,
but we don't want to configure grub to use a real serial device.)
parent c5f973ca
......@@ -1079,7 +1079,11 @@ sub fix_grub_defaults
# append our info
push @buffer, "$esig\n";
push @buffer, "# DO NOT ADD ANYTHING AFTER THIS POINT AS IT WILL GET REMOVED.\n";
if ($sunit < 0) {
if ($sunit < 0 && $console =~ /^hvc/) {
push @buffer, "GRUB_CMDLINE_LINUX=\"console=tty0 console=$console\"\n";
push @buffer, "GRUB_TERMINAL=console\n";
push @buffer, "GRUB_SERIAL_COMMAND=\"\"\n";
} elsif ($sunit < 0) {
push @buffer, "GRUB_CMDLINE_LINUX=\"console=tty0\"\n";
push @buffer, "GRUB_TERMINAL=console\n";
push @buffer, "GRUB_SERIAL_COMMAND=\"\"\n";
......@@ -1164,6 +1168,17 @@ sub fix_grub_console
# change tty0 to appropriate serial device
s#console=tty0#console=ttyS$sunit,$sspeed#;
}
#
# Virtual consoles (e.g. hvcX on POWER). Not true
# serial consoles, so must be handled specially.
# Image grub.cfg must have console=tty0, or
# console=$console, for this to work.
#
if ($console =~ /^hvc/) {
if (! /console=$console/) {
s#console=tty0#console=tty0 console=$console#;
}
}
push @buffer, $_;
next;
}
......@@ -1215,7 +1230,6 @@ sub fix_grub_console
push @buffer, $_;
next;
}
#
# Otherwise, just copy
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment