From 28ee42687c3585e1b015008fd32347a63f298dd8 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 14 Apr 2007 10:51:37 +0000 Subject: * 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 --- .../OpenSLX/OSExport/ExportType/NBD_Squash.pm | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'installer/OpenSLX/OSExport/ExportType/NBD_Squash.pm') 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 ################################################################################ -- cgit v1.2.3-55-g7522