tasks and hooks and scripts - time to reconsider?

Thomas Neumann blacky+fai at fluffbunny.de
Fri Dec 5 16:40:03 CET 2014


Hello

A thought that is floating around in my head is to get rid of the separation 
between 'tasks', 'scripts' and 'hooks' for OS-dependent stuff.

Specifically I'm talking about:
    task extrbase
    [ -f $target/etc/fstab ] || touch $target/etc/fstab
    task debconf
    task prepareapt
    task updatebase
    task instsoft
    task configure

What bugs me is that there's a wall you're going to hit sooner or later. At 
first it's pretty easy. You learn about class/ and disk_config/, files/ and 
scripts/. That is all pretty nice and well. But then GRUB isn't working as 
expected or fai is copying the wrong sources.list or something else and you 
have to figure out what is actually done, where it is done and how to override 
the default behavior.

Wouldn't it make more sense to forget about these tasks and provided the 
functionality as scripts/? If you want to know how something os-specific is 
done then it's _all_ in your config space. There's no more magic going on 
behind the scene. If you want/need to override some default behavior then you 
don't need to read about some magic entity called 'hooks'. You just take the 
provided default script (optionally slap a classname onto it), perform the 
change and you're done. If you don't need a task (e.g. debconf) then simply 
delete it.

  generic, OS-independent stuff -> /usr/lib/fai
  OS-version specific stuff     -> <config space>

If you want to install 2 different OS (versions) then you have the option to 
provide different config spaces or to tweak your config space to support both 
versions. It's no longer necessary to consider the relationship between the 
FAI NFS-client's OS (version) and the actual installed client's OS (version).

e.g.: copy the sources.list to files/... and then use fcopy to pick the 
correct file to copy to the install client instead of using the NFS client's 
sources.list. Then you can dist-upgrade the FAI NFS client without suddenly 
breaking your installed clients.

bye
thomas


More information about the linux-fai-devel mailing list