From 142593316e874567dfaa7164a6a7c36d46ea7f30 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 21 Mar 2008 16:47:39 +0000 Subject: notify when harddrake switched to free video driver (#39164) --- perl-install/standalone/notify-x11-free-driver-switch | 16 ++++++++++++++++ .../standalone/notify-x11-free-driver-switch.xsetup | 9 +++++++++ perl-install/standalone/service_harddrake | 1 + 3 files changed, 26 insertions(+) create mode 100755 perl-install/standalone/notify-x11-free-driver-switch create mode 100755 perl-install/standalone/notify-x11-free-driver-switch.xsetup (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/notify-x11-free-driver-switch b/perl-install/standalone/notify-x11-free-driver-switch new file mode 100755 index 000000000..fd43416a1 --- /dev/null +++ b/perl-install/standalone/notify-x11-free-driver-switch @@ -0,0 +1,16 @@ +#!/usr/bin/perl +use lib qw(/usr/lib/libDrakX); +use standalone; +use interactive; +use common; + +$::isStandalone = 0; +my $in = 'interactive'->vnew; +my $driver = eval { + require Xconfig::xfree; + $raw_X = Xconfig::xfree->read; + $raw_X->get_Driver; +} || N("unknown"); + +$in->ask_warn(N("Warning"), N("The proprietary driver for your graphic card can not be found, the system is now using the free software driver (%s).", $driver)); +unlink $0 if $0 =~ m!/etc/X11/xsetup.d/!; diff --git a/perl-install/standalone/notify-x11-free-driver-switch.xsetup b/perl-install/standalone/notify-x11-free-driver-switch.xsetup new file mode 100755 index 000000000..b3a1d562d --- /dev/null +++ b/perl-install/standalone/notify-x11-free-driver-switch.xsetup @@ -0,0 +1,9 @@ +#!/bin/sh +# (c) 2005-2008 Mandriva SA +# to be sourced + +LOCK=/var/run/harddrake-notify-x11-free-driver-switch; +if [ -f $LOCK ]; then + /usr/share/harddrake/notify-x11-free-driver-switch + rm -f $LOCK; +fi diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 1affd75e9..1788481cf 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -75,6 +75,7 @@ foreach my $card (@cards) { substInFile { $new_driver = $1 if s!Driver "($card->{xorg_driver_regexp})"!Driver "$driver"!g } '/etc/X11/xorg.conf'; if ($new_driver) { log::explanations("switch X.org driver from $new_driver to $driver"); + touch('/var/run/harddrake-notify-x11-free-driver-switch'); Xconfig::card::libgl_config_and_more({ Driver => $driver }); } } -- cgit v1.2.1