diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/Makefile.config | 2 | ||||
-rw-r--r-- | perl-install/Makefile.drakxtools | 2 | ||||
-rw-r--r-- | perl-install/Xconfig/monitor.pm | 34 | ||||
-rw-r--r-- | perl-install/Xconfig/resolution_and_depth.pm | 2 | ||||
-rw-r--r-- | perl-install/Xconfig/various.pm | 6 | ||||
-rw-r--r-- | perl-install/Xconfig/xfree.pm | 103 | ||||
-rw-r--r-- | perl-install/any.pm | 31 | ||||
-rw-r--r-- | perl-install/drakxtools.spec | 6 | ||||
-rw-r--r-- | perl-install/install2.pm | 3 | ||||
-rw-r--r-- | perl-install/share/list | 4 |
10 files changed, 133 insertions, 60 deletions
diff --git a/perl-install/Makefile.config b/perl-install/Makefile.config index 9fa6980c6..940ac2d32 100644 --- a/perl-install/Makefile.config +++ b/perl-install/Makefile.config @@ -14,7 +14,7 @@ ROOTDEST = /export DEST = $(STAGE2_LIVE) DESTREP4PMS = $(DEST)$(REP4PMS) PERL = perl -LOCALFILES = $(patsubst %, ../tools/%,ddcprobe/ddcxinfos serial_probe/serial_probe xhost+) +LOCALFILES = $(patsubst %, ../tools/%,serial_probe/serial_probe xhost+) DIRS = c Newt resize_fat xf86misc #po CFLAGS = -Wall override CFLAGS += -pipe diff --git a/perl-install/Makefile.drakxtools b/perl-install/Makefile.drakxtools index ec1383ba0..ccc8eb77d 100644 --- a/perl-install/Makefile.drakxtools +++ b/perl-install/Makefile.drakxtools @@ -31,7 +31,7 @@ install: mkdir -p $(BINDEST) $(ETCDEST) $(SBINDEST) $(DATADIR)/{harddrake,pixmaps,icons/{large,mini},autostart} $(BINX11DEST) $(LIBX11DEST) $(PIXDIR) $(INITDIR) $(MENUDIR) install -d $(INLIBDEST_DIRS:%=$(LIBDEST)/%) install $(STANDALONEPMS) standalone/service_harddrake.sh standalone/convert $(SBINDEST) - install -s rpcinfo-flushed ddcprobe/ddcxinfos serial_probe/serial_probe $(SBINDEST) + install -s rpcinfo-flushed serial_probe/serial_probe $(SBINDEST) ln -s ../../$(patsubst $(PREFIX)/usr%,%,$(SBINDEST))/XFdrake $(BINX11DEST)/Xdrakres ln -s fileshareset $(SBINDEST)/filesharelist mv -f $(SBINDEST)/lsnetdrake $(BINDEST) diff --git a/perl-install/Xconfig/monitor.pm b/perl-install/Xconfig/monitor.pm index ccd9b4c50..abd141236 100644 --- a/perl-install/Xconfig/monitor.pm +++ b/perl-install/Xconfig/monitor.pm @@ -64,7 +64,7 @@ sub configure_auto_install { put_in_hash($monitor, $auto_install_monitor); } $monitors, $old_X->{monitors} if $old_X->{monitors}; - if (!$monitors->[0]{HorizSync}) { + if (!$monitors->[0]{HorizSync} && !($monitors->[0]{VendorName} && $monitors->[0]{ModelName})) { put_in_hash($monitors->[0], getinfoFromDDC()); } @@ -171,27 +171,23 @@ sub configure_automatic { } sub getinfoFromDDC() { - my ($VideoRam, @l) = any::ddcxinfos() or return; + my ($edid, $vbe) = any::monitor_full_edid() or return; + my $monitor = eval($edid); - my @Modes; - local $_; - while (($_ = shift @l) ne "\n") { - my ($depth, $x, $y) = split; - $depth = int(log($depth) / log(2)) if $depth; - - push @Modes, [ $x, $y, $depth ]; + if ($vbe =~ /Memory: (\d+)k/) { + $monitor->{VideoRam_probed} = $1; + } + $monitor->{ModeLine} = Xconfig::xfree::default_ModeLine(); + foreach (@{$monitor->{detailed_timings} || []}) { + unshift @{$monitor->{ModeLine}}, + { val => $_->{ModeLine}, pre_comment => $_->{ModeLine_comment} . "\n" }; } - my ($h, $v, $size, @_modes) = @l; - { - VideoRam_probed => to_int($VideoRam), - HorizSync => first($h =~ /^(\S*)/), - VertRefresh => first($v =~ /^(\S*)/), - size => to_float($size), - if_($size =~ /EISA ID=(\S*)/, EISA_ID => lc($1), VendorName => "Plug'n Play"), - #- not-used-anymore Modes => \@Modes, - #- not-used-anymore ModeLines => join('', @m), - }; + if ($monitor->{EISA_ID}) { + $monitor->{VendorName} = "Plug'n Play"; + $monitor->{ModelName} = $monitor->{monitor_name}; + } + $monitor; } sub monitors_db() { diff --git a/perl-install/Xconfig/resolution_and_depth.pm b/perl-install/Xconfig/resolution_and_depth.pm index 4f06c3647..9287ddce4 100644 --- a/perl-install/Xconfig/resolution_and_depth.pm +++ b/perl-install/Xconfig/resolution_and_depth.pm @@ -144,7 +144,7 @@ sub choices { @resolutions = filter_using_VideoRam($card->{VideoRam}, @resolutions) if $card->{VideoRam}; my $x_res = do { - my $res = $resolution_wanted->{X} || ($monitors->[0]{ModelName} =~ /^Flat Panel (\d+x\d+)$/ ? $1 : size2default_resolution($monitors->[0]{size} || 14)); + my $res = $resolution_wanted->{X} || ($monitors->[0]{ModelName} =~ /^Flat Panel (\d+x\d+)$/ ? $1 : size2default_resolution($monitors->[0]{diagonal_size} * 1.08 || 14)); my $x_res = first(split 'x', $res); #- take the first available resolution <= the wanted resolution max map { if_($_->{X} <= $x_res, $_->{X}) } @resolutions; diff --git a/perl-install/Xconfig/various.pm b/perl-install/Xconfig/various.pm index 657c26b2f..6a8a93551 100644 --- a/perl-install/Xconfig/various.pm +++ b/perl-install/Xconfig/various.pm @@ -107,13 +107,13 @@ sub configure_FB_TVOUT { my $raw_X = Xconfig::default::configure($do_pkgs); return if is_empty_array_ref($raw_X); - $raw_X->set_monitors({ HorizSync => '30-50', VertRefresh => ($use_FB_TVOUT->{norm} eq 'NTSC' ? 60 : 50) }); - first($raw_X->get_Sections('Monitor'))->{ModeLine} = [ + $raw_X->set_monitors({ HorizSync => '30-50', VertRefresh => ($use_FB_TVOUT->{norm} eq 'NTSC' ? 60 : 50), + ModeLine => [ { val => '"640x480" 29.50 640 675 678 944 480 530 535 625', pre_comment => "# PAL\n" }, { val => '"800x600" 36.00 800 818 820 960 600 653 655 750' }, { val => '"640x480" 28.195793 640 656 658 784 480 520 525 600', pre_comment => "# NTSC\n" }, { val => '"800x600" 38.769241 800 812 814 880 600 646 649 735' }, - ]; + ] }); $raw_X->set_devices({ Driver => 'fbdev' }); my ($device) = $raw_X->get_devices; diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm index d66c6634d..365343ee2 100644 --- a/perl-install/Xconfig/xfree.pm +++ b/perl-install/Xconfig/xfree.pm @@ -258,7 +258,7 @@ sub set_synaptics { ################################################################################ # monitor ###################################################################### ################################################################################ -my @monitor_fields = qw(VendorName ModelName HorizSync VertRefresh); +my @monitor_fields = qw(VendorName ModelName HorizSync VertRefresh ModeLine); sub get_monitors { my ($raw_X) = @_; my @raw_monitors = $raw_X->get_Sections('Monitor'); @@ -285,9 +285,11 @@ sub get_or_new_monitors { } sub _new_monitor_sections { my ($raw_X, $nb_new) = @_; - my $ModeLine = ModeLine_from_string(qq(Section "Monitor"\n) . (our $default_ModeLine) . qq(EndSection\n)); $raw_X->remove_Section('Monitor'); - map { $raw_X->add_Section('Monitor', { Identifier => { val => "monitor$_" }, ModeLine => $ModeLine }) } (1 .. $nb_new); + map { $raw_X->add_Section('Monitor', { Identifier => { val => "monitor$_" }, ModeLine => default_ModeLine() }) } (1 .. $nb_new); +} +sub default_ModeLine() { + ModeLine_from_string(qq(Section "Monitor"\n) . (our $default_ModeLine) . qq(EndSection\n)); } @@ -475,21 +477,90 @@ sub ModeLine_from_string { -our @resolutions = ( - '640x480', - '800x600', - '1024x480', '1024x768', - '1152x768', '1152x864', - '1280x800', # 16/10, - '1280x960', '1280x1024', - '1400x1050', - '1600x1200', - '1680x1050', # 16/10 - '1920x1200', # 16/10 - '1920x1440', - '2048x1536', +# http://home.comcast.net/~igpl/Aspect.html +# movies http://www.technosound.co.uk/nav.php?pageid=hcg_widescreen + +# www.dell.com/downloads/global/vectors/2003_cvt.pdf +# file vesamodes in Xorg is DMT Standard Display Modes + +# http://www.vesa.org/Public +# http://www.vesa.org/Public/EEDIDguideV1.pdf + +#- http://www.vesa.org/Public/CVT +our @CVT_ratios = qw(5/4 4/3 3/2 16/10 15/9 16/9); +our @CVT_vfreqs = qw(50 60 75 85); # and also 60Hz "reduced blanking" in CVT + +our @more_vfreq = qw(100 120); + +our %ratio2resolutions = ( + + # first all the CVT_ratios + + # 1.25 + '5/4' => [ qw(640x512 720x576 1280x1024 1800x1440) ], + + # 1.33 + '4/3' => [ + qw(320x240 480x360 640x480 800x600 832x624 + 1024x768 1152x864 1280x960 1400x1050 + 1600x1200 1920x1440 2048x1536), + ], + + # 1.5 + '3/2' => [ qw(360x240 720x480 1152x768) ], + + # 1.6 + '16/10' => [ qw(1280x800 1440x900 1600x1000 1680x1050 1920x1200) ], + + # 1.67 + '15/9' => [ qw(1280x768) ], + + # 1.78 + '16/9' => [ qw(1280x720 1600x900 1920x1080) ], + + + # now more weird things + + # 1.32 + # '192/145' => [ qw(1152x870) ], + + # 1.42 + # '17/12' => [ qw(544x384) ] , + + # 1.56 + # '25/16' => [ qw(1600x1024) ], + + # 1.775 + # '71/15' => [ qw(852x480) ], + + N_("_:weird aspect ratio\nother") => [ + # 2.13 = 32/15 + qw(1024x480), # VAIO + + # 2.67 = 8/3 + qw(2048x768 2560x960 3200x1200), + + # 4.0 = 4/1 + qw(3072x768 3456x864 3840x960 4800x1200), + + # ?? 352x288 + ], ); +our @resolutions; +foreach my $ratio (keys %ratio2resolutions) { + if ($ratio =~ m!^(\d+)/(\d+)$!) { + my $eval = $2 / $1; + foreach (@{$ratio2resolutions{$ratio}}) { + my ($x, $y) = /(\d+)x(\d+)/; + my $y2 = round($x * $eval); + $y == $y2 or die "bad resolution $_ for ratio $ratio, it should be $x x $y2\n"; + } + } + push @resolutions, @{$ratio2resolutions{$ratio}}; +} + + our $default_header = <<'END'; # File generated by XFdrake. diff --git a/perl-install/any.pm b/perl-install/any.pm index ad7552d37..f96322387 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -834,7 +834,7 @@ sub report_bug { header("partitions"), cat_("/proc/partitions"), header("cpuinfo"), cat_("/proc/cpuinfo"), header("syslog"), cat_("/tmp/syslog") || cat_("$::prefix/var/log/syslog"), - header("ddcxinfos"), ddcxinfos(), + header("monitor_full_edid"), monitor_full_edid(), header("stage1.log"), cat_("/tmp/stage1.log") || cat_("$::prefix/root/drakx/stage1.log"), header("ddebug.log"), cat_("/tmp/ddebug.log") || cat_("$::prefix/root/drakx/ddebug.log"), header("install.log"), cat_("$::prefix/root/drakx/install.log"), @@ -973,22 +973,27 @@ You can use userdrake to add a user to this group.") } } -sub ddcxinfos() { +sub monitor_full_edid() { return if $::noauto; - my @l; - run_program::raw({ timeout => 20 }, 'ddcxinfos', '>', \@l); - if ($::isInstall && -e "/tmp/ddcxinfos") { - my @l_old = cat_("/tmp/ddcxinfos"); - if (@l < @l_old) { - log::l("new ddcxinfos is worse, keeping the previous one"); - @l = @l_old; - } elsif (@l > @l_old) { - log::l("new ddcxinfos is better, dropping the previous one"); + my ($vbe, $edid); + run_program::raw({ timeout => 20 }, 'monitor-edid', '>', \$edid, '2>', \$vbe, '-v', '--perl'); + if ($::isInstall) { + foreach (['edid', \$edid], ['vbe', \$vbe]) { + my ($name, $val) = @$_; + if (-e "/tmp/$name") { + my $old = cat_("/tmp/$name"); + if (length($$val) < length($old)) { + log::l("new $name is worse, keeping the previous one"); + $$val = $old; + } elsif (length($$val) > length($old)) { + log::l("new $name is better, dropping the previous one"); + } + } + output("/tmp/$name", $$val); } } - output("/tmp/ddcxinfos", @l) if $::isInstall; - @l; + ($edid, $vbe); } sub running_window_manager() { diff --git a/perl-install/drakxtools.spec b/perl-install/drakxtools.spec index 1d06cc492..f5a8761a9 100644 --- a/perl-install/drakxtools.spec +++ b/perl-install/drakxtools.spec @@ -24,6 +24,7 @@ Summary: The drakxtools (XFdrake, diskdrake, keyboarddrake, mousedrake...) Group: System/Configuration/Other Requires: perl-base >= 2:5.8.6-1mdk, urpmi >= 4.6.13, modutils >= 2.3.11, usermode-consoleonly >= 1.44-4mdk, msec >= 0.38-5mdk Requires: %{name}-backend = %version-%release +Requires: monitor-edid Requires: netprofile Obsoletes: diskdrake kbdconfig mouseconfig printtool setuptool drakfloppy Provides: diskdrake, kbdconfig mouseconfig printtool setuptool, drakfloppy = %version-%release @@ -108,9 +109,6 @@ them work both under XFree (graphical environment) and in console adduserdrake: help you adding a user -ddcxinfos: get infos from the graphic card and print XF86Config -modlines - diskdrake: DiskDrake makes hard disk partitioning easier. It is graphical, simple and powerful. Different skill levels are available (newbie, advanced user, expert). It's written entirely in Perl and @@ -206,7 +204,7 @@ dirs1="usr/lib/libDrakX usr/share/libDrakX" perl -ni -e '/activefw\.pm|clock|drak(backup|bug|clock|floppy|font|log|net_monitor|perm|printer|sec|splash|TermServ)|gtk|icons|logdrake|net_applet|net_monitor|pixmaps|printer|xf86misc|\.png$/ ? print STDERR $_ : print' %{name}.list 2> %{name}-gtk.list perl -ni -e '/http/ ? print STDERR $_ : print' %{name}.list 2> %{name}-http.list -perl -ni -e 'm!lib/libDrakX|bootloader-config|fileshare|lsnetdrake|ddcxinfos|drakupdate_fstab|rpcinfo|serial_probe! && !/newt/i ? print STDERR $_ : print' %{name}.list 2> %{name}-backend.list +perl -ni -e 'm!lib/libDrakX|bootloader-config|fileshare|lsnetdrake|drakupdate_fstab|rpcinfo|serial_probe! && !/newt/i ? print STDERR $_ : print' %{name}.list 2> %{name}-backend.list #mdk menu entry mkdir -p $RPM_BUILD_ROOT/%_menudir diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 5c916e5bd..bd3d92b18 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -329,7 +329,7 @@ sub start_i810fb() { log::l("trying to load i810fb module with xres <$xres> (vga was <$vga>)"); eval { modules::load('intel-agp') }; eval { - any::ddcxinfos(); # keep the result otherwise ddcxinfos does not return good results afterwards + any::monitor_full_edid(); # keep the result otherwise monitor-edid does not return good results afterwards my $opt = "xres=$xres hsync1=32 hsync2=48 vsync1=50 vsync2=70 vram=2 bpp=16 accel=1 mtrr=1"; #- this sucking i810fb does not accept floating point numbers in hsync! modules::load_with_options([ 'i810fb' ], { i810fb => $opt }); }; @@ -450,7 +450,6 @@ sub main { $o->{prefix} = $::prefix = $::testing ? "/tmp/test-perl-install" : $::move ? "" : "/mnt"; mkdir $o->{prefix}, 0755; - devices::make("/dev/zero"); #- needed by ddcxinfos #- make sure we do not pick up any gunk from the outside world my $remote_path = "$o->{prefix}/sbin:$o->{prefix}/bin:$o->{prefix}/usr/sbin:$o->{prefix}/usr/bin:$o->{prefix}/usr/X11R6/bin"; diff --git a/perl-install/share/list b/perl-install/share/list index c9fe04595..11847d361 100644 --- a/perl-install/share/list +++ b/perl-install/share/list @@ -34,6 +34,9 @@ /usr/bin/packdrake /usr/bin/parsehdlist /usr/bin/perl +/usr/bin/monitor-parse-edid +/usr/sbin/monitor-edid +/usr/sbin/monitor-get-edid /usr/LIB/gconv/BIG5.so /usr/LIB/gconv/EUC-JP.so @@ -85,6 +88,7 @@ /usr/lib/perl5/PERL_VERSION/File/Spec.pm /usr/lib/perl5/PERL_VERSION/File/Spec/Unix.pm /usr/lib/perl5/PERL_VERSION/File/Temp.pm +/usr/lib/perl5/PERL_VERSION/Getopt/Long.pm /usr/lib/perl5/PERL_VERSION/PerlIO.pm /usr/lib/perl5/PERL_VERSION/SelectSaver.pm /usr/lib/perl5/PERL_VERSION/SelfLoader.pm |