diff options
author | Oliver Tappe | 2006-10-29 18:30:23 +0100 |
---|---|---|
committer | Oliver Tappe | 2006-10-29 18:30:23 +0100 |
commit | 63f929da81f9f99cec9ab2f5fe6c19332f21b4f8 (patch) | |
tree | 4c306422c93513e91c93e1629cce7f73ecd745bb /config-db | |
parent | * added support for showing and changing the settings, too. (diff) | |
download | core-63f929da81f9f99cec9ab2f5fe6c19332f21b4f8.tar.gz core-63f929da81f9f99cec9ab2f5fe6c19332f21b4f8.tar.xz core-63f929da81f9f99cec9ab2f5fe6c19332f21b4f8.zip |
* added support for writing of slxconfig file and passing it
on to slxmkramfs.
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@491 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db')
-rwxr-xr-x | config-db/slxconfig-demuxer | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/config-db/slxconfig-demuxer b/config-db/slxconfig-demuxer index 2bc907c5..3f591802 100755 --- a/config-db/slxconfig-demuxer +++ b/config-db/slxconfig-demuxer @@ -84,6 +84,8 @@ openslxInit(); my $openslxDB = connectConfigDB(); +my $settings = fetchSettings($openslxDB); + my $clientConfigPath = "$openslxConfig{'private-path'}/config"; if (!-d $clientConfigPath) { die _tr("Unable to access client-config-path '%s'!", $clientConfigPath); @@ -176,6 +178,20 @@ sub writeAttributesToFile close(ATTRS); } +sub writeSlxConfigToFile +{ + my $slxConf = shift; + my $fileName = shift; + + return if $dryRun; + + open(SLXCONF, "> $fileName") or die "unable to write to $fileName"; + foreach my $key (sort keys %$slxConf) { + print SLXCONF qq[$key="$slxConf->{$key}"\n]; + } + close(SLXCONF); +} + sub copyExternalSystemConfig { # copies local configuration extensions of given system from private # config folder (var/lib/openslx/config/...) into a temporary folder @@ -294,7 +310,28 @@ sub generateInitalRamFS } my $rootPath = "$openslxConfig{'private-path'}/stage1/$vendorOS->{path}"; - $cmd .= "-i $pxeSysPath/initramfs -r $rootPath"; + $cmd .= "-i $pxeSysPath/initramfs -r $rootPath "; + + # fill slxConf-hash... + my %slxConf; + # ...set date initrd has been generated... + my ($y, $m, $d) = localtime; $m++; $y+=1900; + $slxConf{'slxconf_date'} = sprintf('%04d-%02d-%02d', $y, $m, $d); + $slxConf{'slxconf_tftp_prefix'} + = $settings->{'use_absolute_tftp'} + ? "$ENV{SLX_TFTPBOOT_PATH}/" + : ""; + # ...set kernel version... + $setup->{'kernel'} =~ m[-(.+)$]; + $slxConf{'slxconf_kernver'} = $1; + # ...set distro version... + $slxConf{'slxconf_distro'} = $vendorOS->{'name'}; + # ...set list of network modules... + $slxConf{'slxconf_listnwmod'} + = $setup->{'ramfs_nicmods'} || $settings->{'default_nicmods'}; + # ...now create slxconfig file and pass it to slxmkramfs: + writeSlxConfigToFile(\%slxConf, "$tempPath/slxconfig"); + $cmd .= qq[-s "$tempPath/slxconfig" ]; $ENV{'SLX_PRIVATE_PATH'} = $openslxConfig{'private-path'}; $ENV{'SLX_PUBLIC_PATH'} = $openslxConfig{'public-path'}; |