FAI, RAID, booting
mod+linux-fai at std.com
mod+linux-fai at std.com
Tue Sep 17 23:33:15 CEST 2002
> I haven't yet investigated using hooks at all. How does this
> work? I notice that you don't have an /fai/disk_config directory.
> If this doesn't exist, then I'm assuming the hook gets invoked at
> some point instead of setup_harddisks being automatically invoked
> using the disk_config/<class> file?
Hooks are cool, but there's a problem with the
current implementation: your hook has no way to
prevent the "real" task from running after your
hook has completed. The patch below shows how my
current subroutines file differs from the mainline
version, including changes I made (introduction and
use of FAI_HOOK_SHORT_CIRCUIT) that allow a hook
to completely prevent the "real" task from running.
This is hack, of course, but it at least does what
I need. In my hook tasks, if I don't want the "real"
task to run I set FAI_HOOK_SHORT_CIRCUIT to "yes".
skiptask() currently does not do the right thing.
Repairing the skiptask() stuff would be the better
approach to this problem...
--- OLD/lib/subroutines 2002-04-29 13:45:52.000000000 -0400
+++ NEW/lib/subroutines 2002-09-09 13:06:28.000000000 -0400
@@ -27,6 +27,8 @@
# source this file, then you have these function available in the shell
+export FAI_HOOK_SHORT_CIRCUIT="no"
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
die() {
@@ -67,6 +69,29 @@
return 1
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+function undefclass() { # XXX_MIKE
+ if [ -n "$1" ]
+ then
+ local rzq
+ local cl
+
+ rzq=""
+ for cl in $classes
+ do
+ if [ "$cl" != "$1" ]
+ then
+ rzq="$rzq $cl"
+ else
+ echo "undefclass($cl)" >/dev/console #XXX_MIKE
+ fi
+ done
+
+ classes="$rzq"
+ fi
+ return 0
+}
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
create_resolv_conf() {
# create a resolv.conf using the DHCP or BOOTP information
@@ -204,11 +229,17 @@
if [ -f $LOGDIR/skip.$taskname ]; then
# skip whole task and hook
rm $LOGDIR/skip.$taskname
- [ "$verbose" ] && echo "Skiping task_$taskname"
+ [ "$verbose" ] && echo "Skipping task_$taskname"
else
echo "Calling task_$taskname"
+ FAI_HOOK_SHORT_CIRCUIT="no"
call_hook $taskname
+ if [ "$FAI_HOOK_SHORT_CIRCUIT" = "no" ]
+ then
task_$taskname
+ else
+ echo "FAI_HOOK_SHORT_CIRCUIT Task $taskname "
+ fi
fi
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
More information about the linux-fai
mailing list