From 5257a4b51da873ea3f3b5e25e7822930f6433489 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 11 Oct 2004 23:56:40 +0000 Subject: in grub menu.lst, keep previous "serial ..." and "terminal ..." lines (bugzilla #12054) --- perl-install/bootloader.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 83e4fbf95..d1a0b08e9 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1170,6 +1170,11 @@ sub write_grub { my @sorted_hds = sort_hds_according_to_bios($bootloader, $all_hds); write_grub_device_map(\@legacy_floppies, \@sorted_hds); + if (get_append($bootloader, 'console') =~ /ttyS(\d),(\d+)/) { + $bootloader->{serial} ||= "--unit=$1 --speed=$2"; + $bootloader->{terminal} ||= "--timeout=" . ($bootloader->{timeout} || 0) . " console serial"; + } + my $file2grub = sub { my ($part, $file) = fs::get::file2part($fstab, $_[0], 'keep_simple_symlinks'); device2grub($part, \@sorted_hds) . $file; @@ -1177,9 +1182,8 @@ sub write_grub { { my @conf; - push @conf, map { "$_ $bootloader->{$_}" } grep { $bootloader->{$_} } qw(timeout color); + push @conf, map { "$_ $bootloader->{$_}" } grep { $bootloader->{$_} } qw(timeout color serial terminal); push @conf, map { $_ . ' ' . $file2grub->($bootloader->{$_}) } grep { $bootloader->{$_} } qw(splashimage); - push @conf, "serial --unit=$1 --speed=$2\nterminal --timeout=" . ($bootloader->{timeout} || 0) . " console serial" if get_append($bootloader, 'console') =~ /ttyS(\d),(\d+)/; eval { push @conf, "default " . (find_index { $_->{label} eq $bootloader->{default} } @{$bootloader->{entries}}); -- cgit v1.2.1