summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Tappe2007-04-05 17:32:18 +0200
committerOliver Tappe2007-04-05 17:32:18 +0200
commit6858c4d6acf6dbf684adf5183cebb1f5263f336d (patch)
tree292fc9bdac7167272965710acc47174785d3793e
parent* renamed '/etc/sysconfig/slxconfig' to '/etc/sysconfig/slxsystem.conf' in or... (diff)
downloadcore-6858c4d6acf6dbf684adf5183cebb1f5263f336d.tar.gz
core-6858c4d6acf6dbf684adf5183cebb1f5263f336d.tar.xz
core-6858c4d6acf6dbf684adf5183cebb1f5263f336d.zip
* added more precise errors for inconsistent DB states (if the export or vendor-OS a
system refers to doesn't exist) * some cleanup git-svn-id: http://svn.openslx.org/svn/openslx/trunk@866 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--config-db/OpenSLX/ConfigDB.pm12
-rwxr-xr-xconfig-db/slxconfig-demuxer11
2 files changed, 13 insertions, 10 deletions
diff --git a/config-db/OpenSLX/ConfigDB.pm b/config-db/OpenSLX/ConfigDB.pm
index e619c660..efe15078 100644
--- a/config-db/OpenSLX/ConfigDB.pm
+++ b/config-db/OpenSLX/ConfigDB.pm
@@ -863,9 +863,15 @@ sub aggregatedSystemFileInfoFor
my $system = shift;
my $export = $self->fetchExportByID($system->{export_id});
- return () if !$export || !length($export->{name});
+ if (!defined $export) {
+ die _tr("DB-problem: system '%s' references export with id=%s, but that doesn't exist!",
+ $system->{name}, $system->{export_id});
+ }
my $vendorOS = $self->fetchVendorOSByID($export->{vendor_os_id});
- return () if !$vendorOS || !length($vendorOS->{name});
+ if (!defined $vendorOS) {
+ die _tr("DB-problem: export '%s' references vendor-OS with id=%s, but that doesn't exist!",
+ $export->{name}, $export->{vendor_os_id});
+ }
my $kernelPath
= "$openslxConfig{'private-path'}/stage1/$vendorOS->{name}/boot";
@@ -881,6 +887,8 @@ sub aggregatedSystemFileInfoFor
my $info = { %$system };
$info->{'kernel-file'} = "$kernelPath/$system->{kernel}";
$info->{'export-uri'} = $exportURI;
+ $info->{'export'} = $export;
+ $info->{'vendor-os'} = $vendorOS;
return $info;
}
diff --git a/config-db/slxconfig-demuxer b/config-db/slxconfig-demuxer
index 7b854918..d1c2c11b 100755
--- a/config-db/slxconfig-demuxer
+++ b/config-db/slxconfig-demuxer
@@ -302,9 +302,6 @@ sub generateInitalRamFS
vlog 1, _tr('generating initialramfs %s/initramfs', $pxeSysPath);
my $cmd = "$openslxConfig{'bin-path'}/slxmkramfs ";
- if ($setup->{ramfs_use_glibc}) {
- $cmd .= '-g ';
- }
if ($setup->{ramfs_use_busybox}) {
$cmd .= '-b ';
}
@@ -358,13 +355,11 @@ sub writeSystemPXEFiles
{
my $system = shift;
- my $pxePath = "$tftpbootPath/pxe";
-
- my $export = $openslxDB->fetchExportByID($system->{export_id});
- my $vendorOS = $openslxDB->fetchVendorOSByID($export->{vendor_os_id});
my $info = $openslxDB->aggregatedSystemFileInfoFor($system);
my $kernelFile = $info->{'kernel-file'};
my $extSysID = externalIDForSystem($info);
+
+ my $pxePath = "$tftpbootPath/pxe";
my $pxeSysPath = "$pxePath/$extSysID";
if (-e $pxeSysPath) {
die _tr('PXE-system %s already exists!', $pxeSysPath);
@@ -373,7 +368,7 @@ sub writeSystemPXEFiles
vlog 1, _tr('copying kernel %s to %s/kernel', $kernelFile, $pxeSysPath);
system(qq[cp -p "$kernelFile" $pxeSysPath/kernel]) unless $dryRun;
- generateInitalRamFS($info, $vendorOS, $pxeSysPath);
+ generateInitalRamFS($info, $info->{'vendor-os'}, $pxeSysPath);
}
sub writeDhcpConfig