FAI, RAID, booting

AUSTIN MURPHY amurphy at nbcs.rutgers.edu
Wed Sep 18 16:45:24 CEST 2002



On Tue, 17 Sep 2002 mod+linux-fai at std.com wrote:
>
> 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 odd thing is that this used to work in FAI versions before 2.3.1 !
I don't know why it was changed but I mentioned it before on the list.
The patch I use is pasted below.  I modified the task() routine to first
call the hook and then test if the task should be skipped.

 (introduction and
> use of FAI_HOOK_SHORT_CIRCUIT) that allow a hook
> to completely prevent the "real" task from running.

Your introduction of a short_circuit variable may be more elegant.  My
line of thought said that hooks should always run if the class is
defined.

I use a hook as an alternative means of partitioning.  At the end of the
hook, I call "skiptask partition" to prevent the normal code from running.


Austin



--- /home/jimmy/subroutines	Mon Aug 26 22:53:25 2002
+++ ./subroutines	Wed Aug 21 05:15:38 2002
@@ -201,13 +201,14 @@
 task() {

     local taskname=$1
+    call_hook $taskname
     if [ -f $LOGDIR/skip.$taskname ]; then
         # skip whole task and hook
-	rm $LOGDIR/skip.$taskname
-	[ "$verbose" ] && echo "Skiping task_$taskname"
+	mv $LOGDIR/skip.$taskname $LOGDIR/skipped.$taskname
+	[ "$verbose" ] && echo "Skipping task_$taskname"
     else
 	echo "Calling task_$taskname"
-	call_hook $taskname
+	# call_hook $taskname
 	task_$taskname
     fi
 }




More information about the linux-fai mailing list