> On 09/30/2009 12:11 AM, Jean Spirat wrote:
> > 
> >> I prefer using my own variables in my own namespace and initialize
> >> them from a "known good" source - like $HOSTNAME. This may not be
> >> the most obvious solution, but this way you can guarantee that
> >> "your" variable has a valid value. And if $HOSTNAME turns out to be
> >> unrealiable - or undesired - then you could easily change the
> >> source (like maybe retrieving the value from an external database.)
> >> without having to wade through the rest of the source code trying
> >> hard not to introduce new bugs.
> >>
> > ok so any defined variables can be used in setup storage (like in
> > http://www.informatik.uni-koeln.de/fai/fai-guide/ch-config.html#s-classvariables).
> > 
> > I had not thinked of this before i was seeing this as a static file.
> > good to know thanks :)
> 
> Hmm. I don't think I understand what you mean. I mean I HAVE tried
> using $HOSTNAME in my disk_config-layout with setup-storage and it did
> NOT work (at least for me - see my first post in this thread).
> 
> Maybe I've done a mistake?
> 

I think you don't use a proper hook. Let me try to elaborate:

- Create a disk config disk_config/SOMETHING that has ##HOSTNAME## in the places
  you'd like to see $HOSTNAME to be replaced.
- Add a hook hooks/partition.DEFAULT that does the following:

  cp $FAI/disk_config/SOMETHING $FAI/disk_config/$HOSTNAME
  sed -i "s/##HOSTNAME##/$HOSTNAME/" $FAI/disk_config/$HOSTNAME

That should be about it, I think. I haven't actually tested this, so others
might want to correct me.

Best,
Michael

Attachment: pgp1PkJxy3bYE.pgp
Description: PGP signature

Antwort per Email an