From 7a18f5beee274e2de7f60ed80441513f0268a097 Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 13 Dec 2018 14:38:55 +0800 Subject: [PATCH] fix issue Function "httpport" can not work on ubuntu + netboot=grub2 scenario #5869 (#5871) * support site.httpport in ubuntu diskless * fix issue Function httpport can not work on ubuntu + netboot=grub2 scenario #5869 --- xCAT-server/lib/perl/xCAT/Template.pm | 1 + xCAT-server/lib/xcat/plugins/debian.pm | 2 +- xCAT-server/share/xcat/install/ubuntu/compute.tmpl | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index c43753b27..759110740 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -391,6 +391,7 @@ sub subvars { $inc =~ s/#SHORTNAME#/$shortname/g; $inc =~ s/#GETNODEDOMAIN:([^#]+)#/get_node_domain($1)/eg; $inc =~ s/#GETPRINICMAC:([^#]+)#/xCAT::Utils::parseMacTabEntry(tabdb("mac",$1,"mac"),$1)/eg; + $inc =~ s/#COLONHTTPPORT#/$httpportsuffix/eg; if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) { $inc =~ s/#UNCOMMENTOENABLEDEBUGPORT#/ /g; diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 44b434e7f..d0bbd7225 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -872,7 +872,7 @@ sub mkinstall { my $kcmdline = "nofb utf8 auto url=http://" . $instserver . ":$httpport/install/autoinst/" . $node; $kcmdline .= " xcatd=" . $instserver; - $kcmdline .= " mirror/http/hostname=" . $instserver; + $kcmdline .= " mirror/http/hostname=" . $instserver.":$httpport"; if ($maxmem) { $kcmdline .= " mem=$maxmem"; } diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl index 8bc2f7538..e784e01ac 100644 --- a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl @@ -124,7 +124,7 @@ xserver-xorg xserver-xorg/config/monitor/mode-list \ d-i preseed/early_command string \ { \ echo "Running preseeding early_command Installation script..."; \ - wget http://`cat /tmp/xcatserver`/install/autoinst/#HOSTNAME#.pre; \ + wget http://`cat /tmp/xcatserver`#COLONHTTPPORT#/install/autoinst/#HOSTNAME#.pre; \ chmod u+x #HOSTNAME#.pre; \ ./#HOSTNAME#.pre; \ umount /media || true; \ @@ -135,7 +135,7 @@ d-i preseed/late_command string \ { \ cat /tmp/pre-install.log >> /target/var/log/xcat/xcat.log; \ echo "Running preseeding late_command Installation script..."; \ - wget http://`cat /tmp/xcatserver`/install/autoinst/#HOSTNAME#.post; \ + wget http://`cat /tmp/xcatserver`#COLONHTTPPORT#/install/autoinst/#HOSTNAME#.post; \ chmod u+x #HOSTNAME#.post; \ cp ./#HOSTNAME#.post /target/root/post.script; \ mount -o bind /proc /target/proc -t proc; \