Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
This commit is contained in:
33
buildcore.sh
33
buildcore.sh
@@ -85,6 +85,20 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
export HOME=/root # This is so rpm and gpg will know home, even in sudo
|
||||
fi
|
||||
|
||||
# for the git case, query the current branch and set REL (changing master to devel if necessary)
|
||||
function setbranch {
|
||||
#git checkout $BRANCH
|
||||
REL=`git rev-parse --abbrev-ref HEAD`
|
||||
if [ "$REL" = "master" ]; then
|
||||
REL="devel"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$REL" = "xcat-core" ]; then # using git
|
||||
GIT=1
|
||||
setbranch # this changes the REL variable
|
||||
fi
|
||||
|
||||
YUMDIR=$FRS
|
||||
YUMREPOURL="https://sourceforge.net/projects/xcat/files/yum"
|
||||
|
||||
@@ -112,7 +126,11 @@ fi
|
||||
|
||||
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
|
||||
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
|
||||
DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
|
||||
else
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
fi
|
||||
SRCD=core-snap-srpms
|
||||
|
||||
# currently aix builds ppc rpms, but someday it should build noarch
|
||||
@@ -151,20 +169,9 @@ else
|
||||
#echo "source=$source"
|
||||
fi
|
||||
|
||||
# for the git case, query the current branch and set REL (changing master to devel if necessary)
|
||||
function setbranch {
|
||||
#git checkout $BRANCH
|
||||
REL=`git rev-parse --abbrev-ref HEAD`
|
||||
if [ "$REL" = "master" ]; then
|
||||
REL="devel"
|
||||
fi
|
||||
}
|
||||
|
||||
# If they have not given us a premade update file, do an svn update or git pull and capture the results
|
||||
SOMETHINGCHANGED=0
|
||||
if [ "$REL" = "xcat-core" ]; then # using git
|
||||
GIT=1
|
||||
setbranch
|
||||
if [ "$GIT" = "1" ]; then # using git
|
||||
if [ -z "$GITUP" ]; then
|
||||
GITUP=../coregitup
|
||||
echo "git pull > $GITUP"
|
||||
|
@@ -10,7 +10,7 @@ if ($^O =~ /^aix/i) {
|
||||
}
|
||||
|
||||
use strict;
|
||||
use Sys::Syslog qw (:DEFAULT setlogsock);
|
||||
use Sys::Syslog;
|
||||
use xCAT::Utils;
|
||||
#use locale;
|
||||
use Socket;
|
||||
@@ -456,8 +456,7 @@ sub message
|
||||
|
||||
# If they want this msg to also go to syslog, do that now
|
||||
eval {
|
||||
openlog("xCAT", '', 'local4');
|
||||
setlogsock(["tcp", "unix", "stream"]);
|
||||
openlog("xCAT", "nofatal,pid", "local4");
|
||||
if ($sev eq 'SE') {
|
||||
syslog("err", $rsp);
|
||||
} else {
|
||||
@@ -503,8 +502,7 @@ sub message
|
||||
{
|
||||
print $stdouterrf "Unable to open auditlog\n";
|
||||
eval {
|
||||
openlog("xCAT", '', 'local4');
|
||||
setlogsock(["tcp", "unix", "stream"]);
|
||||
openlog("xCAT", "nofatal,pid", "local4");
|
||||
syslog("err", "Unable to write to auditlog");
|
||||
closelog();
|
||||
};
|
||||
@@ -521,8 +519,7 @@ sub message
|
||||
{ # error
|
||||
print $stdouterrf "Unable to open auditlog\n";
|
||||
eval {
|
||||
openlog("xCAT", '', 'local4');
|
||||
setlogsock(["tcp", "unix", "stream"]);
|
||||
openlog("xCAT", "nofatal,pid", "local4");
|
||||
syslog("err", "Unable to open auditlog");
|
||||
closelog();
|
||||
};
|
||||
|
@@ -667,6 +667,9 @@ sub decode_spd {
|
||||
1066 => 8500,
|
||||
1333 => 10600,
|
||||
1600 => 12800,
|
||||
1867 => 14900,
|
||||
2133 => 17000,
|
||||
2134 => 17000,
|
||||
);
|
||||
|
||||
my %ddr3modcap = (
|
||||
@@ -707,9 +710,20 @@ sub decode_spd {
|
||||
}
|
||||
$rethash->{product}->{name}=$memtypes{$spd[2]};
|
||||
if ($spd[2] == 11) { #DDR3 spec applies
|
||||
my $ftbdividend = $spd[9] >> 4;
|
||||
my $ftbdivisor = $spd[9] & 0xf;
|
||||
my $ftb = $ftbdividend/$ftbdivisor;
|
||||
my $fineoffset = $spd[34];
|
||||
if ($fineoffset & 0b10000000) {
|
||||
#negative value, twos complement
|
||||
$fineoffset = 0-(($fineoffset ^ 0xff) + 1);
|
||||
}
|
||||
$fineoffset = ($ftb * $fineoffset) * 10**-3;
|
||||
my $mtb = $spd[10]/$spd[11];
|
||||
my $speed = $speedfromclock{int(2/($mtb*$spd[12]*10**-3))};
|
||||
$rethash->{product}->{name}="PC3-".$speed;
|
||||
my $clock = int(2/(($mtb*$spd[12]+$fineoffset)*10**-3));
|
||||
my $speed = $speedfromclock{$clock};
|
||||
unless ($speed) { $speed = "UNKNOWN"; }
|
||||
$rethash->{product}->{name}="PC3-".$speed." ($clock MT/s)";
|
||||
if ($spd[8]&0b11000) {
|
||||
$rethash->{product}->{name} .= " ECC";
|
||||
}
|
||||
|
100
xCAT-client/pods/man1/geninitrd.1.pod
Normal file
100
xCAT-client/pods/man1/geninitrd.1.pod
Normal file
@@ -0,0 +1,100 @@
|
||||
=head1 NAME
|
||||
|
||||
B<genimage> - Generate an initrd (initial ramfs) which to be used for statefull install or stateless netboot.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<geninitrd> <imagename>
|
||||
|
||||
B<geninitrd> [B<-h> | B<--help>]
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Generate the initrd for the osimage: B<imagename> which is an xCAT object of I<osimage> type.
|
||||
|
||||
B<Diskfull Osimage>
|
||||
|
||||
=over 2
|
||||
|
||||
If the B<imagename> is a statefull one (The provmethod attribute for the osimage is 'install'),
|
||||
this command is used to rebuild the initrd to inject the new drivers from driver rpms or
|
||||
'update distro' and copy the rebuilt initrd and new kernel (If there's new kernel in 'update
|
||||
distro') to the directory I</tftpboot/xcat/<imagename>>.
|
||||
|
||||
If the initrd has been rebuilt by geninitrd, when run nodeset, the I<--noupdateinitrd> option
|
||||
should be used to skip the rebuilding of initrd to improve the performance.
|
||||
|
||||
Three attributes of osimage object can be used to specify the Driver RPM location and Driver names
|
||||
for injecting new drviers to initrd.
|
||||
|
||||
B<netdrivers> - comma separated driver names that need to be injected to the initrd.
|
||||
The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list.
|
||||
If you want to load all the drivers from the driver rpms, using the keyword allupdate.
|
||||
|
||||
B<driverupdatesrc> - comma separated driver rpm packages (full path should be specified)
|
||||
|
||||
B<osupdatename> - comma separated 'osdistroupdate' object. Each 'osdistroupdate' object specifies a
|
||||
Linux distro update. When run geninitrd, 'kernel-*.rpm' will be searched from osdistroupdate.dirpath
|
||||
to get all the rpm packages and then search the drivers from the rpm packages.
|
||||
|
||||
Refer to the doc: https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Using_Linux_Driver_Update_Disk
|
||||
|
||||
=back
|
||||
|
||||
B<Stateless Osimage>
|
||||
|
||||
=over 2
|
||||
|
||||
If the B<imagename> is a stateless one (The provmethod attribute for the osimage is 'netboot'),
|
||||
this command is used to generate the initrd from the rootimg which generated by 'genimage' command.
|
||||
So the 'genimage' must be run once before running the geninitrd command.
|
||||
|
||||
Two attributes of osimage object can be used to specify the Driver RPM location and Driver names
|
||||
for injecting new drviers to initrd.
|
||||
|
||||
B<netdrivers> - comma separated driver names that need to be injected to the initrd.
|
||||
The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list.
|
||||
If you want to load all the drivers from the driver rpms, using the keyword allupdate.
|
||||
|
||||
B<driverupdatesrc> - comma separated driver rpm packages (full path should be specified)
|
||||
|
||||
=back
|
||||
|
||||
|
||||
=head1 Parameters
|
||||
|
||||
I<imagename> specifies the name of an os image definition to be used. The specification for the image is storted in the I<osimage> table and I<linuximage> table.
|
||||
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occurred.
|
||||
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
=over 3
|
||||
|
||||
=item 1
|
||||
To generate initrd for the osimage B<myimagename>:
|
||||
|
||||
geninitrd myimagename
|
||||
|
||||
=back
|
||||
|
||||
|
||||
=head1 FILES
|
||||
|
||||
/opt/xcat/bin/geninitrd
|
||||
|
||||
/opt/xcat/bin/genimage
|
||||
|
||||
/opt/xcat/share/xcat/netboot/<OS>/genimage
|
||||
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<geninitrd(1)|geninitrd.1>, L<genimage(1)|genimage.1>
|
@@ -6,6 +6,8 @@ B<nodeset> - set the boot state for a noderange
|
||||
|
||||
B<nodeset> [I<noderange>] [I<boot>|I<install>|I<stat>|I<iscsiboot>|I<netboot>|I<statelite>|I<offline>|I<runcmd=bmcsetup>|I<osimage[=<imagename>>]]
|
||||
|
||||
B<nodeset> I<noderange> [I<osimage=<imagename>> I<--noupdateinitrd>]
|
||||
|
||||
B<nodeset> [I<-h>|I<--help>|I<-v>|I<--version>]
|
||||
|
||||
=head1 B<Description>
|
||||
@@ -67,6 +69,11 @@ Cleanup the current pxe/tftp boot configuration files for the nodes requested
|
||||
|
||||
Prepare server for installing a node using the specified os image. The os image is defined in the I<osimage> table and I<linuximage> table. If the <imagename> is omitted, the os image name will be obtained from I<nodetype.provmethod> for the node.
|
||||
|
||||
=item B<--noupdateinitrd>
|
||||
|
||||
Skip the rebuilding of initrd when the 'netdrivers', 'drvierupdatesrc' or 'osupdatename' were set for injecting new drviers to initrd. But, the geninitrd command
|
||||
should be run to rebuild the initrd for new drivers injecting. This is used to improve the performance of nodeset command.
|
||||
|
||||
=item B<runimage>=<task>>
|
||||
|
||||
If you would like to run a task after deployment, you can define that task with this attribute.
|
||||
|
@@ -14,7 +14,7 @@ B<xcatconfig> {B<-i>|B<--initinstall>} [B<-V>|B<--verbose>]
|
||||
|
||||
B<xcatconfig> {B<-u>|B<--updateinstall>} [B<-V>|B<--verbose>]
|
||||
|
||||
B<xcatconfig> [B<-k>|B<--sshkeys>] [B<-s>|B<--sshnodehostkeys>] [B<-c>|B<--credentials>] [B<-d>|B<--database>] [B<-m>|B<--mgtnode>] [B<-V>|B<--verbose>]
|
||||
B<xcatconfig> [B<-k>|B<--sshkeys>] [B<-s>|B<--sshnodehostkeys>] [B<-c>|B<--credentials>] [B<-d>|B<--database>] [B<-m>|B<--mgtnode>] [B<-t>|B<--tunables>] [B<-V>|B<--verbose>]
|
||||
|
||||
B<xcatconfig> {B<-f>|B<--force>} [B<-V>|B<--verbose>]
|
||||
|
||||
@@ -74,6 +74,11 @@ Redistribute credentials and ssh keys to the service nodes and ssh keys to the n
|
||||
|
||||
This option will add the Management Node to the database with the correct attributes set to be recognized by xCAT. This should be run after the hostname of the Management Node is set to the name that will resolve to the cluster-facing NIC.
|
||||
|
||||
|
||||
=item B<-t|--tunables>
|
||||
|
||||
This option will set tunable parameters on the Management and Service nodes recommended for your Linux cluster. It will only set them during initial install, if you run xcatconfig -f or xcatconfig -t.
|
||||
|
||||
=back
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
@@ -5,6 +5,9 @@ PUBKEY=`echo $PUBKEY|sed -e 's/ //g'`
|
||||
export PUBKEY
|
||||
|
||||
echo "Beginning node discovery process"
|
||||
for nic in `ip link|grep mtu|grep -v LOOPBACK|grep -v usb|grep -v ,LOWER_UP|awk -F: '{print $2}'`; do
|
||||
ip link set $nic up
|
||||
done
|
||||
waitforlink=100
|
||||
while [ ! -z "$NICSTOBRINGUP" -a $waitforlink -gt 0 ]; do
|
||||
NICSTOBRINGUP=`ip link|grep mtu|grep -v LOOPBACK|grep -v usb|grep -v ,LOWER_UP|awk -F: '{print $2}'`
|
||||
|
@@ -82,7 +82,7 @@ dhclient -6 -pf /var/run/dhclient6.$bootnic.pid $bootnic -lf /var/lib/dhclient/d
|
||||
NICSTOBRINGUP=`ip link|grep mtu|grep -v LOOPBACK|grep -v $bootnic|grep -v usb|grep -v ,UP|awk -F: '{print $2}'`
|
||||
export NICSTOBRINGUP
|
||||
for nic in $NICSTOBRINGUP; do
|
||||
(while ! ethtool $nic | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; cdhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$nic.pid $nic ) &
|
||||
(while ! ethtool $nic | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$nic.pid $nic ) &
|
||||
(while ! ethtool $nic | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -6 -pf /var/run/dhclient6.$nic.pid -lf /var/lib/dhclient/dhclient6.leases $nic ) &
|
||||
done
|
||||
openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 &
|
||||
|
@@ -186,15 +186,15 @@ sub makescript {
|
||||
if($entries[0]) {
|
||||
$installroot = $entries[0];
|
||||
}
|
||||
my $tmpl="$installroot/postscripts/mypostscript.tmpl";
|
||||
my $tmpl="$installroot/postscripts/mypostscript.tmpl"; #the customized mypostscript template
|
||||
|
||||
unless ( -r $tmpl) {
|
||||
$tmpl="$::XCATROOT/share/xcat/templates/mypostscript/mypostscript.tmpl";
|
||||
$tmpl="$::XCATROOT/share/xcat/mypostscript/mypostscript.tmpl"; #the default xcat mypostscript template
|
||||
}
|
||||
|
||||
unless ( -r "$tmpl") {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0]= "No mypostscript template exists in directory /install/postscripts or $::XCATROOT/share/xcat/templates/mypostscript/mypostscript.tmpl.\n";
|
||||
$rsp->{data}->[0]= "No mypostscript template exists in directory /install/postscripts or $::XCATROOT/share/xcat/mypostscript/mypostscript.tmpl.\n";
|
||||
xCAT::MsgUtils->message("SE", $rsp, $callback,1);
|
||||
return ;
|
||||
}
|
||||
|
@@ -1556,7 +1556,8 @@ sub mksysclone
|
||||
}
|
||||
}
|
||||
|
||||
# copy postscripts
|
||||
# copy postscripts, the xCAT scripts may update, but the image is captured long time ago
|
||||
# should update the scripts at each nodeset
|
||||
my $script1 = "configefi";
|
||||
my $script2 = "updatenetwork";
|
||||
my $pspath = "$installroot/sysclone/scripts/post-install/";
|
||||
|
@@ -26,8 +26,28 @@ sub preprocess_request
|
||||
my $req = shift;
|
||||
my $callback = shift;
|
||||
|
||||
unless (defined ($req->{arg}) && $req->{arg}->[0]) {
|
||||
xCAT::MsgUtils->message("E", {error=>["An osimage name needs to be specified."], errorcode=>["1"]}, $callback);
|
||||
my $usage = sub {
|
||||
my $callback = shift;
|
||||
xCAT::MsgUtils->message("I", {data=>["Usage: geninitrd <imagename> [-h | --help]"]}, $callback);
|
||||
};
|
||||
|
||||
my $osimage;
|
||||
if (defined ($req->{arg})) {
|
||||
foreach (@{$req->{arg}}) {
|
||||
if (/^-/) {
|
||||
$usage->($callback);
|
||||
return;
|
||||
}else {
|
||||
$osimage = $_;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$usage->($callback);
|
||||
return;
|
||||
}
|
||||
|
||||
unless ($osimage) {
|
||||
$usage->($callback);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,10 +66,11 @@ sub process_request
|
||||
{
|
||||
my $req = shift;
|
||||
my $callback = shift;
|
||||
my $doreq = shift;
|
||||
|
||||
if ($req->{command}->[0] eq 'geninitrd')
|
||||
{
|
||||
return geninitrd($req, $callback);
|
||||
return geninitrd($req, $callback, $doreq);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,6 +78,7 @@ sub process_request
|
||||
sub geninitrd {
|
||||
my $req = shift;
|
||||
my $callback = shift;
|
||||
my $doreq = shift;
|
||||
|
||||
my $osimage = $req->{arg}->[0];
|
||||
|
||||
@@ -69,7 +91,7 @@ sub geninitrd {
|
||||
return;
|
||||
}
|
||||
|
||||
my $oient = $osimagetab->getAttribs({imagename => $osimage}, 'osvers', 'osarch', 'osupdatename');
|
||||
my $oient = $osimagetab->getAttribs({imagename => $osimage}, 'provmethod', 'osvers', 'osarch', 'osupdatename');
|
||||
unless ($oient && $oient->{'osvers'} && $oient->{'osarch'} ) {
|
||||
xCAT::MsgUtils->message("E", {error=>["The osimage [$osimage] was not defined or [osvers, osarch] attributes were not set."], errorcode=>["1"]}, $callback);
|
||||
return;
|
||||
@@ -84,7 +106,7 @@ sub geninitrd {
|
||||
return;
|
||||
}
|
||||
|
||||
my $lient = $linuximagetab->getAttribs({imagename => $osimage}, 'pkgdir', 'driverupdatesrc', 'netdrivers');
|
||||
my $lient = $linuximagetab->getAttribs({imagename => $osimage}, 'rootimgdir', 'pkgdir', 'driverupdatesrc', 'netdrivers');
|
||||
unless ($lient && $lient->{'pkgdir'}) {
|
||||
xCAT::MsgUtils->message("E", {error=>["The osimage [$osimage] was not defined or [pkgdir] attribute was not set."], errorcode=>["1"]}, $callback);
|
||||
return;
|
||||
@@ -93,6 +115,27 @@ sub geninitrd {
|
||||
$driverupdatesrc = $lient->{'driverupdatesrc'};
|
||||
$netdrivers = $lient->{'netdrivers'};
|
||||
|
||||
# if the provmethod equals 'netboot', call the genimage --onlyinitrd directly
|
||||
if ($oient->{'provmethod'} && $oient->{'provmethod'} eq "netboot") {
|
||||
if ($lient->{'rootimgdir'}) {
|
||||
unless (-d $lient->{'rootimgdir'}."/rootimg/lib/modules") {
|
||||
xCAT::MsgUtils->message("E", {error=>["The genimage should be run before running geninitrd."], errorcode=>["1"]}, $callback);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
xCAT::MsgUtils->message("E", {error=>["The rootimgdir attribute for the osimage should be set."], errorcode=>["1"]}, $callback);
|
||||
return;
|
||||
}
|
||||
my @output = `genimage $osimage --onlyinitrd`;
|
||||
xCAT::MsgUtils->message("I", {data=>\@output}, $callback);
|
||||
#$doreq->({ command => ['genimage'],
|
||||
# arg => [$osimage, '--onlyinitrd'] }, $callback);
|
||||
return;
|
||||
} elsif (!$oient->{'provmethod'} || $oient->{'provmethod'} ne "install") {
|
||||
xCAT::MsgUtils->message("E", {error=>["The attribute [provmethod] for osimage [$osimage] must be set to install or netboot."], errorcode=>["1"]}, $callback);
|
||||
return;
|
||||
}
|
||||
|
||||
# get the path list of the osdistroupdate
|
||||
if ($oient->{'osupdatename'}) {
|
||||
my @osupdatenames = split (/,/, $oient->{'osupdatename'});
|
||||
|
@@ -2895,6 +2895,7 @@ sub parseprod {
|
||||
}
|
||||
$idx+=$currsize;
|
||||
($currsize,$currdata,$encode)=extractfield(\@area,$idx);
|
||||
if ($currsize < 0) { last }
|
||||
}
|
||||
return \%info;
|
||||
|
||||
@@ -2967,6 +2968,7 @@ sub parseboard {
|
||||
}
|
||||
$idx+=$currsize;
|
||||
($currsize,$currdata,$encode)=extractfield(\@area,$idx);
|
||||
if ($currsize < 0) { last }
|
||||
}
|
||||
if ($global_sessdata->{isanimm}) { #we can understand more specifically some of the extra fields...
|
||||
$boardinf{frunum}=$boardinf{extra}->[0]->{value};
|
||||
@@ -3031,6 +3033,7 @@ sub parsechassis {
|
||||
}
|
||||
$idx+=$currsize;
|
||||
($currsize,$currdata,$encode)=extractfield(\@chassarea,$idx);
|
||||
if ($currsize < 0) { last }
|
||||
}
|
||||
return \%chassisinf;
|
||||
}
|
||||
@@ -3042,7 +3045,7 @@ sub extractfield { #idx is location of the type/length byte, returns something a
|
||||
my $data;
|
||||
if ($idx >= scalar @$area) {
|
||||
xCAT::SvrUtils::sendmsg([1,"Error parsing FRU data from BMC"],$callback);
|
||||
return 1,undef,undef;
|
||||
return -1,undef,undef;
|
||||
}
|
||||
my $size = $area->[$idx] & 0b00111111;
|
||||
my $encoding = ($area->[$idx] & 0b11000000)>>6;
|
||||
|
@@ -64,6 +64,7 @@ if (
|
||||
'k|sshkeys' => \$::genSSHRootKeys,
|
||||
'm|mgtnode' => \$::setupMNinDB,
|
||||
's|sshnodehostkeys' => \$::genSSHNodeHostKeys,
|
||||
't|tunables' => \$::settunables,
|
||||
'c|credentials' => \$::genCredentials,
|
||||
'd|database' => \$::initDB,
|
||||
'h|help' => \$::HELP,
|
||||
@@ -101,6 +102,7 @@ if ($::FORCE)
|
||||
|| $::genSSHRootKeys
|
||||
|| $::genSSHNodeHostKey
|
||||
|| $::genCredentials
|
||||
|| $::settunables
|
||||
|| $::initDB)
|
||||
{
|
||||
my $warning =
|
||||
@@ -234,6 +236,17 @@ if (xCAT::Utils->isMN()) {
|
||||
&genSSHNodeHostKey;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Set tunables
|
||||
#
|
||||
#
|
||||
if ($::FORCE || $::settunables || $::INITIALINSTALL )
|
||||
{
|
||||
if ($::osname eq 'Linux') {
|
||||
&settunables;
|
||||
}
|
||||
}
|
||||
#
|
||||
# gen root's ssh keys, if needed and copy to appropriate directories to
|
||||
# be used during install
|
||||
@@ -628,11 +641,11 @@ sub usage
|
||||
{
|
||||
xCAT::MsgUtils->message(
|
||||
'I',
|
||||
"Usage:\nxcatconfig - Performs basic xCAT setup operations on an xCAT management node. This command should not be run on an xCAT Service Node, unless you are making it a Management Node.\n"
|
||||
"Usage:\nxcatconfig - Performs basic xCAT setup operations on an xCAT management node. Only the -t option should be used on a Service Node.\n"
|
||||
);
|
||||
xCAT::MsgUtils->message(
|
||||
'I',
|
||||
"xcatconfig [-h|--help]\nxcatconfig [-v|--version]\nxcatconfig [-f|--force] [-V|--verbose]\nxcatconfig [-i|--initinstall] [-V|--verbose]\nxcatconfig [-u|--updateinstall] [-V|--verbose]\nxcatconfig [-k|--sshkeys] [-s|--sshnodehostkeys] [-c|--credentials] [-d|database] [-m|mgtnode] [-V|--verbose]"
|
||||
"xcatconfig [-h|--help]\nxcatconfig [-v|--version]\nxcatconfig [-f|--force] [-V|--verbose]\nxcatconfig [-i|--initinstall] [-V|--verbose]\nxcatconfig [-u|--updateinstall] [-V|--verbose]\nxcatconfig [-k|--sshkeys] [-s|--sshnodehostkeys] [-c|--credentials] [-d|database] [-m|mgtnode] [-t|tunables] [-V|--verbose]"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -822,7 +835,24 @@ sub genSSHRootKeys
|
||||
);
|
||||
}
|
||||
}
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 settunables
|
||||
|
||||
Will set the default suggested tunables on the Management Node or service node for Linux
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
sub settunables
|
||||
|
||||
{
|
||||
xCAT::MsgUtils->message(
|
||||
'I',
|
||||
"The set of tunables that will be initialized is TBD.");
|
||||
|
||||
}
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 genSSHNodeHostKey
|
||||
|
@@ -72,6 +72,7 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/install
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/ca
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/mypostscript
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/scripts
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/samples
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools
|
||||
@@ -118,6 +119,7 @@ chmod -h 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
|
||||
cp share/xcat/ca/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/ca
|
||||
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/ca/*
|
||||
|
||||
cp share/xcat/mypostscript/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/mypostscript
|
||||
cp share/xcat/scripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/scripts
|
||||
cp share/xcat/samples/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/samples
|
||||
cp -r share/xcat/tools/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools
|
||||
|
@@ -48,7 +48,7 @@ then
|
||||
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
|
||||
|
||||
fi
|
||||
|
||||
xcatpost="xcatpost"
|
||||
if [ -d /xcatpost/_ssh ]
|
||||
then
|
||||
logger -p local4.info -t xcat "Install: setup root .ssh"
|
||||
@@ -74,7 +74,7 @@ CREDPID=$!
|
||||
|
||||
|
||||
#first contact daemon xcatflowrequest <server> 3001
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: xcatflowrequest $master 3001"
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: /$xcatpost/xcatflowrequest $master 3001"
|
||||
/$xcatpost/xcatflowrequest $master 3001
|
||||
getcredentials.awk ssh_dsa_hostkey | grep -E -v '</{0,1}xcatresponse>|</{0,1}serverdone>' | sed -e 's/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /tmp/ssh_dsa_hostkey
|
||||
|
||||
@@ -87,7 +87,7 @@ if [ $? -ne 0 ]; then
|
||||
MYCONT=`cat /etc/ssh/ssh_host_dsa_key`
|
||||
while [ -z "$MYCONT" ]; do
|
||||
#first contact daemon xcatflowrequest <server> 3001
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: xcatflowrequest $master 3001"
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: /$xcatpost/xcatflowrequest $master 3001"
|
||||
/$xcatpost/xcatflowrequest $master 3001
|
||||
getcredentials.awk ssh_dsa_hostkey | grep -v '<'|sed -e 's/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /etc/ssh/ssh_host_dsa_key
|
||||
MYCONT=`cat /etc/ssh/ssh_host_dsa_key`
|
||||
@@ -108,7 +108,7 @@ fi
|
||||
rm /tmp/ssh_dsa_hostkey
|
||||
|
||||
# first contact daemon xcatflowrequest <server> 3001
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: xcatflowrequest $master 3001"
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: /$xcatpost/xcatflowrequest $master 3001"
|
||||
/$xcatpost/xcatflowrequest $master 3001
|
||||
getcredentials.awk ssh_rsa_hostkey | grep -E -v '</{0,1}xcatresponse>|</{0,1}serverdone>' | sed -e 's/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /tmp/ssh_rsa_hostkey
|
||||
|
||||
@@ -121,7 +121,7 @@ if [ $? -ne 0 ]; then
|
||||
MYCONT=`cat /etc/ssh/ssh_host_rsa_key`
|
||||
while [ -z "$MYCONT" ]; do
|
||||
# first contact daemon xcatflowrequest <server> 3001
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: xcatflowrequest $master 3001"
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: /$xcatpost/xcatflowrequest $master 3001"
|
||||
/$xcatpost/xcatflowrequest $master 3001
|
||||
|
||||
getcredentials.awk ssh_rsa_hostkey | grep -v '<'|sed -e 's/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /etc/ssh/ssh_host_rsa_key
|
||||
@@ -155,7 +155,7 @@ sleep 1
|
||||
if [ $ENABLESSHBETWEENNODES = "YES" ];
|
||||
then
|
||||
#first contact daemon xcatflowrequest <server> 3001
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: xcatflowrequest $master 3001"
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: /$xcatpost/xcatflowrequest $master 3001"
|
||||
/$xcatpost/xcatflowrequest $master 3001
|
||||
getcredentials.awk ssh_root_key | grep -E -v '</{0,1}xcatresponse>|</{0,1}serverdone>'|sed -e 's/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /tmp/ssh_root_key
|
||||
|
||||
@@ -168,7 +168,7 @@ then
|
||||
MYCONT=`cat /root/.ssh/id_rsa`
|
||||
while [ -z "$MYCONT" ]; do
|
||||
# first contact daemon xcatflowrequest <server> 3001
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: xcatflowrequest $master 3001"
|
||||
logger -t xCAT -p local4.info "xcatdsklspost: /$xcatpost/xcatflowrequest $master 3001"
|
||||
/$xcatpost/xcatflowrequest $master 3001
|
||||
getcredentials.awk ssh_root_key | grep -v '<'|sed -e 's/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /root/.ssh/id_rsa
|
||||
MYCONT=`cat /root/.ssh/id_rsa`
|
||||
|
Reference in New Issue
Block a user