From 89e9745a4fe802183dccba3ebd7bf84660342f8d Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Tue, 30 Apr 2019 11:52:31 +0800 Subject: [PATCH] Handle site.httpport for grub2-http --- xCAT-server/lib/xcat/plugins/grub2.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 12048e0d1..f9c133acd 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -230,11 +230,21 @@ sub setstate { # write entries to boot config file, but only if not offline directive if ($cref and $cref->{currstate} ne "offline") { + my $httpport = "80"; + my @hports = xCAT::TableUtils->get_site_attribute("httpport"); + if ($hports[0]) { + $httpport = $hports[0]; + } + print $pcfg "set default=\"xCAT OS Deployment\"\n"; print $pcfg "menuentry \"xCAT OS Deployment\" {\n"; print $pcfg " insmod http\n"; print $pcfg " insmod tftp\n"; - print $pcfg " set root=$grub2protocol,$serverip\n"; + if ($grub2protocol eq "http" && $httpport ne "80") { + print $pcfg " set root=http,$serverip:$httpport\n"; + } else { + print $pcfg " set root=$grub2protocol,$serverip\n"; + } print $pcfg " echo Loading Install kernel ...\n"; my $protocolrootdir = "";