From ac6a8316fe4cdded3b2c536ef8558c008f5f90b9 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Tue, 29 Aug 2006 18:36:01 +0000 Subject: * fixed several bugs, such that now the kernel is starting to boot (until it notices that there's no root-fs...) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@341 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/config-demuxer.pl | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'config-db/config-demuxer.pl') diff --git a/config-db/config-demuxer.pl b/config-db/config-demuxer.pl index 7de6ffcd..dccbea7b 100755 --- a/config-db/config-demuxer.pl +++ b/config-db/config-demuxer.pl @@ -6,22 +6,20 @@ use FindBin; 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); -my $pxelinux0Path = "/usr/share/syslinux/pxelinux.0"; -my $pxeConfigDefaultTemplate = q[NOESCAPE 0 +my $pxeConfigDefaultTemplate = q[# generated by openslx +NOESCAPE 0 PROMPT 0 TIMEOUT 100 DEFAULT menu.c32 IMPLICIT 1 ALLOWOPTIONS 1 -ONERROR menu MENU TITLE What would you like to do? (use cursor to select) MENU MASTER PASSWD secret -LABEL menu - ]; my ( @@ -56,14 +54,11 @@ if (!$dryRun) { } my $exportPath = "$openslxConfig{'public-basepath'}/tftpboot"; if (!$dryRun) { - system("rm -rf $exportPath/client-conf/* $exportPath/pxe/pxelinux.cfg/*"); + system("rm -rf $exportPath/client-conf/* $exportPath/pxe/*"); system("mkdir -p $exportPath/client-conf $exportPath/pxe/pxelinux.cfg"); if (!-d $exportPath) { die _tr("Unable to create or access export-path '%s'!", $exportPath); } - if (!-e "$exportPath/pxe/pxelinux.0") { - system(qq[cp -a "$pxelinux0Path" $exportPath/pxe/pxelinux.0]); - } } my $lockFile = "$exportPath/config-demuxer.lock"; @@ -181,6 +176,17 @@ sub writePXEMenus { my $pxePath = "$exportPath/pxe/pxelinux.cfg"; + if (!-e "$exportPath/pxe/pxelinux.0") { + my $pxelinux0Path + = "$openslxConfig{'shared-basepath'}/tftpboot/pxelinux.0"; + system(qq[cp -a "$pxelinux0Path" $exportPath/pxe/]); + } + if (!-e "$exportPath/pxe/menu.c32") { + my $menuc32Path + = "$openslxConfig{'shared-basepath'}/tftpboot/menu.c32"; + system(qq[cp -a "$menuc32Path" $exportPath/pxe/]); + } + my @clients = fetchClientsByFilter($openslxDB); foreach my $client (@clients) { my $externalClientID = externalIDForClient($client); @@ -192,11 +198,12 @@ sub writePXEMenus my @systems = fetchSystemsByID($openslxDB, \@systemIDs); foreach my $system (@systems) { print PXE "LABEL openslx-$system->{name}\n"; - print PXE " MENU DEFAULT\n"; - print PXE " MENU LABEL ^$system->{label}\n"; - print PXE " KERNEL $system->{kernel}\n"; - print PXE " append $system->{kernel_params}\n"; - print PXE " ipappend 1\n"; +# print PXE "\tMENU DEFAULT\n"; + print PXE "\tMENU LABEL ^$system->{label}\n"; + my $kernel = basename($system->{kernel}); + print PXE "\tKERNEL $kernel\n"; + print PXE "\tAPPEND $system->{kernel_params}\n"; + print PXE "\tIPAPPEND 1\n"; } close(PXE); } @@ -206,17 +213,17 @@ sub writeSystemPXEFiles { my $system = shift; - my $pxePath = "$exportPath/pxe/pxelinux.cfg"; + my $pxePath = "$exportPath/pxe"; my @kernelFiles = aggregatedKernelFilesOfSystem($openslxDB, $system); foreach my $kernelFile (@kernelFiles) { vlog 1, _tr('copying kernel %s to %s/', $kernelFile, $pxePath); system(qq[cp -a "$kernelFile" $pxePath/]) unless $dryRun; } - foreach my $initramFile (aggregatedInitramFilesOfSystem($openslxDB, $system)) { - vlog 1, _tr('copying initramfs %s to %s/', $initramFile, $pxePath); - system(qq[cp -a "$initramFile" $pxePath/]) unless $dryRun; - } +# foreach my $initramFile (aggregatedInitramFilesOfSystem($openslxDB, $system)) { +# vlog 1, _tr('copying initramfs %s to %s/', $initramFile, $pxePath); +# system(qq[cp -a "$initramFile" $pxePath/]) unless $dryRun; +# } } sub writeClientConfigurationsForSystem -- cgit v1.2.3-55-g7522