Revision: 5963
Author: pebender
Date: Wed Dec 16 15:57:26 2009
Log: - Obsoleted MM_LIRC_DEVICE_LIST as the change to udev hotplug makes it  
obsolete.


http://code.google.com/p/minimyth/source/detail?r=5963

Modified:
   
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/bdremote.pm
   
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/MM_LIRC.pm
   
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/obsolete
   
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/iguanair.pm
   
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/irtrans.pm
   
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/lirc.pm

=======================================
---  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/bdremote.pm
   
Mon Dec 14 18:28:54 2009
+++  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/bdremote.pm
   
Wed Dec 16 15:57:26 2009
@@ -13,26 +13,14 @@
      my $self     = shift;
      my $minimyth = shift;

-    my $device = undef;
-    my $driver = undef;
-
-    my @device_list = split(/ +/,  
$minimyth->var_get('MM_LIRC_DEVICE_LIST'));
-    foreach my $device_item (@device_list)
-    {
-        ($device, $driver, undef) = split(/,/, $device_item);
-        if ($driver eq 'bdremote')
-        {
-            last;
-        }
-    }
-    if ($driver eq 'bdremote')
+    if ($minimyth->var_get('MM_LIRC_DRIVER') eq 'bdremote')
      {
          $minimyth->message_output('info', "starting Sony PS3 Blu-ray Disc  
Remote Control daemon ...");

          my $daemon = '/usr/sbin/bdremoteng';
          $daemon = $daemon . " -l";
          $daemon = $daemon . " -E";
-        $daemon = $daemon . " -a $device";
+        $daemon = $daemon . " -a " . $minimyth->var_get('MM_LIRC_DEVICE');
          $daemon = $daemon . " -t 30";
          $daemon = $daemon . " -p 8765";
          system(qq($daemon));
=======================================
---  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/MM_LIRC.pm
       
Mon Dec 14 22:52:22 2009
+++  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/MM_LIRC.pm
       
Wed Dec 16 15:57:26 2009
@@ -554,68 +554,6 @@
      value_file     => 'yes',
      file           => {name_remote => '/lircrc.xine',
                         name_local  => '/etc/lirc/lircrc.d/xine'}
-};
-$var_list{'MM_LIRC_DEVICE_LIST'} =
-{
-    prerequisite   =>  
['MM_LIRC_AUTO_ENABLED', 'MM_LIRC_DEVICE_BLACKLIST', 'MM_LIRC_DEVICE', 
'MM_LIRC_FETCH_LIRCD_CONF'],
-    value_default  => 'auto',
-    value_valid    => 'auto|.+',
-    value_auto     => sub
-    {
-        my $minimyth = shift;
-        my $name     = shift;
-
-        my @device_list;
-
-        # Create the LIRC device list.
-        {
-            my $device     =  
$minimyth->device_canonicalize($minimyth->var_get('MM_LIRC_DEVICE'));
-            my $driver     = $minimyth->var_get('MM_LIRC_DRIVER');
-            my $lircd_conf = q(/etc/lirc/lircd.conf);
-            if (($device) && ($driver))
-            {
-                push(@device_list, "$device,$driver,$lircd_conf");
-            }
-            if ($minimyth->var_get('MM_LIRC_AUTO_ENABLED') eq 'yes')
-            {
-                foreach my $item (@{$minimyth->detect_state_get('lirc')})
-                {
-                    my $device =      
$minimyth->device_canonicalize($item->{'device'});
-                    my $driver     = $item->{'driver'};
-                    my $lircd_conf = $item->{'lircd_conf'};
-                    if ((! $lircd_conf) ||  
($minimyth->var_get('MM_LIRC_FETCH_LIRCD_CONF') eq 'yes'))
-                    {
-                        $lircd_conf = q(/etc/lirc/lircd.conf);
-                    }
-                    if (($device) && ($driver))
-                    {
-                        push(@device_list, "$device,$driver,$lircd_conf");
-                    }
-                }
-            }
-            # Remove any duplicates.
-            {
-                my $prev = '';
-                @device_list = grep($_ ne $prev && (($prev) = $_),  
sort(@device_list));
-            }
-        }
-
-        if ($minimyth->var_get('MM_LIRC_DEVICE_BLACKLIST'))
-        {
-            my @blacklist = ();
-            foreach my $item (split(/  +/,  
$minimyth->var_get('MM_LIRC_DEVICE_BLACKLIST')))
-            {
-                if ($item)
-                {
-                    push(@blacklist,  
$minimyth->device_canonicalize($item));
-                }
-            }
-            my $blacklist_filter = join('|', @blacklist);
-            @device_list = grep(! /^($blacklist_filter),.+$/,  
@device_list);
-        }
-
-        return join(' ', @device_list);
-    }
  };
  $var_list{'MM_LIRC_LIRCM_DEVICE'} =
  {
@@ -638,7 +576,7 @@
  };
  $var_list{'MM_LIRC_KERNEL_MODULE_LIST'} =
  {
-    prerequisite   =>  
['MM_LIRC_KERNEL_MODULE', 'MM_LIRC_KERNEL_MODULE_OPTIONS', 
'MM_LIRC_AUTO_ENABLED', 'MM_LIRC_DEVICE_LIST', 'MM_LIRC_FETCH_LIRCMD_CONF'],
+    prerequisite   =>  
['MM_LIRC_KERNEL_MODULE', 'MM_LIRC_KERNEL_MODULE_OPTIONS', 
'MM_LIRC_AUTO_ENABLED', 'MM_LIRC_DRIVER', 'MM_LIRC_FETCH_LIRCMD_CONF'],
      value_clean    => sub
      {
          my $minimyth = shift;
@@ -661,9 +599,9 @@
          {
              push(@kernel_modules,  
$minimyth->var_get('MM_LIRC_KERNEL_MODULE'));
          }
-        # Since we have drivers,
+        # Since we have a configured device,
          # MiniMyth will be starting lircd and lircudevd, both of which  
require uinput.
-        if ($minimyth->var_get('MM_LIRC_DEVICE_LIST') ne '')
+        if ($minimyth->var_get('MM_LIRC_DRIVER') ne '')
          {
              push(@kernel_modules, 'uinput');
          }
=======================================
---  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/obsolete
         
Tue May 19 17:34:52 2009
+++  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/obsolete
         
Wed Dec 16 15:57:26 2009
@@ -28,6 +28,7 @@
  MM_HARDWARE_SOUTHBRIDGE
  MM_HARDWARE_TV
  MM_HOSTNAME
+MM_LIRC_DEVICE_LIST
  MM_LIRC_REMOTE
  MM_LIRC_SLEEP_X_RESTART_ENABLED
  MM_LOG_SERVERS
=======================================
---  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/iguanair.pm
   
Fri May 29 13:27:53 2009
+++  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/iguanair.pm
   
Wed Dec 16 15:57:26 2009
@@ -13,17 +13,7 @@
      my $self     = shift;
      my $minimyth = shift;

-    my $igdaemon_enabled = 'no';
-    my @device_list = split(/ +/,  
$minimyth->var_get('MM_LIRC_DEVICE_LIST'));
-    foreach my $device_item (@device_list)
-    {
-        my (undef, $driver, undef) = split(/,/, $device_item);
-        if ($driver eq 'iguanaIR')
-        {
-            $igdaemon_enabled = 'yes';
-        }
-    }
-    if ($igdaemon_enabled eq 'yes')
+    if ($minimyth->var_get('MM_LIRC_DRIVER') eq 'iguanaIR')
      {
          $minimyth->message_output('info', "starting iguanaIR daemon ...");
          system('/usr/bin/igdaemon',
=======================================
---  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/irtrans.pm
    
Mon Jan 12 13:18:38 2009
+++  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/irtrans.pm
    
Wed Dec 16 15:57:26 2009
@@ -19,16 +19,13 @@
          if ($minimyth->var_get('MM_LCDPROC_DEVICE'))
          {
              $minimyth->message_output('info', "starting IRTrans  
server ...");
-            # Use IRTrans server's LIRC support if
-            # either the LIRC driver is 'irtrans',
-            # or there is no other LIRC device.
-            if (($minimyth->var_get('MM_LIRC_DRIVER') eq 'irtrans') ||
-                (! $minimyth->var_get('MM_LIRC_DEVICE_LIST')))
+            # Use IRTrans server's LIRC support if LIRC driver  
is 'irtrans'.
+            if ($minimyth->var_get('MM_LIRC_DRIVER') eq 'irtrans')
              {
                  system('/usr/sbin/irserver',
                         '-logfile', '/var/log/irserver',
-                      '-pidfile', '/var/run/irserver.pid',
-                      '-daemon',
+                       '-pidfile', '/var/run/irserver.pid',
+                       '-daemon',
                         $minimyth->var_get('MM_LCDPROC_DEVICE'));
              }
              else
@@ -36,8 +33,8 @@
                  system('/usr/sbin/irserver',
                         '-no_lirc',
                         '-logfile', '/var/log/irserver',
-                      '-pidfile', '/var/run/irserver.pid',
-                      '-daemon',
+                       '-pidfile', '/var/run/irserver.pid',
+                       '-daemon',
                         $minimyth->var_get('MM_LCDPROC_DEVICE'));
              }
          }
=======================================
---  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/lirc.pm
       
Tue Dec 15 10:48:23 2009
+++  
/trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/lirc.pm
       
Wed Dec 16 15:57:26 2009
@@ -12,7 +12,6 @@
  use File::Path ();
  use MiniMyth ();

-                my $dir = File::Basename::dirname($_);
  sub _remote_wakeup_enable
  {
      my $self   = shift;
@@ -68,11 +67,9 @@
      my $self     = shift;
      my $minimyth = shift;

-    my @device_list = split(/ +/,  
$minimyth->var_get('MM_LIRC_DEVICE_LIST'));
-
-    # There are no remote control devices and we will not auto-detect any  
later, so there is no need to continue.
-    if ((($#device_list + 1) <= 0) &&
-        ($minimyth->var_get('MM_LIRC_AUTO_ENABLED') == 'no'))
+    # There are is no configured remote control device and we will not  
auto-detect any later, so there is no need to continue.
+    if ( ($minimyth->var_get('MM_LIRC_DRIVER')       eq ''  ) &&
+         ($minimyth->var_get('MM_LIRC_AUTO_ENABLED') eq 'no') )
      {
          return 1;
      }
@@ -85,32 +82,21 @@
      File::Path::mkpath('/var/run/lirc', { mode => 0755 });
      chmod(0755, '/var/run/lirc');

-    # Enable wakeup and start an LIRC daemon for each device.
-    foreach my $device_item (@device_list)
-    {
-        my @device_args = split(/,/, $device_item);
-        my $device     = $device_args[0];
-        my $driver     = $device_args[1];
-        my $lircd_conf = $device_args[2];
-
-        if ((! $device) || (! $driver))
-        {
-            next;
-        }
+    # Start an lircd instance associated with the device unless the device  
is
+    # handled by a daemon other than lircd.
+    my $driver = $minimyth->var_get('MM_LIRC_DRIVER');
+    if (($driver !~ /^bdremote$/) &&
+        ($driver !~ /^irtrans$/ ) )
+    {
+        my $device = $minimyth->var_get('MM_LIRC_DEVICE');

          # Convert the driver to the lirc daemon appropriate driver.
-        if    (($driver) && ($driver =~ /^bdremote$/))
-        {
-        }
-        elsif (($driver) && ($driver =~ /^irtrans$/))
-        {
-        }
-        elsif (($driver) && (open(FILE, '-|', '/usr/sbin/lircd  
--driver=help 2>&1')))
+        if (($driver) && (open(FILE, '-|', '/usr/sbin/lircd --driver=help  
2>&1')))
          {
              my $driver_actual = 'default';
              while (<FILE>)
              {
-               chomp;
+                chomp;
                  s/[[:cntrl:]]//g;
                  if (/^$driver$/)
                  {
@@ -126,23 +112,19 @@
              $self->_remote_wakeup_enable($device);
          }

-        # Start an lircd instance associated with the device the device is
-        # handled by a unless a daemon other than lircd.
-        if ( ($driver !~ /^bdremote$/) &&
-             ($driver !~ /^irtrans$/ ) )
-        {
-            my $instance = $device;
-            $instance =~ s/\/+/~/g;
-            $instance =~ s/^~dev~//;
-            my $daemon = '/usr/sbin/lircd';
-            $daemon = $daemon . " --driver=$driver";
-            $daemon = $daemon . " --device=$device";
-            $daemon = $daemon . " --output=/var/run/lirc/lircd-$instance  
--pidfile=/var/run/lirc/lircd-$instance.pid";
-            $daemon = $daemon . " --uinput";
-            $daemon = $daemon . " $lircd_conf";
-            $minimyth->message_log('info', "started '$daemon'.");
-            system(qq($daemon));
-        }
+        # Start the lircd daemon.
+        my $instance = $device;
+        $instance =~ s/\/+/~/g;
+        $instance =~ s/^~dev~//;
+        my $daemon = '/usr/sbin/lircd';
+        $daemon = $daemon . " --driver=$driver";
+        $daemon = $daemon . " --device=$device";
+        $daemon = $daemon . " --output=/var/run/lirc/lircd-$instance  
--pidfile=/var/run/lirc/lircd-$instance.pid";
+        $daemon = $daemon . " --uinput";
+        $daemon = $daemon . " /etc/lirc/lircd.conf";
+
+        $minimyth->message_log('info', "started '$daemon'.");
+        system(qq($daemon));
      }

      # Start the lircudevd daemon.

--

You received this message because you are subscribed to the Google Groups 
"minimyth-commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/minimyth-commits?hl=en.


Reply via email to