summaryrefslogtreecommitdiffstats
path: root/perl-install/share/locales-skeleton.tar.bz2
blob: 0bf8c6ad2682ae8762775882bce093036ceda867 (plain)
ofshex dumpascii
0000 42 5a 68 39 31 41 59 26 53 59 51 41 60 4b 00 15 b7 ff 84 f8 b0 00 81 48 07 ff fe 7f ff df f0 ff BZh91AY&SYQA`K.........H........
0020 ff ff f8 00 00 80 08 60 08 df 7d f0 18 f0 1d a5 e7 83 ef 7d 65 69 be cd 4d 53 d0 68 73 63 9e 91 .......`..}........}ei..MS.hsc..
0040 99 26 d2 3d 4f 53 26 23 21 a0 06 9a 1e a0 00 d0 00 00 c8 11 32 9e 9b 53 44 9b 12 35 46 83 20 00 .&.=OS&#!...........2..SD..5F...
0060 00 1a 00 0d 94 00 00 12 4d 0a 8d 13 10 99 a4 68 00 00 06 8c 43 d4 00 34 00 00 25 3f 55 55 03 4d ........M......h....C..4..%?UU.M
0080 34 00 32 0d 00 0d 00 d0 34 64 00 00 00 04 4a 13 40 a6 d2 4f 20 a6 f5 09 90 0d a8 d0 d0 34 64 68 4.2.....4d....J.@..O.........4dh
00a0 00 00 00 24 4a 34 24 c5 37 93 4a 7a 6d 26 a6 80 00 d0 34 03 4f 53 4c 9e 51 a7 a4 03 65 39 02 9e ...$J4$.7.Jzm&....4.OSL.Q...e9..
00c0 8e 8d af 15 ab 2c fa 02 98 04 9d e4 90 2b b3 14 d2 13 26 c2 e2 79 9d d6 52 e0 62 9c 18 1d 21 14 .....,.......+....&..y..R.b...!.
00e0 0a 56 42 48 21 e8 a8 01 24 18 4a ca 33 2b 0c aa 4c c4 91 11 11 11 11 11 11 12 44 44 44 52 44 44 .VBH!...$.J.3+..L.........DDDRDD
0100 44 44 44 c4 44 44 44 44 44 44 44 44 49 11 11 11 11 11 11 12 46 11 84 44 44 44 44 49 31 11 11 11 DDD.DDDDDDDDI.......F..DDDDI1...
0120 12 44 44 44 44 44 91 11 11 11 8d 8d 8d 8d 95 2e b1 78 c1 40 ec ca 39 24 8e ec f0 90 85 11 00 02 .DDDDD...........x.@..9$........
0140 26 e1 8f 4b 63 e2 69 20 f2 d5 02 c4 a7 22 16 ea 2b 0d e0 80 a3 99 9a fb 1a 74 97 b9 f5 d6 61 bc &..Kc.i......"..+........t....a.
0160 58 55 78 da 5a 0d f4 f3 d1 8c fb 9c 21 ec 04 24 05 c2 e6 d0 f9 35 71 bd c9 c1 e5 8c 7c de 8d ef XUx.Z.......!..$.....5q.....|...
0180 72 7a 8f 88 dd 1c 3b cc e8 81 a3 16 a5 27 43 a3 9b 85 93 ae e1 b7 88 d2 ed 8b 69 29 db 71 a1 07 rz....;......'C...........i).q..
01a0 69 a8 ac 6a b5 91 e5 ad 9b 76 d0 f6 a5 27 4c 16 b9 eb ba d9 dd 0a b8 51 6c ac d6 27 ba 03 47 96 i..j.....v...'L........Ql..'..G.
01c0 e9 a4 db 27 51 ab 43 c9 24 2f 1b bd 9f 13 c5 cd c2 c9 d7 60 bd cd 34 6c 5b 39 4e da cd 08 3b 4d ...'Q.C.$/.........`..4l[9N...;M
01e0 45 63 55 ac 8f 2c d9 b4 d0 3d a9 d9 96 34 c6 2d 6d 7b 33 5b bb a1 4f 0c 56 ea cd 72 7c d0 1a 3c EcU..,...=...4.-m{3[..O.V..r|..<
0200 b8 d3 49 b6 4e a2 e9 92 47 55 76 4e b5 34 d2 45 1b 3e 37 89 a1 20 89 c9 5a cb 65 ce 47 8d 99 b4 ..I.N...GUvN.4.E.>7.....Z.e.G...
0220 d1 e5 72 a5 27 4c 16 f9 eb ba ca ce 46 45 5c 31 5c 2c c4 d6 27 ba 04 47 21 b2 69 38 e4 ea 2d 08 ..r.'L......FE\1\,..'..G!.i8..-.
0240 42 10 28 75 37 88 c9 4c fb 9c 3e cf bb cb c7 d8 8a 3f 88 78 c3 1c 72 cf 3c f3 cd 01 74 f8 42 15 B.(u7..L..>......?.x..r.<...t.B.
0260 0f 7d 97 07 e8 06 02 e2 05 dc 9d 72 ea d3 aa 80 95 37 da e3 9c 23 70 24 1a a6 5c be 20 b4 94 06 .}.........r.....7...#p$..\.....
0280 11 a9 0c 32 0c 0a 3a 50 21 07 f4 ec 5e de 16 0d 7c c0 49 02 9a 6c b8 66 d8 24 fb 3a 2a 17 b7 d6 ...2..:P!...^...|.I..l.f.$.:*...
02a0 95 0b e5 68 1d 61 86 77 9b cf 50 31 39 8c dd 34 0b 86 13 05 52 0a 11 58 5a 08 48 0c 21 e0 33 94 ...h.a.w..P19..4....R..XZ.H.!.3.
02c0 06 03 34 67 f7 cd c0 fb 54 c4 3d 1d 9d 93 6f 44 c4 20 64 3a da 2e 00 4e 3c 0b 4d 9e 67 9d 3c ad ..4g....T.=...oD..d:...N<.M.g.<.
02e0 ae 60 1c ea 05 25 73 46 4e f5 f0 1d ef e2 d9 e4 9e 25 c9 31 61 68 61 f9 a3 0a 6c 85 51 91 54 06 .`...%sFN........%.1aha...l.Q.T.
0300 38 0a 84 74 cc 94 53 28 8b 2d 2c 97 a2 d3 0b ec 0d 41 28 12 08 50 2e d2 bc 3d 3e 96 f3 47 43 7f 8..t..S(.-,......A(..P...=>..GC.
0320 a5 b6 d3 d0 6e f3 75 b9 e5 6d c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 82 00 00 00 00 ....n.u..m......................
0340 00 00 00 00 00 00 33 b3 5c 1e 47 4f a2 75 3d 2c e5 f4 2e 6e d9 77 55 45 53 aa 7f 95 00 24 a0 05 ......3.\.GO.u=,...n.wUES....$..
0360 e5 49 10 00 7d 7f 23 f8 86 43 b3 f7 92 ea 78 80 56 03 e2 7e 56 88 9b 00 af ec 08 c3 82 18 42 05 .I..}.#..C....x.V..~V.........B.
0380 b7 33 c1 11 2f db a4 56 e8 d4 42 45 00 45 42 30 40 06 00 20 04 93 29 5c 32 ca c5 ee 28 b9 a0 ef .3../..V..BE.EB0@.....)\2...(...
03a0 1f 54 11 40 a2 26 b7 92 4e ba ab 0f 46 a7 8f 6e c4 b7 03 3e 56 9b 63 6d 48 b4 2d fe 2d 78 70 e1 .T.@.&..N...F..n...>V.cmH.-.-xp.
03c0 c3 87 14 22 d4 08 32 10 8c 6a 57 91 4f bd 6d 1c 59 73 4c cc b6 f1 2c 58 f3 69 cf 8b 82 ee ee ee ..."..2..jW.O.m.YsL...,X.i......
03e0 ee ec c3 0c 2b 77 c8 02 b6 01 5a 0a 01 18 8d b1 ac 3a e5 21 4a d2 b0 99 0a 04 b4 bd 9c 17 76 aa ....+w....Z......:.!J.........v.
0400 a9 55 55 52 2b 39 77 c8 01 25 b2 18 08 5c 49 ea 67 a8 6a 5e 13 9e c4 00 05 12 49 48 01 12 06 cd .UUR+9w..%...\I.g.j^......IH....
0420 ec 22 02 31 9c 08 b9 bc b3 33 38 65 87 09 b1 a1 b0 01 27 91 52 45 10 18 19 a7 46 e6 9b bb bb ba .".1.....38e......'.RE....F.....
0440 a2 aa 8b bb 9c 80 84 80 c6 83 9b ba 30 c9 84 44 6c 6d ef a8 9a 8a 9a 51 32 e5 45 6d 30 76 18 28 ............0..Dlm.....Q2.Em0v.(
0460 2f 70 55 03 22 22 39 c1 54 6a 1d 57 92 37 09 56 17 58 db 7d 70 1b 01 25 3a b4 b2 c9 4d 34 d3 44 /pU.""9.Tj.W.7.V.X.}p..%:...M4.D
0480 44 45 d2 41 ba 64 82 24 63 68 90 ef af 1a f0 2e b0 76 03 84 35 6a 88 88 a5 46 f7 7b 7a 66 65 b7 DE.A.d.$ch.......v..5j...F.{zfe.
04a0 33 3b ea c3 c2 16 b2 18 b8 5b 71 0d c9 14 db 88 6d d8 70 0a 12 29 78 a2 09 a3 50 c1 bb 52 b9 69 3;.......[q.....m.p..)x...P..R.i
04c0 5a d6 b4 69 4a 79 3e 39 24 3c 8e 2f c9 09 09 38 6d 26 eb ea aa aa a6 dc e6 5a c2 d6 0c 16 65 82 Z..iJy>9$<./...8m&.......Z....e.
04e0 c4 62 88 23 42 cf 38 36 db 70 b0 5a 10 f6 0e b0 15 ab 89 ac 84 9b 9f 2b 67 25 33 4f 37 36 94 a5 .b.#B.86.p.Z...........+g%3O76..
0500 29 42 92 4e 69 24 98 01 c1 d1 c5 c9 2c 18 bb eb 24 9a a6 0e ad c3 27 8b 9b 40 b3 ae ab 6d a4 92 )B.Ni$......,...$.....'..@...m..
0520 15 00 42 be a5 92 98 88 88 8a 03 d4 14 87 f9 64 c7 97 0e 1a f2 04 95 db 38 38 37 71 d7 cb d8 ee ..B............d........887q....
0540 cd 7c 3d 95 cc 2f 77 8e 21 5a b5 0d 6e 16 b3 23 91 10 9b 56 84 42 84 bf 61 2d 95 62 19 df aa a4 .|=../w.!Z..n..#...V.B..a-.b....
0560 da df bf 2c 81 0a 14 a4 af c4 27 19 19 02 46 77 b7 1b 74 f6 f7 44 89 dd af 2a aa 8d 00 ab 10 ab ...,......'...Fw..t..D...*......
0580 02 b9 66 c8 c8 c8 c8 c8 c8 11 55 18 c2 38 f1 cb 81 79 72 ec 61 86 18 61 91 86 18 61 86 18 61 89 ..f.......U..8...yr.a..a...a..a.
05a0 88 f4 6e dc 16 b3 23 23 23 23 23 20 48 ce 21 bc 76 d6 31 b6 0e fa 51 91 ce 94 6d bb bf c3 6b 54 ..n...#####.H.!.v.1...Q...m...kT
05c0 6a d1 a0 55 bd d9 1e 54 a3 23 23 a9 db e3 fe f7 bc 16 6c d9 ab 67 a5 2d d5 d5 a6 8f 85 e8 27 03 j..U...T.##.......l..g.-......'.
05e0 7f 1e 15 cc ae 59 31 8c 81 3b 52 8c 65 f7 e5 e0 94 63 47 0c 19 18 c9 1d b9 72 ef f3 f5 e7 af 2b .....Y1..;R.e....cG......r.....+
0600 05 db b8 b8 36 4c 5c 5c 40 ee 84 35 d5 a8 ef ad 59 1e 6a 51 91 ee a2 2d 28 c8 d3 5d 20 03 43 48 ....6L\\@..5....Y.jQ...-(..]..CH
0620 42 51 c1 29 2c d3 aa e7 9d 36 0c 68 63 4e e9 74 d7 61 58 ef ef ed b6 d2 ae 16 6a 16 70 75 e6 70 BQ.),....6.hcN.t.aX.......j.pu.p
0640 5e be 79 e9 82 2e c5 5c fa 05 17 74 63 9e 6c 8c 8f 52 22 d2 8c 8c 81 35 b0 64 74 85 02 72 e7 ee ^.y....\...tc.l..R"....5.dt..r..
0660 5b 87 4d 81 bb 72 92 05 d8 16 70 6e cc b3 d1 ea c0 2b 57 4c 03 59 af 6a 95 dd 44 b3 00 2c c1 6c [.M..r....pn.....+WL.Y.j..D..,.l
0680 c0 b3 01 70 0d 0d 11 17 53 4d 1e 7a 71 ab 48 e8 52 8c 42 b0 6d 74 42 42 65 44 04 65 bd bc dc 6c ...p....SM.zq.H.R.B.mtBBeD.e...l
06a0 d0 14 16 a1 16 ad 52 2d 62 c6 b6 03 6a 65 60 da c5 bb 32 b4 36 b8 ed 35 ae 19 f4 e4 98 52 a5 4a ......R-b...je`...2.6..5.....R.J
06c0 bb 58 db 4c db fa d7 b3 68 61 b6 c4 42 85 08 dc dc 59 c2 21 5f 3a 96 85 37 56 0d 53 4a c7 70 4c .X.L....ha..B....Y.!_:..7V.SJ.pL
06e0 56 24 87 a0 a0 7f e2 ee 48 a7 0a 12 0a 28 2c 09 60 V$......H....(,.`
'#n388'>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 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160
package Xconfigurator; # $Id$

use diagnostics;
use strict;
use vars qw($in $install $isLaptop @window_managers @depths @monitorSize2resolution @hsyncranges %min_hsync4wres @vsyncranges %depths @resolutions %serversdriver @svgaservers @accelservers @allbutfbservers @allservers %vgamodes %videomemory @ramdac_name @ramdac_id @clockchip_name @clockchip_id %keymap_translate %standard_monitors $XF86firstchunk_text $XF86firstchunk_text2 $keyboardsection_start $keyboardsection_start_v4 $keyboardsection_part2 $keyboardsection_part3 $keyboardsection_part3_v4 $keyboardsection_end $pointersection_text $pointersection_text_v4 $monitorsection_text1 $monitorsection_text2 $monitorsection_text3 $monitorsection_text4 $modelines_text_Trident_TG_96xx $modelines_text $devicesection_text $devicesection_text_v4 $screensection_text1 %lines @options %xkb_options $default_monitor $layoutsection_v4);

use common qw(:common :file :functional :system);
use log;
use detect_devices;
use run_program;
use Xconfigurator_consts;
use any;
use modules;
use my_gtk qw(:wrappers);

my $tmpconfig = "/tmp/Xconfig";

my ($prefix, %monitors);

1;

sub getVGAMode($) { $_[0]->{card}{vga_mode} || $vgamodes{"640x480x16"}; }

sub readCardsDB {
    my ($file) = @_;
    my ($card, %cards);

    local *F;
    open F, $file or die "file $file not found";

    my ($lineno, $cmd, $val) = 0;
    my $fs = {
        LINE => sub { push @{$card->{lines}}, $val unless $val eq "VideoRam" },
	NAME => sub {
	    $cards{$card->{type}} = $card if $card;
	    $card = { type => $val };
	},
	SEE => sub {
	    my $c = $cards{$val} or die "Error in database, invalid reference $val at line $lineno";

	    push @{$card->{lines}}, @{$c->{lines} || []};
	    add2hash($card->{flags}, $c->{flags});
	    add2hash($card, $c);
	},
	CHIPSET => sub {
	    $card->{chipset} = $val;
	    $card->{flags}{needChipset} = 1 if $val eq 'GeForce DDR';
	    $card->{flags}{needVideoRam} = 1 if member($val, qw(mgag10 mgag200 RIVA128 SiS6326));
	},
	SERVER => sub { $card->{server} = $val; },
	DRIVER => sub { $card->{driver} = $val; },
	RAMDAC => sub { $card->{ramdac} = $val; },
	DACSPEED => sub { $card->{dacspeed} = $val; },
	CLOCKCHIP => sub { $card->{clockchip} = $val; $card->{flags}{noclockprobe} = 1; },
	NOCLOCKPROBE => sub { $card->{flags}{noclockprobe} = 1 },
	UNSUPPORTED => sub { $card->{flags}{unsupported} = 1 },
	COMMENT => sub {},
    };

    foreach (<F>) { $lineno++;
	s/\s+$//;
	/^#/ and next;
	/^$/ and next;
	/^END/ and last;

	($cmd, $val) = /(\S+)\s*(.*)/ or next; #log::l("bad line $lineno ($_)"), next;

	my $f = $fs->{$cmd};

	$f ? &$f() : log::l("unknown line $lineno ($_)");
    }
    \%cards;
}
sub readCardsNames {
    my $file = "/usr/X11R6/lib/X11/CardsNames";
    local *F; open F, $file or die "can't find $file\n";
    map { (split '=>')[0] } <F>;
}
sub cardName2RealName {
    my $file = "/usr/X11R6/lib/X11/CardsNames";
    my ($name) = @_;
    local *F; open F, $file or die "can't find $file\n";
    foreach (<F>) { chop;
	my ($name_, $real) = split '=>';
	return $real if $name eq $name_;
    }
    $name;
}
sub updateCardAccordingName {
    my ($card, $name) = @_;
    my $cards = readCardsDB("/usr/X11R6/lib/X11/Cards+");

    add2hash($card->{flags}, $cards->{$name}{flags});
    add2hash($card, $cards->{$name});
    $card;
}

sub readMonitorsDB {
    my ($file) = @_;

    %monitors and return;

    local *F;
    open F, $file or die "can't open monitors database ($file): $!";
    my $lineno = 0; foreach (<F>) {
	$lineno++;
	s/\s+$//;
	/^#/ and next;
	/^$/ and next;

	my @fields = qw(vendor type eisa hsyncrange vsyncrange);
	my @l = split /\s*;\s*/;
	@l == @fields or log::l("bad line $lineno ($_)"), next;

	my %l; @l{@fields} = @l;
	if ($monitors{$l{type}}) {
	    my $i; for ($i = 0; $monitors{"$l{type} ($i)"}; $i++) {}
	    $l{type} = "$l{type} ($i)";
	}
	$monitors{"$l{vendor}|$l{type}"} = \%l;
    }
    while (my ($k, $v) = each %standard_monitors) {
	$monitors{'Generic|' . translate($k)} =
	    { hsyncrange => $v->[1], vsyncrange => $v->[2] };
    }
}

sub rewriteInittab {
    my ($runlevel) = @_;
    my $f = "$prefix/etc/inittab";
    -r $f or log::l("missing inittab!!!"), return;
    substInFile { s/^(id:)[35](:initdefault:)\s*$/$1$runlevel$2\n/ } $f;
}

sub keepOnlyLegalModes {
    my ($card, $monitor) = @_;
    my $mem = 1024 * ($card->{memory} || ($card->{server} eq 'FBDev' ? 2048 : 99999));
    my $hsync = max(split(/[,-]/, $monitor->{hsyncrange}));

    while (my ($depth, $res) = each %{$card->{depth}}) {
	@$res = grep {
	    $mem >= product(@$_, $depth / 8) &&
	    $hsync >= ($min_hsync4wres{$_->[0]} || 0) &&
	    ($card->{server} ne 'FBDev' || $vgamodes{"$_->[0]x$_->[1]x$depth"})
	} @$res;
	delete $card->{depth}{$depth} if @$res == 0;
    }
}

sub cardConfigurationAuto() {
    my $card;
    if (my ($c) = grep { $_->{driver} =~ /(Card|Server):/ } detect_devices::probeall()) {
	local $_ = $c->{driver};
	$card->{type} = $1 if /Card:(.*)/;
	$card->{server} = $1 if /Server:(.*)/;
	$card->{flags}{needVideoRam} &&= /86c368/;
	$card->{identifier} = $c->{description};
	push @{$card->{lines}}, @{$lines{$card->{identifier}} || []};
    }
    #- take a default on sparc if nothing has been found.
    if (arch() =~ /^sparc/ && !$card->{server} && !$card->{type}) {
        log::l("Using probe with /proc/fb as nothing has been found!");
	local $_ = cat_("/proc/fb");
	if (/Mach64/) { $card->{server} = "Mach64" }
	elsif (/Permedia2/) { $card->{server} = "3DLabs" }
	else { $card->{server} = "Sun24" }
    }
    $card;
}

sub cardConfiguration(;$$$) {
    my ($card, $noauto, $allowFB) = @_;
    $card ||= {};

    updateCardAccordingName($card, $card->{type}) if $card->{type}; #- try to get info from given type
    undef $card->{type} unless $card->{server}; #- bad type as we can't find the server
    add2hash($card, cardConfigurationAuto()) unless $card->{server} || $noauto;
    $card->{server} = 'FBDev' unless !$allowFB || $card->{server} || $card->{type} || $noauto;
    $card->{type} = cardName2RealName($in->ask_from_treelist(_("Graphic card"), _("Select a graphic card"), '|', ['Other|Unlisted', readCardsNames()])) unless $card->{type} || $card->{server};
    undef $card->{type}, $card->{server} = $in->ask_from_list(_("X server"), _("Choose a X server"), $allowFB ? \@allservers : \@allbutfbservers ) if $card->{type} eq 'Other|Unlisted';

    updateCardAccordingName($card, $card->{type}) if $card->{type};
    add2hash($card, { vendor => "Unknown", board => "Unknown" });

    $card->{memory} = 4096,  delete $card->{depth} if $card->{driver} eq 'i810';
    $card->{memory} = 16384, delete $card->{depth} if $card->{chipset} =~ /PERMEDIA/ && $card->{memory} <= 1024;

    #- 3D acceleration configuration for XFree 3.3 using Utah-GLX.
    $card->{Utah_glx} = ($card->{identifier} =~ /Matrox.* G[24]00/ || #- 8bpp does not work.
			 $card->{identifier} =~ /Riva.*128/ ||
			 $card->{identifier} =~ /Rage X[CL]/ ||
			 $card->{identifier} =~ /Rage Mobility (?:P\/M|L) / ||
			 $card->{identifier} =~ /3D Rage (?:LT|Pro)/);
                         #- NOT WORKING $card->{type} =~ /Intel 810/);
    #- 3D acceleration configuration for XFree 3.3 using Utah-GLX but EXPERIMENTAL that may freeze the machine (FOR INFO NOT USED).
    $card->{Utah_glx_EXPERIMENTAL} = ($card->{type} =~ /RIVA TNT/ || #- all RIVA/GeForce comes from NVIDIA and may freeze (gltron).
				      #$card->{type} =~ /RIVA128/ ||
				      $card->{type} =~ /GeForce 256/ ||
				      $card->{type} =~ /S3 Savage3D/ || #- only this one is evoluting (expect a stable release ?)
				      #- $card->{type} =~ /S3 ViRGE/ || #- 15bits only
				      $card->{type} =~ /SiS /);
    #- 3D acceleration configuration for XFree 4.0 using DRI.
    $card->{DRI_glx} = ($card->{identifier} =~ /Voodoo [35]/ || $card->{identifier} =~ /Voodoo Banshee/ || #- 16bit only
			#$card->{identifier} =~ /Matrox.* G[24]00/ || #- prefer 16bit (24bit not well tested according to DRI)
			$card->{identifier} =~ /8281[05].* CGC/ || #- 16bit (Intel 810 & 815).
			$card->{identifier} =~ /Rage 128/); #- 16 and 32 bits, prefer 16bit as no DMA.

    #- check to use XFree 4.0 or XFree 3.3.
    $card->{use_xf4} = $card->{driver} && !$card->{flags}{unsupported};
    $card->{prefer_xf3} = ($card->{type} =~ /RIVA TNT/ ||
			   $card->{type} =~ /RIVA128/ ||
			   $card->{type} =~ /GeForce/ ||
			   $card->{type} =~ /NeoMagic /);

    #- basic installation, use of XFree 4.0 or XFree 3.3.
    my ($xf4_ver, $xf3_ver) = ("4.0.1", "3.3.6");
    my $xf3_tc = { text => _("XFree %s", $xf3_ver),
		   code => sub { $card->{Utah_glx} = $card->{DRI_glx} = ''; $card->{use_xf4} = '';
				 log::l("Using XFree $xf3_ver") } };
    my $msg = _("Which configuration of XFree do you want to have?");
    my @choices = $card->{use_xf4} ? (($card->{prefer_xf3} ? ($xf3_tc) : ()),
				      (!$card->{prefer_xf3} || $::expert ?
				       ({ text => _("XFree %s", $xf4_ver),
					  code => sub { $card->{Utah_glx} = $card->{DRI_glx} = '';
							log::l("Using XFree $xf4_ver") } }) : (),),
				      ($::expert && !$card->{prefer_xf3} ? ($xf3_tc) : ())) : ($xf3_tc);

    #- try to figure if 3D acceleration is supported
    #- by XFree 3.3 but not XFree 4.0 then ask user to keep XFree 3.3 ?
    if ($card->{Utah_glx}) {
	$msg = ($card->{use_xf4} && !$card->{DRI_glx} ?
_("Your card can have 3D hardware acceleration support but only with XFree %s.
Your card is supported by XFree %s which may have a better support in 2D.", $xf3_ver, $xf4_ver) :
_("Your card can have 3D hardware acceleration support with XFree %s.", $xf3_ver)) . "\n\n\n" . $msg;
	$::beginner and @choices = (); #- keep it by default here as it is the only choice available.
	unshift @choices, { text => _("XFree %s with 3D hardware acceleration", $xf3_ver),
			    code => sub { $card->{use_xf4} = '';
					  log::l("Using XFree $xf3_ver with 3D hardware acceleration") } };
    }

    #- an expert user may want to try to use an EXPERIMENTAL 3D acceleration, currenlty
    #- this is with Utah GLX and so, it can provide a way of testing.
    if ($::expert && $card->{Utah_glx_EXPERIMENTAL}) {
	$msg = ($card->{use_xf4} && !$card->{DRI_glx} ?
_("Your card can have 3D hardware acceleration support but only with XFree %s,
NOTE THIS IS EXPERIMENTAL SUPPORT AND MAY FREEZE YOUR COMPUTER.
Your card is supported by XFree %s which may have a better support in 2D.", $xf3_ver, $xf4_ver) :
_("Your card can have 3D hardware acceleration support with XFree %s,
NOTE THIS IS EXPERIMENTAL SUPPORT AND MAY FREEZE YOUR COMPUTER.", $xf3_ver)) . "\n\n\n" . $msg;
	push @choices, { text => _("XFree %s with EXPERIMENTAL 3D hardware acceleration", $xf3_ver),
			 code => sub { $card->{use_xf4} = ''; $card->{Utah_glx} = 'EXPERIMENTAL';
				       log::l("Using XFree $xf3_ver with EXPERIMENTAL 3D hardware acceleration") } };
    }

    #- ask the expert user to enable or not hardware acceleration support.
    if ($card->{use_xf4} && $card->{DRI_glx}) {
	$msg = _("Your card can have 3D hardware acceleration support with XFree %s.", $xf4_ver) . "\n\n\n" . $msg;
	$::expert or @choices = (); #- keep all user by default with XFree 4.0 including 3D acceleration.
	unshift @choices, { text => _("XFree %s with 3D hardware acceleration", $xf4_ver),
			    code => sub { log::l("Using XFree $xf4_ver with 3D hardware acceleration") } };
    }

    #- examine choice of user, beware the list MUST NOT BE REORDERED AS the first item should be the
    #- proposed one by DrakX.
    my $tc = $in->ask_from_listf(_("XFree configuration"), formatAlaTeX($msg), sub { translate($_[0]{text}) }, \@choices);
    $tc->{code} and $tc->{code}();

    $card->{prog} = "/usr/X11R6/bin/" . ($card->{use_xf4} ? 'XFree86' : $card->{server} =~ /Sun (.*)/x ?
					 "Xsun$1" : "XF86_$card->{server}");

    #- additional packages to install according available card.
    #- add XFree86-libs-DRI here if using DRI (future split of XFree86 TODO)
    my @l = ();
    if ($card->{DRI_glx}) {
	push @l, 'Glide_V5' if $card->{identifier} =~ /Voodoo 5/;
	push @l, 'Glide_V3-DRI' if $card->{identifier} =~ /Voodoo (3|Banshee)/;
	push @l, 'Device3Dfx', 'XFree86-glide-module' if $card->{identifier} =~ /Voodoo/;
    }
    if ($card->{Utah_glx}) {
	push @l, 'Mesa' if !$card->{use_xf4};
    }

    -x "$prefix$card->{prog}" or $install && do {
	$in->suspend;
	&$install('server', @l) if $card->{use_xf4};
	&$install($card->{server}, @l) if !$card->{use_xf4};
	$in->resume;
    };
    -x "$prefix$card->{prog}" or die "server $card->{server} is not available (should be in $prefix$card->{prog})";

    $card->{options}{sw_cursor} = 1 if $card->{type} =~ /S3 Trio3D/;
    unless ($card->{type}) {
	$card->{flags}{noclockprobe} = member($card->{server}, qw(I128 S3 S3V Mach64));
    }
    $card->{options_xf3}{power_saver} = 1;
    $card->{options_xf4}{DPMS} = 1;

    $card->{flags}{needVideoRam} and
      $card->{memory} ||=
	$videomemory{$in->ask_from_list_('',
					 _("Select the memory size of your graphic card"),
					 [ sort { $videomemory{$a} <=> $videomemory{$b} }
					   keys %videomemory])};


    #- hack for ATI Mach64 card where two options should be used if using Utah-GLX.
    if ($card->{identifier} =~ /Rage X[CL]/ ||
	$card->{identifier} =~ /Rage Mobility (?:P\/M|L) / ||
	$card->{identifier} =~ /3D Rage (?:LT|Pro)/) {
	$card->{options_xf3}{no_font_cache} = $card->{Utah_glx};
	$card->{options_xf3}{no_pixmap_cache} = $card->{Utah_glx};
    }

    #- 3D acceleration configuration for XFree 4.0 using DRI, this is enabled by default
    #- but for some there is a need to specify VideoRam (else it won't run).
    if ($card->{DRI_glx}) {
	$card->{identifier} =~ /Matrox.* G[24]00/ and $card->{flags}{needVideoRam} = 'fakeVideoRam';
	$card->{identifier} =~ /8281[05].* CGC/ and ($card->{flags}{needVideoRam}, $card->{memory}) = ('fakeVideoRam', 16384);
    }

    if (!$::isStandalone && $card->{driver} eq 'i810') {
	require modules;
	eval { modules::load("agpgart"); };
    }
    $card;
}

sub optionsConfiguration($) {
    my ($o) = @_;
    my @l;