mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Fix remaining XCATPREFIX references, add an AF_INET failback for AF_INET6 lookup, fix ipmi perl script to properly include perl libraries from XCATROOT
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@206 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -46,6 +46,7 @@ rm -rf $RPM_BUILD_ROOT | ||||
| mkdir -p $RPM_BUILD_ROOT/usr/share/xcat/netboot/%{tarch}/nbroot | ||||
| cd $RPM_BUILD_ROOT/usr/share/xcat/netboot/%{tarch}/nbroot | ||||
| tar zxvf %{SOURCE1} | ||||
| chmod 755 etc/S40network bin/getdestiny bin/getdestiny.awk bin/getipmi bin/getipmi.awk | ||||
| cd - | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -188,12 +188,12 @@ sub mkinstall { | ||||
|     my $os = $ent->{os}; | ||||
|     my $arch = $ent->{arch}; | ||||
|     my $profile = $ent->{profile}; | ||||
|     unless (-r $::XCATPREFIX."/share/xcat/install/centos/".$ent->{profile}.".tmpl") { | ||||
|     unless (-r $::XCATROOT."/share/xcat/install/centos/".$ent->{profile}.".tmpl") { | ||||
|       $callback->({error=>["No kickstart template exists for ".$ent->{profile}],errorcode=>[1]}); | ||||
|       next; | ||||
|     } | ||||
|     #Call the Template class to do substitution to produce a kickstart file in the autoinst dir | ||||
|     xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/centos/".$ent->{profile}.".tmpl","/install/autoinst/".$node,$node); | ||||
|     xCAT::Template->subvars($::XCATROOT."/share/xcat/install/centos/".$ent->{profile}.".tmpl","/install/autoinst/".$node,$node); | ||||
|     mkpath "/install/postscripts/"; | ||||
|     xCAT::Postage->writescript($node,"/install/postscripts/".$node); | ||||
|     if (-r "/install/$os/$arch/images/pxeboot/vmlinuz"  | ||||
|   | ||||
| @@ -174,7 +174,7 @@ sub donodeent { | ||||
|     push @$content," port ".$cfgent->{termport}.";\n"; | ||||
|   } else { #a script method... | ||||
|     push @$content,"  type exec;\n"; | ||||
|     push @$content,"  exec ".$::XCATPREFIX."/share/xcat/cons/".$cmeth." ".$node.";\n" | ||||
|     push @$content,"  exec ".$::XCATROOT."/share/xcat/cons/".$cmeth." ".$node.";\n" | ||||
|   } | ||||
|   push @$content,"}\n"; | ||||
|   push @$content,"#xCAT END $node CONS\n"; | ||||
|   | ||||
| @@ -182,23 +182,23 @@ sub mkinstall { | ||||
|     my $os = $ent->{os}; | ||||
|     my $arch = $ent->{arch}; | ||||
|     my $profile = $ent->{profile}; | ||||
|     unless (-r $::XCATPREFIX."/share/xcat/install/rh/".$ent->{profile}.".tmpl" or  | ||||
|             -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$arch.tmpl" or | ||||
|             -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$os.tmpl" or | ||||
|             -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$os.$arch.tmpl") { | ||||
|     unless (-r $::XCATROOT."/share/xcat/install/rh/".$ent->{profile}.".tmpl" or  | ||||
|             -r $::XCATROOT."/share/xcat/install/rh/$profile.$arch.tmpl" or | ||||
|             -r $::XCATROOT."/share/xcat/install/rh/$profile.$os.tmpl" or | ||||
|             -r $::XCATROOT."/share/xcat/install/rh/$profile.$os.$arch.tmpl") { | ||||
|       $callback->({error=>["No kickstart template exists for ".$ent->{profile}],errorcode=>[1]}); | ||||
|       next; | ||||
|     } | ||||
|     #Call the Template class to do substitution to produce a kickstart file in the autoinst dir | ||||
|      | ||||
|     if ( -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$os.$arch.tmpl" ) {  | ||||
|        xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/rh/$profile.$os.$arch.tmpl","/install/autoinst/".$node,$node); | ||||
|     } elsif ( -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$arch.tmpl" ) {  | ||||
|        xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/rh/$profile.$arch.tmpl","/install/autoinst/".$node,$node); | ||||
|     } elsif ( -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$os.tmpl" ) {  | ||||
|        xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/rh/$profile.$os.tmpl","/install/autoinst/".$node,$node); | ||||
|     if ( -r $::XCATROOT."/share/xcat/install/rh/$profile.$os.$arch.tmpl" ) {  | ||||
|        xCAT::Template->subvars($::XCATROOT."/share/xcat/install/rh/$profile.$os.$arch.tmpl","/install/autoinst/".$node,$node); | ||||
|     } elsif ( -r $::XCATROOT."/share/xcat/install/rh/$profile.$arch.tmpl" ) {  | ||||
|        xCAT::Template->subvars($::XCATROOT."/share/xcat/install/rh/$profile.$arch.tmpl","/install/autoinst/".$node,$node); | ||||
|     } elsif ( -r $::XCATROOT."/share/xcat/install/rh/$profile.$os.tmpl" ) {  | ||||
|        xCAT::Template->subvars($::XCATROOT."/share/xcat/install/rh/$profile.$os.tmpl","/install/autoinst/".$node,$node); | ||||
|     } else { | ||||
|        xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/rh/".$ent->{profile}.".tmpl","/install/autoinst/".$node,$node); | ||||
|        xCAT::Template->subvars($::XCATROOT."/share/xcat/install/rh/".$ent->{profile}.".tmpl","/install/autoinst/".$node,$node); | ||||
|     } | ||||
|     mkpath "/install/postscripts/"; | ||||
|     xCAT::Postage->writescript($node,"/install/postscripts/".$node); | ||||
|   | ||||
| @@ -53,23 +53,23 @@ sub mkinstall { | ||||
|     my $arch = $ent->{arch}; | ||||
|     my $profile = $ent->{profile}; | ||||
|     unless ( | ||||
|         -r $::XCATPREFIX."/share/xcat/install/sles/$profile.tmpl" or | ||||
|         -r $::XCATPREFIX."/share/xcat/install/sles/$profile.$arch.tmpl" or | ||||
|         -r $::XCATPREFIX."/share/xcat/install/sles/$profile.$os.tmpl" or | ||||
|         -r $::XCATPREFIX."/share/xcat/install/sles/$profile.$os.$arch.tmpl" | ||||
|         -r $::XCATROOT."/share/xcat/install/sles/$profile.tmpl" or | ||||
|         -r $::XCATROOT."/share/xcat/install/sles/$profile.$arch.tmpl" or | ||||
|         -r $::XCATROOT."/share/xcat/install/sles/$profile.$os.tmpl" or | ||||
|         -r $::XCATROOT."/share/xcat/install/sles/$profile.$os.$arch.tmpl" | ||||
|         ) { | ||||
|       $callback->({error=>["No AutoYaST template exists for ".$ent->{profile}],errorcode=>[1]}); | ||||
|       next; | ||||
|     } | ||||
|     #Call the Template class to do substitution to produce a kickstart file in the autoinst dir | ||||
|     if (-r $::XCATPREFIX."/share/xcat/install/sles/$profile.$os.$arch.tmpl") { | ||||
|         xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/sles/$profile.$os.$arch.tmpl","/install/autoinst/$node",$node); | ||||
|     } elsif (-r $::XCATPREFIX."/share/xcat/install/sles/$profile.$arch.tmpl") { | ||||
|         xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/sles/$profile.$arch.tmpl","/install/autoinst/$node",$node); | ||||
|     } elsif (-r $::XCATPREFIX."/share/xcat/install/sles/$profile.$os.tmpl") { | ||||
|         xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/sles/$profile.$os.tmpl","/install/autoinst/$node",$node); | ||||
|     } elsif (-r $::XCATPREFIX."/share/xcat/install/sles/$profile.tmpl") { | ||||
|         xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/sles/$profile.tmpl","/install/autoinst/$node",$node); | ||||
|     if (-r $::XCATROOT."/share/xcat/install/sles/$profile.$os.$arch.tmpl") { | ||||
|         xCAT::Template->subvars($::XCATROOT."/share/xcat/install/sles/$profile.$os.$arch.tmpl","/install/autoinst/$node",$node); | ||||
|     } elsif (-r $::XCATROOT."/share/xcat/install/sles/$profile.$arch.tmpl") { | ||||
|         xCAT::Template->subvars($::XCATROOT."/share/xcat/install/sles/$profile.$arch.tmpl","/install/autoinst/$node",$node); | ||||
|     } elsif (-r $::XCATROOT."/share/xcat/install/sles/$profile.$os.tmpl") { | ||||
|         xCAT::Template->subvars($::XCATROOT."/share/xcat/install/sles/$profile.$os.tmpl","/install/autoinst/$node",$node); | ||||
|     } elsif (-r $::XCATROOT."/share/xcat/install/sles/$profile.tmpl") { | ||||
|         xCAT::Template->subvars($::XCATROOT."/share/xcat/install/sles/$profile.tmpl","/install/autoinst/$node",$node); | ||||
|     } | ||||
|     mkpath "/install/postscripts/"; | ||||
|     xCAT::Postage->writescript($node,"/install/postscripts/".$node); | ||||
|   | ||||
| @@ -298,6 +298,7 @@ until ($quit) { | ||||
|         $domain = $tmp->{value}; | ||||
|     } | ||||
|     $peerhost = gethostbyaddr($connection->peeraddr,AF_INET6); | ||||
|     unless ($peerhost) { $peerhost = gethostbyaddr($connection->peeraddr,AF_INET); } | ||||
|     $peerhost =~ s/\.$domain\.*$//; | ||||
|     $peerhost =~ s/-eth\d*$//; | ||||
|     $peerhost =~ s/-myri\d*$//; | ||||
|   | ||||
| @@ -1,5 +1,11 @@ | ||||
| #!/usr/bin/env perl | ||||
| # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html | ||||
| BEGIN | ||||
| { | ||||
|     $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; | ||||
| } | ||||
| $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; | ||||
| use lib "$::XCATROOT/lib/perl"; | ||||
| use xCAT::Table; | ||||
| my $dba; | ||||
| my $ipmitab = xCAT::Table->new('ipmi'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user