hooks

Holger Levsen hl at hbt.de
Fri Jul 16 10:34:39 CEST 2004


Hi,

On Fri, 2004-07-16 at 07:18, Nicolas Triantafillou wrote:
> I've gained a lot more insight to the workings of fai after reading 
> http://toolbox.rutgers.edu/~amurphy/fai/fai-howto, it's very useful.
> 
> I'm assuming 'test' isnt a FAI task, so it won't run. Is there a list of 
> tasks somewhere?

in /usr/share/fai/subroutines there is a bash-function called
"task_install" which calls the tasks. You can use this as a list.

This is from fai2.3.1:

task_install() {

    > $stamp

    save_dmesg
    load_keymap_consolechars

    task partition
    task mountdisks
    task extrbase
    task mirror
    task updatebase
    task instsoft
    task configure
    task finish
    date
    echo -e "FAI finished.\a"
    task chboot

    rm -f $stamp
    # save again, because new messages could be created
    save_dmesg
    task savelog

    if [ -f $stamp ]; then
        echo "Error while executing commands in subshell."
        echo "$stamp was not removed."
        die "Please look at the log files in $LOGDIR for errors."
    fi
    task faiend
}

 
> I know 'partition' and 'savelog' are both tasks as they seem to be in 
> the documentation/examples, I just thought anything in there would work.
> 
> Nicolas.
> 
> Nicolas Triantafillou wrote:
> > Hopefully this is a simple problem,
> > 
> > I'm trying to get a simple hook working which echo's the word "test" to 
> > /etc/fai/hook.test
> > 
> > hrm:/usr/local/share/fai/hooks# ls -la test.LAST
> > -rwxr-xr-x    1 root     staff          43 Jul 16 10:24 test.LAST
> > hrm:/usr/local/share/fai/hooks# cat test.LAST
> > #!/bin/sh
> > echo "test" > /etc/fai/hook.test
> > 
> > It just doesn't seem to be called, the install only seems to show that 
> > 'Calling hook: savelog.LAST' is being run, is there somewhere else I 
> > have to specify which hooks to call ? From the fai documentation this is 
> > all I can see I should be doing, but I'm now thinking i'm missing 
> > something vital or interpreted it incorrectly.

hooks are class based as well. The system you're trying to install has
to belong to this class. To learn more about hooks you could copy
hooks/savelog.LAST to hooks/savelog.DEFAULT and modify it a bit and see
what happens... 
 

regards,
	Holger Levsen

> > (Not sure if it matters what version, but this is the latest 2.6BETA)
> > 
> > Thanks,
> > 
> > Nicolas.
> > 
> > 
> 




More information about the linux-fai mailing list