From 6cc0301ce1c41da47228dce70c7623b44d04338b Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Tue, 3 Feb 2009 20:14:51 +0000 Subject: * Fixed TODO introduced by Sebastian: we generated completely bogus contents of default.tgz if more than one boot-env was active. Now we generate default.tgz at the right moment and additionally ask each boot environment if the default client configuration is required at all (which is not the case for preboot environments, since they will always have at least one specific client, which is being used for booting) * minor cleanup git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2568 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/slxconfig-demuxer | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'config-db/slxconfig-demuxer') diff --git a/config-db/slxconfig-demuxer b/config-db/slxconfig-demuxer index 9c10190e..49336ffa 100755 --- a/config-db/slxconfig-demuxer +++ b/config-db/slxconfig-demuxer @@ -237,8 +237,8 @@ sub writeAttributesToFile $content .= qq[$attr="$attrVal"\n]; } # Overwrite attribute file even if it exists, to make sure that our users - # will never again try to fiddle with machine-setup directly the - # file-system. From now on the DB is the keeper of that info. + # will never try to fiddle with machine-setup directly in the file-system. + # The config-DB is the keeper of that info! spitFile($fileName, $content); if ($openslxConfig{'log-level'} > 2) { vlog(0, "--- START OF $fileName ---"); @@ -557,17 +557,18 @@ sub createBootEnvironmentsForSystem $initramfsCount += $bootEnv->writeFilesRequiredForBooting($info, $buildPath); - # TODO: use different paths for other boot environments - # QUICK FIX: only write something for pxe at the moment - if ($bootType eq 'pxe') { - my $systemPath - = "$bootEnv->{'target-path'}/client-config/$info->{'external-id'}"; - createTarOfPath($buildPath, "default.tgz", $systemPath); - - writeClientConfigurationsForSystem( - $info, $buildPath, $attrFile, $bootType, $clients - ); - } + # only create a default.tgz if required by boot environment + if ($bootEnv->requiresDefaultClientConfig()) { + writeAttributesToFile($info, $attrFile); + + my $systemPath + = "$bootEnv->{'target-path'}/client-config/$info->{'external-id'}"; + createTarOfPath($buildPath, "default.tgz", $systemPath); + } + + writeClientConfigurationsForSystem( + $info, $buildPath, $attrFile, $bootType, $clients + ); } return; @@ -614,8 +615,7 @@ sub writeSystemConfiguration } my $attrFile = "$buildPath/initramfs/machine-setup"; - writeAttributesToFile($info, $attrFile); - + writePluginConfigurationsForSystem($info, $buildPath); # create all required (pre-)boot-environments (PXE, CD, ...) -- cgit v1.2.3-55-g7522