Providing Defaults to class/ scripts (was:: Adding to $kernelmodules)

Michael Tautschnig mt at debian.org
Fri Oct 16 13:20:09 CEST 2009


> hiya
> >> Is there a "correct" way to provide variables to scripts in class/ ?
> [...]
> 
> > If you name your script 00foobar.source it will be executed first _and_
> > sourced, therefore all variable definitions from 00foobar.source will
> > also be visible in all other scripts. You might need to export the
> > variable to have it available in the entire FAI run, but that I'm not
> > sure of.
> 
> > Is that what you're looking for?
> 
> Yes, This is exactly what I need. I knew about ###.source file but wasn't
> aware that they could do this. Is this a documentation bug?
> 
> 10-hwdetect.source has the following header in my config space
> ================================
> #! /bin/bash
> 
> # (c) Thomas Lange, 2002-2007, lange at informatik.uni-koeln.de
> 
> # NOTE: Files named *.source will be evaluated, but their output ignored.
> Instead
> # the contents of $newclasses will be added to the list of defined classes.
> ================================
> 
> Maybe newer releases state something else by now. This file is from a
> rather old configspace example.
> 
> 
> contents of /srv/fai/config/class/01-init.source
> ---
> #!/bin/bash
> 
> TESTVAR="foobar"
> export TESTVAR
> ---
> 
> contents of /srv/fai/config/class/71-test
> ---
> #! /bin/bash
> 
> echo "TESTVAR is set to: $TESTVAR"
> ---
> 

So ... does that work? IMHO it should, but as Michael Goetze said, you probably
cannot do more than this, like use $TESTVAR in some *.var files or somewhere
later on. Could you verify this?

Best,
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
Url : http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20091016/bda195b7/attachment.bin 


More information about the linux-fai mailing list