summaryrefslogtreecommitdiffstats
path: root/config-db
diff options
context:
space:
mode:
authorOliver Tappe2006-09-22 15:13:07 +0200
committerOliver Tappe2006-09-22 15:13:07 +0200
commit8882da5b69b03af9a41040ff655eab06ec185ec2 (patch)
tree181023364dc2044a0dd9c7917d04316089121554 /config-db
parent* if NFSROOT contains @@@server_ip@@@, it is now replaces by the real server-... (diff)
downloadcore-8882da5b69b03af9a41040ff655eab06ec185ec2.tar.gz
core-8882da5b69b03af9a41040ff655eab06ec185ec2.tar.xz
core-8882da5b69b03af9a41040ff655eab06ec185ec2.zip
* added support for correct auto-generation of export_uri, such that the configuration should be
independent of server-IPs git-svn-id: http://svn.openslx.org/svn/openslx/trunk@386 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db')
-rw-r--r--config-db/OpenSLX/ConfigDB.pm10
-rw-r--r--config-db/OpenSLX/DBSchema.pm3
-rwxr-xr-xconfig-db/config-demuxer.pl3
-rwxr-xr-xconfig-db/test-config-demuxer.pl1
4 files changed, 15 insertions, 2 deletions
diff --git a/config-db/OpenSLX/ConfigDB.pm b/config-db/OpenSLX/ConfigDB.pm
index 3db779e2..4376ec68 100644
--- a/config-db/OpenSLX/ConfigDB.pm
+++ b/config-db/OpenSLX/ConfigDB.pm
@@ -806,6 +806,15 @@ sub aggregatedSystemFileInfosOfSystem
my $kernelPath
= "$openslxConfig{'private-path'}/stage1/$vendorOS->{path}";
+ my $exportURI = $system->{'export_uri'};
+ if ($exportURI !~ m[\w]) {
+ # auto-generate export_uri if none has been given:
+ my $type = $system->{'export_type'};
+ my $serverIpToken = '@@@server_ip@@@';
+ $exportURI
+ = "$type://$serverIpToken$openslxConfig{'public-path'}/$type/$vendorOS->{path}";
+ }
+
my @variantIDs = fetchSystemVariantIDsOfSystem($confDB, $system->{id});
my @variants = fetchSystemVariantsByID($confDB, \@variantIDs);
@@ -814,6 +823,7 @@ sub aggregatedSystemFileInfosOfSystem
next if !length($sys->{kernel});
my %info = %$sys;
$info{'kernel-file'} = "$kernelPath/$sys->{kernel}";
+ $info{'export-uri'} = $exportURI;
if (!defined $info{'name'}) {
# compose full name and label for system-variant:
$info{'name'} = "$system->{name}-$info{name_addition}";
diff --git a/config-db/OpenSLX/DBSchema.pm b/config-db/OpenSLX/DBSchema.pm
index f979295e..3c27fa56 100644
--- a/config-db/OpenSLX/DBSchema.pm
+++ b/config-db/OpenSLX/DBSchema.pm
@@ -75,7 +75,8 @@ $DbSchema = {
'label:s.128', # name visible to user (pxe-label)
'comment:s.1024', # internal comment (optional, for admins)
'export_type:s.10', # 'nbd', 'nbd-squash', 'nfs', ...
- 'export_uri:s.256', # path to export (NDB-image or NFS-path)
+ 'export_uri:s.256', # path to export (NDB-image or NFS-path), if empty it
+ # will be auto-generated by config-demuxer
'kernel:s.128', # path to kernel file, relative to OS root
'kernel_params:s.512', # kernel-param string for pxe
'ramfs_debug_level:i', # debug level for initramfs-generator-script
diff --git a/config-db/config-demuxer.pl b/config-db/config-demuxer.pl
index 9c16abc1..b8292a5e 100755
--- a/config-db/config-demuxer.pl
+++ b/config-db/config-demuxer.pl
@@ -8,6 +8,7 @@ use lib $FindBin::Bin;
use Fcntl qw(:DEFAULT :flock);
use File::Basename;
use Getopt::Long qw(:config pass_through);
+
use OpenSLX::Basics;
use OpenSLX::ConfigDB qw(:access :aggregation :support);
@@ -205,7 +206,7 @@ sub writePXEMenus
my $append = $system->{kernel_params};
$append .= " initrd=$extSysID/initialramfs";
$append .= " $clientAppend";
- $append .= " rootfs=nfs:///srv/openslx/nfsroot/suse-10.0";
+ $append .= " rootfs=$info->{'export-uri'}";
print PXE "LABEL openslx-$extSysID\n";
# print PXE "\tMENU DEFAULT\n";
print PXE "\tMENU LABEL ^$info->{label}\n";
diff --git a/config-db/test-config-demuxer.pl b/config-db/test-config-demuxer.pl
index c5839d08..8132ab4a 100755
--- a/config-db/test-config-demuxer.pl
+++ b/config-db/test-config-demuxer.pl
@@ -43,6 +43,7 @@ foreach my $id (1..10) {
'ramfs_fsmods' => ($id % 3)==2 ? 'nbd ext3 nfs reiserfs xfs' : '',
'kernel' => "boot/vmlinuz-2.6.13-15-default",
'kernel_params' => "splash=silent",
+ 'export_type' => 'nfs',
};
}
addSystem($openslxDB, \@systems);