summaryrefslogtreecommitdiffstats
path: root/installer/OpenSLX/OSExport/FileSystem/NFS.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-05-12 14:59:10 +0200
committerOliver Tappe2008-05-12 14:59:10 +0200
commitc816de2507a6c638d0a25f4b404418a1518a57fa (patch)
treeb5c9c243587daaf63c0ce1c6729159db7ffac333 /installer/OpenSLX/OSExport/FileSystem/NFS.pm
parent* removed content_regex from verbose listing of attrs, as it does not make sense (diff)
downloadcore-c816de2507a6c638d0a25f4b404418a1518a57fa.tar.gz
core-c816de2507a6c638d0a25f4b404418a1518a57fa.tar.xz
core-c816de2507a6c638d0a25f4b404418a1518a57fa.zip
* added explicit check for /srv/openslx/export/nfs being a bind-mount to
/var/opt/openslx/stage1 and skip the rsync step in that case This makes it possible to use a bind mount during development, which in turn avoids having to wait for rsync to do copy the largish vendor-OS folder. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1763 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/OpenSLX/OSExport/FileSystem/NFS.pm')
-rw-r--r--installer/OpenSLX/OSExport/FileSystem/NFS.pm34
1 files changed, 34 insertions, 0 deletions
diff --git a/installer/OpenSLX/OSExport/FileSystem/NFS.pm b/installer/OpenSLX/OSExport/FileSystem/NFS.pm
index f14bc497..b114348d 100644
--- a/installer/OpenSLX/OSExport/FileSystem/NFS.pm
+++ b/installer/OpenSLX/OSExport/FileSystem/NFS.pm
@@ -52,7 +52,41 @@ sub exportVendorOS
my $source = shift;
my $target = $self->{'export-path'};
+
+ # For development purposes, it is very desirable to be able to take a
+ # shortcut that avoids doing the actual copying of the folders (as that
+ # takes a considerable amount of time).
+ # In order to support this, we explicitly check if the OpenSLX NFS export
+ # root folder (/srv/openslx/export/nfs) is a bind-mount of the OpenSLX
+ # stage1 folder (/var/opt/openslx/stage1).
+ # If that is the case, we print a notice and skip the rsync step (which
+ # wouldn't work anyway, as source and target folder are the same).
+ my $stage1Root = dirname($source);
+ my $nfsRoot = dirname($target);
+ chomp(my $canonicalStage1Root = qx{readlink -f $stage1Root} || $stage1Root);
+ chomp(my $canonicalNFSRoot = qx{readlink -f $nfsRoot} || $nfsRoot);
+ my @mounts = slurpFile('/etc/mtab');
+ for my $mount (@mounts) {
+ if ($mount =~ m{
+ ^
+ $canonicalStage1Root # mount source
+ \s+
+ $canonicalNFSRoot # mount target
+ \s+
+ none # filesystem for bind mounts is 'none'
+ \s+
+ \S*\bbind\b\S* # look for bind mounts only
+ }gmsx) {
+ warn _tr(
+ "%s is a bind-mount to vendor-OS root - rsync step is skipped!",
+ $target
+ );
+ return;
+ }
+ }
+
$self->_copyViaRsync($source, $target);
+
return;
}