mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-30 19:02:27 +00:00 
			
		
		
		
	git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1561 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
		
			
				
	
	
		
			51 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Perl
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Perl
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env perl 
 | |
| use strict;
 | |
| use Getopt::Long;
 | |
| use File::Basename;
 | |
| sub usage {
 | |
|     print basename($0)." usage:\n";
 | |
|     print " ".basename($0)." [-o|--osver [-p|--profile] [-a|--arch] [-c|--console] <noderange>\n"
 | |
| }
 | |
| 
 | |
| my $OSVER;
 | |
| my $PROFILE;
 | |
| my $ARCH;
 | |
| my $CONSOLE;
 | |
| unless (GetOptions(
 | |
|     'o|osver=s' => \$OSVER,
 | |
|     'p|profile=s' => \$PROFILE,
 | |
|     'a|arch=s' => \$ARCH,
 | |
|     'c|console' => \$CONSOLE
 | |
|     )) {
 | |
|     usage;
 | |
|     exit 1;
 | |
| }
 | |
| my $noderange=join(',',@ARGV);
 | |
| my $nodechline = "";
 | |
| if ($OSVER) {
 | |
|     $nodechline = "nodetype.os=$OSVER";
 | |
| }
 | |
| if ($PROFILE) {
 | |
|     $nodechline .= " nodetype.profile=$PROFILE";
 | |
| }
 | |
| if ($ARCH) {
 | |
|     $nodechline .= " nodetype.arch=$ARCH";
 | |
| }
 | |
| 
 | |
| my $rc;
 | |
| if ($nodechline) {
 | |
|     $rc=system("nodech $noderange $nodechline");
 | |
| }
 | |
| if ($rc) { die "nodech failure" };
 | |
| $rc=system("nodeset $noderange install");
 | |
| if ($rc) { die "nodeset failure" };
 | |
| $rc=system("rpower $noderange boot");
 | |
| if ($rc) { die "rpower failure" };
 | |
| if (basename($0) =~ /rinstall/) {
 | |
|     if ($CONSOLE) {
 | |
|         exec("rcons $noderange");
 | |
|     }
 | |
| } elsif (basename($0) =~ /winstall/) {
 | |
|     exec("wcons $noderange");
 | |
| }
 |