From d02fb775fe8c4244fe3868ffaed7a57e8f8caff4 Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Tue, 10 Mar 2009 02:03:10 +0000 Subject: * pxe_prefix_ip support Usage: slxconfig change-system pxe_prefix_ip= Result: sets :: prefixes for initramfs/kernel and if no boot_uri is set it adds file:// to the pxe menu git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2706 95ad53e4-c205-0410-b2fa-d234c58c8868 --- boot-env/OpenSLX/BootEnvironment/PXE.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'boot-env/OpenSLX/BootEnvironment/PXE.pm') diff --git a/boot-env/OpenSLX/BootEnvironment/PXE.pm b/boot-env/OpenSLX/BootEnvironment/PXE.pm index fe72b1cf..f3c20e19 100644 --- a/boot-env/OpenSLX/BootEnvironment/PXE.pm +++ b/boot-env/OpenSLX/BootEnvironment/PXE.pm @@ -83,12 +83,22 @@ sub writeBootloaderMenuFor my $vendorOSName = $info->{'vendor-os'}->{name}; my $kernelName = basename($info->{'kernel-file'}); my $append = $info->{attrs}->{kernel_params}; - $append .= " initrd=$vendorOSName/$info->{'initramfs-name'}"; + my $pxePrefix = ''; + my $tftpPrefix = ''; + + # pxe_prefix_ip set and looks like a ip + if ($info->{'pxe_prefix_ip'} =~ m/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) { + $pxePrefix = "$info->{'pxe_prefix_ip'}::"; + $tftpPrefix = "tftp://$info->{'pxe_prefix_ip'}" if ! length($bootURI); + } + + $append .= " initrd=$pxePrefix$vendorOSName/$info->{'initramfs-name'}"; $append .= " file=$bootURI" if length($bootURI); + $append .= " file=$tftpPrefix" if length($tftpPrefix); $append .= " $clientAppend"; $slxLabels .= "LABEL openslx-$info->{'external-id'}\n"; $slxLabels .= "\tMENU LABEL ^$info->{pxeLabel}\n"; - $slxLabels .= "\tKERNEL $vendorOSName/$kernelName\n"; + $slxLabels .= "\tKERNEL $pxePrefix$vendorOSName/$kernelName\n"; $slxLabels .= "\tAPPEND $append\n"; $slxLabels .= "\tIPAPPEND 3\n"; my $helpText = $info->{description} || ''; -- cgit v1.2.3-55-g7522