Author: pebender
Date: Wed Jun 24 20:58:10 2009
New Revision: 5054
Modified:
trunk/gar-minimyth/html/minimyth/document-changelog.txt
trunk/gar-minimyth/html/minimyth/document-minimyth_conf.html
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/lirc.pm
Log:
- Moved autogeneration of /etc/lircd.conf and /etc/lircrc to earlier in
the init process.
Modified: trunk/gar-minimyth/html/minimyth/document-changelog.txt
==============================================================================
--- trunk/gar-minimyth/html/minimyth/document-changelog.txt (original)
+++ trunk/gar-minimyth/html/minimyth/document-changelog.txt Wed Jun 24
20:58:10 2009
@@ -18,6 +18,8 @@
in the init process.
- Moved wiimote's uinput kernel module detection and loading to earlier
in the init process.
+ - Moved autogeneration of /etc/lircd.conf and /etc/lircrc to earlier in
+ the init process.
Modified suspend/resume script (mm_sleep)
- Added hack to 'clear' NVidia HDMI output upon resume so that it does
not
Modified: trunk/gar-minimyth/html/minimyth/document-minimyth_conf.html
==============================================================================
--- trunk/gar-minimyth/html/minimyth/document-minimyth_conf.html
(original)
+++ trunk/gar-minimyth/html/minimyth/document-minimyth_conf.html Wed Jun
24
20:58:10 2009
@@ -2694,10 +2694,7 @@
Inidicate whether or not to fetch the
'<a
href="document-configure.html#lircrc_minimyth">lircrc.minimyth</a>'
file from the MiniMyth system's MiniMyth read-only
configuration directory.
- Valid values are
- 'yes' and 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='no',
- 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='yes',
- with 'no' the default.
+ Valid values are 'yes' and 'no', with 'no' the default.
</p>
</dd>
<dt
id="MM_LIRC_FETCH_LIRCRC_MYTHTV"><strong>MM_LIRC_FETCH_LIRCRC_MYTHTV</strong></dt>
@@ -2706,10 +2703,7 @@
Inidicate whether or not to fetch the
'<a
href="document-configure.html#lircrc_mythtv">lircrc.mythtv</a>'
file from the MiniMyth system's MiniMyth read-only
configuration directory.
- Valid values are
- 'yes' and 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='no',
- 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='yes',
- with 'no' the default.
+ Valid values are 'yes' and 'no', with 'no' the default.
</p>
</dd>
<dt
id="MM_LIRC_FETCH_LIRCRC_MPLAYER"><strong>MM_LIRC_FETCH_LIRCRC_MPLAYER</strong></dt>
@@ -2718,10 +2712,7 @@
Inidicate whether or not to fetch the
'<a
href="document-configure.html#lircrc_mplayer">lircrc.mplayer</a>'
file from the MiniMyth system's MiniMyth read-only
configuration directory.
- Valid values are
- 'yes' and 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='no',
- 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='yes',
- with 'no' the default.
+ Valid values are 'yes' and 'no', with 'no' the default.
</p>
</dd>
<dt
id="MM_LIRC_FETCH_LIRCRC_VLC"><strong>MM_LIRC_FETCH_LIRCRC_VLC</strong></dt>
@@ -2730,10 +2721,7 @@
Inidicate whether or not to fetch the
'<a
href="document-configure.html#lircrc_vlc">lircrc.vlc</a>'
file from the MiniMyth system's MiniMyth read-only
configuration directory.
- Valid values are
- 'yes' and 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='no',
- 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='yes',
- with 'no' the default.
+ Valid values are 'yes' and 'no', with 'no' the default.
</p>
</dd>
<dt
id="MM_LIRC_FETCH_LIRCRC_XINE"><strong>MM_LIRC_FETCH_LIRCRC_XINE</strong></dt>
@@ -2742,10 +2730,7 @@
Inidicate whether or not to fetch the
'<a
href="document-configure.html#lircrc_xine">lircrc.xine</a>'
file from the MiniMyth system's MiniMyth read-only
configuration directory.
- Valid values are
- 'yes' and 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='no',
- 'no' when <a
href="#MM_LIRC_FETCH_LIRCRC">MM_LIRC_LIRCRC</a>='yes',
- with 'no' the default.
+ Valid values are 'yes' and 'no', with 'no' the default.
</p>
</dd>
</dl>
Modified:
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/MM_LIRC.pm
(original)
+++
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/conf/MM_LIRC.pm
Wed Jun 24 20:58:10 2009
@@ -151,34 +151,94 @@
};
$var_list{'MM_LIRC_IREXEC_ENABLED'} =
{
+ prerequisite => [ 'MM_LIRC_FETCH_LIRCRC' ],
value_default => 'auto',
value_valid => 'auto|no|yes',
value_auto => sub
{
- if (-e '/usr/bin/irexec')
- {
- return 'auto';
- }
- else
+ my $value = 'no';
+
+ if ((-e '/usr/bin/irxevent') && (-e '/etc/lircrc'))
{
- return 'no';
+ # Only one level of includes is supported.
+ my @lircrc_list = ();
+ push(@lircrc_list, '/etc/lircrc');
+ if (open(FILE, '<', '/etc/lircrc'))
+ {
+ foreach (grep(s/^include +(.*)$/$1/, (<FILE>)))
+ {
+ chomp;
+ push(@lircrc_list, $_);
+ }
+ close(FILE);
+ }
+ foreach my $lircrc_file (@lircrc_list)
+ {
+ if (open(FILE, '<', $lircrc_file))
+ {
+ foreach (grep(/^ *prog *= *irexec *$/, (<FILE>)))
+ {
+ $value = 'yes';
+ if ($value eq 'yes')
+ {
+ last;
+ }
+ }
+ close(FILE);
+ }
+ if ($value eq 'yes')
+ {
+ last;
+ }
+ }
}
+ return $value;
}
};
$var_list{'MM_LIRC_IRXEVENT_ENABLED'} =
{
+ prerequisite => [ 'MM_LIRC_FETCH_LIRCRC' ],
value_default => 'auto',
value_valid => 'auto|no|yes',
value_auto => sub
{
- if (-e '/usr/bin/irxevent')
- {
- return 'auto';
- }
- else
+ my $value = 'no';
+
+ if ((-e '/usr/bin/irxevent') && (-e '/etc/lircrc'))
{
- return 'no';
+ # Only one level of includes is supported.
+ my @lircrc_list = ();
+ push(@lircrc_list, '/etc/lircrc');
+ if (open(FILE, '<', '/etc/lircrc'))
+ {
+ foreach (grep(s/^include +(.*)$/$1/, (<FILE>)))
+ {
+ chomp;
+ push(@lircrc_list, $_);
+ }
+ close(FILE);
+ }
+ foreach my $lircrc_file (@lircrc_list)
+ {
+ if (open(FILE, '<', $lircrc_file))
+ {
+ foreach (grep(/^ *prog *= *irxevent *$/, (<FILE>)))
+ {
+ $value = 'yes';
+ if ($value eq 'yes')
+ {
+ last;
+ }
+ }
+ close(FILE);
+ }
+ if ($value eq 'yes')
+ {
+ last;
+ }
+ }
}
+ return $value;
}
};
$var_list{'MM_LIRC_SLEEP_ENABLED'} =
@@ -197,7 +257,37 @@
value_valid => 'no|yes',
value_file => 'yes',
file => {name_remote => '/lircd.conf',
- name_local => '/etc/lircd.conf'}
+ name_local => '/etc/lircd.conf'},
+ extra => sub
+ {
+ my $minimyth = shift;
+ my $name = shift;
+
+ # If there is no lircd.conf file, then create it.
+ if (! -e '/etc/lircd.conf')
+ {
+ my $lircd_conf_path = q(/etc/lirc.d/lircd.conf);
+ my @lircd_conf_list = ();
+ if (opendir(DIR, $lircd_conf_path))
+ {
+ foreach (grep((! /^\./) && (-f qq($lircd_conf_path/$_)),
(readdir(DIR))))
+ {
+ push(@lircd_conf_list, qq($lircd_conf_path/$_));
+ }
+ closedir(DIR);
+ }
+ if (open(FILE, '>', q(/etc/lircd.conf)))
+ {
+ print FILE qq(# autogenerated\n);
+ foreach (sort @lircd_conf_list)
+ {
+ print FILE qq(include <$_>\n);
+ }
+ close(FILE);
+ }
+ }
+ return 1;
+ }
};
$var_list{'MM_LIRC_FETCH_LIRCMD_CONF'} =
{
@@ -209,118 +299,140 @@
};
$var_list{'MM_LIRC_FETCH_LIRCRC'} =
{
+ prerequisite => [
+ 'MM_LIRC_FETCH_LIRCRC_MINIMYTH',
+ 'MM_LIRC_FETCH_LIRCRC_MYTHTV',
+ 'MM_LIRC_FETCH_LIRCRC_MPLAYER',
+ 'MM_LIRC_FETCH_LIRCRC_VLC',
+ 'MM_LIRC_FETCH_LIRCRC_XINE',
+ 'MM_LIRC_SLEEP_ENABLED',
+ 'MM_EXTERNAL_VOLUME_DOWN',
+ 'MM_EXTERNAL_VOLUME_UP',
+ 'MM_EXTERNAL_VOLUME_MUTE'
+ ],
value_default => 'no',
value_valid => 'no|yes',
value_file => 'yes',
file => {name_remote => '/lircrc',
- name_local => '/etc/lircrc'}
-};
-$var_list{'MM_LIRC_FETCH_LIRCRC_MINIMYTH'} =
-{
- prerequisite => [ 'MM_LIRC_FETCH_LIRCRC' ],
- value_default => 'no',
- value_valid => sub
+ name_local => '/etc/lircrc'},
+ extra => sub
{
my $minimyth = shift;
my $name = shift;
- if ($minimyth->var_get('MM_LIRC_FETCH_LIRCRC') =~ /^no/)
+ # If there is no lircrc file, then create it.
+ if (! -e '/etc/lircrc')
{
- return 'no|yes';
+ my $lircrc_path = q(/etc/lirc.d/lircrc);
+ # Create a list of lircrc applications.
+ my @application_path_list = ();
+ if (opendir(DIR, $lircrc_path))
+ {
+ foreach (grep((! /^\./), (readdir(DIR))))
+ {
+ push(@application_path_list, qq($lircrc_path/$_));
+ }
+ closedir(DIR);
+ }
+
+ # Create a list of lircrc files.
+ my @lircrc_list = ();
+ foreach my $application_path (@application_path_list)
+ {
+ # Add all lircrc application files to the lircrc file list.
+ if (-f $application_path)
+ {
+ push(@lircrc_list, $application_path);
+ }
+ # Process all lircrc application directories.
+ elsif (-d $application_path)
+ {
+ # Add all files in the lircrc application directory to
the lircrc file list.
+ if (opendir(DIR, $application_path))
+ {
+ foreach (grep(((! /^\./) && (-f
qq($application_path/$_)), (readdir(DIR)))))
+ {
+ push(@lircrc_list, qq($application_path/$_));
+ }
+ closedir(DIR);
+ }
+ # Add files for the power key(s).
+ if ($minimyth->var_get('MM_LIRC_SLEEP_ENABLED')
eq 'yes')
+ {
+ if (-f
qq($application_path/optional/key.power.sleep))
+ {
+ push(@lircrc_list,
qq($application_path/optional/key.power.sleep));
+ }
+ }
+ # Add files for the volume key(s).
+ if ((-e q(/usr/bin/mm_external_volume_down)) &&
+ (-e q(/usr/bin/mm_external_volume_up) ) &&
+ (-e q(/usr/bin/mm_external_volume_mute)))
+ {
+ if (-f
qq($application_path/optional/key.volume.external))
+ {
+ push(@lircrc_list,
qq($application_path/optional/key.volume.external));
+ }
+ }
+ else
+ {
+ if (-f
qq($application_path/optional/key.volume.internal))
+ {
+ push(@lircrc_list,
qq($application_path/optional/key.volume.internal));
+ }
+ }
+ }
+ }
+ if (open(FILE, '>', q(/etc/lircrc)))
+ {
+ print FILE qq(# autogenerated\n);
+ foreach (sort @lircrc_list)
+ {
+ print FILE qq(include $_\n);
+ }
+ close(FILE);
+ }
}
- else
- {
- return 'no';
- }
- },
+
+ return 1;
+ }
+};
+$var_list{'MM_LIRC_FETCH_LIRCRC_MINIMYTH'} =
+{
+ value_default => 'no',
+ value_valid => 'no|yes',
value_file => 'yes',
file => {name_remote => '/lircrc.minimyth',
name_local => '/etc/lirc.d/lircrc/minimyth'}
};
$var_list{'MM_LIRC_FETCH_LIRCRC_MYTHTV'} =
{
- prerequisite => [ 'MM_LIRC_FETCH_LIRCRC' ],
value_default => 'no',
- value_valid => sub
- {
- my $minimyth = shift;
- my $name = shift;
-
- if ($minimyth->var_get('MM_LIRC_FETCH_LIRCRC') =~ /^no/)
- {
- return 'no|yes';
- }
- else
- {
- return 'no';
- }
- },
+ value_valid => 'no|yes',
value_file => 'yes',
file => {name_remote => '/lircrc.mythtv',
name_local => '/etc/lirc.d/lircrc/mythtv'}
};
$var_list{'MM_LIRC_FETCH_LIRCRC_MPLAYER'} =
{
- prerequisite => [ 'MM_LIRC_FETCH_LIRCRC' ],
value_default => 'no',
- value_valid => sub
- {
- my $minimyth = shift;
- my $name = shift;
-
- if ($minimyth->var_get('MM_LIRC_FETCH_LIRCRC') =~ /^no/)
- {
- return 'no|yes';
- }
- else
- {
- return 'no';
- }
- },
+ value_valid => 'no|yes',
value_file => 'yes',
file => {name_remote => '/lircrc.mplayer',
name_local => '/etc/lirc.d/lircrc/mplayer'}
};
$var_list{'MM_LIRC_FETCH_LIRCRC_VLC'} =
{
- prerequisite => [ 'MM_LIRC_FETCH_LIRCRC' ],
value_default => 'no',
- value_valid => sub
- {
- my $minimyth = shift;
- my $name = shift;
-
- if ($minimyth->var_get('MM_LIRC_FETCH_LIRCRC') =~ /^no/)
- {
- return 'no|yes';
- }
- else
- {
- return 'no';
- }
- },
+ value_valid => 'no|yes',
value_file => 'yes',
file => {name_remote => '/lircrc.vlc',
name_local => '/etc/lirc.d/lircrc/vlc'}
};
$var_list{'MM_LIRC_FETCH_LIRCRC_XINE'} =
{
- prerequisite => [ 'MM_LIRC_FETCH_LIRCRC' ],
value_default => 'no',
- value_valid => sub
- {
- my $minimyth = shift;
- my $name = shift;
-
- if ($minimyth->var_get('MM_LIRC_FETCH_LIRCRC') =~ /^no/)
- {
- return 'no|yes';
- }
- else
- {
- return 'no';
- }
- },
+ value_valid => 'no|yes',
value_file => 'yes',
file => {name_remote => '/lircrc.xine',
name_local => '/etc/lirc.d/lircrc/xine'}
Modified:
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/lirc.pm
(original)
+++
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init/lirc.pm
Wed Jun 24 20:58:10 2009
@@ -172,104 +172,6 @@
}
}
- # If there is no lircd.conf file, then create it.
- if (! -e '/etc/lircd.conf')
- {
- my $lircd_conf_path = q(/etc/lirc.d/lircd.conf);
- my @lircd_conf_list = ();
- if (opendir(DIR, $lircd_conf_path))
- {
- foreach (grep((! /^\./) && (-f qq($lircd_conf_path/$_)),
(readdir(DIR))))
- {
- push(@lircd_conf_list, qq($lircd_conf_path/$_));
- }
- closedir(DIR);
- }
- if (open(FILE, '>', q(/etc/lircd.conf)))
- {
- print FILE qq(# autogenerated\n);
- foreach (sort @lircd_conf_list)
- {
- print FILE qq(include <$_>\n);
- }
- close(FILE);
- }
- }
-
- # If there is no lircrc file, then create it.
- if (! -e '/etc/lircrc')
- {
- my $lircrc_path = q(/etc/lirc.d/lircrc);
- # Create a list of lircrc applications.
- my @application_path_list = ();
- if (opendir(DIR, $lircrc_path))
- {
- foreach (grep((! /^\./), (readdir(DIR))))
- {
- push(@application_path_list, qq($lircrc_path/$_));
- }
- closedir(DIR);
- }
-
- # Create a list of lircrc files.
- my @lircrc_list = ();
- foreach my $application_path (@application_path_list)
- {
- # Add all lircrc application files to the lircrc file list.
- if (-f $application_path)
- {
- push(@lircrc_list, $application_path);
- }
- # Process all lircrc application directories.
- elsif (-d $application_path)
- {
- # Add all files in the lircrc application directory to the
lircrc file list.
- if (opendir(DIR, $application_path))
- {
- foreach (grep(((! /^\./) && (-f
qq($application_path/$_)), (readdir(DIR)))))
- {
- push(@lircrc_list, qq($application_path/$_));
- }
- closedir(DIR);
- }
- # Add files for the power key(s).
- if ($minimyth->var_get('MM_LIRC_SLEEP_ENABLED') eq 'yes')
- {
- if (-f qq($application_path/optional/key.power.sleep))
- {
- push(@lircrc_list,
qq($application_path/optional/key.power.sleep));
- }
- }
- # Add files for the volume key(s).
- if ((-e q(/usr/bin/mm_external_volume_down)) &&
- (-e q(/usr/bin/mm_external_volume_up) ) &&
- (-e q(/usr/bin/mm_external_volume_mute)))
- {
- if (-f
qq($application_path/optional/key.volume.external))
- {
- push(@lircrc_list,
qq($application_path/optional/key.volume.external));
- }
- }
- else
- {
- if (-f
qq($application_path/optional/key.volume.internal))
- {
- push(@lircrc_list,
qq($application_path/optional/key.volume.internal));
- }
- }
- }
- }
- if (open(FILE, '>', q(/etc/lircrc)))
- {
- print FILE qq(# autogenerated\n);
- foreach (sort @lircrc_list)
- {
- print FILE qq(include $_\n);
- }
- close(FILE);
- }
- }
-
# Create directories used by the LIRC daemon.
File::Path::mkpath('/var/lock', { mode => 0755 });
chmod(0755, '/var/lock');
@@ -341,102 +243,14 @@
system(qq($daemon_master));
}
- my $irexec_enabled = $minimyth->var_get('MM_LIRC_IREXEC_ENABLED');
-
- # Auto-configure usage of 'irexec'.
- if ($irexec_enabled eq 'auto')
- {
- $minimyth->message_log('info', "attempting to auto-configure usage
of 'irexec'.");
- $irexec_enabled = 'no';
- if (-e '/etc/lircrc')
- {
- # Only one level of includes is supported.
- my @lircrc_list = ();
- push(@lircrc_list, '/etc/lircrc');
- if (open(FILE, '<', '/etc/lircrc'))
- {
- foreach (grep(s/^include +(.*)$/$1/, (<FILE>)))
- {
- chomp;
- push(@lircrc_list, $_);
- }
- close(FILE);
- }
- foreach my $lircrc_file (@lircrc_list)
- {
- if (open(FILE, '<', $lircrc_file))
- {
- foreach (grep(/^ *prog *= *irexec *$/, (<FILE>)))
- {
- $irexec_enabled = 'yes';
- if ($irexec_enabled eq 'yes')
- {
- last;
- }
- }
- close(FILE);
- }
- if ($irexec_enabled eq 'yes')
- {
- last;
- }
- }
- }
- $minimyth->message_log('info', "auto-configured usage of 'irexec'
as '$irexec_enabled'.");
- }
-
# Start the irexec daemon.
- if ($irexec_enabled eq 'yes')
+ if ($minimyth->var_get('MM_LIRC_IREXEC_ENABLED') eq 'yes')
{
system(qq(/usr/bin/irexec -d /etc/lircrc));
}
- my $irxevent_enabled = $minimyth->var_get('MM_LIRC_IRXEVENT_ENABLED');
-
- # Auto-configure usage of 'irxevent'.
- if ($irxevent_enabled eq 'auto')
- {
- $minimyth->message_log('info', "attempting to auto-configure usage
of 'irxevent'.");
- $irxevent_enabled = 'no';
- if (-e '/etc/lircrc')
- {
- # Only one level of includes is supported.
- my @lircrc_list = ();
- push(@lircrc_list, '/etc/lircrc');
- if (open(FILE, '<', '/etc/lircrc'))
- {
- foreach (grep(s/^include +(.*)$/$1/, (<FILE>)))
- {
- chomp;
- push(@lircrc_list, $_);
- }
- close(FILE);
- }
- foreach my $lircrc_file (@lircrc_list)
- {
- if (open(FILE, '<', $lircrc_file))
- {
- foreach (grep(/^ *prog *= *irxevent *$/, (<FILE>)))
- {
- $irxevent_enabled = 'yes';
- if ($irxevent_enabled eq 'yes')
- {
- last;
- }
- }
- close(FILE);
- }
- if ($irxevent_enabled eq 'yes')
- {
- last;
- }
- }
- }
- $minimyth->message_log('info', "auto-configured usage
of 'irxevent' as '$irxevent_enabled'.");
- }
-
# Start the irxevent daemon.
- if ($irxevent_enabled eq 'yes')
+ if ($minimyth->var_get('MM_LIRC_IRXEVENT_ENABLED') eq 'yes')
{
system(qq(/usr/bin/irxevent -d /etc/lircrc));
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---