From a60c79e0c1b9b1bd3b9da5e14feb9bd833f425e0 Mon Sep 17 00:00:00 2001 From: yangsong Date: Tue, 4 Dec 2018 11:14:19 +0800 Subject: [PATCH] support site.httpport in ubuntu diskless (#5865) --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index c36006d41..ab7896726 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -235,6 +235,11 @@ unless ($onlyinitrd) { my @pkgdir_internet; #Put all the http mirror in ths array, but only the first http mirror which will be used to create bootstrap my @pkgdir_local; #Put all directories except first in this array my $masternode = xCAT::TableUtils->get_site_Master(); + my $httpport="80"; + my @hports=xCAT::TableUtils->get_site_attribute("httpport"); + if ($hports[0]){ + $httpport=$hports[0]; + } $srcdir = undef; foreach my $dir (@srcdirs) { if ($dir =~ /^http.*/) { @@ -246,7 +251,7 @@ unless ($onlyinitrd) { $srcdir = $dir; find(\&isaptdir, <$dir/>); } else { #set other directory to http url - my $osuurl = "http://$masternode$dir ./"; + my $osuurl = "http://$masternode:$httpport$dir ./"; push @pkgdir_local, $osuurl; } } @@ -347,7 +352,7 @@ unless ($onlyinitrd) { open($aptconfig, ">", "$rootimg_dir/etc/apt/sources.list"); if ($srcdir) { - print $aptconfig "deb http://$masternode$srcdir $dist main\n"; + print $aptconfig "deb http://$masternode:$httpport$srcdir $dist main\n"; } foreach (@pkgdir_internet) {