Revert "Revert "fix for bug 4239: do not use ip command on AIX""
This reverts commit 5b348a322028e3a245c23595f6f7eaeaac2319f5.
This commit is contained in:
parent
5b348a3220
commit
64a2057a94
12
perl-xCAT/xCAT/InstUtils.pm
Normal file → Executable file
12
perl-xCAT/xCAT/InstUtils.pm
Normal file → Executable file
@ -217,7 +217,17 @@ sub is_me
|
||||
#my ($b1, $b2, $b3, $b4) = split /\./, $nameIP;
|
||||
|
||||
# get all the possible IPs for the node I'm running on
|
||||
my $ipcmd = "ip addr | grep 'inet'";
|
||||
# this is a common subroutine for both AIX and Linux,
|
||||
# AIX does not have ip command
|
||||
my $ipcmd;
|
||||
if ( -f "/sbin/ip" )
|
||||
{
|
||||
$ipcmd = "ip addr | grep 'inet'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ipcmd = "ifconfig -a | grep 'inet'";
|
||||
}
|
||||
my $result = xCAT::Utils->runcmd($ipcmd, -1, 1);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
|
@ -1 +0,0 @@
|
||||
xcatclient
|
102
xCAT-client/bin/chhypervisor
Executable file
102
xCAT-client/bin/chhypervisor
Executable file
@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
# Used as a standard client cmd that can be used for many of the xcat cmds.
|
||||
# It grabs the arguments, noderange, and stdin and then submits the request to
|
||||
# xcatd and waits for responses. Most of the client/server communication is
|
||||
# contained in Client.pm.
|
||||
|
||||
# To use this, sym link your cmd name to this script.
|
||||
|
||||
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use Cwd;
|
||||
#use IO::Socket::SSL;
|
||||
#use IO::Socket::INET;
|
||||
use File::Basename;
|
||||
#use Data::Dumper;
|
||||
use xCAT::Client;
|
||||
use strict;
|
||||
my $bname = basename($0);
|
||||
my $cmdref;
|
||||
if ($bname =~ /xcatclient/) { $cmdref->{command}->[0]=shift @ARGV; } # xcatclient was invoked directly and the 1st arg is cmd name that is used to locate the plugin
|
||||
else { $cmdref->{command}->[0] = $bname; } # the cmd was sym linked to xcatclient
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
|
||||
my $data;
|
||||
# allows our plugins to get the stdin of the cmd that invoked the plugin
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rin="";
|
||||
my $rout;
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
if ($nfound)
|
||||
{
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-p STDIN) {
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $arg;
|
||||
my @tmpargv = @ARGV;
|
||||
|
||||
# lslite needs to handle imagename besides noderange
|
||||
# so do not fill {noderange} if imagename given
|
||||
my $str = join(',', @tmpargv);
|
||||
if (($bname =~ /lslite/) && $str =~ /-i/)
|
||||
{
|
||||
$arg = "NO_NODE_RANGE";
|
||||
}
|
||||
else
|
||||
{ # Consider the 1st non-hyphen arg to be the noderange. All others (before and after) go on the arg list.
|
||||
$arg=shift(@ARGV);
|
||||
while ($arg =~ /^-/) {
|
||||
push (@{$cmdref->{arg}}, $arg);
|
||||
$arg=shift(@ARGV);
|
||||
}
|
||||
}
|
||||
|
||||
if ($arg ne "NO_NODE_RANGE") {
|
||||
# The noderange can be specified through a noderange file,
|
||||
# the noderange file can be a relative path,
|
||||
# convert the relative path to a full path.
|
||||
# an ideal way is converting the relative path in xCAT::Noderange::noderange,
|
||||
# but the existing xCAT::Noderange::noderange can not get the cwd(),
|
||||
# needs to change all the callers to pass the cwd(),
|
||||
# there are more than 100 callers.
|
||||
my @tempnr = ();
|
||||
foreach my $nr (split(/,/, $arg)) {
|
||||
if ($nr =~ /^\^(.*)$/) {
|
||||
my $nrf = $1;
|
||||
if ($nrf !~ /^\//) { #relative path
|
||||
$nrf = Cwd::abs_path($nrf);
|
||||
}
|
||||
$nrf = "\^" . $nrf;
|
||||
push @tempnr, $nrf;
|
||||
} else {
|
||||
push @tempnr, $nr;
|
||||
}
|
||||
}
|
||||
$arg = join(',',@tempnr);
|
||||
$cmdref->{noderange}->[0]=$arg;
|
||||
}
|
||||
if (@ARGV) {
|
||||
push (@{$cmdref->{arg}}, @ARGV);
|
||||
}
|
||||
foreach (keys %ENV) {
|
||||
if (/^XCAT_/) {
|
||||
$cmdref->{environment}->{$_} = $ENV{$_};
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
@ -1 +0,0 @@
|
||||
xcatclient
|
102
xCAT-client/bin/clonevm
Executable file
102
xCAT-client/bin/clonevm
Executable file
@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
# Used as a standard client cmd that can be used for many of the xcat cmds.
|
||||
# It grabs the arguments, noderange, and stdin and then submits the request to
|
||||
# xcatd and waits for responses. Most of the client/server communication is
|
||||
# contained in Client.pm.
|
||||
|
||||
# To use this, sym link your cmd name to this script.
|
||||
|
||||
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use Cwd;
|
||||
#use IO::Socket::SSL;
|
||||
#use IO::Socket::INET;
|
||||
use File::Basename;
|
||||
#use Data::Dumper;
|
||||
use xCAT::Client;
|
||||
use strict;
|
||||
my $bname = basename($0);
|
||||
my $cmdref;
|
||||
if ($bname =~ /xcatclient/) { $cmdref->{command}->[0]=shift @ARGV; } # xcatclient was invoked directly and the 1st arg is cmd name that is used to locate the plugin
|
||||
else { $cmdref->{command}->[0] = $bname; } # the cmd was sym linked to xcatclient
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
|
||||
my $data;
|
||||
# allows our plugins to get the stdin of the cmd that invoked the plugin
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rin="";
|
||||
my $rout;
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
if ($nfound)
|
||||
{
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-p STDIN) {
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $arg;
|
||||
my @tmpargv = @ARGV;
|
||||
|
||||
# lslite needs to handle imagename besides noderange
|
||||
# so do not fill {noderange} if imagename given
|
||||
my $str = join(',', @tmpargv);
|
||||
if (($bname =~ /lslite/) && $str =~ /-i/)
|
||||
{
|
||||
$arg = "NO_NODE_RANGE";
|
||||
}
|
||||
else
|
||||
{ # Consider the 1st non-hyphen arg to be the noderange. All others (before and after) go on the arg list.
|
||||
$arg=shift(@ARGV);
|
||||
while ($arg =~ /^-/) {
|
||||
push (@{$cmdref->{arg}}, $arg);
|
||||
$arg=shift(@ARGV);
|
||||
}
|
||||
}
|
||||
|
||||
if ($arg ne "NO_NODE_RANGE") {
|
||||
# The noderange can be specified through a noderange file,
|
||||
# the noderange file can be a relative path,
|
||||
# convert the relative path to a full path.
|
||||
# an ideal way is converting the relative path in xCAT::Noderange::noderange,
|
||||
# but the existing xCAT::Noderange::noderange can not get the cwd(),
|
||||
# needs to change all the callers to pass the cwd(),
|
||||
# there are more than 100 callers.
|
||||
my @tempnr = ();
|
||||
foreach my $nr (split(/,/, $arg)) {
|
||||
if ($nr =~ /^\^(.*)$/) {
|
||||
my $nrf = $1;
|
||||
if ($nrf !~ /^\//) { #relative path
|
||||
$nrf = Cwd::abs_path($nrf);
|
||||
}
|
||||
$nrf = "\^" . $nrf;
|
||||
push @tempnr, $nrf;
|
||||
} else {
|
||||
push @tempnr, $nr;
|
||||
}
|
||||
}
|
||||
$arg = join(',',@tempnr);
|
||||
$cmdref->{noderange}->[0]=$arg;
|
||||
}
|
||||
if (@ARGV) {
|
||||
push (@{$cmdref->{arg}}, @ARGV);
|
||||
}
|
||||
foreach (keys %ENV) {
|
||||
if (/^XCAT_/) {
|
||||
$cmdref->{environment}->{$_} = $ENV{$_};
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
@ -1 +0,0 @@
|
||||
xcatclient
|
102
xCAT-client/bin/rmigrate
Executable file
102
xCAT-client/bin/rmigrate
Executable file
@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
# Used as a standard client cmd that can be used for many of the xcat cmds.
|
||||
# It grabs the arguments, noderange, and stdin and then submits the request to
|
||||
# xcatd and waits for responses. Most of the client/server communication is
|
||||
# contained in Client.pm.
|
||||
|
||||
# To use this, sym link your cmd name to this script.
|
||||
|
||||
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use Cwd;
|
||||
#use IO::Socket::SSL;
|
||||
#use IO::Socket::INET;
|
||||
use File::Basename;
|
||||
#use Data::Dumper;
|
||||
use xCAT::Client;
|
||||
use strict;
|
||||
my $bname = basename($0);
|
||||
my $cmdref;
|
||||
if ($bname =~ /xcatclient/) { $cmdref->{command}->[0]=shift @ARGV; } # xcatclient was invoked directly and the 1st arg is cmd name that is used to locate the plugin
|
||||
else { $cmdref->{command}->[0] = $bname; } # the cmd was sym linked to xcatclient
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
|
||||
my $data;
|
||||
# allows our plugins to get the stdin of the cmd that invoked the plugin
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rin="";
|
||||
my $rout;
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
if ($nfound)
|
||||
{
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-p STDIN) {
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $arg;
|
||||
my @tmpargv = @ARGV;
|
||||
|
||||
# lslite needs to handle imagename besides noderange
|
||||
# so do not fill {noderange} if imagename given
|
||||
my $str = join(',', @tmpargv);
|
||||
if (($bname =~ /lslite/) && $str =~ /-i/)
|
||||
{
|
||||
$arg = "NO_NODE_RANGE";
|
||||
}
|
||||
else
|
||||
{ # Consider the 1st non-hyphen arg to be the noderange. All others (before and after) go on the arg list.
|
||||
$arg=shift(@ARGV);
|
||||
while ($arg =~ /^-/) {
|
||||
push (@{$cmdref->{arg}}, $arg);
|
||||
$arg=shift(@ARGV);
|
||||
}
|
||||
}
|
||||
|
||||
if ($arg ne "NO_NODE_RANGE") {
|
||||
# The noderange can be specified through a noderange file,
|
||||
# the noderange file can be a relative path,
|
||||
# convert the relative path to a full path.
|
||||
# an ideal way is converting the relative path in xCAT::Noderange::noderange,
|
||||
# but the existing xCAT::Noderange::noderange can not get the cwd(),
|
||||
# needs to change all the callers to pass the cwd(),
|
||||
# there are more than 100 callers.
|
||||
my @tempnr = ();
|
||||
foreach my $nr (split(/,/, $arg)) {
|
||||
if ($nr =~ /^\^(.*)$/) {
|
||||
my $nrf = $1;
|
||||
if ($nrf !~ /^\//) { #relative path
|
||||
$nrf = Cwd::abs_path($nrf);
|
||||
}
|
||||
$nrf = "\^" . $nrf;
|
||||
push @tempnr, $nrf;
|
||||
} else {
|
||||
push @tempnr, $nr;
|
||||
}
|
||||
}
|
||||
$arg = join(',',@tempnr);
|
||||
$cmdref->{noderange}->[0]=$arg;
|
||||
}
|
||||
if (@ARGV) {
|
||||
push (@{$cmdref->{arg}}, @ARGV);
|
||||
}
|
||||
foreach (keys %ENV) {
|
||||
if (/^XCAT_/) {
|
||||
$cmdref->{environment}->{$_} = $ENV{$_};
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
@ -1 +0,0 @@
|
||||
xcatclient
|
102
xCAT-client/bin/rshutdown
Executable file
102
xCAT-client/bin/rshutdown
Executable file
@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
# Used as a standard client cmd that can be used for many of the xcat cmds.
|
||||
# It grabs the arguments, noderange, and stdin and then submits the request to
|
||||
# xcatd and waits for responses. Most of the client/server communication is
|
||||
# contained in Client.pm.
|
||||
|
||||
# To use this, sym link your cmd name to this script.
|
||||
|
||||
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use Cwd;
|
||||
#use IO::Socket::SSL;
|
||||
#use IO::Socket::INET;
|
||||
use File::Basename;
|
||||
#use Data::Dumper;
|
||||
use xCAT::Client;
|
||||
use strict;
|
||||
my $bname = basename($0);
|
||||
my $cmdref;
|
||||
if ($bname =~ /xcatclient/) { $cmdref->{command}->[0]=shift @ARGV; } # xcatclient was invoked directly and the 1st arg is cmd name that is used to locate the plugin
|
||||
else { $cmdref->{command}->[0] = $bname; } # the cmd was sym linked to xcatclient
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
|
||||
my $data;
|
||||
# allows our plugins to get the stdin of the cmd that invoked the plugin
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rin="";
|
||||
my $rout;
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
if ($nfound)
|
||||
{
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-p STDIN) {
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $arg;
|
||||
my @tmpargv = @ARGV;
|
||||
|
||||
# lslite needs to handle imagename besides noderange
|
||||
# so do not fill {noderange} if imagename given
|
||||
my $str = join(',', @tmpargv);
|
||||
if (($bname =~ /lslite/) && $str =~ /-i/)
|
||||
{
|
||||
$arg = "NO_NODE_RANGE";
|
||||
}
|
||||
else
|
||||
{ # Consider the 1st non-hyphen arg to be the noderange. All others (before and after) go on the arg list.
|
||||
$arg=shift(@ARGV);
|
||||
while ($arg =~ /^-/) {
|
||||
push (@{$cmdref->{arg}}, $arg);
|
||||
$arg=shift(@ARGV);
|
||||
}
|
||||
}
|
||||
|
||||
if ($arg ne "NO_NODE_RANGE") {
|
||||
# The noderange can be specified through a noderange file,
|
||||
# the noderange file can be a relative path,
|
||||
# convert the relative path to a full path.
|
||||
# an ideal way is converting the relative path in xCAT::Noderange::noderange,
|
||||
# but the existing xCAT::Noderange::noderange can not get the cwd(),
|
||||
# needs to change all the callers to pass the cwd(),
|
||||
# there are more than 100 callers.
|
||||
my @tempnr = ();
|
||||
foreach my $nr (split(/,/, $arg)) {
|
||||
if ($nr =~ /^\^(.*)$/) {
|
||||
my $nrf = $1;
|
||||
if ($nrf !~ /^\//) { #relative path
|
||||
$nrf = Cwd::abs_path($nrf);
|
||||
}
|
||||
$nrf = "\^" . $nrf;
|
||||
push @tempnr, $nrf;
|
||||
} else {
|
||||
push @tempnr, $nr;
|
||||
}
|
||||
}
|
||||
$arg = join(',',@tempnr);
|
||||
$cmdref->{noderange}->[0]=$arg;
|
||||
}
|
||||
if (@ARGV) {
|
||||
push (@{$cmdref->{arg}}, @ARGV);
|
||||
}
|
||||
foreach (keys %ENV) {
|
||||
if (/^XCAT_/) {
|
||||
$cmdref->{environment}->{$_} = $ENV{$_};
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
@ -1 +0,0 @@
|
||||
xcatclient
|
102
xCAT-client/bin/rspconfig
Executable file
102
xCAT-client/bin/rspconfig
Executable file
@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
# Used as a standard client cmd that can be used for many of the xcat cmds.
|
||||
# It grabs the arguments, noderange, and stdin and then submits the request to
|
||||
# xcatd and waits for responses. Most of the client/server communication is
|
||||
# contained in Client.pm.
|
||||
|
||||
# To use this, sym link your cmd name to this script.
|
||||
|
||||
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use Cwd;
|
||||
#use IO::Socket::SSL;
|
||||
#use IO::Socket::INET;
|
||||
use File::Basename;
|
||||
#use Data::Dumper;
|
||||
use xCAT::Client;
|
||||
use strict;
|
||||
my $bname = basename($0);
|
||||
my $cmdref;
|
||||
if ($bname =~ /xcatclient/) { $cmdref->{command}->[0]=shift @ARGV; } # xcatclient was invoked directly and the 1st arg is cmd name that is used to locate the plugin
|
||||
else { $cmdref->{command}->[0] = $bname; } # the cmd was sym linked to xcatclient
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
|
||||
my $data;
|
||||
# allows our plugins to get the stdin of the cmd that invoked the plugin
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rin="";
|
||||
my $rout;
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
if ($nfound)
|
||||
{
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-p STDIN) {
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $arg;
|
||||
my @tmpargv = @ARGV;
|
||||
|
||||
# lslite needs to handle imagename besides noderange
|
||||
# so do not fill {noderange} if imagename given
|
||||
my $str = join(',', @tmpargv);
|
||||
if (($bname =~ /lslite/) && $str =~ /-i/)
|
||||
{
|
||||
$arg = "NO_NODE_RANGE";
|
||||
}
|
||||
else
|
||||
{ # Consider the 1st non-hyphen arg to be the noderange. All others (before and after) go on the arg list.
|
||||
$arg=shift(@ARGV);
|
||||
while ($arg =~ /^-/) {
|
||||
push (@{$cmdref->{arg}}, $arg);
|
||||
$arg=shift(@ARGV);
|
||||
}
|
||||
}
|
||||
|
||||
if ($arg ne "NO_NODE_RANGE") {
|
||||
# The noderange can be specified through a noderange file,
|
||||
# the noderange file can be a relative path,
|
||||
# convert the relative path to a full path.
|
||||
# an ideal way is converting the relative path in xCAT::Noderange::noderange,
|
||||
# but the existing xCAT::Noderange::noderange can not get the cwd(),
|
||||
# needs to change all the callers to pass the cwd(),
|
||||
# there are more than 100 callers.
|
||||
my @tempnr = ();
|
||||
foreach my $nr (split(/,/, $arg)) {
|
||||
if ($nr =~ /^\^(.*)$/) {
|
||||
my $nrf = $1;
|
||||
if ($nrf !~ /^\//) { #relative path
|
||||
$nrf = Cwd::abs_path($nrf);
|
||||
}
|
||||
$nrf = "\^" . $nrf;
|
||||
push @tempnr, $nrf;
|
||||
} else {
|
||||
push @tempnr, $nr;
|
||||
}
|
||||
}
|
||||
$arg = join(',',@tempnr);
|
||||
$cmdref->{noderange}->[0]=$arg;
|
||||
}
|
||||
if (@ARGV) {
|
||||
push (@{$cmdref->{arg}}, @ARGV);
|
||||
}
|
||||
foreach (keys %ENV) {
|
||||
if (/^XCAT_/) {
|
||||
$cmdref->{environment}->{$_} = $ENV{$_};
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
@ -1 +0,0 @@
|
||||
xcatclient
|
102
xCAT-client/bin/switchblade
Executable file
102
xCAT-client/bin/switchblade
Executable file
@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
# Used as a standard client cmd that can be used for many of the xcat cmds.
|
||||
# It grabs the arguments, noderange, and stdin and then submits the request to
|
||||
# xcatd and waits for responses. Most of the client/server communication is
|
||||
# contained in Client.pm.
|
||||
|
||||
# To use this, sym link your cmd name to this script.
|
||||
|
||||
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use Cwd;
|
||||
#use IO::Socket::SSL;
|
||||
#use IO::Socket::INET;
|
||||
use File::Basename;
|
||||
#use Data::Dumper;
|
||||
use xCAT::Client;
|
||||
use strict;
|
||||
my $bname = basename($0);
|
||||
my $cmdref;
|
||||
if ($bname =~ /xcatclient/) { $cmdref->{command}->[0]=shift @ARGV; } # xcatclient was invoked directly and the 1st arg is cmd name that is used to locate the plugin
|
||||
else { $cmdref->{command}->[0] = $bname; } # the cmd was sym linked to xcatclient
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
|
||||
my $data;
|
||||
# allows our plugins to get the stdin of the cmd that invoked the plugin
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rin="";
|
||||
my $rout;
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
if ($nfound)
|
||||
{
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-p STDIN) {
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $arg;
|
||||
my @tmpargv = @ARGV;
|
||||
|
||||
# lslite needs to handle imagename besides noderange
|
||||
# so do not fill {noderange} if imagename given
|
||||
my $str = join(',', @tmpargv);
|
||||
if (($bname =~ /lslite/) && $str =~ /-i/)
|
||||
{
|
||||
$arg = "NO_NODE_RANGE";
|
||||
}
|
||||
else
|
||||
{ # Consider the 1st non-hyphen arg to be the noderange. All others (before and after) go on the arg list.
|
||||
$arg=shift(@ARGV);
|
||||
while ($arg =~ /^-/) {
|
||||
push (@{$cmdref->{arg}}, $arg);
|
||||
$arg=shift(@ARGV);
|
||||
}
|
||||
}
|
||||
|
||||
if ($arg ne "NO_NODE_RANGE") {
|
||||
# The noderange can be specified through a noderange file,
|
||||
# the noderange file can be a relative path,
|
||||
# convert the relative path to a full path.
|
||||
# an ideal way is converting the relative path in xCAT::Noderange::noderange,
|
||||
# but the existing xCAT::Noderange::noderange can not get the cwd(),
|
||||
# needs to change all the callers to pass the cwd(),
|
||||
# there are more than 100 callers.
|
||||
my @tempnr = ();
|
||||
foreach my $nr (split(/,/, $arg)) {
|
||||
if ($nr =~ /^\^(.*)$/) {
|
||||
my $nrf = $1;
|
||||
if ($nrf !~ /^\//) { #relative path
|
||||
$nrf = Cwd::abs_path($nrf);
|
||||
}
|
||||
$nrf = "\^" . $nrf;
|
||||
push @tempnr, $nrf;
|
||||
} else {
|
||||
push @tempnr, $nr;
|
||||
}
|
||||
}
|
||||
$arg = join(',',@tempnr);
|
||||
$cmdref->{noderange}->[0]=$arg;
|
||||
}
|
||||
if (@ARGV) {
|
||||
push (@{$cmdref->{arg}}, @ARGV);
|
||||
}
|
||||
foreach (keys %ENV) {
|
||||
if (/^XCAT_/) {
|
||||
$cmdref->{environment}->{$_} = $ENV{$_};
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
@ -1 +0,0 @@
|
||||
rinstall
|
87
xCAT-client/bin/winstall
Executable file
87
xCAT-client/bin/winstall
Executable file
@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
# Used as a convience command combined of [nodech]-nodeset-rsetboot-rpower-[rcons/wcons]
|
||||
# to make ease of node OS provision
|
||||
|
||||
# This is the client front-end to rinstall/winstall commands
|
||||
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT =
|
||||
$ENV{'XCATROOT'} ? $ENV{'XCATROOT'}
|
||||
: -d '/opt/xcat' ? '/opt/xcat'
|
||||
: '/usr';
|
||||
}
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use File::Basename;
|
||||
use Getopt::Long;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::Utils;
|
||||
use xCAT::Client;
|
||||
use Cwd;
|
||||
use strict;
|
||||
|
||||
# build a request to go the rinstall plugin
|
||||
my $bname = basename($0);
|
||||
my $cmdref;
|
||||
$cmdref->{command}->[0] = $bname;
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
# allows our plugins to get the stdin of the cmd that invoked the plugin
|
||||
my $data;
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rin="";
|
||||
my $rout;
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
if ($nfound)
|
||||
{
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-p STDIN) {
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
my $arg;
|
||||
my @tmpargv = @ARGV;
|
||||
# first
|
||||
$arg=shift(@ARGV);
|
||||
# first 1st non-hyphen arg is the noderange
|
||||
while ($arg =~ /^-/) {
|
||||
push (@{$cmdref->{arg}}, $arg);
|
||||
$arg=shift(@ARGV);
|
||||
}
|
||||
$cmdref->{noderange}->[0]=$arg;
|
||||
push (@{$cmdref->{arg}}, @ARGV);
|
||||
|
||||
my $noderange=$cmdref->{noderange}->[0]; # save the noderange
|
||||
|
||||
# ok call Client to run the plugin rinstall.pm
|
||||
xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response);
|
||||
|
||||
if ($xCAT::Client::EXITCODE == 0) # no errors
|
||||
{
|
||||
my $startconsole=$cmdref->{startconsole}->[0];
|
||||
# if startconsole requested ( -c flag) for rinstall always for winstall
|
||||
# This is set in the rinstall plugin
|
||||
if ($startconsole == 1) {
|
||||
if (basename($0) =~ /rinstall/) {
|
||||
|
||||
exec("rcons $noderange");
|
||||
}
|
||||
elsif (basename($0) =~ /winstall/) {
|
||||
# winstall can commence a wcons command to the noderange for monitoring the provision cycle
|
||||
|
||||
exec("wcons $noderange");
|
||||
}
|
||||
}
|
||||
}
|
||||
exit $xCAT::Client::EXITCODE;
|
@ -1 +0,0 @@
|
||||
../rh/compute.rhels6.pkglist
|
8
xCAT-server/share/xcat/install/SL/compute.SL6.pkglist
Normal file
8
xCAT-server/share/xcat/install/SL/compute.SL6.pkglist
Normal file
@ -0,0 +1,8 @@
|
||||
#Please make sure there is a space between @ and group name
|
||||
ntp
|
||||
nfs-utils
|
||||
net-snmp
|
||||
rsync
|
||||
yp-tools
|
||||
openssh-server
|
||||
util-linux-ng
|
@ -1 +0,0 @@
|
||||
../rh/compute.rhels6.tmpl
|
149
xCAT-server/share/xcat/install/SL/compute.SL6.tmpl
Normal file
149
xCAT-server/share/xcat/install/SL/compute.SL6.tmpl
Normal file
@ -0,0 +1,149 @@
|
||||
#
|
||||
#cmdline
|
||||
|
||||
lang en_US
|
||||
|
||||
#
|
||||
# Where's the source?
|
||||
# nfs --server hostname.of.server or IP --dir /path/to/RH/CD/image
|
||||
#
|
||||
#nfs --server #XCATVAR:INSTALL_NFS# --dir #XCATVAR:INSTALL_SRC_DIR#
|
||||
|
||||
%include /tmp/repos
|
||||
|
||||
#device ethernet e100
|
||||
keyboard "us"
|
||||
|
||||
#
|
||||
# Clear the MBR
|
||||
#
|
||||
zerombr
|
||||
|
||||
#
|
||||
# Wipe out the disk
|
||||
#
|
||||
clearpart --all --initlabel
|
||||
#clearpart --linux
|
||||
key --skip
|
||||
|
||||
#
|
||||
# Customize to fit your needs
|
||||
#
|
||||
|
||||
#XCAT_PARTITION_START#
|
||||
#No RAID
|
||||
#/boot really significant for this sort of setup nowadays?
|
||||
#part /boot --size 50 --fstype ext3
|
||||
%include /tmp/partitioning
|
||||
#part swap --size 1024
|
||||
#part / --size 1 --grow --fstype ext4
|
||||
#XCAT_PARTITION_END#
|
||||
|
||||
#RAID 0 /scr for performance
|
||||
#part / --size 1024 --ondisk sda
|
||||
#part swap --size 512 --ondisk sda
|
||||
#part /var --size 1024 --ondisk sdb
|
||||
#part swap --size 512 --ondisk sdb
|
||||
#part raid.01 --size 1 --grow --ondisk sda
|
||||
#part raid.02 --size 1 --grow --ondisk sdb
|
||||
#raid /scr --level 0 --device md0 raid.01 raid.02
|
||||
|
||||
#Full RAID 1 Sample
|
||||
#part raid.01 --size 50 --ondisk sda
|
||||
#part raid.02 --size 50 --ondisk sdb
|
||||
#raid /boot --level 1 --device md0 raid.01 raid.02
|
||||
#
|
||||
#part raid.11 --size 1024 --ondisk sda
|
||||
#part raid.12 --size 1024 --ondisk sdb
|
||||
#raid / --level 1 --device md1 raid.11 raid.12
|
||||
#
|
||||
#part raid.21 --size 1024 --ondisk sda
|
||||
#part raid.22 --size 1024 --ondisk sdb
|
||||
#raid /var --level 1 --device md2 raid.21 raid.22
|
||||
#
|
||||
#part raid.31 --size 1024 --ondisk sda
|
||||
#part raid.32 --size 1024 --ondisk sdb
|
||||
#raid swap --level 1 --device md3 raid.31 raid.32
|
||||
#
|
||||
#part raid.41 --size 1 --grow --ondisk sda
|
||||
#part raid.42 --size 1 --grow --ondisk sdb
|
||||
#raid /scr --level 1 --device md4 raid.41 raid.42
|
||||
|
||||
#
|
||||
# bootloader config
|
||||
# --append <args>
|
||||
# --useLilo
|
||||
# --md5pass <crypted MD5 password for GRUB>
|
||||
#
|
||||
bootloader
|
||||
|
||||
#
|
||||
# install or upgrade
|
||||
#
|
||||
install
|
||||
|
||||
#
|
||||
# text mode install (default is graphical)
|
||||
#
|
||||
#text
|
||||
|
||||
#
|
||||
# firewall
|
||||
#
|
||||
firewall --disabled
|
||||
|
||||
#
|
||||
# Select a zone
|
||||
# Add the --utc switch if your hardware clock is set to GMT
|
||||
#
|
||||
#timezone US/Hawaii
|
||||
#timezone US/Pacific
|
||||
#timezone US/Mountain
|
||||
#timezone US/Central
|
||||
#timezone US/Eastern
|
||||
timezone --utc "#TABLE:site:key=timezone:value#"
|
||||
|
||||
#
|
||||
# Don't do X
|
||||
#
|
||||
skipx
|
||||
|
||||
|
||||
#
|
||||
# To generate an encrypted root password use:
|
||||
#
|
||||
# perl -e 'print crypt("blah","Xa") . "\n";'p
|
||||
# openssl passwd -apr1 -salt xxxxxxxx password
|
||||
#
|
||||
# where "blah" is your root password.
|
||||
#
|
||||
#rootpw --iscrypted XaLGAVe1C41x2
|
||||
#rootpw XaLGAVe1C41x2 --iscrypted
|
||||
rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password#
|
||||
|
||||
#
|
||||
# NIS setup: auth --enablenis --nisdomain sensenet
|
||||
# --nisserver neptune --useshadow --enablemd5
|
||||
#
|
||||
# OR
|
||||
auth --useshadow --enablemd5
|
||||
|
||||
#
|
||||
# SE Linux
|
||||
#
|
||||
selinux --disabled
|
||||
|
||||
#
|
||||
# Reboot after installation
|
||||
#
|
||||
reboot
|
||||
|
||||
#
|
||||
#end of section
|
||||
#
|
||||
%packages
|
||||
#INCLUDE_DEFAULT_PKGLIST#
|
||||
%pre
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh#
|
||||
%post
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rh#
|
@ -1 +0,0 @@
|
||||
../esx/base.esxi4.1.tmpl
|
36
xCAT-server/share/xcat/install/esxi/base.esxi4.1.tmpl
Normal file
36
xCAT-server/share/xcat/install/esxi/base.esxi4.1.tmpl
Normal file
@ -0,0 +1,36 @@
|
||||
# Sample scripted installation file
|
||||
# edited and updated by vallard@sumavi.com
|
||||
|
||||
# Accept the VMware End User License Agreement
|
||||
vmaccepteula
|
||||
|
||||
# Set the root password for the DCUI and Tech Support Mode
|
||||
rootpw --iscrypted #CRYPT:passwd:key=vmware,username=root:password#
|
||||
|
||||
# clear all partitions.
|
||||
clearpart --alldrives --overwritevmfs
|
||||
# Choose the first disk (in channel/target/lun order) to install onto
|
||||
autopart --firstdisk --overwritevmfs
|
||||
|
||||
# The install media is on the network.
|
||||
install url http://#TABLE:noderes:$NODE:nfsserver#/install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch#
|
||||
|
||||
|
||||
# Set the network to DHCP on the first network adapter
|
||||
#network --bootproto=dhcp --device=vmnic0
|
||||
network --bootproto=dhcp
|
||||
|
||||
# reboot automatically when we're done.
|
||||
reboot
|
||||
|
||||
# A sample post-install script
|
||||
%post --interpreter=busybox --unsupported --ignorefailure=true
|
||||
|
||||
# tell xCAT management server we are done installing
|
||||
# have to put in the IP address instead of the hostname because VMware
|
||||
# ESXi 4.1 can not resolve IP addresses...
|
||||
echo "<xcatrequest>\n<command>nextdestiny</command>\n</xcatrequest>" | /bin/openssl s_client -quiet -connect #COMMAND: host #TABLE:noderes:$NODE:xcatmaster# | head -1 | sed 's/.*address//g' #:3001 2>&1 | tee /tmp/foo.log
|
||||
|
||||
# enable SSH on next boot:
|
||||
%firstboot --interpreter=busybox --unsupported --level=47
|
||||
sed -ie 's/#ssh/ssh/' /etc/inetd.conf #ssh is too nice not to have
|
@ -1 +0,0 @@
|
||||
compute.fedora13.tmpl
|
149
xCAT-server/share/xcat/install/fedora/compute.fedora12.tmpl
Normal file
149
xCAT-server/share/xcat/install/fedora/compute.fedora12.tmpl
Normal file
@ -0,0 +1,149 @@
|
||||
#egan@us.ibm.com
|
||||
#
|
||||
cmdline
|
||||
|
||||
lang en_US
|
||||
network --bootproto dhcp --hostname=#HOSTNAME#
|
||||
|
||||
#
|
||||
# Where's the source?
|
||||
# nfs --server hostname.of.server or IP --dir /path/to/RH/CD/image
|
||||
#
|
||||
#nfs --server #XCATVAR:INSTALL_NFS# --dir #XCATVAR:INSTALL_SRC_DIR#
|
||||
url --url http://#TABLE:noderes:$NODE:nfsserver#/install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch#
|
||||
|
||||
#device ethernet e100
|
||||
keyboard "us"
|
||||
|
||||
#
|
||||
# Clear the MBR
|
||||
#
|
||||
zerombr yes
|
||||
|
||||
#
|
||||
# Wipe out the disk
|
||||
#
|
||||
clearpart --all --initlabel
|
||||
#clearpart --linux
|
||||
key --skip
|
||||
|
||||
#
|
||||
# Customize to fit your needs
|
||||
#
|
||||
|
||||
#XCAT_PARTITION_START#
|
||||
#No RAID
|
||||
#/boot really significant for this sort of setup nowadays?
|
||||
#part /boot --size 50 --fstype ext3
|
||||
part swap --size 1024
|
||||
part / --size 1 --grow --fstype ext4
|
||||
#XCAT_PARTITION_END#
|
||||
|
||||
#RAID 0 /scr for performance
|
||||
#part / --size 1024 --ondisk sda
|
||||
#part swap --size 512 --ondisk sda
|
||||
#part /var --size 1024 --ondisk sdb
|
||||
#part swap --size 512 --ondisk sdb
|
||||
#part raid.01 --size 1 --grow --ondisk sda
|
||||
#part raid.02 --size 1 --grow --ondisk sdb
|
||||
#raid /scr --level 0 --device md0 raid.01 raid.02
|
||||
|
||||
#Full RAID 1 Sample
|
||||
#part raid.01 --size 50 --ondisk sda
|
||||
#part raid.02 --size 50 --ondisk sdb
|
||||
#raid /boot --level 1 --device md0 raid.01 raid.02
|
||||
#
|
||||
#part raid.11 --size 1024 --ondisk sda
|
||||
#part raid.12 --size 1024 --ondisk sdb
|
||||
#raid / --level 1 --device md1 raid.11 raid.12
|
||||
#
|
||||
#part raid.21 --size 1024 --ondisk sda
|
||||
#part raid.22 --size 1024 --ondisk sdb
|
||||
#raid /var --level 1 --device md2 raid.21 raid.22
|
||||
#
|
||||
#part raid.31 --size 1024 --ondisk sda
|
||||
#part raid.32 --size 1024 --ondisk sdb
|
||||
#raid swap --level 1 --device md3 raid.31 raid.32
|
||||
#
|
||||
#part raid.41 --size 1 --grow --ondisk sda
|
||||
#part raid.42 --size 1 --grow --ondisk sdb
|
||||
#raid /scr --level 1 --device md4 raid.41 raid.42
|
||||
|
||||
#
|
||||
# bootloader config
|
||||
# --append <args>
|
||||
# --useLilo
|
||||
# --md5pass <crypted MD5 password for GRUB>
|
||||
#
|
||||
bootloader
|
||||
|
||||
#
|
||||
# install or upgrade
|
||||
#
|
||||
install
|
||||
|
||||
#
|
||||
# text mode install (default is graphical)
|
||||
#
|
||||
text
|
||||
|
||||
#
|
||||
# firewall
|
||||
#
|
||||
firewall --disabled
|
||||
|
||||
#
|
||||
# Select a zone
|
||||
# Add the --utc switch if your hardware clock is set to GMT
|
||||
#
|
||||
#timezone US/Hawaii
|
||||
#timezone US/Pacific
|
||||
#timezone US/Mountain
|
||||
#timezone US/Central
|
||||
#timezone US/Eastern
|
||||
timezone --utc "#TABLE:site:key=timezone:value#"
|
||||
|
||||
#
|
||||
# Don't do X
|
||||
#
|
||||
skipx
|
||||
|
||||
|
||||
#
|
||||
# To generate an encrypted root password use:
|
||||
#
|
||||
# perl -e 'print crypt("blah","Xa") . "\n";'p
|
||||
# openssl passwd -apr1 -salt xxxxxxxx password
|
||||
#
|
||||
# where "blah" is your root password.
|
||||
#
|
||||
#rootpw --iscrypted XaLGAVe1C41x2
|
||||
#rootpw XaLGAVe1C41x2 --iscrypted
|
||||
rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password#
|
||||
|
||||
#
|
||||
# NIS setup: auth --enablenis --nisdomain sensenet
|
||||
# --nisserver neptune --useshadow --enablemd5
|
||||
#
|
||||
# OR
|
||||
auth --useshadow --enablemd5
|
||||
|
||||
#
|
||||
# SE Linux
|
||||
#
|
||||
selinux --disabled
|
||||
|
||||
#
|
||||
# Reboot after installation
|
||||
#
|
||||
reboot
|
||||
|
||||
#
|
||||
#end of section
|
||||
#
|
||||
%packages
|
||||
#INCLUDE_DEFAULT_PKGLIST#
|
||||
%pre
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh#
|
||||
%post
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rh#
|
@ -1 +0,0 @@
|
||||
compute.fedora14.pkglist
|
@ -0,0 +1,8 @@
|
||||
#Please make sure there is a space between @ and group name
|
||||
ntp
|
||||
nfs-utils
|
||||
net-snmp
|
||||
rsync
|
||||
yp-tools
|
||||
openssh-server
|
||||
util-linux-ng
|
@ -1 +0,0 @@
|
||||
compute.fedora14.tmpl
|
151
xCAT-server/share/xcat/install/fedora/compute.fedora15.tmpl
Normal file
151
xCAT-server/share/xcat/install/fedora/compute.fedora15.tmpl
Normal file
@ -0,0 +1,151 @@
|
||||
#egan@us.ibm.com
|
||||
#
|
||||
cmdline
|
||||
|
||||
lang en_US
|
||||
network --bootproto dhcp --hostname=#HOSTNAME#
|
||||
|
||||
#
|
||||
# Where's the source?
|
||||
# nfs --server hostname.of.server or IP --dir /path/to/RH/CD/image
|
||||
#
|
||||
#nfs --server #XCATVAR:INSTALL_NFS# --dir #XCATVAR:INSTALL_SRC_DIR#
|
||||
url --url http://#TABLE:noderes:$NODE:nfsserver#/install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch#
|
||||
|
||||
#device ethernet e100
|
||||
keyboard "us"
|
||||
|
||||
#
|
||||
# Clear the MBR
|
||||
#
|
||||
zerombr
|
||||
|
||||
#
|
||||
# Wipe out the disk
|
||||
#
|
||||
clearpart --all --initlabel
|
||||
#clearpart --linux
|
||||
|
||||
#
|
||||
# Customize to fit your needs
|
||||
#
|
||||
|
||||
#XCAT_PARTITION_START#
|
||||
#No RAID
|
||||
#/boot really significant for this sort of setup nowadays?
|
||||
#part /boot --size 50 --fstype ext3
|
||||
part swap --size 1024
|
||||
part / --size 1 --grow --fstype ext4
|
||||
#XCAT_PARTITION_END#
|
||||
|
||||
#RAID 0 /scr for performance
|
||||
#part / --size 1024 --ondisk sda
|
||||
#part swap --size 512 --ondisk sda
|
||||
#part /var --size 1024 --ondisk sdb
|
||||
#part swap --size 512 --ondisk sdb
|
||||
#part raid.01 --size 1 --grow --ondisk sda
|
||||
#part raid.02 --size 1 --grow --ondisk sdb
|
||||
#raid /scr --level 0 --device md0 raid.01 raid.02
|
||||
|
||||
#Full RAID 1 Sample
|
||||
#part raid.01 --size 50 --ondisk sda
|
||||
#part raid.02 --size 50 --ondisk sdb
|
||||
#raid /boot --level 1 --device md0 raid.01 raid.02
|
||||
#
|
||||
#part raid.11 --size 1024 --ondisk sda
|
||||
#part raid.12 --size 1024 --ondisk sdb
|
||||
#raid / --level 1 --device md1 raid.11 raid.12
|
||||
#
|
||||
#part raid.21 --size 1024 --ondisk sda
|
||||
#part raid.22 --size 1024 --ondisk sdb
|
||||
#raid /var --level 1 --device md2 raid.21 raid.22
|
||||
#
|
||||
#part raid.31 --size 1024 --ondisk sda
|
||||
#part raid.32 --size 1024 --ondisk sdb
|
||||
#raid swap --level 1 --device md3 raid.31 raid.32
|
||||
#
|
||||
#part raid.41 --size 1 --grow --ondisk sda
|
||||
#part raid.42 --size 1 --grow --ondisk sdb
|
||||
#raid /scr --level 1 --device md4 raid.41 raid.42
|
||||
|
||||
#
|
||||
# bootloader config
|
||||
# --append <args>
|
||||
# --useLilo
|
||||
# --md5pass <crypted MD5 password for GRUB>
|
||||
#
|
||||
bootloader
|
||||
|
||||
#
|
||||
# install or upgrade
|
||||
#
|
||||
install
|
||||
|
||||
#
|
||||
# text mode install (default is graphical)
|
||||
#
|
||||
text
|
||||
|
||||
#
|
||||
# firewall
|
||||
#
|
||||
firewall --disabled
|
||||
|
||||
#
|
||||
# Select a zone
|
||||
# Add the --utc switch if your hardware clock is set to GMT
|
||||
#
|
||||
#timezone US/Hawaii
|
||||
#timezone US/Pacific
|
||||
#timezone US/Mountain
|
||||
#timezone US/Central
|
||||
#timezone US/Eastern
|
||||
timezone --utc "#TABLE:site:key=timezone:value#"
|
||||
|
||||
#
|
||||
# Don't do X
|
||||
#
|
||||
skipx
|
||||
|
||||
|
||||
#
|
||||
# To generate an encrypted root password use:
|
||||
#
|
||||
# perl -e 'print crypt("blah","Xa") . "\n";'p
|
||||
# openssl passwd -apr1 -salt xxxxxxxx password
|
||||
#
|
||||
# where "blah" is your root password.
|
||||
#
|
||||
#rootpw --iscrypted XaLGAVe1C41x2
|
||||
#rootpw XaLGAVe1C41x2 --iscrypted
|
||||
rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password#
|
||||
|
||||
#
|
||||
# NIS setup: auth --enablenis --nisdomain sensenet
|
||||
# --nisserver neptune --useshadow --enablemd5
|
||||
#
|
||||
# OR
|
||||
auth --useshadow --enablemd5
|
||||
|
||||
#
|
||||
# SE Linux
|
||||
#
|
||||
selinux --disabled
|
||||
|
||||
#
|
||||
# Reboot after installation
|
||||
#
|
||||
reboot
|
||||
|
||||
#
|
||||
#end of section
|
||||
#
|
||||
%packages
|
||||
#INCLUDE_DEFAULT_PKGLIST#
|
||||
%end
|
||||
%pre
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh#
|
||||
%end
|
||||
%post
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rh#
|
||||
%end
|
@ -1 +0,0 @@
|
||||
../rh/compute.rhels6.pkglist
|
8
xCAT-server/share/xcat/install/ol/compute.ol6.pkglist
Normal file
8
xCAT-server/share/xcat/install/ol/compute.ol6.pkglist
Normal file
@ -0,0 +1,8 @@
|
||||
#Please make sure there is a space between @ and group name
|
||||
ntp
|
||||
nfs-utils
|
||||
net-snmp
|
||||
rsync
|
||||
yp-tools
|
||||
openssh-server
|
||||
util-linux-ng
|
@ -1 +0,0 @@
|
||||
../rh/compute.rhels6.tmpl
|
149
xCAT-server/share/xcat/install/ol/compute.ol6.tmpl
Normal file
149
xCAT-server/share/xcat/install/ol/compute.ol6.tmpl
Normal file
@ -0,0 +1,149 @@
|
||||
#
|
||||
#cmdline
|
||||
|
||||
lang en_US
|
||||
|
||||
#
|
||||
# Where's the source?
|
||||
# nfs --server hostname.of.server or IP --dir /path/to/RH/CD/image
|
||||
#
|
||||
#nfs --server #XCATVAR:INSTALL_NFS# --dir #XCATVAR:INSTALL_SRC_DIR#
|
||||
|
||||
%include /tmp/repos
|
||||
|
||||
#device ethernet e100
|
||||
keyboard "us"
|
||||
|
||||
#
|
||||
# Clear the MBR
|
||||
#
|
||||
zerombr
|
||||
|
||||
#
|
||||
# Wipe out the disk
|
||||
#
|
||||
clearpart --all --initlabel
|
||||
#clearpart --linux
|
||||
key --skip
|
||||
|
||||
#
|
||||
# Customize to fit your needs
|
||||
#
|
||||
|
||||
#XCAT_PARTITION_START#
|
||||
#No RAID
|
||||
#/boot really significant for this sort of setup nowadays?
|
||||
#part /boot --size 50 --fstype ext3
|
||||
%include /tmp/partitioning
|
||||
#part swap --size 1024
|
||||
#part / --size 1 --grow --fstype ext4
|
||||
#XCAT_PARTITION_END#
|
||||
|
||||
#RAID 0 /scr for performance
|
||||
#part / --size 1024 --ondisk sda
|
||||
#part swap --size 512 --ondisk sda
|
||||
#part /var --size 1024 --ondisk sdb
|
||||
#part swap --size 512 --ondisk sdb
|
||||
#part raid.01 --size 1 --grow --ondisk sda
|
||||
#part raid.02 --size 1 --grow --ondisk sdb
|
||||
#raid /scr --level 0 --device md0 raid.01 raid.02
|
||||
|
||||
#Full RAID 1 Sample
|
||||
#part raid.01 --size 50 --ondisk sda
|
||||
#part raid.02 --size 50 --ondisk sdb
|
||||
#raid /boot --level 1 --device md0 raid.01 raid.02
|
||||
#
|
||||
#part raid.11 --size 1024 --ondisk sda
|
||||
#part raid.12 --size 1024 --ondisk sdb
|
||||
#raid / --level 1 --device md1 raid.11 raid.12
|
||||
#
|
||||
#part raid.21 --size 1024 --ondisk sda
|
||||
#part raid.22 --size 1024 --ondisk sdb
|
||||
#raid /var --level 1 --device md2 raid.21 raid.22
|
||||
#
|
||||
#part raid.31 --size 1024 --ondisk sda
|
||||
#part raid.32 --size 1024 --ondisk sdb
|
||||
#raid swap --level 1 --device md3 raid.31 raid.32
|
||||
#
|
||||
#part raid.41 --size 1 --grow --ondisk sda
|
||||
#part raid.42 --size 1 --grow --ondisk sdb
|
||||
#raid /scr --level 1 --device md4 raid.41 raid.42
|
||||
|
||||
#
|
||||
# bootloader config
|
||||
# --append <args>
|
||||
# --useLilo
|
||||
# --md5pass <crypted MD5 password for GRUB>
|
||||
#
|
||||
bootloader
|
||||
|
||||
#
|
||||
# install or upgrade
|
||||
#
|
||||
install
|
||||
|
||||
#
|
||||
# text mode install (default is graphical)
|
||||
#
|
||||
#text
|
||||
|
||||
#
|
||||
# firewall
|
||||
#
|
||||
firewall --disabled
|
||||
|
||||
#
|
||||
# Select a zone
|
||||
# Add the --utc switch if your hardware clock is set to GMT
|
||||
#
|
||||
#timezone US/Hawaii
|
||||
#timezone US/Pacific
|
||||
#timezone US/Mountain
|
||||
#timezone US/Central
|
||||
#timezone US/Eastern
|
||||
timezone --utc "#TABLE:site:key=timezone:value#"
|
||||
|
||||
#
|
||||
# Don't do X
|
||||
#
|
||||
skipx
|
||||
|
||||
|
||||
#
|
||||
# To generate an encrypted root password use:
|
||||
#
|
||||
# perl -e 'print crypt("blah","Xa") . "\n";'p
|
||||
# openssl passwd -apr1 -salt xxxxxxxx password
|
||||
#
|
||||
# where "blah" is your root password.
|
||||
#
|
||||
#rootpw --iscrypted XaLGAVe1C41x2
|
||||
#rootpw XaLGAVe1C41x2 --iscrypted
|
||||
rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password#
|
||||
|
||||
#
|
||||
# NIS setup: auth --enablenis --nisdomain sensenet
|
||||
# --nisserver neptune --useshadow --enablemd5
|
||||
#
|
||||
# OR
|
||||
auth --useshadow --enablemd5
|
||||
|
||||
#
|
||||
# SE Linux
|
||||
#
|
||||
selinux --disabled
|
||||
|
||||
#
|
||||
# Reboot after installation
|
||||
#
|
||||
reboot
|
||||
|
||||
#
|
||||
#end of section
|
||||
#
|
||||
%packages
|
||||
#INCLUDE_DEFAULT_PKGLIST#
|
||||
%pre
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh#
|
||||
%post
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rh#
|
@ -1 +0,0 @@
|
||||
../rh/compute.rhels6.pkglist
|
15
xCAT-server/share/xcat/netboot/SL/compute.SL6.pkglist
Normal file
15
xCAT-server/share/xcat/netboot/SL/compute.SL6.pkglist
Normal file
@ -0,0 +1,15 @@
|
||||
bash
|
||||
dracut-network
|
||||
nfs-utils
|
||||
openssl
|
||||
dhclient
|
||||
kernel
|
||||
openssh-server
|
||||
openssh-clients
|
||||
wget
|
||||
vim-minimal
|
||||
ntp
|
||||
rpm
|
||||
rsync
|
||||
rsyslog
|
||||
e2fsprogs
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/check
|
3
xCAT-server/share/xcat/netboot/SL/dracut/check
Executable file
3
xCAT-server/share/xcat/netboot/SL/dracut/check
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
[ "$1" = "-d" ] && echo network
|
||||
exit 0
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/install.netboot
|
10
xCAT-server/share/xcat/netboot/SL/dracut/install.netboot
Executable file
10
xCAT-server/share/xcat/netboot/SL/dracut/install.netboot
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
echo $drivers
|
||||
dracut_install wget cpio gzip dash modprobe touch echo cut wc
|
||||
dracut_install -o ctorrent
|
||||
dracut_install grep ifconfig hostname awk egrep grep dirname expr
|
||||
dracut_install mount.nfs
|
||||
dracut_install parted mke2fs bc mkswap swapon chmod
|
||||
inst "$moddir/xcat-updateflag" "/tmp/updateflag"
|
||||
inst "$moddir/xcatroot" "/sbin/xcatroot"
|
||||
inst_hook cmdline 10 "$moddir/xcat-cmdline.sh"
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/install.statelite
|
9
xCAT-server/share/xcat/netboot/SL/dracut/install.statelite
Executable file
9
xCAT-server/share/xcat/netboot/SL/dracut/install.statelite
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
echo $drivers
|
||||
dracut_install wget cpio gzip dash modprobe wc touch echo cut
|
||||
dracut_install -o ctorrent
|
||||
dracut_install grep ifconfig hostname awk egrep grep dirname expr
|
||||
dracut_install parted mke2fs bc mkswap swapon chmod
|
||||
inst "$moddir/xcat-updateflag" "/tmp/updateflag"
|
||||
inst_hook pre-mount 5 "$moddir/xcat-premount.sh"
|
||||
inst_hook pre-pivot 5 "$moddir/xcat-prepivot.sh"
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/installkernel
|
2
xCAT-server/share/xcat/netboot/SL/dracut/installkernel
Executable file
2
xCAT-server/share/xcat/netboot/SL/dracut/installkernel
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
instmods nfs sunrpc
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcat-cmdline.sh
|
4
xCAT-server/share/xcat/netboot/SL/dracut/xcat-cmdline.sh
Normal file
4
xCAT-server/share/xcat/netboot/SL/dracut/xcat-cmdline.sh
Normal file
@ -0,0 +1,4 @@
|
||||
root=1
|
||||
rootok=1
|
||||
netroot=xcat
|
||||
echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/xcatroot.sh
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcat-prepivot.sh
|
126
xCAT-server/share/xcat/netboot/SL/dracut/xcat-prepivot.sh
Executable file
126
xCAT-server/share/xcat/netboot/SL/dracut/xcat-prepivot.sh
Executable file
@ -0,0 +1,126 @@
|
||||
#!/bin/sh
|
||||
NEWROOT=/sysroot
|
||||
SERVER=${SERVER%%/*}
|
||||
SERVER=${SERVER%:}
|
||||
RWDIR=.statelite
|
||||
if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other than nfs open, will u se // to detect uri in the future I guess
|
||||
SNAPSHOTSERVER=${STATEMNT%:*}
|
||||
SNAPSHOTROOT=${STATEMNT#*/}
|
||||
#echo $SNAPSHOTROOT
|
||||
#echo $SNAPSHOTSERVER
|
||||
# may be that there is not server and just a directory.
|
||||
if [ -z $SNAPSHOTROOT ]; then
|
||||
SNAPSHOTROOT=$SNAPSHOTSERVER
|
||||
SNAPSHOTSERVER=
|
||||
fi
|
||||
fi
|
||||
|
||||
echo Setting up Statelite
|
||||
mkdir -p $NEWROOT
|
||||
|
||||
# now we need to mount the rest of the system. This is the read/write portions
|
||||
# echo Mounting snapshot directories
|
||||
|
||||
MAXTRIES=7
|
||||
ITER=0
|
||||
if [ ! -e "$NEWROOT/$RWDIR" ]; then
|
||||
echo ""
|
||||
echo "This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... "
|
||||
echo ""
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then
|
||||
echo ""
|
||||
echo "$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with th e -m statelite mode"
|
||||
echo ""
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
mount -t tmpfs rw $NEWROOT/$RWDIR
|
||||
mkdir -p $NEWROOT/$RWDIR/tmpfs
|
||||
ME=`hostname`
|
||||
if [ ! -z $NODE ]; then
|
||||
ME=$NODE
|
||||
fi
|
||||
|
||||
# mount the SNAPSHOT directory here for persistent use.
|
||||
if [ ! -z $SNAPSHOTSERVER ]; then
|
||||
mkdir -p $NEWROOT/$RWDIR/persistent
|
||||
MAXTRIES=5
|
||||
ITER=0
|
||||
if [ -z $MNTOPTS ]; then
|
||||
MNT_OPTIONS="nolock,rsize=32768,tcp,nfsvers=3,timeo=14"
|
||||
else
|
||||
MNT_OPTIONS=$MNTOPTS
|
||||
fi
|
||||
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Possible problems:
|
||||
1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ?
|
||||
2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
|
||||
# create directory which is named after my node name
|
||||
mkdir -p $NEWROOT/$RWDIR/persistent/$ME
|
||||
ITER=0
|
||||
# umount current persistent mount
|
||||
while ! umount -l $NEWROOT/$RWDIR/persistent; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Cannot umount $NEWROOT/$RWDIR/persistent."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
|
||||
# mount persistent to server:/rootpath/nodename
|
||||
ITER=0
|
||||
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
fi
|
||||
|
||||
# TODO: handle the dhclient/resolv.conf/ntp, etc
|
||||
echo "Get to enable localdisk"
|
||||
$NEWROOT/etc/init.d/localdisk
|
||||
$NEWROOT/etc/init.d/statelite
|
||||
READONLY=yes
|
||||
export READONLY
|
||||
fastboot=yes
|
||||
export fastboot
|
||||
keep_old_ip=yes
|
||||
export keep_old_ip
|
||||
mount -n --bind /dev $NEWROOT/dev
|
||||
mount -n --bind /proc $NEWROOT/proc
|
||||
mount -n --bind /sys $NEWROOT/sys
|
||||
|
||||
if [ -d "$NEWROOT/etc/sysconfig" -a ! -e "$NEWROOT/etc/sysconfig/selinux" ]; then
|
||||
echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux"
|
||||
fi
|
||||
|
||||
# inject new exit_if_exists
|
||||
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > /initqueue/xcat.sh
|
||||
# force udevsettle to break
|
||||
> /initqueue/work
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcatroot
|
263
xCAT-server/share/xcat/netboot/SL/dracut/xcatroot
Executable file
263
xCAT-server/share/xcat/netboot/SL/dracut/xcatroot
Executable file
@ -0,0 +1,263 @@
|
||||
#!/bin/sh
|
||||
NEWROOT=$3
|
||||
RWDIR=.statelite
|
||||
XCATMASTER=$XCAT
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
rootlimit="$(getarg rootlimit=)"
|
||||
|
||||
|
||||
getarg nonodestatus
|
||||
NODESTATUS=$?
|
||||
|
||||
MASTER=`echo $XCATMASTER |awk -F: '{print $1}'`
|
||||
XCATIPORT="$(getarg XCATIPORT=)"
|
||||
if [ $? -ne 0 ]; then
|
||||
XCATIPORT="3002"
|
||||
fi
|
||||
|
||||
|
||||
if [ $NODESTATUS -ne 0 ];then
|
||||
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
|
||||
fi
|
||||
|
||||
if [ ! -z "$imgurl" ]; then
|
||||
if [ xhttp = x${imgurl%%:*} ]; then
|
||||
NFS=0
|
||||
FILENAME=${imgurl##*/}
|
||||
while [ ! -r "$FILENAME" ]; do
|
||||
echo Getting $imgurl...
|
||||
if ! wget $imgurl; then
|
||||
rm -f $FILENAME
|
||||
sleep 27
|
||||
fi
|
||||
done
|
||||
elif [ xnfs = x${imgurl%%:*} ]; then
|
||||
NFS=1
|
||||
SERVER=${imgurl#nfs:}
|
||||
SERVER=${SERVER#/}
|
||||
SERVER=${SERVER#/}
|
||||
ROOTDIR=$SERVER
|
||||
SERVER=${SERVER%%/*}
|
||||
SERVER=${SERVER%:}
|
||||
ROOTDIR=/${ROOTDIR#*/}
|
||||
fi
|
||||
fi
|
||||
#echo 0 > /proc/sys/vm/zone_reclaim_mode #Avoid kernel bug
|
||||
|
||||
if [ -r /*.metainfo ]; then
|
||||
ctorrent /*.metainfo -e 0
|
||||
fi
|
||||
if [ -r /rootimg.sfs ]; then
|
||||
echo Setting up squashfs with ram overlay.
|
||||
mknod /dev/loop0 b 7 0
|
||||
mkdir -p /ro
|
||||
mkdir -p /rw
|
||||
mount -t squashfs /rootimg.sfs /ro
|
||||
mount -t tmpfs rw /rw
|
||||
mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT
|
||||
mkdir -p $NEWROOT/ro
|
||||
mkdir -p $NEWROOT/rw
|
||||
mount --move /ro $NEWROOT/ro
|
||||
mount --move /rw $NEWROOT/rw
|
||||
elif [ -r /rootimg.gz ]; then
|
||||
echo Setting up RAM-root tmpfs.
|
||||
if [ -z $rootlimit ];then
|
||||
mount -t tmpfs -o mode=755 rootfs $NEWROOT
|
||||
else
|
||||
mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT
|
||||
fi
|
||||
|
||||
cd $NEWROOT
|
||||
echo -n "Extracting root filesystem:"
|
||||
if [ -x /bin/cpio ]; then
|
||||
gzip -cd /rootimg.gz |/bin/cpio -idum
|
||||
else
|
||||
gzip -cd /rootimg.gz |cpio -idum
|
||||
fi
|
||||
$NEWROOT/etc/init.d/localdisk
|
||||
echo Done
|
||||
elif [ -r /rootimg-statelite.gz ]; then
|
||||
echo Setting up RAM-root tmpfs for statelite mode.
|
||||
|
||||
if [ -z $rootlimit];then
|
||||
mount -t tmpfs -o mode=755 rootfs $NEWROOT
|
||||
else
|
||||
mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT
|
||||
fi
|
||||
|
||||
cd $NEWROOT
|
||||
echo -n "Extracting root filesystem:"
|
||||
if [ -x /bin/cpio ]; then
|
||||
gzip -cd /rootimg-statelite.gz |/bin/cpio -idum
|
||||
else
|
||||
gzip -cd /rootimg-statelite.gz |cpio -idum
|
||||
fi
|
||||
echo Done
|
||||
# then, the statelite staffs will be processed
|
||||
echo Setting up Statelite
|
||||
modprobe nfs
|
||||
MAXTRIES=7
|
||||
ITER=0
|
||||
if [ ! -e "$NEWROOT/$RWDIR" ]; then
|
||||
echo ""
|
||||
echo "The /$RWDIR directory doesn't exist in the rootimg... "
|
||||
echo ""
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then
|
||||
echo ""
|
||||
echo "$NEWROOT/etc/init.d/statelite doesn't exist... "
|
||||
echo ""
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
mount -t tmpfs rw $NEWROOT/$RWDIR
|
||||
mkdir -p $NEWROOT/$RWDIR/tmpfs
|
||||
ME=`hostname`
|
||||
if [ ! -z $NODE ]; then
|
||||
ME=$NODE
|
||||
fi
|
||||
|
||||
|
||||
# mount the SNAPSHOT directory here for persistent use.
|
||||
if [ ! -z $STATEMNT ]; then
|
||||
SNAPSHOTSERVER=${STATEMNT%:*}
|
||||
SNAPSHOTROOT=${STATEMNT#*/}
|
||||
if [ -z $SNAPSHOTROOT ]; then
|
||||
SNAPSHOTROOT=$SNAPSHOTSERVER
|
||||
SNAPSHOTSERVER=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z $SNAPSHOTSERVER ]; then
|
||||
mkdir -p $NEWROOT/$RWDIR/persistent
|
||||
MAXTRIES=5
|
||||
ITER=0
|
||||
if [ -z $MNTOPTS ]; then
|
||||
MNT_OPTIONS="nolock,rsize=32768,tcp,nfsvers=3,timeo=14"
|
||||
else
|
||||
MNT_OPTIONS=$MNTOPTS
|
||||
fi
|
||||
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "You are dead, rpower $ME boot to play again."
|
||||
echo "Possible problems:
|
||||
1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ?
|
||||
2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS=$(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds ..."
|
||||
sleep $RS
|
||||
done
|
||||
|
||||
# create directory which is named after my node name
|
||||
mkdir -p $NEWROOT/$RWDIR/persistent/$ME
|
||||
ITER=0
|
||||
# umount current persistent mount
|
||||
while ! umount -l $NEWROOT/$RWDIR/persistent; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Cannot umount $NEWROOT/$RWDIR/persistent."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
|
||||
# mount persistent to server:/rootpath/nodename
|
||||
ITER=0
|
||||
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
fi
|
||||
|
||||
$NEWROOT/etc/init.d/localdisk
|
||||
$NEWROOT/etc/init.d/statelite
|
||||
fastboot=yes
|
||||
export fastboot
|
||||
keep_old_ip=yes
|
||||
export keep_old_ip
|
||||
|
||||
mount -n --bind /dev $NEWROOT/dev
|
||||
mount -n --bind /proc $NEWROOT/proc
|
||||
mount -n --bind /sys $NEWROOT/sys
|
||||
|
||||
else
|
||||
echo -n Failed to download image, panicing in 5...
|
||||
for i in 4 3 2 1 0; do
|
||||
/bin/sleep 1
|
||||
echo -n $i...
|
||||
done
|
||||
echo
|
||||
echo "You're dead. rpower nodename reset to play again.
|
||||
|
||||
* Did you packimage with -m cpio, -m squashfs, or -m nfs?
|
||||
* If using -m squashfs did you include aufs.ko with geninitrd?
|
||||
e.g.: -n tg3,squashfs,aufs,loop
|
||||
* If using -m nfs did you export NFS and sync rootimg? And
|
||||
did you include the aufs and nfs modules in the proper order:
|
||||
e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs
|
||||
|
||||
"
|
||||
/bin/dash
|
||||
exit
|
||||
fi
|
||||
cd /
|
||||
|
||||
if [ -z $STATEMNT ]; then
|
||||
for lf in /tmp/dhclient.*.lease; do
|
||||
netif=${lf#*.}
|
||||
netif=${netif%.*}
|
||||
cp $lf "$NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
|
||||
done
|
||||
|
||||
if [ ! -z "$ifname" ]; then
|
||||
MACX=${ifname#*:}
|
||||
ETHX=${ifname%:$MACX*}
|
||||
elif [ ! -z "$netdev" ]; then
|
||||
ETHX=$netdev
|
||||
MACX=`ip link show $netdev | grep ether | awk '{print $2}'`
|
||||
elif [ ! -z "$BOOTIF" ]; then
|
||||
MACX=$BOOTIF
|
||||
#ETHX=`ifconfig |grep -i $BOOTIF | awk '{print $1}'`
|
||||
ETHX=` ip -oneline link show |grep -i $BOOTIF|awk -F ':' '{print $2}'|grep -o "[^ ]\+\( \+[^ ]\+\)*"`
|
||||
fi
|
||||
|
||||
if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then
|
||||
if [ ! -e $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX ]; then
|
||||
touch $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
fi
|
||||
echo "DEVICE=$ETHX" > $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
echo "BOOTPROTO=dhcp" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
echo "HWADDR=$MACX" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
echo "ONBOOT=yes" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
fi
|
||||
fi
|
||||
|
||||
cp /etc/resolv.conf "$NEWROOT/etc/"
|
||||
|
||||
if [ -d "$NEWROOT/etc/sysconfig" -a ! -e "$NEWROOT/etc/sysconfig/selinux" ]; then
|
||||
echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux"
|
||||
fi
|
||||
|
||||
# inject new exit_if_exists
|
||||
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > /initqueue/xcat.sh
|
||||
# force udevsettle to break
|
||||
> /initqueue/work
|
@ -1 +0,0 @@
|
||||
../rh/genimage
|
2081
xCAT-server/share/xcat/netboot/SL/genimage
Executable file
2081
xCAT-server/share/xcat/netboot/SL/genimage
Executable file
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
../rh/dracut
|
@ -1 +0,0 @@
|
||||
../rh/genimage
|
2081
xCAT-server/share/xcat/netboot/centos/genimage
Executable file
2081
xCAT-server/share/xcat/netboot/centos/genimage
Executable file
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
genimage
|
2081
xCAT-server/share/xcat/netboot/centos/geninitrd
Executable file
2081
xCAT-server/share/xcat/netboot/centos/geninitrd
Executable file
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
../rh/kvm.exlist
|
24
xCAT-server/share/xcat/netboot/centos/kvm.exlist
Normal file
24
xCAT-server/share/xcat/netboot/centos/kvm.exlist
Normal file
@ -0,0 +1,24 @@
|
||||
./usr/share/man/*
|
||||
./usr/share/locale/*
|
||||
./usr/share/i18n*
|
||||
./var/cache/yum*
|
||||
./usr/share/doc*
|
||||
./usr/share/gnome*
|
||||
./usr/share/zoneinfo*
|
||||
./usr/share/cracklib*
|
||||
./usr/share/info*
|
||||
./usr/share/omf*
|
||||
./usr/lib/locale*
|
||||
./usr/lib64/dri*
|
||||
./usr/share/backgrounds*
|
||||
./lib/modules/*/kernel/drivers/net/pcmcia*
|
||||
./lib/modules/*/kernel/drivers/net/tokenring*
|
||||
./lib/modules/*/kernel/drivers/net/wireless*
|
||||
./lib/modules/*/kernel/drivers/net/media*
|
||||
./lib/modules/*/kernel/drivers/media*
|
||||
./lib/modules/*/kernel/drivers/video*
|
||||
./lib/modules/*/kernel/drivers/gpu*
|
||||
./lib/modules/*/kernel/drivers/isdn*
|
||||
./lib/modules/*/kernel/drivers/hwmon*
|
||||
./lib/modules/*/kernel/sound*
|
||||
./boot*
|
@ -1 +0,0 @@
|
||||
../rh/kvm.rhels5.4.pkglist
|
25
xCAT-server/share/xcat/netboot/centos/kvm.pkglist
Normal file
25
xCAT-server/share/xcat/netboot/centos/kvm.pkglist
Normal file
@ -0,0 +1,25 @@
|
||||
bash
|
||||
postfix
|
||||
nfs-utils
|
||||
openssl
|
||||
dhclient
|
||||
kernel
|
||||
openssh-server
|
||||
openssh-clients
|
||||
busybox-anaconda
|
||||
wget
|
||||
vim-minimal
|
||||
ntp
|
||||
sysklogd
|
||||
rpm
|
||||
rsync
|
||||
bridge-utils
|
||||
dnsmasq
|
||||
iscsi-initiator-utils
|
||||
kvm
|
||||
libvirt.x86_64
|
||||
perl-Sys-Virt
|
||||
python-urlgrabber.noarch
|
||||
python-virtinst
|
||||
screen
|
||||
xnba-kvm
|
@ -1 +0,0 @@
|
||||
../rh/xen.exlist
|
13
xCAT-server/share/xcat/netboot/centos/xen.exlist
Normal file
13
xCAT-server/share/xcat/netboot/centos/xen.exlist
Normal file
@ -0,0 +1,13 @@
|
||||
./usr/share/man/*
|
||||
./usr/share/locale/*
|
||||
./usr/share/i18n*
|
||||
./var/cache/yum*
|
||||
./usr/share/doc*
|
||||
./usr/share/gnome*
|
||||
./usr/share/zoneinfo*
|
||||
./usr/share/cracklib*
|
||||
./usr/share/info*
|
||||
./usr/share/omf*
|
||||
./usr/lib/locale*
|
||||
./usr/lib/perl5*
|
||||
./boot*
|
@ -1 +0,0 @@
|
||||
../rh/xen.pkglist
|
20
xCAT-server/share/xcat/netboot/centos/xen.pkglist
Normal file
20
xCAT-server/share/xcat/netboot/centos/xen.pkglist
Normal file
@ -0,0 +1,20 @@
|
||||
bash
|
||||
postfix
|
||||
nfs-utils
|
||||
openssl
|
||||
dhclient
|
||||
kernel-xen
|
||||
openssh-server
|
||||
openssh-clients
|
||||
busybox-anaconda
|
||||
wget
|
||||
vim-minimal
|
||||
ntp
|
||||
sysklogd
|
||||
rpm
|
||||
rsync
|
||||
bridge-utils
|
||||
iscsi-initiator-utils
|
||||
xen
|
||||
libvirt.x86_64
|
||||
screen
|
@ -1 +0,0 @@
|
||||
compute.fedora13.pkglist
|
@ -0,0 +1,14 @@
|
||||
bash
|
||||
dracut-network
|
||||
nfs-utils
|
||||
openssl
|
||||
dhclient
|
||||
kernel
|
||||
openssh-server
|
||||
openssh-clients
|
||||
wget
|
||||
vim-minimal
|
||||
ntp
|
||||
rpm
|
||||
rsync
|
||||
rsyslog
|
@ -1 +0,0 @@
|
||||
compute.fedora14.pkglist
|
@ -0,0 +1,14 @@
|
||||
bash
|
||||
dracut-network
|
||||
nfs-utils
|
||||
openssl
|
||||
dhclient
|
||||
kernel
|
||||
openssh-server
|
||||
openssh-clients
|
||||
wget
|
||||
vim-minimal
|
||||
ntp
|
||||
rpm
|
||||
rsync
|
||||
rsyslog
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/check
|
3
xCAT-server/share/xcat/netboot/fedora/dracut/check
Executable file
3
xCAT-server/share/xcat/netboot/fedora/dracut/check
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
[ "$1" = "-d" ] && echo network
|
||||
exit 0
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/install.netboot
|
10
xCAT-server/share/xcat/netboot/fedora/dracut/install.netboot
Executable file
10
xCAT-server/share/xcat/netboot/fedora/dracut/install.netboot
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
echo $drivers
|
||||
dracut_install wget cpio gzip dash modprobe touch echo cut wc
|
||||
dracut_install -o ctorrent
|
||||
dracut_install grep ifconfig hostname awk egrep grep dirname expr
|
||||
dracut_install mount.nfs
|
||||
dracut_install parted mke2fs bc mkswap swapon chmod
|
||||
inst "$moddir/xcat-updateflag" "/tmp/updateflag"
|
||||
inst "$moddir/xcatroot" "/sbin/xcatroot"
|
||||
inst_hook cmdline 10 "$moddir/xcat-cmdline.sh"
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/install.statelite
|
9
xCAT-server/share/xcat/netboot/fedora/dracut/install.statelite
Executable file
9
xCAT-server/share/xcat/netboot/fedora/dracut/install.statelite
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
echo $drivers
|
||||
dracut_install wget cpio gzip dash modprobe wc touch echo cut
|
||||
dracut_install -o ctorrent
|
||||
dracut_install grep ifconfig hostname awk egrep grep dirname expr
|
||||
dracut_install parted mke2fs bc mkswap swapon chmod
|
||||
inst "$moddir/xcat-updateflag" "/tmp/updateflag"
|
||||
inst_hook pre-mount 5 "$moddir/xcat-premount.sh"
|
||||
inst_hook pre-pivot 5 "$moddir/xcat-prepivot.sh"
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/installkernel
|
2
xCAT-server/share/xcat/netboot/fedora/dracut/installkernel
Executable file
2
xCAT-server/share/xcat/netboot/fedora/dracut/installkernel
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
instmods nfs sunrpc
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcat-cmdline.sh
|
@ -0,0 +1,4 @@
|
||||
root=1
|
||||
rootok=1
|
||||
netroot=xcat
|
||||
echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/xcatroot.sh
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcat-premount.sh
|
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
#script to update nodelist.nodestatus during provision
|
||||
|
||||
MASTER=`echo $XCAT |awk -F: '{print $1}'`
|
||||
|
||||
getarg nonodestatus
|
||||
NODESTATUS=$?
|
||||
|
||||
XCATIPORT="$(getarg XCATIPORT=)"
|
||||
if [ $? -ne 0 ]; then
|
||||
XCATIPORT="3002"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ $NODESTATUS -ne 0 ];then
|
||||
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
|
||||
fi
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcat-prepivot.sh
|
126
xCAT-server/share/xcat/netboot/fedora/dracut/xcat-prepivot.sh
Executable file
126
xCAT-server/share/xcat/netboot/fedora/dracut/xcat-prepivot.sh
Executable file
@ -0,0 +1,126 @@
|
||||
#!/bin/sh
|
||||
NEWROOT=/sysroot
|
||||
SERVER=${SERVER%%/*}
|
||||
SERVER=${SERVER%:}
|
||||
RWDIR=.statelite
|
||||
if [ ! -z $STATEMNT ]; then #btw, uri style might have left future options other than nfs open, will u se // to detect uri in the future I guess
|
||||
SNAPSHOTSERVER=${STATEMNT%:*}
|
||||
SNAPSHOTROOT=${STATEMNT#*/}
|
||||
#echo $SNAPSHOTROOT
|
||||
#echo $SNAPSHOTSERVER
|
||||
# may be that there is not server and just a directory.
|
||||
if [ -z $SNAPSHOTROOT ]; then
|
||||
SNAPSHOTROOT=$SNAPSHOTSERVER
|
||||
SNAPSHOTSERVER=
|
||||
fi
|
||||
fi
|
||||
|
||||
echo Setting up Statelite
|
||||
mkdir -p $NEWROOT
|
||||
|
||||
# now we need to mount the rest of the system. This is the read/write portions
|
||||
# echo Mounting snapshot directories
|
||||
|
||||
MAXTRIES=7
|
||||
ITER=0
|
||||
if [ ! -e "$NEWROOT/$RWDIR" ]; then
|
||||
echo ""
|
||||
echo "This NFS root directory doesn't have a /$RWDIR directory for me to mount a rw filesystem. You'd better create it... "
|
||||
echo ""
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then
|
||||
echo ""
|
||||
echo "$NEWROOT/etc/init.d/statelite doesn't exist. Perhaps you didn't create this image with th e -m statelite mode"
|
||||
echo ""
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
mount -t tmpfs rw $NEWROOT/$RWDIR
|
||||
mkdir -p $NEWROOT/$RWDIR/tmpfs
|
||||
ME=`hostname`
|
||||
if [ ! -z $NODE ]; then
|
||||
ME=$NODE
|
||||
fi
|
||||
|
||||
# mount the SNAPSHOT directory here for persistent use.
|
||||
if [ ! -z $SNAPSHOTSERVER ]; then
|
||||
mkdir -p $NEWROOT/$RWDIR/persistent
|
||||
MAXTRIES=5
|
||||
ITER=0
|
||||
if [ -z $MNTOPTS ]; then
|
||||
MNT_OPTIONS="nolock,rsize=32768,tcp,nfsvers=3,timeo=14"
|
||||
else
|
||||
MNT_OPTIONS=$MNTOPTS
|
||||
fi
|
||||
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Possible problems:
|
||||
1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ?
|
||||
2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
|
||||
# create directory which is named after my node name
|
||||
mkdir -p $NEWROOT/$RWDIR/persistent/$ME
|
||||
ITER=0
|
||||
# umount current persistent mount
|
||||
while ! umount -l $NEWROOT/$RWDIR/persistent; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Cannot umount $NEWROOT/$RWDIR/persistent."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
|
||||
# mount persistent to server:/rootpath/nodename
|
||||
ITER=0
|
||||
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
fi
|
||||
|
||||
# TODO: handle the dhclient/resolv.conf/ntp, etc
|
||||
echo "Get to enable localdisk"
|
||||
$NEWROOT/etc/init.d/localdisk
|
||||
$NEWROOT/etc/init.d/statelite
|
||||
READONLY=yes
|
||||
export READONLY
|
||||
fastboot=yes
|
||||
export fastboot
|
||||
keep_old_ip=yes
|
||||
export keep_old_ip
|
||||
mount -n --bind /dev $NEWROOT/dev
|
||||
mount -n --bind /proc $NEWROOT/proc
|
||||
mount -n --bind /sys $NEWROOT/sys
|
||||
|
||||
if [ -d "$NEWROOT/etc/sysconfig" -a ! -e "$NEWROOT/etc/sysconfig/selinux" ]; then
|
||||
echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux"
|
||||
fi
|
||||
|
||||
# inject new exit_if_exists
|
||||
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > /initqueue/xcat.sh
|
||||
# force udevsettle to break
|
||||
> /initqueue/work
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcat-updateflag
|
24
xCAT-server/share/xcat/netboot/fedora/dracut/xcat-updateflag
Executable file
24
xCAT-server/share/xcat/netboot/fedora/dracut/xcat-updateflag
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/awk -f
|
||||
#script to feedback the node provision status to xcatd
|
||||
BEGIN {
|
||||
|
||||
xcatdhost = ARGV[1]
|
||||
xcatiport = ARGV[2]
|
||||
|
||||
|
||||
ns = "/inet/tcp/0/" xcatdhost "/" xcatiport
|
||||
print "xCAT_xcatd" |& ns
|
||||
|
||||
while(1) {
|
||||
ns |& getline
|
||||
|
||||
if($0 == "ready")
|
||||
print ARGV[3] |& ns
|
||||
if($0 == "done")
|
||||
break
|
||||
}
|
||||
|
||||
close(ns)
|
||||
|
||||
exit 0
|
||||
}
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcatroot
|
263
xCAT-server/share/xcat/netboot/fedora/dracut/xcatroot
Executable file
263
xCAT-server/share/xcat/netboot/fedora/dracut/xcatroot
Executable file
@ -0,0 +1,263 @@
|
||||
#!/bin/sh
|
||||
NEWROOT=$3
|
||||
RWDIR=.statelite
|
||||
XCATMASTER=$XCAT
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
rootlimit="$(getarg rootlimit=)"
|
||||
|
||||
|
||||
getarg nonodestatus
|
||||
NODESTATUS=$?
|
||||
|
||||
MASTER=`echo $XCATMASTER |awk -F: '{print $1}'`
|
||||
XCATIPORT="$(getarg XCATIPORT=)"
|
||||
if [ $? -ne 0 ]; then
|
||||
XCATIPORT="3002"
|
||||
fi
|
||||
|
||||
|
||||
if [ $NODESTATUS -ne 0 ];then
|
||||
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
|
||||
fi
|
||||
|
||||
if [ ! -z "$imgurl" ]; then
|
||||
if [ xhttp = x${imgurl%%:*} ]; then
|
||||
NFS=0
|
||||
FILENAME=${imgurl##*/}
|
||||
while [ ! -r "$FILENAME" ]; do
|
||||
echo Getting $imgurl...
|
||||
if ! wget $imgurl; then
|
||||
rm -f $FILENAME
|
||||
sleep 27
|
||||
fi
|
||||
done
|
||||
elif [ xnfs = x${imgurl%%:*} ]; then
|
||||
NFS=1
|
||||
SERVER=${imgurl#nfs:}
|
||||
SERVER=${SERVER#/}
|
||||
SERVER=${SERVER#/}
|
||||
ROOTDIR=$SERVER
|
||||
SERVER=${SERVER%%/*}
|
||||
SERVER=${SERVER%:}
|
||||
ROOTDIR=/${ROOTDIR#*/}
|
||||
fi
|
||||
fi
|
||||
#echo 0 > /proc/sys/vm/zone_reclaim_mode #Avoid kernel bug
|
||||
|
||||
if [ -r /*.metainfo ]; then
|
||||
ctorrent /*.metainfo -e 0
|
||||
fi
|
||||
if [ -r /rootimg.sfs ]; then
|
||||
echo Setting up squashfs with ram overlay.
|
||||
mknod /dev/loop0 b 7 0
|
||||
mkdir -p /ro
|
||||
mkdir -p /rw
|
||||
mount -t squashfs /rootimg.sfs /ro
|
||||
mount -t tmpfs rw /rw
|
||||
mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT
|
||||
mkdir -p $NEWROOT/ro
|
||||
mkdir -p $NEWROOT/rw
|
||||
mount --move /ro $NEWROOT/ro
|
||||
mount --move /rw $NEWROOT/rw
|
||||
elif [ -r /rootimg.gz ]; then
|
||||
echo Setting up RAM-root tmpfs.
|
||||
if [ -z $rootlimit ];then
|
||||
mount -t tmpfs -o mode=755 rootfs $NEWROOT
|
||||
else
|
||||
mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT
|
||||
fi
|
||||
|
||||
cd $NEWROOT
|
||||
echo -n "Extracting root filesystem:"
|
||||
if [ -x /bin/cpio ]; then
|
||||
gzip -cd /rootimg.gz |/bin/cpio -idum
|
||||
else
|
||||
gzip -cd /rootimg.gz |cpio -idum
|
||||
fi
|
||||
$NEWROOT/etc/init.d/localdisk
|
||||
echo Done
|
||||
elif [ -r /rootimg-statelite.gz ]; then
|
||||
echo Setting up RAM-root tmpfs for statelite mode.
|
||||
|
||||
if [ -z $rootlimit];then
|
||||
mount -t tmpfs -o mode=755 rootfs $NEWROOT
|
||||
else
|
||||
mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT
|
||||
fi
|
||||
|
||||
cd $NEWROOT
|
||||
echo -n "Extracting root filesystem:"
|
||||
if [ -x /bin/cpio ]; then
|
||||
gzip -cd /rootimg-statelite.gz |/bin/cpio -idum
|
||||
else
|
||||
gzip -cd /rootimg-statelite.gz |cpio -idum
|
||||
fi
|
||||
echo Done
|
||||
# then, the statelite staffs will be processed
|
||||
echo Setting up Statelite
|
||||
modprobe nfs
|
||||
MAXTRIES=7
|
||||
ITER=0
|
||||
if [ ! -e "$NEWROOT/$RWDIR" ]; then
|
||||
echo ""
|
||||
echo "The /$RWDIR directory doesn't exist in the rootimg... "
|
||||
echo ""
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then
|
||||
echo ""
|
||||
echo "$NEWROOT/etc/init.d/statelite doesn't exist... "
|
||||
echo ""
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
mount -t tmpfs rw $NEWROOT/$RWDIR
|
||||
mkdir -p $NEWROOT/$RWDIR/tmpfs
|
||||
ME=`hostname`
|
||||
if [ ! -z $NODE ]; then
|
||||
ME=$NODE
|
||||
fi
|
||||
|
||||
|
||||
# mount the SNAPSHOT directory here for persistent use.
|
||||
if [ ! -z $STATEMNT ]; then
|
||||
SNAPSHOTSERVER=${STATEMNT%:*}
|
||||
SNAPSHOTROOT=${STATEMNT#*/}
|
||||
if [ -z $SNAPSHOTROOT ]; then
|
||||
SNAPSHOTROOT=$SNAPSHOTSERVER
|
||||
SNAPSHOTSERVER=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z $SNAPSHOTSERVER ]; then
|
||||
mkdir -p $NEWROOT/$RWDIR/persistent
|
||||
MAXTRIES=5
|
||||
ITER=0
|
||||
if [ -z $MNTOPTS ]; then
|
||||
MNT_OPTIONS="nolock,rsize=32768,tcp,nfsvers=3,timeo=14"
|
||||
else
|
||||
MNT_OPTIONS=$MNTOPTS
|
||||
fi
|
||||
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "You are dead, rpower $ME boot to play again."
|
||||
echo "Possible problems:
|
||||
1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ?
|
||||
2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS=$(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds ..."
|
||||
sleep $RS
|
||||
done
|
||||
|
||||
# create directory which is named after my node name
|
||||
mkdir -p $NEWROOT/$RWDIR/persistent/$ME
|
||||
ITER=0
|
||||
# umount current persistent mount
|
||||
while ! umount -l $NEWROOT/$RWDIR/persistent; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Cannot umount $NEWROOT/$RWDIR/persistent."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
|
||||
# mount persistent to server:/rootpath/nodename
|
||||
ITER=0
|
||||
while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do
|
||||
ITER=$(( ITER + 1 ))
|
||||
if [ "$ITER" == "$MAXTRIES" ]; then
|
||||
echo "Your are dead, rpower $ME boot to play again."
|
||||
echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME."
|
||||
/bin/sh
|
||||
exit
|
||||
fi
|
||||
RS= $(( $RANDOM % 20 ))
|
||||
echo "Trying again in $RS seconds..."
|
||||
sleep $RS
|
||||
done
|
||||
fi
|
||||
|
||||
$NEWROOT/etc/init.d/localdisk
|
||||
$NEWROOT/etc/init.d/statelite
|
||||
fastboot=yes
|
||||
export fastboot
|
||||
keep_old_ip=yes
|
||||
export keep_old_ip
|
||||
|
||||
mount -n --bind /dev $NEWROOT/dev
|
||||
mount -n --bind /proc $NEWROOT/proc
|
||||
mount -n --bind /sys $NEWROOT/sys
|
||||
|
||||
else
|
||||
echo -n Failed to download image, panicing in 5...
|
||||
for i in 4 3 2 1 0; do
|
||||
/bin/sleep 1
|
||||
echo -n $i...
|
||||
done
|
||||
echo
|
||||
echo "You're dead. rpower nodename reset to play again.
|
||||
|
||||
* Did you packimage with -m cpio, -m squashfs, or -m nfs?
|
||||
* If using -m squashfs did you include aufs.ko with geninitrd?
|
||||
e.g.: -n tg3,squashfs,aufs,loop
|
||||
* If using -m nfs did you export NFS and sync rootimg? And
|
||||
did you include the aufs and nfs modules in the proper order:
|
||||
e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs
|
||||
|
||||
"
|
||||
/bin/dash
|
||||
exit
|
||||
fi
|
||||
cd /
|
||||
|
||||
if [ -z $STATEMNT ]; then
|
||||
for lf in /tmp/dhclient.*.lease; do
|
||||
netif=${lf#*.}
|
||||
netif=${netif%.*}
|
||||
cp $lf "$NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
|
||||
done
|
||||
|
||||
if [ ! -z "$ifname" ]; then
|
||||
MACX=${ifname#*:}
|
||||
ETHX=${ifname%:$MACX*}
|
||||
elif [ ! -z "$netdev" ]; then
|
||||
ETHX=$netdev
|
||||
MACX=`ip link show $netdev | grep ether | awk '{print $2}'`
|
||||
elif [ ! -z "$BOOTIF" ]; then
|
||||
MACX=$BOOTIF
|
||||
#ETHX=`ifconfig |grep -i $BOOTIF | awk '{print $1}'`
|
||||
ETHX=` ip -oneline link show |grep -i $BOOTIF|awk -F ':' '{print $2}'|grep -o "[^ ]\+\( \+[^ ]\+\)*"`
|
||||
fi
|
||||
|
||||
if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then
|
||||
if [ ! -e $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX ]; then
|
||||
touch $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
fi
|
||||
echo "DEVICE=$ETHX" > $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
echo "BOOTPROTO=dhcp" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
echo "HWADDR=$MACX" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
echo "ONBOOT=yes" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX
|
||||
fi
|
||||
fi
|
||||
|
||||
cp /etc/resolv.conf "$NEWROOT/etc/"
|
||||
|
||||
if [ -d "$NEWROOT/etc/sysconfig" -a ! -e "$NEWROOT/etc/sysconfig/selinux" ]; then
|
||||
echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux"
|
||||
fi
|
||||
|
||||
# inject new exit_if_exists
|
||||
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > /initqueue/xcat.sh
|
||||
# force udevsettle to break
|
||||
> /initqueue/work
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/check
|
3
xCAT-server/share/xcat/netboot/fedora/dracut_009/check
Executable file
3
xCAT-server/share/xcat/netboot/fedora/dracut_009/check
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
[ "$1" = "-d" ] && echo network
|
||||
exit 0
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/install.netboot
|
10
xCAT-server/share/xcat/netboot/fedora/dracut_009/install.netboot
Executable file
10
xCAT-server/share/xcat/netboot/fedora/dracut_009/install.netboot
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
echo $drivers
|
||||
dracut_install wget cpio gzip dash modprobe touch echo cut wc
|
||||
dracut_install -o ctorrent
|
||||
dracut_install grep ifconfig hostname awk egrep grep dirname expr
|
||||
dracut_install mount.nfs
|
||||
dracut_install parted mke2fs bc mkswap swapon chmod
|
||||
inst "$moddir/xcat-updateflag" "/tmp/updateflag"
|
||||
inst "$moddir/xcatroot" "/sbin/xcatroot"
|
||||
inst_hook cmdline 10 "$moddir/xcat-cmdline.sh"
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/install.statelite
|
9
xCAT-server/share/xcat/netboot/fedora/dracut_009/install.statelite
Executable file
9
xCAT-server/share/xcat/netboot/fedora/dracut_009/install.statelite
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
echo $drivers
|
||||
dracut_install wget cpio gzip dash modprobe wc touch echo cut
|
||||
dracut_install -o ctorrent
|
||||
dracut_install grep ifconfig hostname awk egrep grep dirname expr
|
||||
dracut_install parted mke2fs bc mkswap swapon chmod
|
||||
inst "$moddir/xcat-updateflag" "/tmp/updateflag"
|
||||
inst_hook pre-mount 5 "$moddir/xcat-premount.sh"
|
||||
inst_hook pre-pivot 5 "$moddir/xcat-prepivot.sh"
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/installkernel
|
2
xCAT-server/share/xcat/netboot/fedora/dracut_009/installkernel
Executable file
2
xCAT-server/share/xcat/netboot/fedora/dracut_009/installkernel
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
instmods nfs sunrpc
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcat-premount.sh
|
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
#script to update nodelist.nodestatus during provision
|
||||
|
||||
MASTER=`echo $XCAT |awk -F: '{print $1}'`
|
||||
|
||||
getarg nonodestatus
|
||||
NODESTATUS=$?
|
||||
|
||||
XCATIPORT="$(getarg XCATIPORT=)"
|
||||
if [ $? -ne 0 ]; then
|
||||
XCATIPORT="3002"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ $NODESTATUS -ne 0 ];then
|
||||
/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting"
|
||||
fi
|
@ -1 +0,0 @@
|
||||
../../rh/dracut/xcat-updateflag
|
24
xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-updateflag
Executable file
24
xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-updateflag
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/awk -f
|
||||
#script to feedback the node provision status to xcatd
|
||||
BEGIN {
|
||||
|
||||
xcatdhost = ARGV[1]
|
||||
xcatiport = ARGV[2]
|
||||
|
||||
|
||||
ns = "/inet/tcp/0/" xcatdhost "/" xcatiport
|
||||
print "xCAT_xcatd" |& ns
|
||||
|
||||
while(1) {
|
||||
ns |& getline
|
||||
|
||||
if($0 == "ready")
|
||||
print ARGV[3] |& ns
|
||||
if($0 == "done")
|
||||
break
|
||||
}
|
||||
|
||||
close(ns)
|
||||
|
||||
exit 0
|
||||
}
|
@ -1 +0,0 @@
|
||||
../rh/genimage
|
2081
xCAT-server/share/xcat/netboot/fedora/genimage
Executable file
2081
xCAT-server/share/xcat/netboot/fedora/genimage
Executable file
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
genimage
|
2081
xCAT-server/share/xcat/netboot/fedora/geninitrd
Executable file
2081
xCAT-server/share/xcat/netboot/fedora/geninitrd
Executable file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user