X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vserver-reference.init;h=287e5a2d5a6eced20b38afa6915a83b44a8b6df3;hb=3df81b45200fceeb1e4ae5adfa68d5e2f67930c8;hp=4458a385554c0cd00e61de7d5a3fa0b6ed5bb1bd;hpb=a51c659a0f02e2b28cef9f8d612b164535a3c3c2;p=sliceimage.git diff --git a/vserver-reference.init b/vserver-reference.init index 4458a38..287e5a2 100755 --- a/vserver-reference.init +++ b/vserver-reference.init @@ -57,7 +57,19 @@ setattr --barrier "$__DEFAULT_VSERVERDIR" # Set the attribute to unlink so vclone does the right thing wrt to # conserving space by linking and not copying unified files. -find "$__DEFAULT_VSERVERDIR/.vref"/* -type f -print0 | xargs -0 setattr --iunlink + +if [ -f /proc/virtual/info ] ; then + x=$[ 16#`awk '/^VCIKernel:/ { print $2 }' /proc/virtual/info` ]; + y=$[ (x >> 9) & 1] + if test "$y" = 1 ; then + # COW support + find "$__DEFAULT_VSERVERDIR/.vref"/* -type f -print0 | xargs -0 setattr --iunlink + else + # no COW; + find "$__DEFAULT_VSERVERDIR/.vref"/* -type f -print0 | xargs -0 setattr --~iunlink + fi +fi + # Build reference images for system slices # xxx if several instances of systemslices get installed, only one gets instanciated