summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_stdio.pm
blob: ac9408b3cbb8a5653c31dc93ab827fa3dcdea2dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package install_steps_stdio; # $Id$

use diagnostics;
use strict;
use vars qw(@ISA);

@ISA = qw(install_steps_interactive interactive::stdio);

use common;
use interactive::stdio;
use install_steps_interactive;
use lang;

sub new($$) {
    my ($type, $o) = @_;

    (bless {}, ref($type) || $type)->SUPER::new($o);
}

sub charsetChanged {
    my ($o) = @_;
    lang::load_console_font($o->{locale});
}

sub enteringStep {
    my ($o, $step) = @_;
    print N("Entering step `%s'\n", translate($o->{steps}{$step}{text}));
    $o->SUPER::enteringStep($step);
}
sub leavingStep {
    my ($o, $step) = @_;
    $o->SUPER::leavingStep($step);
    print "--------\n";
}

1;
kwa">default; use Xconfig::resolution_and_depth; use common; sub to_string { my ($raw_X) = @_; $raw_X->is_fbdev ? 'frame-buffer' : Xconfig::resolution_and_depth::to_string($raw_X->get_resolution); } sub info { my ($raw_X, $card) = @_; my $info; my $xf_ver = Xconfig::card::xorg_version(); my $title = $card->{use_DRI_GLX} ? N("Xorg %s with 3D hardware acceleration", $xf_ver) : N("Xorg %s", $xf_ver); my $keyboard = eval { $raw_X->get_keyboard } || {}; my @monitors = eval { $raw_X->get_monitors }; my $device = eval { $raw_X->get_device } || {}; my $mouse = eval { first($raw_X->get_mice) } || {}; $info .= N("Keyboard layout: %s\n", $keyboard->{XkbLayout}); $info .= N("Mouse type: %s\n", $mouse->{Protocol}); $info .= N("Mouse device: %s\n", $mouse->{Device}) if $::expert; foreach my $monitor (@monitors) { $info .= N("Monitor: %s\n", $monitor->{ModelName}); $info .= N("Monitor HorizSync: %s\n", $monitor->{HorizSync}) if $::expert; $info .= N("Monitor VertRefresh: %s\n", $monitor->{VertRefresh}) if $::expert; } $info .= N("Graphics card: %s\n", $device->{VendorName} . ' ' . $device->{BoardName}); $info .= N("Graphics memory: %s kB\n", $device->{VideoRam}) if $device->{VideoRam}; if (my $resolution = eval { $raw_X->get_resolution }) { $info .= N("Color depth: %s\n", translate($Xconfig::resolution_and_depth::depth2text{$resolution->{Depth}})); $info .= N("Resolution: %s\n", join('x', @$resolution{'X', 'Y'})); } $info .= N("Xorg driver: %s\n", $device->{Driver}) if $device->{Driver}; "$title\n\n$info"; } sub various { my ($in, $card, $options, $b_auto) = @_; tvout($in, $card, $options) if !$b_auto; choose_xdm($in, $b_auto); 1; } sub runlevel { my ($o_runlevel) = @_; my $f = "$::prefix/etc/inittab"; -r $f or log::l("missing inittab!!!"), return; if ($o_runlevel) { substInFile { s/^id:\d:initdefault:\s*$/id:$o_runlevel:initdefault:\n/ } $f if !$::testing; } else { cat_($f) =~ /^id:(\d):initdefault:\s*$/m && $1; } } sub choose_xdm { my ($in, $b_auto) = @_;