Commit b6b227e3 authored by Mike Hibler's avatar Mike Hibler
Browse files

Fix setting of console on Xen command lines.

Did this in the FreeBSD version previously.
parent 85e73fa2
......@@ -920,6 +920,7 @@ sub fix_console
sub fix_grub_console
{
my ($imageroot, $file, $console, $sunit, $sspeed) = @_;
my $comunit = $sunit + 1;
open FILE, "+<$imageroot/$file" ||
die "Couldn't open $imageroot/$file: $!\n";
......@@ -981,6 +982,20 @@ sub fix_grub_console
next;
}
#
# Xen command lines with VGA (vga)
#
if (/console=vga\s/) {
# get rid of any existing serial console clauses
s#console=com\d\S*##g;
s#com\d=\S+##g;
if ($sunit >= 0) {
# change vga to appropriate serial device
s#console=vga#console=com$comunit com$comunit=$sspeed#;
}
push @buffer, $_;
next;
}
#
# Kernel and initrd command lines with serial (ttyS*)
#
if (/console=ttyS(\d+)/) {
......@@ -996,6 +1011,24 @@ sub fix_grub_console
push @buffer, $_;
next;
}
#
# Xen command lines with serial (console=comN, comN=<speed>)
#
if (/console=com(\d)/) {
# get rid of any existing VGA clause
s#console=vga##g;
if ($sunit < 0) {
# replace serial with VGA
s#console=com\d\S*#console=vga#g;
s#com\d=\S+##g;
} else {
# fixup serial lines
s#console=com\d\S*#console=com$comunit#g;
s#com\d=\S+#com$comunit=$sspeed#g;
}
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