The easiest would be to create an LhA archive with only the needed files in it which are already custimised.
E.g. install AmiCDFS once and then do something like this:
cd sys:
lha -x a work:cdfs l/amicdfs devs/dosdrivers/cd0(|.info)
Now, after you reinstalled 3.1, you only need to
lha x work:cdfs sys:
and everything is in place again.
Even better would be to LhA the complete system partition after successful installation. Then you can just unLhA the archive instead of doing a full installation again.
Bye,
Thomas