disk_var.sh copied during softupdates?

Michael Tautschnig tautschn at model.in.tum.de
Tue Oct 10 00:33:36 CEST 2006


> >>>>> On Tue, 3 Oct 2006 23:37:59 +0200, Michael Tautschnig <tautschn at model.in.tum.de> said:
> 
>     > does anybody know why disk_var.sh gets copied during softupdates? In
>     > lib/subroutines, line 493 it says:
>     >   cp -p /var/lib/fai/disk_var.sh $LOGDIR # use the last disk_var during update
> IMO it's just for historical reasons. I'm not the softupdate guru, but
> I think I added this because the information from disk_var.sh are
> needed during softupdate and if someone changes the data in
> disk_var.sh we need the last version of disk_var.sh during
> softupdate. If this is not correct feel free to fill a bug report and
> tell me how to do it better. 
> 
>     > Even though this shouldn't cause too much trouble, it does result in an error
>     > message on systems that were installed using fai < 3.0 because AFAIK the path
>     > was changed.
> Any ideas how to fix that? Are there other problems when using FAI 3.0
> for softupdate when the install client was installed with 2.X? IMO
> there must be problems when using variables in customization scripts,
> which had been renamed.
> 
The following patch should address both of the above issues: 
* Yes, disk_var.sh may be required during softupdates (at least I do source it
  in my grub-script to know how to update grub properly); Even though I could
  simply source /var/lib/fai/disk_var.sh the location in $LOGDIR seems to be the
  only place that can be used during updates as well as installations. This is
  documented in the comment below.

* A possible fix for the fai < 3.0 issue is the if ; cp ; fi below.


--- lib/subroutines     (revision 4071)
+++ lib/subroutines     (working copy)
@@ -491,6 +491,13 @@
 
     [ -f "$stamp" ] && die "Another fai softupdate is already running. Aborting."
     > $stamp
+    # in case the system had been installed using fai < 3.0 disk_var.sh is found
+    # in /etc/fai
+    if [ ! -f /var/lib/fai/disk_var.sh -a -f /etc/fai/disk_var.sh ] ; then
+      cp -p /etc/fai/disk_var.sh /var/lib/fai/
+    fi
+    # the following copy operation is required to make $LOGDIR a reliable source
+    # for disk_var.sh
     cp -p /var/lib/fai/disk_var.sh $LOGDIR # use the last disk_var during update
 
     defnop wait_for_jobs

HTH,
Michael


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


More information about the linux-fai-devel mailing list