From 10855117d20b57835d9b77cc692c7569015b193b Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 8 Jun 2008 12:34:41 +0000 Subject: * sort the labels in the boot menu git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1864 95ad53e4-c205-0410-b2fa-d234c58c8868 --- boot-env/OpenSLX/BootEnvironment/PXE.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'boot-env') diff --git a/boot-env/OpenSLX/BootEnvironment/PXE.pm b/boot-env/OpenSLX/BootEnvironment/PXE.pm index a764826d..931a2335 100644 --- a/boot-env/OpenSLX/BootEnvironment/PXE.pm +++ b/boot-env/OpenSLX/BootEnvironment/PXE.pm @@ -61,14 +61,8 @@ sub writeBootloaderMenuFor my $clientAppend = $client->{kernel_params} || ''; vlog(1, _tr("writing PXE-file %s", $pxeFile)); - my $slxLabels = ''; + # set label for each system foreach my $info (@$systemInfos) { - my $vendorOSName = $info->{'vendor-os'}->{name}; - my $kernelName = basename($info->{'kernel-file'}); - my $append = $info->{kernel_params}; - $append .= " initrd=$vendorOSName/$info->{'initramfs-name'}"; - $append .= " $clientAppend"; - $slxLabels .= "LABEL openslx-$info->{'external-id'}\n"; my $label = $info->{label} || ''; if (!length($label) || $label eq $info->{name}) { if ($info->{name} =~ m{^(.+)::(.+)$}) { @@ -79,7 +73,17 @@ sub writeBootloaderMenuFor $label = $info->{name}; } } - $slxLabels .= "\tMENU LABEL ^$label\n"; + $info->{label} = $label; + } + my $slxLabels = ''; + foreach my $info (sort { $a->{label} cmp $b->{label} } @$systemInfos) { + my $vendorOSName = $info->{'vendor-os'}->{name}; + my $kernelName = basename($info->{'kernel-file'}); + my $append = $info->{kernel_params}; + $append .= " initrd=$vendorOSName/$info->{'initramfs-name'}"; + $append .= " $clientAppend"; + $slxLabels .= "LABEL openslx-$info->{'external-id'}\n"; + $slxLabels .= "\tMENU LABEL ^$info->{label}\n"; $slxLabels .= "\tKERNEL $vendorOSName/$kernelName\n"; $slxLabels .= "\tAPPEND $append\n"; $slxLabels .= "\tIPAPPEND 1\n"; -- cgit v1.2.3-55-g7522