diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-12-10 13:57:53 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-12-10 13:57:53 +0000 |
commit | 62f00af9af47d131a0f9b7040dfee59816fa95b5 (patch) | |
tree | 2be6a2efaf5c8fd3fa6223aa83c4916d946e64af /perl-install/bootloader.pm | |
parent | 88470ddf129d2c8f193e3450a100503a121a944d (diff) | |
download | drakx-backup-do-not-use-62f00af9af47d131a0f9b7040dfee59816fa95b5.tar drakx-backup-do-not-use-62f00af9af47d131a0f9b7040dfee59816fa95b5.tar.gz drakx-backup-do-not-use-62f00af9af47d131a0f9b7040dfee59816fa95b5.tar.bz2 drakx-backup-do-not-use-62f00af9af47d131a0f9b7040dfee59816fa95b5.tar.xz drakx-backup-do-not-use-62f00af9af47d131a0f9b7040dfee59816fa95b5.zip |
- fix bootloader::add_append
- add handling of serial console
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r-- | perl-install/bootloader.pm | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 73f37e6c6..922cf0ac0 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -176,10 +176,16 @@ sub get_append { sub add_append { my ($b, $key, $val) = @_; - foreach ({ append => $b->{perImageAppend} }, @{$b->{entries}}) { - $_->{append} =~ s/\b$key=\S*\s*//; - $_->{append} =~ s/\s*$/ $key=$val/ if $val; + foreach (\$b->{perImageAppend}, map { \$_->{append} } @{$b->{entries}}) { + $$_ =~ s/\b$key=\S*\s*//; + $$_ =~ s/\s*$/ $key=$val/ if $val; + log::l("add_append: $$_"); } + log::l("add_append: $b->{perImageAppend}"); +} +sub may_append { + my ($b, $key, $val) = @_; + add_append($b, $key, $val) if !get_append($b, $key); } sub configure_entry($$) { @@ -316,6 +322,11 @@ wait %d seconds for default boot. add2hash_($lilo, { getVarsFromSh("$prefix/etc/sysconfig/system") }); #- for CLEAN_TMP add2hash_($lilo, { memsize => $1 }) if cat_("/proc/cmdline") =~ /mem=(\S+)/; + if (my ($s, $port, $speed) = cat_("/proc/cmdline") =~ /console=(ttyS(\d),(\d+)\S*)/) { + log::l("serial console $s $port $speed"); + add_append($lilo, 'console' => $s); + any::set_login_serial_console($prefix, $port, $speed); + } my %labels = get_kernels_and_labels($prefix); $labels{''} or die "no kernel installed"; @@ -655,6 +666,7 @@ sub write_lilo_conf { $lilo->{$_} and print F $_ foreach qw(linear lba32 compact prompt restricted); print F "password=", $lilo->{password} if $lilo->{restricted} && $lilo->{password}; #- also done by msec print F "timeout=", round(10 * $lilo->{timeout}) if $lilo->{timeout}; + print F "serial=", $1 if get_append($lilo, 'console') =~ /ttyS(.*)/; my $dev = $hds->[0]{device}; my %dev2bios = map_index { $_ => $::i } dev2bios($hds, $lilo->{boot}); @@ -772,6 +784,8 @@ sub write_grub_config { print F "color black/cyan yellow/cyan"; print F "i18n ", $file2grub->("/boot/grub/messages"); print F "keytable ", $file2grub->($lilo->{keytable}) if $lilo->{keytable}; + print F "serial --unit=$1 --speed=$2\nterminal serial console" if get_append($lilo, 'console') =~ /ttyS(\d),(\d+)/; + #- since we use notail in reiserfs, altconfigfile is broken :-( unless ($bootIsReiser) { print F "altconfigfile ", $file2grub->(my $once = "/boot/grub/menu.once"); |