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

Thomas Neumann blacky+fai at fluffbunny.de
Fri Oct 16 13:10:43 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"
---

tschüß
thomas



More information about the linux-fai mailing list