summaryrefslogtreecommitdiffstats
path: root/installer/OpenSLX/OSExport/ExportType/NBD_Squash.pm
diff options
context:
space:
mode:
authorOliver Tappe2007-04-14 12:51:37 +0200
committerOliver Tappe2007-04-14 12:51:37 +0200
commit28ee42687c3585e1b015008fd32347a63f298dd8 (patch)
treeedd174b95d5459532f4f0851bbbd5e82f534a1dc /installer/OpenSLX/OSExport/ExportType/NBD_Squash.pm
parent* small cleanup (diff)
downloadcore-28ee42687c3585e1b015008fd32347a63f298dd8.tar.gz
core-28ee42687c3585e1b015008fd32347a63f298dd8.tar.xz
core-28ee42687c3585e1b015008fd32347a63f298dd8.zip
* added hook for checking the requirements of a specific export type (for NBD-squash,
we look for the kernel modules). git-svn-id: http://svn.openslx.org/svn/openslx/trunk@889 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/OpenSLX/OSExport/ExportType/NBD_Squash.pm')
-rw-r--r--installer/OpenSLX/OSExport/ExportType/NBD_Squash.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/installer/OpenSLX/OSExport/ExportType/NBD_Squash.pm b/installer/OpenSLX/OSExport/ExportType/NBD_Squash.pm
index 770107a7..d103868d 100644
--- a/installer/OpenSLX/OSExport/ExportType/NBD_Squash.pm
+++ b/installer/OpenSLX/OSExport/ExportType/NBD_Squash.pm
@@ -63,6 +63,29 @@ sub purgeExport
1;
}
+sub checkRequirements
+{
+ my $self = shift;
+ my $vendorOSPath = shift;
+ my $kernel = shift || 'vmlinuz';
+
+ while (-l "$vendorOSPath/boot/$kernel") {
+ $kernel = readlink "$vendorOSPath/boot/$kernel";
+ }
+ if ($kernel !~ m[^vmlinuz-(.+?)(\..+)?$]) {
+ die _tr("unable to determine version of kernel '%s'!", $kernel);
+ }
+ my $kernelVer = $1;
+ if (!-e "$vendorOSPath/lib/modules/$kernelVer/kernel/drivers/block/nbd.ko") {
+ warn _tr("unable to find nbd-module for kernel '%s',\nclients wouldn't be able to access the exported root-fs!",
+ $kernel);
+ }
+ if (!-e "$vendorOSPath/lib/modules/$kernelVer/kernel/fs/squashfs.ko") {
+ warn _tr("unable to find squashfs-module for kernel '%s',\nclients wouldn't be able to access the exported root-fs!",
+ $kernel);
+ }
+}
+
################################################################################
### implementation methods
################################################################################