Author: pebender
Date: Sun Sep 28 11:04:30 2008
New Revision: 3802
Modified:
trunk/gar-minimyth/html/minimyth/conf/minimyth.pm
trunk/gar-minimyth/html/minimyth/document-changelog.txt
trunk/gar-minimyth/html/minimyth/document-configure.html
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/conf.pm
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/rc
Log:
- Added support for running the 'stop' method if it is included
in 'minimyth.pm'.
Modified: trunk/gar-minimyth/html/minimyth/conf/minimyth.pm
==============================================================================
--- trunk/gar-minimyth/html/minimyth/conf/minimyth.pm (original)
+++ trunk/gar-minimyth/html/minimyth/conf/minimyth.pm Sun Sep 28 11:04:30
2008
@@ -64,4 +64,12 @@
return 1;
}
+sub stop
+{
+ my $self = shift;
+ my $minimyth = shift;
+
+ return 1;
+}
+
1;
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 Sun Sep 28
11:04:30 2008
@@ -43,9 +43,11 @@
- Changed MM_FONT_FILE_TTF_ADD so that the font files can be located
in a
sub-directory of the MiniMyth read-only configuration directory.
- Re-added MM_PLUGIN_DVD_ENABLED.
+ - Added support for running the 'stop' method if it is included in
+ 'minimyth.pm'.
Modified MiniMyth commands
- - Changed mm_slpeed so that is saves the system clock to the hardware
+ - Changed mm_sleep so that is saves the system clock to the hardware
clock on suspend and sets the system clock to the hardware clock on
wakeup.
- Changed mm_sleep so that it restarts commands that it stops using the
Modified: trunk/gar-minimyth/html/minimyth/document-configure.html
==============================================================================
--- trunk/gar-minimyth/html/minimyth/document-configure.html (original)
+++ trunk/gar-minimyth/html/minimyth/document-configure.html Sun Sep 28
11:04:30 2008
@@ -435,17 +435,23 @@
(see <a
href="document-configure.html#MM_INIT_TYPE">MM_INIT_TYPE</a>).
The MiniMyth configuration package is called 'minimyth.pm'.
The MiniMyth configuration package is optional.
- The MiniMyth configuration package is a perl package that is
executed by MiniMyth
- after MiniMyth has retrieved and imported (but not processed)
the MiniMyth configuration file and
- updated DHCP configuration.
- You can use the MiniMyth configuration package to do things
such as change the startup or shutdown packages.
Whether or not 'minimyth.pm' is retrieved depends on
'<a
href="document-minimyth_conf.html#MM_MINIMYTH_FETCH_MINIMYTH_PM">MM_MINIMYTH_FETCH_MINIMYTH_PM</a>'.
</p>
<p>
+ MiniMyth executes the MiniMyth configuration package as early
as possible during startup and shutdown.
+ At startup, MiniMyth executes the package's 'start' method
+ after retrieving and importing (but not processing) the
MiniMyth configuration file and
+ after updating DHCP configuration.
+ At shutdown, MiniMyth executes the package's 'stop' method
+ before running any of MiniMyth's built in shutdown packages.
+ </p>
+ <p>
As mentioned above, 'minimyth.pm' defines a perl package.
- The perl package must define the class 'init::minimyth' and
- the 'init::minimyth' class must contain a method named 'start'
+ The perl package must define the class 'init::minimyth'.
+ If you want to run commands during startup, then
the 'init::minimyth' class must contain a method named 'start'
+ that accepts a pointer to the perl class 'MiniMyth'.
+ If you want to run commands during shutdown, then
the 'init::minimyth' class must contain a method named 'stop'
that accepts a pointer to the perl class 'MiniMyth'.
The following is a stub for the perl package
defining 'init::minimyth':
</p>
@@ -467,6 +473,14 @@
return 1;
}
+sub stop
+{
+ my $self = shift;
+ my $minimyth = shift;
+
+ return 1;
+}
+
1;
</pre>
</div>
@@ -484,14 +498,17 @@
<p>
The MiniMyth configuration script is called 'minimyth.script'.
The MiniMyth configuration script is optional.
- The MiniMyth configuration script is a shell script that is
executed by MiniMyth
- after MiniMyth has retrieved and imported (but not processed)
the MiniMyth configuration file and
- updated DHCP configuration.
- You can use the MiniMyth configuration script to do things
such as change the startup or shutdown scripts.
Whether or not 'minimyth.script' is retrieved depends on
'<a
href="document-minimyth_conf.html#MM_MINIMYTH_FETCH_MINIMYTH_SCRIPT">MM_MINIMYTH_FETCH_MINIMYTH_SCRIPT</a>'.
</p>
<p>
+ MiniMyth executes the MiniMyth configuration script as early
as possible during startup.
+ The MiniMyth configuration script is a shell script that is
executed by MiniMyth
+ At startup, MiniMyth executes the script
+ after retrieving and importing (but not processing) the
MiniMyth configuration file and
+ after updating DHCP configuration.
+ </p>
+ <p>
As mentioned above 'minimyth.script' is a shell script.
The following is a stub for the shell script:
</p>
@@ -688,7 +705,7 @@
alt="Valid CSS!" height="31" width="88" /></a>
</div>
<div class="version">
- Last Updated on 2008-09-19
+ Last Updated on 2008-09-28
<br />
< mailto : webmaster at minimyth dot org >
</div>
Modified:
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/conf.pm
==============================================================================
---
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/conf.pm
(original)
+++
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/conf.pm
Sun Sep 28 11:04:30 2008
@@ -128,11 +128,17 @@
}
if (-f '/etc/minimyth.d/minimyth.pm')
{
- $minimyth->message_output('info', "running configuration
script ...");
unlink("$dir/minimyth.pm");
symlink('/etc/minimyth.d/minimyth.pm', "$dir/minimyth.pm");
+ }
+ if (-f "$dir/minimyth.pm")
+ {
require init::minimyth;
- init::minimyth->start($minimyth);
+ if (exists(&init::minimyth::start))
+ {
+ $minimyth->message_output('info', "running configuration
script ...");
+ init::minimyth->start($minimyth);
+ }
}
# Enable configuration auto-detection udev rules.
@@ -195,6 +201,19 @@
{
my $self = shift;
my $minimyth = shift;
+
+ my $dir = Cwd::abs_path(File::Basename::dirname(__FILE__));
+
+ # Run 'minimyth.pm'.
+ if (-f "$dir/minimyth.pm")
+ {
+ require init::minimyth;
+ if (exists(&init::minimyth::stop))
+ {
+ $minimyth->message_output('info', "running configuration
script ...");
+ init::minimyth->stop($minimyth);
+ }
+ }
return 1;
}
Modified:
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/rc
==============================================================================
---
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/rc
(original)
+++
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/rc
Sun Sep 28 11:04:30 2008
@@ -162,6 +162,7 @@
@script_list = sort(@script_list);
s/^K[0-9]+// foreach (@script_list);
}
+ unshift(@script_list, 'conf');
push(@script_list, @script_list_kill_halt);
rc_script_list_run($minimyth, 2, 'stop', [EMAIL PROTECTED]) ||
return 0;
@@ -179,6 +180,7 @@
@script_list = sort(@script_list);
s/^K[0-9]+// foreach (@script_list);
}
+ unshift(@script_list, 'conf');
push(@script_list, @script_list_kill_reboot);
rc_script_list_run($minimyth, 2, 'stop', [EMAIL PROTECTED]) ||
return 0;
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---