summaryrefslogtreecommitdiffstats
path: root/perl-install/network/tools.pm
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2002-08-06 10:16:30 +0000
committerDaouda Lo <daouda@mandriva.com>2002-08-06 10:16:30 +0000
commit4017cf0cbded37336bf35e56f0434b94974e8647 (patch)
tree335d1ac7551a79ac6abb84a1e8a653fcc4bc0201 /perl-install/network/tools.pm
parent13321b3ed07d5275c9829424a8b489648d2659af (diff)
downloaddrakx-4017cf0cbded37336bf35e56f0434b94974e8647.tar
drakx-4017cf0cbded37336bf35e56f0434b94974e8647.tar.gz
drakx-4017cf0cbded37336bf35e56f0434b94974e8647.tar.bz2
drakx-4017cf0cbded37336bf35e56f0434b94974e8647.tar.xz
drakx-4017cf0cbded37336bf35e56f0434b94974e8647.zip
- set the vpi vci correctly according to selected country.
Diffstat (limited to 'perl-install/network/tools.pm')
-rw-r--r--perl-install/network/tools.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index f43406c80..95616a82a 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -101,7 +101,7 @@ sub ask_info2 {
]
) or return;
if ($netc->{vpivci}) {
- foreach (['Netherlands', '8_48'], ['France', '8_35'], ['Belgium', '8_35'], ['Italy', '8_35'], ['UK', '0_38'], ['USA', '8_35']) {
+ foreach ([_("Netherlands"), '8_48'], [_("France"), '8_35'], [_("Belgium"), '8_35'], [_("Italy"), '8_35'], [_("United Kingdom"), '0_38'], [_("United States"), '8_35']) {
$netc->{vpivci} eq $_->[0] and $netc->{vpivci} = $_->[1];
}
}
d='n181' href='#n181'>181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579
package Xconfig::card; # $Id$

use diagnostics;
use strict;

use detect_devices;
use modules;
use common;
use log;


my $force_xf4 = arch() =~ /ppc|ia64/;


my %VideoRams = (
     256 => __("256 kB"),
     512 => __("512 kB"),
    1024 => __("1 MB"),
    2048 => __("2 MB"),
    4096 => __("4 MB"),
    8192 => __("8 MB"),
   16384 => __("16 MB"),
   32768 => __("32 MB"),
   65536 => __("64 MB or more"),
);

our %serversdriver = arch() =~ /^sparc/ ? (
    'Mach64'    => "accel",
    '3DLabs'    => "accel",
    'Sun'       => "fbdev",
    'Sun24'     => "fbdev",
    'SunMono'   => "fbdev",
    'VGA16'     => "vga16",
    'FBDev'     => "fbdev",
) : (
    'SVGA'      => "svga",
    'S3'        => "accel",
    'Mach32'    => "accel",
    'Mach8'     => "accel",
    '8514'      => "accel",
    'P9000'     => "accel",
    'AGX'       => "accel",
    'W32'       => "accel",
    'Mach64'    => "accel",
    'I128'      => "accel",
    'S3V'       => "accel",
    '3DLabs'    => "accel",
    'VGA16'     => "vga16",
    'FBDev'     => "fbdev",
);
my @allbutfbservers = grep { arch() =~ /^sparc/ || $serversdriver{$_} ne "fbdev" } keys(%serversdriver);
my @allservers = keys(%serversdriver);

my @xfree4_Drivers = ((arch() =~ /^sparc/ ? qw(sunbw2 suncg14 suncg3 suncg6 sunffb sunleo suntcx) :
		    qw(apm ark chips cirrus cyrix glide i128 i740 i810 imstt 
                       mga neomagic newport nv rendition r128 radeon vesa
                       s3 s3virge savage siliconmotion sis tdfx tga trident tseng vmware)), 
		    qw(ati glint vga fbdev));


#- using XF4 if {Driver} && !{prefer_xf3} otherwise using XF3
#- error if $force_xf4 && !{Driver} || !{Driver} && !{server}
#- internal error if $force_xf4 && {prefer_xf3} || {prefer_xf3} && !{server}

sub using_xf4 {
    my ($card) = @_;
    $card->{Driver} && !$card->{prefer_xf3};
}

sub server_binary {
    my ($card) = @_;
    "/usr/X11R6/bin/" . 
      (using_xf4($card) ? 'XFree86' : 
       $card->{server} =~ /Sun(.*)/ ? "Xsun$1" : 
       $card->{server} eq 'Xpmac' ? 'Xpmac' :
       "XF86_$card->{server}");
}

sub from_raw_X {
    my ($raw_X) = @_;

    my $device = $raw_X->get_device or die "no card configured";

    my ($xfree3_server) = readlink("$::prefix/etc/X11/X") =~ /XF86_(.*)/;

    my $card = {
	use_UTAH_GLX => int(grep { /glx/ } $raw_X->{xfree3}->get_modules),
	use_DRI_GLX  => int(grep { /dri/ } $raw_X->{xfree4}->get_modules),
	server => $xfree3_server,
	prefer_xf3 => $xfree3_server && !$force_xf4,
	%$device,
    };
    add_to_card__using_Cards($card, $card->{BoardName});
    $card->{prog} = server_binary($card);
    $card;
}

sub to_raw_X {
    my ($card, $raw_X) = @_;

    $raw_X->set_devices($card, @{$card->{cards} || []});

    $raw_X->{xfree4}->get_ServerLayout->{Xinerama} = { commented => !$card->{Xinerama}, Option => 1 }
      if defined $card->{Xinerama};

    $raw_X->{xfree3}->set_load_module('glx-3.so', $card->{use_UTAH_GLX}); #- glx.so may clash with server version 4.

    $raw_X->{xfree4}->set_load_module('glx', !$card->{DRI_GLX_SPECIAL}); #- glx for everyone, except proprietary nvidia
    $raw_X->{xfree4}->set_load_module('dri', $card->{use_DRI_GLX} && !$card->{DRI_GLX_SPECIAL});

    # This loads the NVIDIA GLX extension module.
    # IT IS IMPORTANT TO KEEP NAME AS FULL PATH TO libglx.so ELSE
    # IT WILL LOAD XFree86 glx module and the server will crash.
    $raw_X->{xfree4}->set_load_module('/usr/X11R6/lib/modules/extensions/libglx.so', $card->{DRI_GLX_SPECIAL}); 

    $raw_X->{xfree4}->remove_Section('DRI');
    $raw_X->{xfree4}->add_Section('DRI', { Mode => { val => '0666' } }) if $card->{use_DRI_GLX};

    $raw_X->{xfree4}->remove_load_module('v4l') if $card->{use_DRI_GLX} && $card->{Driver} eq 'r128';
}

sub probe() {
#-for Pixel tests
#-    my @c = { driver => 'Card:Matrox Millennium G400 DualHead', description => 'Matrox|Millennium G400 Dual HeadCard' };
    my @c = grep { $_->{driver} =~ /(Card|Server|Driver):/ } detect_devices::probeall();

    my @cards = map {
	my @l = $_->{description} =~ /(.*?)\|(.*)/;
	my $card = { 
	    description => $_->{description},
	    VendorName => $l[0], BoardName => $l[1],
	    BusID => "PCI:$_->{pci_bus}:$_->{pci_device}:$_->{pci_function}",
	};
	if    ($_->{driver} =~ /Card:(.*)/)   { $card->{BoardName} = $1; add_to_card__using_Cards($card, $1) }
	elsif ($_->{driver} =~ /Server:(.*)/) { $card->{server} = $1 }
	elsif ($_->{driver} =~ /Driver:(.*)/) { $card->{Driver} = $1 }
	else { internal_error() }

	$_->{VideoRam} = 4096 if $_->{Driver} eq 'i810';
	$_->{Options_xfree4}{UseFBDev} = undef if arch =~ /ppc/ && $_->{Driver} eq 'r128';

	$card;
    } @c;

    if (@cards >= 2 && $cards[0]{card_name} eq $cards[1]{card_name} && $cards[0]{card_name} eq 'Intel 830') {
	shift @cards;
    }
    #- take a default on sparc if nothing has been found.
    if (arch() =~ /^sparc/ && !@cards) {
        log::l("Using probe with /proc/fb as nothing has been found!");
	local $_ = cat_("/proc/fb");
	@cards = { server => /Mach64/ ? "Mach64" : /Permedia2/ ? "3DLabs" : "Sun24" };
    }

    #- disabling MULTI_HEAD when not available
    foreach (@cards) { 
	$_->{MULTI_HEAD} && $_->{card_name} =~ /G[24]00/ or next;
	if ($ENV{MATROX_HAL}) {
	    $_->{need_MATROX_HAL} = 1;
	} else {
	    delete $_->{MULTI_HEAD};
	}
    }

    #- in case of only one cards, remove all BusID reference, this will avoid
    #- need of change of it if the card is moved.
    #- on many PPC machines, card is on-board, BusID is important, leave?
    if (@cards == 1 && !$cards[0]{MULTI_HEAD} && arch() !~ /ppc/) {
	delete $cards[0]{BusID};
    }

    @cards;
}

sub card_config__not_listed {
    my ($in, $card, $options) = @_;

    my $vendors_regexp = join '|', map { quotemeta } (
        '3Dlabs',
        'AOpen', 'ASUS', 'ATI', 'Ark Logic', 'Avance Logic',
        'Cardex', 'Chaintech', 'Chips & Technologies', 'Cirrus Logic', 'Compaq', 'Creative Labs',
        'Dell', 'Diamond', 'Digital',
        'ET', 'Elsa',
        'Genoa', 'Guillemot', 'Hercules', 'Intel', 'Leadtek',
        'Matrox', 'Miro', 'NVIDIA', 'NeoMagic', 'Number Nine',
        'Oak', 'Orchid',
        'RIVA', 'Rendition Verite',
        'S3', 'Silicon Motion', 'STB', 'SiS', 'Sun',
        'Toshiba', 'Trident',
        'VideoLogic',
    );
    my $cards = readCardsDB("$ENV{SHARE_PATH}/ldetect-lst/Cards+");

    my @xf3 = $options->{allowFB} ? @allservers : @allbutfbservers;
    my @xf4 = grep { $options->{allowFB} || $_ ne 'fbdev' } @xfree4_Drivers;
    my @list = (
	(map { 'Vendor|' . $_ } keys %$cards),
        if_(!$force_xf4, map { 'XFree 3|' . $_ } @xf3), 
	(map { 'XFree 4|' . $_ } @xf4),
    );

    my $r = $in->ask_from_treelistf(
	_("X server"), _("Choose a X server"), '|', 
	sub { $_[0] =~ /^Vendor\|($vendors_regexp)\s*-?(.*)/ ? "Vendor|$1|$2" : 
	      $_[0] =~ /^Vendor\|(.*)/ ? "Vendor|Other|$1" : $_[0] },
	\@list, 
	exists $cards->{$card->{BoardName}} ? "Vendor|$card->{BoardName}" : 'XFree 4|vesa') or return;

    $r eq "Vendor|$card->{BoardName}" and return 1; #- it is unchanged, don't modify $card

    my ($kind, $s) = $r =~ /(.*?)\|(.*)/;

    %$card = ();