diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-07-31 22:32:10 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-07-31 22:32:10 +0000 |
commit | 2c2ac91cdc7f1bd86dfd222fc8edeb4edea46a5d (patch) | |
tree | 9fb1eefecfd5f9940fb7d5bf92fe99f4f3f528d3 | |
parent | 157a01642c2a988c3308d7d3dd0f8ba36a0cf641 (diff) | |
download | drakx-backup-do-not-use-2c2ac91cdc7f1bd86dfd222fc8edeb4edea46a5d.tar drakx-backup-do-not-use-2c2ac91cdc7f1bd86dfd222fc8edeb4edea46a5d.tar.gz drakx-backup-do-not-use-2c2ac91cdc7f1bd86dfd222fc8edeb4edea46a5d.tar.bz2 drakx-backup-do-not-use-2c2ac91cdc7f1bd86dfd222fc8edeb4edea46a5d.tar.xz drakx-backup-do-not-use-2c2ac91cdc7f1bd86dfd222fc8edeb4edea46a5d.zip |
- add non-wizard ability to XFdrake
- first part of ATI TVout support
(still needs patching initscript, and adding an entry in bootloader)
(and testing of course :)
-rw-r--r-- | perl-install/Xconfig/card.pm | 3 | ||||
-rw-r--r-- | perl-install/Xconfig/main.pm | 122 | ||||
-rw-r--r-- | perl-install/Xconfig/various.pm | 51 | ||||
-rwxr-xr-x | perl-install/standalone/XFdrake | 15 |
4 files changed, 166 insertions, 25 deletions
diff --git a/perl-install/Xconfig/card.pm b/perl-install/Xconfig/card.pm index 3d993dd48..c0b4ea827 100644 --- a/perl-install/Xconfig/card.pm +++ b/perl-install/Xconfig/card.pm @@ -478,7 +478,7 @@ sub set_glx_restrictions { #- hack for ATI Rage 128 card using a bttv or peripheral with PCI bus mastering exchange #- AND using DRI at the same time. - if (member($card->{card_name}, 'ATI Rage 128', 'ATI Rage 128 Mobility')) { + if (member($card->{card_name}, 'ATI Rage 128', 'ATI Rage 128 TVout', 'ATI Rage 128 Mobility')) { $card->{Options_xfree4}{UseCCEFor2D} = bool2text(modules::probe_category('multimedia/tv')); } } @@ -549,6 +549,7 @@ sub readCardsDB { MULTI_HEAD => sub { $card->{MULTI_HEAD} = $val if $card->{Driver} }, BAD_FB_RESTORE => sub { $card->{BAD_FB_RESTORE} = 1 }, BAD_FB_RESTORE_XF3 => sub { $card->{BAD_FB_RESTORE_XF3} = 1 }, + FB_TVOUT => sub { $card->{FB_TVOUT} = 1 }, UNSUPPORTED => sub { delete $card->{Driver} }, COMMENT => sub {}, diff --git a/perl-install/Xconfig/main.pm b/perl-install/Xconfig/main.pm index 909c23108..d926df0c3 100644 --- a/perl-install/Xconfig/main.pm +++ b/perl-install/Xconfig/main.pm @@ -49,40 +49,118 @@ sub configure_everything_auto_install { sub configure_everything { my ($in, $raw_X, $do_pkgs, $auto, $options) = @_; - + my $X = {}; my $ok = 1; - $ok &&= my $card = Xconfig::card::configure($in, $raw_X, $do_pkgs, $auto, $options); - $ok &&= my $monitor = Xconfig::monitor::configure($in, $raw_X, $auto); - $ok &&= Xconfig::screen::configure($raw_X, $card); - $ok &&= my $resolution = Xconfig::resolution_and_depth::configure($in, $raw_X, $card, $monitor, $auto); - $ok &&= Xconfig::test::test($in, $raw_X, $card, $auto); + $ok &&= $X->{card} = Xconfig::card::configure($in, $raw_X, $do_pkgs, $auto, $options); + $ok &&= $X->{monitor} = Xconfig::monitor::configure($in, $raw_X, $auto); + $ok &&= Xconfig::screen::configure($raw_X, $X->{card}); + $ok &&= $X->{resolution} = Xconfig::resolution_and_depth::configure($in, $raw_X, $X->{card}, $X->{monitor}, $auto); + $ok &&= Xconfig::test::test($in, $raw_X, $X->{card}, $auto); + + if (!$ok) { + ($ok) = configure_chooser_raw($in, $raw_X, $do_pkgs, $options, $X, 1); + } else { + Xconfig::various::various($in, $X->{card}, $options, $auto); + } + $ok = &write($in, $raw_X, $X, $ok); + + $ok && 'config_changed'; +} + +sub configure_chooser_raw { + my ($in, $raw_X, $do_pkgs, $options, $X, $modified) = @_; + + my %texts; + + my $update_texts = sub { + $texts{card} = $X->{card} && $X->{card}{BoardName} || _("Custom"); + $texts{monitor} = $X->{monitor} && $X->{monitor}{ModelName} || _("Custom"); + $texts{resolution} = Xconfig::resolution_and_depth::to_string($X->{resolution}); + + $texts{$_} =~ s/(.{20}).*/$1.../ foreach keys %texts; #- ensure not too long + }; + $update_texts->(); + + my $may_set = sub { + my ($field, $val) = @_; + if ($val) { + $X->{$field} = $val; + $X->{"modified_$field"} = 1; + $modified = 1; + $update_texts->(); + } + }; + + my $ok; + $in->ask_from_({ ok => '' }, + [ + { label => _("Graphic Card"), val => \$texts{card}, icon => "eth_card_mini", clicked => sub { + $may_set->('card', Xconfig::card::configure($in, $raw_X, $do_pkgs, 0, $options)); + } }, + { label => _("Monitor"), val => \$texts{monitor}, icon => "ic82-systemeplus-40", clicked => sub { + $may_set->('monitor', Xconfig::monitor::configure($in, $raw_X)); + } }, + { label => _("Resolution"), val => \$texts{resolution}, icon => "X", disabled => sub { !$X->{card} || !$X->{monitor} }, + clicked => sub { + if (grep { delete $X->{"modified_$_"} } 'card', 'monitor') { + Xconfig::screen::configure($raw_X, $X->{card}); + } + $may_set->('resolution', Xconfig::resolution_and_depth::configure($in, $raw_X, $X->{card}, $X->{monitor})); + } }, + { val => _("Test"), icon => "warning", disabled => sub { !$X->{card} || !$X->{monitor} || !$modified || !Xconfig::card::check_bad_card($X->{card}) }, + clicked => sub { + $ok = Xconfig::test::test($in, $raw_X, $X->{card}, 1); + } }, + { val => _("Options"), icon => "ic82-tape-40", clicked => sub { + Xconfig::various::various($in, $X->{card}, $options); + } }, + { val => _("Quit"), icon => "exit", clicked_may_quit => sub { 1 } }, + ]); + $ok, $modified; +} + +sub configure_chooser { + my ($in, $raw_X, $do_pkgs, $options) = @_; + + my $X = { + card => eval { Xconfig::card::from_raw_X($raw_X) }, + monitor => $raw_X->get_monitors && Xconfig::monitor::from_raw_X($raw_X), + resolution => eval { $raw_X->get_resolution }, + }; + my ($ok, $modified) = configure_chooser_raw($in, $raw_X, $do_pkgs, $options, $X); + + $modified and &write($in, $raw_X, $X, $ok) or return; + + 'config_changed'; +} + +sub write { + my ($in, $raw_X, $X, $ok) = @_; $ok ||= $in->ask_yesorno('', _("Keep the changes? The current configuration is: -%s", Xconfig::various::info($raw_X, $card))); +%s", Xconfig::various::info($raw_X, $X->{card})), 1); - if ($ok) { - export_to_install_X($card, $monitor, $resolution); - $raw_X->write; - symlinkf "../..$card->{prog}", "$::prefix/etc/X11/X" if $card->{server} !~ /Xpmac/; - } - Xconfig::various::choose_xdm($in, $auto); - - $ok && 'config_changed'; -} + $ok or return; + export_to_install_X($X); + $raw_X->write; + Xconfig::various::check_XF86Config_symlink(); + symlinkf "../..$X->{card}{prog}", "$::prefix/etc/X11/X" if $X->{card}{server} !~ /Xpmac/; + 1; +} sub export_to_install_X { - my ($card, $monitor, $resolution) = @_; + my ($X) = @_; $::isInstall or return; - $::o->{X}{resolution_wanted} = $resolution->{X}; - $::o->{X}{default_depth} = $resolution->{Depth}; - $::o->{X}{bios_vga_mode} = $resolution->{bios}; - $::o->{X}{monitor} = $monitor if $monitor->{manually_chosen}; - $::o->{X}{card} = $monitor if $card->{manually_chosen}; + $::o->{X}{resolution_wanted} = $X->{resolution}{X}; + $::o->{X}{default_depth} = $X->{resolution}{Depth}; + $::o->{X}{bios_vga_mode} = $X->{resolution}{bios}; + $::o->{X}{monitor} = $X->{monitor} if $X->{monitor}{manually_chosen}; + $::o->{X}{card} = $X->{monitor} if $X->{card}{manually_chosen}; } diff --git a/perl-install/Xconfig/various.pm b/perl-install/Xconfig/various.pm index dea93439b..0089acd30 100644 --- a/perl-install/Xconfig/various.pm +++ b/perl-install/Xconfig/various.pm @@ -42,6 +42,13 @@ sub info { "$title\n\n$info"; } +sub various { + my ($in, $card, $options, $auto) = @_; + + tvout($in, $card, $options); + choose_xdm($in, $auto); +} + sub choose_xdm { my ($in, $auto) = @_; my $xdm = $::isStandalone ? any::runlevel($::prefix) : 1; @@ -56,4 +63,48 @@ Would you like XFree to start when you reboot?"), $xdm) or return any::runlevel($::prefix, $xdm ? 5 : 3); } +sub tvout { + my ($in, $card, $options) = @_; + + $card->{FB_TVOUT} && Xconfig::card::using_xf4($card) && $options->{allowFB} or return; + + $in->ask_yesorno('', _("Your graphic card seems to have a TV-OUT connector. +It can be configured to work using frame-buffer. + +For this you have to plug your graphic card to your TV before booting your computer. +Then choose the \"TVout\" entry in the bootloader + +Do you have this feature?")) or return; + + my $norm = $in->ask_from_list('', _("What norm is your TV using?"), [ 'NTSC', 'PAL' ]) or return; + + configure_FB_TVOUT({ norm => $norm }); +} + +sub configure_FB_TVOUT { + my ($use_FB_TVOUT) = @_; + + my $raw_X = Xconfig::default::configure(); + my $xfree4 = $raw_X->{xfree4}; + + $xfree4->set_monitors({ HorizSync => '30-50', VertRefresh => ($use_FB_TVOUT->{norm} eq 'NTSC' ? 60 : 50) }); + $xfree4->set_devices({ Driver => 'fbdev' }); + + my ($device) = $xfree4->get_devices; + my ($monitor) = $xfree4->get_monitors; + $xfree4->set_screens({ Device => $device->{Identifier}, Monitor => $monitor->{Identifier} }); + + $xfree4->write("$::prefix/etc/X11/XF86Config-4.tvout"); + + check_XF86Config_symlink(); +} + +sub check_XF86Config_symlink { + my $f = "$::prefix/etc/X11/XF86Config-4"; + if (!-l $f && -e "$f.tvout") { + rename $f, "$f.standard"; + symlink "XF86Config-4.standard", $f; + } +} + 1; diff --git a/perl-install/standalone/XFdrake b/perl-install/standalone/XFdrake index 5153b54b9..f547c722a 100755 --- a/perl-install/standalone/XFdrake +++ b/perl-install/standalone/XFdrake @@ -25,6 +25,7 @@ use Xconfig::main; use Xconfig::xfree; use Xconfig::default; use interactive; +use common; use any; use c; @@ -58,11 +59,15 @@ begin: if ($configure_this eq 'everything') { check_XFree($in); my $raw_X = Xconfig::xfree->read; + my $default = Xconfig::default::configure(); + my $has_conf = @{$raw_X->{xfree3}} || @{$raw_X->{xfree4}}; + $raw_X->{xfree3} = $default->{xfree3} if !@{$raw_X->{xfree3}}; + $raw_X->{xfree4} = $default->{xfree4} if !@{$raw_X->{xfree4}}; - if (@{$raw_X->{xfree3}} || @{$raw_X->{xfree4}}) { + if ($has_conf) { Xconfig::main::configure_chooser($in, $raw_X, $in->do_pkgs, { allowNVIDIA_rpms => allowNVIDIA_rpms() }); } else { - Xconfig::main::configure_everything($in, Xconfig::default::configure(), $in->do_pkgs, $auto, { allowNVIDIA_rpms => allowNVIDIA_rpms() }); + Xconfig::main::configure_everything($in, $raw_X, $in->do_pkgs, $auto, { allowNVIDIA_rpms => allowNVIDIA_rpms() }); } } elsif ($configure_this eq 'auto_install') { Xconfig::main::configure_everything_auto_install(Xconfig::default::configure(), $in->do_pkgs, {}, { allowNVIDIA_rpms => allowNVIDIA_rpms() }); @@ -83,6 +88,12 @@ begin: sub check_XFree { my ($in) = @_; + #- set the standard configuration + foreach ('XF86Config', 'XF86Config-4') { + my $f = "/etc/X11/$_"; + symlinkf("$_.standard", $f) if -l $f && -e "$f.standard"; + } + my $f = "/usr/X11R6/lib/X11/rgb.txt"; #- this one is on all platform -e $f or $in->do_pkgs->install('XFree86', 'XFree86-75dpi-fonts'); -e $f or die "install XFree86 first!\n"; |