diff options
author | Sebastian Schmelzer | 2009-03-10 03:03:10 +0100 |
---|---|---|
committer | Sebastian Schmelzer | 2009-03-10 03:03:10 +0100 |
commit | d02fb775fe8c4244fe3868ffaed7a57e8f8caff4 (patch) | |
tree | 81664a7e4377221ce26cc2879970ad9f1835f3db /boot-env/OpenSLX/BootEnvironment/PXE.pm | |
parent | vmchooser plugin: (diff) | |
download | core-d02fb775fe8c4244fe3868ffaed7a57e8f8caff4.tar.gz core-d02fb775fe8c4244fe3868ffaed7a57e8f8caff4.tar.xz core-d02fb775fe8c4244fe3868ffaed7a57e8f8caff4.zip |
* pxe_prefix_ip support
Usage: slxconfig change-system <system> pxe_prefix_ip=<ip>
Result: sets <ip>:: prefixes for initramfs/kernel and if no boot_uri is set
it adds file://<ip> to the pxe menu
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2706 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'boot-env/OpenSLX/BootEnvironment/PXE.pm')
-rw-r--r-- | boot-env/OpenSLX/BootEnvironment/PXE.pm | 14 |
1 files changed, 12 insertions, 2 deletions
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} || ''; |