diff --git a/build-ubunturepo b/build-ubunturepo index f8ae7a10d..d2d81d47d 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -86,7 +86,7 @@ if [ "$c_flag" -a "$d_flag" ];then exit 2 fi -uploader="bp-sawyers" +uploader="ligc" # Find where this script is located to set some build variables old_pwd=`pwd` cd `dirname $0` @@ -279,7 +279,7 @@ __EOF__ cat << '__EOF__' > mklocalrepo.sh . /etc/lsb-release cd `dirname $0` -echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-core.list +echo deb [arch=amd64] file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-core.list __EOF__ chmod 775 mklocalrepo.sh @@ -380,7 +380,7 @@ __EOF__ cat << '__EOF__' > mklocalrepo.sh . /etc/lsb-release cd `dirname $0` -echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-dep.list +echo deb [arch=amd64] file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-dep.list __EOF__ chmod 775 mklocalrepo.sh diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 82dc54ce5..3ba3117c4 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -105,11 +105,6 @@ sub subvars { } - my @managedaddressmode = xCAT::TableUtils->get_site_attribute("managedaddressmode"); - my $tmp=$managedaddressmode[0]; - if( defined($tmp) ){ - $ENV{MANAGEDADDRESSMODE}=$tmp; - } #replace the env with the right value so that correct include files can be found $inc =~ s/#ENV:([^#]+)#/envvar($1)/eg; @@ -248,6 +243,7 @@ sub subvars { $inc =~ s/#WINDISABLENULLADMIN#/windows_disable_null_admin()/eg; $inc =~ s/#MANAGEDADDRESSMODE#/managed_address_mode()/eg; $inc =~ s/#HOSTNAME#/$node/g; + $inc =~ s/#GETNODEDOMAIN:([^#]+)#/get_node_domain($1)/eg; my $nrtab = xCAT::Table->new("noderes"); my $tftpserver = $nrtab->getNodeAttribs($node, ['tftpserver']); @@ -619,6 +615,22 @@ sub get_win_prodkey { sub managed_address_mode { return $::XCATSITEVALS{managedaddressmode}; } + + +sub get_node_domain { + my $lcnode=shift; + if ( $lcnode eq 'THISNODE' ){ + $lcnode=$node; + } + + my $nd = xCAT::NetworkUtils->getNodeDomains([$lcnode]); + my %nodedomains = %$nd; + my $domain=$nodedomains{$lcnode}; + + return $domain; + +} + sub esxipv6setup { if (not $::XCATSITEVALS{managedaddressmode} or $::XCATSITEVALS{managedaddressmode} =~ /v4/) { return ""; } # blank line for ipv4 schemes my $v6addr; @@ -686,7 +698,7 @@ sub kickstartnetwork { push @nameserversIP, $ip; } - + #there is no network option to set dns search domain in kickstart, it will be set in %post if (scalar @nameserversIP) { $line .=" --nameserver=". join(",",@nameserversIP); } diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 1a936d5c8..22c6dcdb6 100755 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -884,10 +884,15 @@ sub check_options # if not help and not -n, dhcpd needs to be running if (!($opt->{h})&& (!($opt->{n}))) { if (xCAT::Utils->isLinux()) { - my @output = xCAT::Utils->runcmd("service dhcpd status", -1); + my $DHCPSERVER="dhcpd"; + if( -e "/etc/init.d/isc-dhcp-server" ){ + $DHCPSERVER="isc-dhcp-server"; + } + + my @output = xCAT::Utils->runcmd("service $DHCPSERVER status", -1); if ($::RUNCMD_RC != 0) { # not running my $rsp = {}; - $rsp->{data}->[0] = "dhcpd is not running. Run service dhcpd start and rerun your command."; + $rsp->{data}->[0] = "$DHCPSERVER is not running. Run service $DHCPSERVER start and rerun your command."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; } diff --git a/xCAT-server/lib/xcat/plugins/mic.pm b/xCAT-server/lib/xcat/plugins/mic.pm index 1037c69b3..6da7c7395 100644 --- a/xCAT-server/lib/xcat/plugins/mic.pm +++ b/xCAT-server/lib/xcat/plugins/mic.pm @@ -612,7 +612,25 @@ sub rflash { # run the cmd on the host to flash the mic my @args = ("-s", "-v", "-e"); push @args, "$::XCATROOT/sbin/flashmic"; - my $master = $request->{'_xcatdest'}; + # assume that all hosts are on the same network connected to this master + # (otherwise, will need to move this call into loop above for each host + # and build separate miccfg calls for each unique returned value from + # my_ip_facing) + my $ipfn = xCAT::NetworkUtils->my_ip_facing(@hosts[0]); + if ($ipfn) { + $master = $ipfn; + } else { + my $hostname = ""; + my $hostnamecmd = "/bin/hostname"; + my @thostname = xCAT::Utils->runcmd($hostnamecmd, 0); + if ($::RUNCMD_RC = 0) { + $hostname = "from server $thostname[0]"; + } + xCAT::MsgUtils->message("E", {error=>["Cannot detect an active network interface $hostname to @hosts[0]."], errorcode=>["1"]}, $callback); + return; + } + +} push @args, ("-m", "$master"); push @args, ("-p", "$tftpdir/xcat/miccfg"); @@ -912,7 +930,23 @@ sub nodeset { # run the cmd on the host to configure the mic my @args = ("-s", "-v", "-e"); push @args, "$::XCATROOT/sbin/configmic"; - my $master = $request->{'_xcatdest'}; + # assume that all hosts are on the same network connected to this master + # (otherwise, will need to move this call into loop above for each host + # and build separate miccfg calls for each unique returned value from + # my_ip_facing) + my $ipfn = xCAT::NetworkUtils->my_ip_facing(@hosts[0]); + if ($ipfn) { + $master = $ipfn; + } else { + my $hostname = ""; + my $hostnamecmd = "/bin/hostname"; + my @thostname = xCAT::Utils->runcmd($hostnamecmd, 0); + if ($::RUNCMD_RC = 0) { + $hostname = "from server $thostname[0]"; + } + xCAT::MsgUtils->message("E", {error=>["Cannot detect an active network interface $hostname to @hosts[0]."], errorcode=>["1"]}, $callback); + return; + } push @args, ("-m", "$master"); push @args, ("-p", "$tftpdir/xcat/miccfg"); diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index d3a3a29fc..786dcbfd0 100755 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1183,11 +1183,19 @@ sub mkinstall } if(scalar @nameserversIP){ - $kcmdline .=" dns=".join(",",@nameserversIP); + $kcmdline .=" Nameserver=".join(",",@nameserversIP); } + + my $nd = xCAT::NetworkUtils->getNodeDomains([$node]); + my %nodedomains = %$nd; + my $domain=$nodedomains{$node}; + + $kcmdline .=" Domain=$domain "; } + + if (defined $sent->{serialport}) { diff --git a/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl index ec75d88bd..b32f1f01d 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl @@ -2,6 +2,7 @@ #cmdline lang en_US +#KICKSTARTNET# # # Where's the source? diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels6.x86_64.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhels6.x86_64.tmpl index 9f0fddf60..c77177ae7 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels6.x86_64.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhels6.x86_64.tmpl @@ -3,6 +3,7 @@ #cmdline lang en_US +#KICKSTARTNET# # # Where's the source? diff --git a/xCAT-server/share/xcat/install/scripts/post.rh.common b/xCAT-server/share/xcat/install/scripts/post.rh.common index f34fe6e5d..79bc733a7 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rh.common +++ b/xCAT-server/share/xcat/install/scripts/post.rh.common @@ -2,6 +2,8 @@ # Setup hostname # echo "post scripts" >/root/post.log + + export PRINIC=#TABLEBLANKOKAY:noderes:THISNODE:primarynic# if [ "$PRINIC" == "mac" ] then diff --git a/xCAT-server/share/xcat/install/scripts/post.sles.common b/xCAT-server/share/xcat/install/scripts/post.sles.common index cfe6f29cc..ae6db1e24 100644 --- a/xCAT-server/share/xcat/install/scripts/post.sles.common +++ b/xCAT-server/share/xcat/install/scripts/post.sles.common @@ -1,5 +1,5 @@ #!/bin/sh -export MANAGEDADDRESSMODE="#XCATVAR:MANAGEDADDRESSMODE#" +export MANAGEDADDRESSMODE=#MANAGEDADDRESSMODE# cd /etc/sysconfig/network diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index 113c5760b..346b6de73 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -14,6 +14,17 @@ if [ -r /tmp/updates/etc/pki/tls/certs/ca-bundle.crt ]; then fi +#there is no boot option to set dns search domain in kickstart file, +#the search domain in /etc/resolv.conf is set in the pre installation script +export MANAGEDADDRESSMODE=#MANAGEDADDRESSMODE# +export SEARCHDOMAIN=#GETNODEDOMAIN:THISNODE# + +if [ "$MANAGEDADDRESSMODE" == "static" ]; then + echo "#appended by %pre " >> /etc/resolv.conf + echo "search $SEARCHDOMAIN" >> /etc/resolv.conf +fi + + cat >/tmp/baz.py <