Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
This commit is contained in:
commit
084e71387b
@ -289,7 +289,7 @@ for rpmname in xCAT xCATsn xCAT-OpenStack xCAT-OpenStack-baremetal; do
|
||||
./makerpm $rpmname "$EMBED"
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname"; fi
|
||||
else
|
||||
for arch in x86_64 ppc64 s390x; do
|
||||
for arch in x86_64 ppc64 ppc64le s390x; do
|
||||
if [ "$rpmname" = "xCAT-OpenStack" -a "$arch" != "x86_64" ] || [ "$rpmname" = "xCAT-OpenStack-baremetal" -a "$arch" != "x86_64" ] ; then continue; fi # only bld openstack for x86_64 for now
|
||||
./makerpm $rpmname $arch "$EMBED"
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname-$arch"; fi
|
||||
|
@ -111,6 +111,8 @@ echo "This is an $OSNAME system"
|
||||
ARCH=$(uname -p)
|
||||
if [ "$ARCH" = "x64_64" ]; then
|
||||
$CURDIR/makerpm xCAT-genesis-scripts x86_64
|
||||
else
|
||||
$CURDIR/makerpm xCAT-genesis-scripts ppc64
|
||||
fi
|
||||
|
||||
|
||||
|
@ -422,7 +422,7 @@ sub chvm_parse_args {
|
||||
my $check_chvm_arg = chvm_parse_extra_options(\@ARGV, \%opt);
|
||||
if (defined($check_chvm_arg)) {
|
||||
return (usage("Invalid argument: $check_chvm_arg"));
|
||||
} elsif (($opt{lparname} ne '*') && (scalar(@{$request->{node}}) > '1')){
|
||||
} elsif (($opt{lparname}) && ($opt{lparname} ne '*') && (scalar(@{$request->{node}}) > '1')){
|
||||
return(usage( "Invalid argument: must specify '*' for more than one node" ));
|
||||
}
|
||||
if ((exists($opt{lparname}) ||exists($opt{huge_page})) &&
|
||||
@ -615,7 +615,6 @@ sub mkvm_parse_args {
|
||||
if ( (!exists( $opt{i} ) || !exists( $opt{r} )) ) {
|
||||
return(usage());
|
||||
}
|
||||
}
|
||||
$opt{target} = \@{$request->{node}};
|
||||
my $ppctab = xCAT::Table->new( 'ppc');
|
||||
unless($ppctab) {
|
||||
@ -640,9 +639,11 @@ sub mkvm_parse_args {
|
||||
return(usage("For Power 775, please make sure the noderange are in one CEC "));
|
||||
}
|
||||
}
|
||||
if (exists($opt{p775})) {
|
||||
#if (exists($opt{p775})) {
|
||||
$request->{node} = [$other_p];
|
||||
$request->{noderange} = $other_p;
|
||||
#}
|
||||
|
||||
}
|
||||
####################################
|
||||
# No operands - add command name
|
||||
|
@ -1578,7 +1578,7 @@ discoverydata => {
|
||||
method => 'The method which handled the discovery request. The method could be one of: switch, blade, profile, sequential.',
|
||||
discoverytime => 'The last time that xCAT received the discovery message.',
|
||||
arch => 'The architecture of the discovered node. e.g. x86_64.',
|
||||
cpucount => 'The cpu number of the discovered node. e.g. 32.',
|
||||
cpucount => 'The number of cores multiply by threads core supported for the discovered node. e.g. 192.',
|
||||
cputype => 'The cpu type of the discovered node. e.g. Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz',
|
||||
memory => 'The memory size of the discovered node. e.g. 198460852',
|
||||
mtm => 'The machine type model of the discovered node. e.g. 786310X',
|
||||
|
@ -215,6 +215,9 @@ sub init_dbworker {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
# sleep a while to make sure the client process has done
|
||||
sleep 1.5;
|
||||
close($dbworkersocket);
|
||||
unlink($dbsockpath);
|
||||
exit 0;
|
||||
|
@ -353,10 +353,10 @@ sub find_latest_pkg_deb
|
||||
}
|
||||
|
||||
foreach my $r (@deblist) {
|
||||
my $basename = `dpkg -I $r* |grep Package|awk '{print \$2}'`;
|
||||
my $basename = `dpkg -I $r* |grep Package|awk '{print \$2}'|head -1`;
|
||||
chomp $basename;
|
||||
|
||||
my $version = `dpkg -I $r* |grep Version|awk '{print \$2}'`;
|
||||
my $version = `dpkg -I $r* |grep Version|awk '{print \$2}'|head -1`;
|
||||
chomp $version;
|
||||
|
||||
$founddeb{$basename}{$r}{version}=$version;
|
||||
|
@ -43,6 +43,7 @@ my $interactive;
|
||||
my $onlyinitrd;
|
||||
my $dryrun;
|
||||
my $ignorekernelchk;
|
||||
my $noupdate;
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 print_usage - usage message
|
||||
@ -55,8 +56,8 @@ sub print_usage
|
||||
print "Usage:\n";
|
||||
print " genimage\n\n";
|
||||
print " genimage --dryrun\n\n";
|
||||
print ' genimage -o <osver> [-a <arch>] -p <profile> -i <nodebootif> -n <nodenetdrivers> [--onlyinitrd] [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>] [--interactive] [--dryrun]'."\n\n";
|
||||
print ' genimage [-o <osver>] [-a <arch>] [-p <profile>] [-i <nodebootif>] [-n <nodenetdrivers>] [--onlyinitrd] [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>] [--interactive] [--dryrun] <imagename>'."\n\n";
|
||||
print ' genimage -o <osver> [-a <arch>] -p <profile> -i <nodebootif> -n <nodenetdrivers> [--onlyinitrd] [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>] [--interactive] [--dryrun] [--noupdate]'."\n\n";
|
||||
print ' genimage [-o <osver>] [-a <arch>] [-p <profile>] [-i <nodebootif>] [-n <nodenetdrivers>] [--onlyinitrd] [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>] [--interactive] [--dryrun] [--noupdate] <imagename>'."\n\n";
|
||||
print " --permission is used for statelite only\n";
|
||||
print " -g is used for SLES only\n\n";
|
||||
print " -m is used for urbuntu, debian and fedora12 only\n\n";
|
||||
@ -90,6 +91,7 @@ if (!GetOptions(
|
||||
'onlyinitrd' => \$onlyinitrd,
|
||||
'dryrun' => \$dryrun,
|
||||
'ignorekernelchk' => \$ignorekernelchk,
|
||||
'noupdate' => \$noupdate,
|
||||
'h|help' => \$help,
|
||||
'v|version' => \$version,
|
||||
)) {
|
||||
@ -409,6 +411,10 @@ if ($ignorekernelchk) {
|
||||
push @arg, "--ignorekernelchk";
|
||||
}
|
||||
|
||||
if ($noupdate) {
|
||||
push @arg, "--noupdate";
|
||||
}
|
||||
|
||||
my $cmdref;
|
||||
push (@{$cmdref->{arg}}, @arg);
|
||||
$cmdref->{command}->[0] = "genimage";
|
||||
|
@ -6,9 +6,9 @@ B<genimage> - Generates a stateless image to be used for a diskless install.
|
||||
|
||||
B<genimage>
|
||||
|
||||
B<genimage> [B<-o> I<osver>] [B<-a> I<arch>] [B<-p> I<profile>] [B<-i> I<nodebootif>] [B<-n> I<nodenetdrivers>] [B<--onlyinitrd>] [B<-r> I<otherifaces>] [B<-k> I<kernelver>] [B<-g> I<krpmver>] [B<-m> I<statelite>] [B<-l> I<rootlimitsize>] [B<--permission> I<permission>] [B<--interactive>] [B<--dryrun>] [B<--ignorekernelchk>] I<imagename>
|
||||
B<genimage> [B<-o> I<osver>] [B<-a> I<arch>] [B<-p> I<profile>] [B<-i> I<nodebootif>] [B<-n> I<nodenetdrivers>] [B<--onlyinitrd>] [B<-r> I<otherifaces>] [B<-k> I<kernelver>] [B<-g> I<krpmver>] [B<-m> I<statelite>] [B<-l> I<rootlimitsize>] [B<--permission> I<permission>] [B<--interactive>] [B<--dryrun>] [B<--ignorekernelchk>] [B<--noupdate>] I<imagename>
|
||||
|
||||
B<genimage> B<-o> I<osver> [B<-a> I<arch>] B<-p> I<profile> B<-i> I<nodebootif> B<-n> I<nodenetdrivers> [B<--onlyinitrd>] [B<-r> I<otherifaces>] [B<-k> I<kernelver>] [B<-g> I<krpmver>] [B<-m> I<statelite>] [B<-l> I<rootlimitsize>] [B<--permission> I<permission>] [B<--interactive>] [B<--dryrun>]
|
||||
B<genimage> B<-o> I<osver> [B<-a> I<arch>] B<-p> I<profile> B<-i> I<nodebootif> B<-n> I<nodenetdrivers> [B<--onlyinitrd>] [B<-r> I<otherifaces>] [B<-k> I<kernelver>] [B<-g> I<krpmver>] [B<-m> I<statelite>] [B<-l> I<rootlimitsize>] [B<--permission> I<permission>] [B<--interactive>] [B<--dryrun>] [B<--noupdate>]
|
||||
|
||||
|
||||
B<genimage> [B<-h> | B<--help> | B<-v> | B<--version>]
|
||||
@ -154,6 +154,10 @@ This flag shows the underlying call to the os specific genimage function. The us
|
||||
|
||||
Skip the kernel version checking when injecting drivers from osimage.driverupdatesrc. That means all drivers from osimage.driverupdatesrc will be injected to initrd for the specific target kernel.
|
||||
|
||||
=item B<--noupdate>
|
||||
|
||||
This flag allows the user to bypass automatic package updating when installing other packages.
|
||||
|
||||
=item B<-v|--version>
|
||||
|
||||
Display version.
|
||||
|
@ -386,6 +386,9 @@ sub setdestiny {
|
||||
return;
|
||||
}
|
||||
my $arch = $ent->{arch};
|
||||
if ($arch eq "ppc64le" or $arch eq "ppc64el") {
|
||||
$arch = "ppc64";
|
||||
}
|
||||
my $ent = $resents->{$_}->[0]; #$restab->getNodeAttribs($_,[qw(xcatmaster)]);
|
||||
my $master;
|
||||
my $kcmdline = "quiet ";
|
||||
|
@ -70,6 +70,7 @@ sub process_request {
|
||||
my $tempfile;
|
||||
my $dryrun;
|
||||
my $ignorekernelchk;
|
||||
my $noupdate;
|
||||
|
||||
GetOptions(
|
||||
'a=s' => \$arch,
|
||||
@ -90,6 +91,7 @@ sub process_request {
|
||||
'tempfile=s' => \$tempfile,
|
||||
'dryrun' => \$dryrun,
|
||||
'ignorekernelchk' => \$ignorekernelchk,
|
||||
'noupdate' => \$noupdate,
|
||||
);
|
||||
|
||||
my $osimagetab;
|
||||
@ -301,6 +303,7 @@ sub process_request {
|
||||
}
|
||||
if ($driverupdatesrc) { $cmd .= " --driverupdatesrc $driverupdatesrc"; }
|
||||
if ($ignorekernelchk) { $cmd .= " --ignorekernelchk $ignorekernelchk"; }
|
||||
if ($noupdate) { $cmd .= " --noupdate $noupdate"; }
|
||||
|
||||
if($osfamily eq "sles") {
|
||||
my @entries = xCAT::TableUtils->get_site_attribute("timezone");
|
||||
|
@ -3862,6 +3862,7 @@ sub lskitcomp_processargs {
|
||||
# Option -C for kit component attributes
|
||||
if ( defined($::opt_C) ) {
|
||||
$::kitcompattrs = split_comma_delim_str($::opt_C);
|
||||
push ($::kitcompattrs,"kitcompname");
|
||||
ensure_kitname_attr_in_list($::kitcompattrs);
|
||||
if (check_attr_names_exist('kitcomponent', $::kitcompattrs) != 0) {
|
||||
return 3;
|
||||
@ -4266,8 +4267,6 @@ sub lskit {
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#lskit use options
|
||||
if ( defined($::opt_K) || defined($::opt_R) || defined($::opt_C) ) {
|
||||
|
||||
if ( ! defined($::opt_x)) {
|
||||
@ -4297,9 +4296,8 @@ sub lskit {
|
||||
}
|
||||
lskit_C($kit_hash,$kitcomp_hash);
|
||||
}
|
||||
}else
|
||||
{
|
||||
#To support xml format
|
||||
}else
|
||||
{
|
||||
if (defined($::opt_K)) {
|
||||
create_lskit_K_xml_response($kit_hash);
|
||||
}
|
||||
@ -4309,11 +4307,10 @@ sub lskit {
|
||||
if (defined($::opt_C)) {
|
||||
create_lskit_C_xml_response($kit_hash,$kitcomp_hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#lskit use no options
|
||||
if (defined($::opt_x)) {
|
||||
create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash);
|
||||
} else {
|
||||
@ -4550,21 +4547,93 @@ sub lskitcomp {
|
||||
## Kit hash table
|
||||
my @kitnames = map {$_->{kitname}} @$kitcomps;
|
||||
my $kit_hash = get_kit_hash(\@kitnames, ['kitname']);
|
||||
|
||||
## Kit component hash table
|
||||
my $kitcomp_hash = create_hash_from_table_rows($kitcomps, 'kitname');
|
||||
|
||||
|
||||
## Now display the output
|
||||
if ( defined($::opt_C) ) {
|
||||
if ( defined($::opt_x)) {
|
||||
create_lskitcomp_C_xml_response($kit_hash,$kitcomp_hash);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( defined($::opt_C) ) {
|
||||
my @kitcomplist = keys(%$kitcomp_hash);
|
||||
if (scalar @kitcomplist == 0) {
|
||||
my $rsp = {};
|
||||
push @{ $rsp->{data} }, "No kit components were found.";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
return 0;
|
||||
}
|
||||
lskitcomp_C($kit_hash,$kitcomp_hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (defined($::opt_x)) {
|
||||
create_lskit_xml_response($kit_hash, {}, $kitcomp_hash);
|
||||
} else {
|
||||
create_lskit_stanza_response($kit_hash, {}, $kitcomp_hash);
|
||||
if (defined($::opt_x)) {
|
||||
create_lskit_xml_response($kit_hash, {}, $kitcomp_hash);
|
||||
}
|
||||
else
|
||||
{
|
||||
create_lskit_stanza_response($kit_hash, {}, $kitcomp_hash);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head3 lskitcomp_C
|
||||
|
||||
Support for listing kitcomponent
|
||||
|
||||
Arguments:
|
||||
Returns:
|
||||
0 - OK
|
||||
1 - help
|
||||
2 - error
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
sub lskitcomp_C {
|
||||
|
||||
my $kit_hash = shift;
|
||||
my $kitcomp_hash = shift;
|
||||
my $rsp = {};
|
||||
my $count = 0;
|
||||
|
||||
|
||||
for my $kitname (sort(keys(%$kit_hash))) {
|
||||
|
||||
my $output .= "\n----------------------------------------------------\n";
|
||||
$output .= "\nkit : $kitname:\n\n";
|
||||
|
||||
|
||||
# Kit component info
|
||||
if (defined($kitcomp_hash->{$kitname})) {
|
||||
|
||||
for my $kitcomp (@{$kitcomp_hash->{$kitname}}) {
|
||||
$output .= "kitcomponent:\n";
|
||||
for my $kitcomp_attr (sort(keys(%$kitcomp))) {
|
||||
$output .= sprintf(" %s=%s\n", $kitcomp_attr, $kitcomp->{$kitcomp_attr});
|
||||
}
|
||||
$output .= "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
push @{ $rsp->{data} }, $output;
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->message("D", $rsp, $::CALLBACK);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@ -5241,7 +5310,45 @@ sub create_lskit_C_xml_response {
|
||||
xCAT::MsgUtils->message("D", $rsp, $::CALLBACK);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head3 create_lskitcomp_C_xml_response
|
||||
|
||||
Prepare a response that returns the
|
||||
kit component info in XML format.
|
||||
|
||||
Arguments:
|
||||
kit hash table
|
||||
kit component hash table
|
||||
|
||||
Note: Hash tables are created by create_hash_from_table_rows()
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
sub create_lskitcomp_C_xml_response {
|
||||
|
||||
my $kit_hash = shift;
|
||||
my $kitcomp_hash = shift;
|
||||
|
||||
my $rsp = {};
|
||||
|
||||
for my $kitname (sort(keys(%$kit_hash))) {
|
||||
my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } };
|
||||
|
||||
|
||||
# Kit component info
|
||||
if (defined($kitcomp_hash->{$kitname})) {
|
||||
for my $kitcomp (@{$kitcomp_hash->{$kitname}}) {
|
||||
push(@{$output_hash->{kitinfo}->{kitcomp}}, $kitcomp);
|
||||
}
|
||||
}
|
||||
|
||||
push @{ $rsp->{data} }, $output_hash;
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->message("D", $rsp, $::CALLBACK);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
@ -618,7 +618,7 @@ sub build_nicstruct {
|
||||
foreach (@macs) {
|
||||
my $rethash;
|
||||
my $nic = shift @nics;
|
||||
my $type = 'e1000'; #better default fake nic than rtl8139, relevant to most
|
||||
my $type = 'virtio'; #better default fake nic than rtl8139, relevant to most
|
||||
unless ($nic) {
|
||||
last; #Don't want to have multiple vnics tied to the same switch
|
||||
}
|
||||
@ -2240,7 +2240,7 @@ sub fixup_clone_network {
|
||||
my $nic;
|
||||
my $deviceroot=$newnodexml->findnodes("/domain/devices")->[0];
|
||||
foreach $nic (@nics) { #need more xml to throw at it..
|
||||
my $type = 'e1000'; #better default fake nic than rtl8139, relevant to most
|
||||
my $type = 'virtio'; #better default fake nic than rtl8139, relevant to most
|
||||
$nic =~ s/.*://; #the detail of how the bridge was built is of no
|
||||
#interest to this segment of code
|
||||
if ($confdata->{vm}->{$node}->[0]->{nicmodel}) {
|
||||
|
@ -1153,7 +1153,7 @@ until ($quit) {
|
||||
|
||||
if ($child == 0) {
|
||||
close($udpctl); $udpctl=0;
|
||||
$SIG{TERM} = $SIG{INT} = {};
|
||||
$SIG{TERM} = $SIG{INT} = 'DEFAULT';
|
||||
$SIG{CHLD} = \&generic_reaper; #THROTTLE
|
||||
$listener->close;
|
||||
|
||||
@ -1455,6 +1455,16 @@ sub plugin_command {
|
||||
# save the old signal
|
||||
my $old_sig_chld = $SIG{CHLD};
|
||||
$SIG{CHLD} = \&plugin_reaper; #sub {my $plugpid; while (($plugpid = waitpid(-1, WNOHANG)) > 0) { if ($plugin_children{$plugpid}) { delete $plugin_children{$plugpid}; $plugin_numchildren--; } } };
|
||||
|
||||
# make the request handler process to take care all the plugin children
|
||||
$SIG{TERM} = $SIG{INT} = sub {
|
||||
foreach (keys %plugin_children) {
|
||||
kill 2, $_;
|
||||
}
|
||||
$SIG{ALRM} = sub { xexit 0; }; # wait 1s for grace exit
|
||||
alarm(1);
|
||||
};
|
||||
|
||||
my $check_fds;
|
||||
if ($sock) {
|
||||
$check_fds = new IO::Select;
|
||||
@ -1559,7 +1569,6 @@ sub plugin_command {
|
||||
die;
|
||||
}
|
||||
if ($child == 0) {
|
||||
setpgrp(0,0);
|
||||
if ($parfd) { #If xCAT is doing multiple requests in same communication PID, things would get unfortunate otherwise
|
||||
$parent_fd = $parfd;
|
||||
}
|
||||
@ -1776,9 +1785,11 @@ sub dispatch_request {
|
||||
$dispatch_children=0;
|
||||
$SIG{CHLD} = \&dispatch_reaper; #sub {my $cpid; while (($cpid =waitpid(-1, WNOHANG)) > 0) { if ($dispatched_children{$cpid}) { delete $dispatched_children{$cpid}; $dispatch_children--; } } };
|
||||
$SIG{TERM} = $SIG{INT} = sub {
|
||||
foreach (keys %dispatched_children) {
|
||||
kill 2, $_;
|
||||
}
|
||||
foreach (keys %dispatched_children) {
|
||||
kill 2, $_;
|
||||
}
|
||||
$SIG{ALRM} = sub { xexit 0; }; # wait 1s for grace exit
|
||||
alarm(1);
|
||||
};
|
||||
# this is used to filter out the incorrect module that xcat command came into
|
||||
# Mainly useful for hierarchical environment on SN
|
||||
@ -2398,7 +2409,7 @@ sub relay_fds { #Relays file descriptors from pipes to children to the SSL socke
|
||||
print "Aborting...";
|
||||
foreach (keys %plugin_children) {
|
||||
print "Sending INT to $_\n";
|
||||
kill -15, $_;
|
||||
kill 2, $_;
|
||||
}
|
||||
foreach my $cin ($fds->handles) {
|
||||
print $cin "die\n";
|
||||
|
@ -125,7 +125,7 @@ run_ps () {
|
||||
echo "\"\`date\` Running postscript: \$@\"" | tee -a \$logfile
|
||||
#./\$@ 2>&1 1> /tmp/tmp4xcatlog
|
||||
#cat /tmp/tmp4xcatlog | tee -a \$logfile
|
||||
./\$@ 2>&1 | tee -a $logfile
|
||||
./\$@ 2>&1 | tee -a \$logfile
|
||||
ret_local=\${PIPESTATUS[0]}
|
||||
if [ \"\$ret_local\" -ne \"0\" ]; then
|
||||
return_value=\$ret_local
|
||||
|
@ -0,0 +1,5 @@
|
||||
@base
|
||||
@x11
|
||||
openssl
|
||||
ntp
|
||||
rsync
|
126
xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl
Normal file
126
xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE profile SYSTEM "/usr/share/YaST2/include/autoinstall/profile.dtd">
|
||||
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
|
||||
<install>
|
||||
<bootloader>
|
||||
<write_bootloader config:type="boolean">true</write_bootloader>
|
||||
<activate config:type="boolean">true</activate>
|
||||
<kernel_parameters></kernel_parameters>
|
||||
<lba_support config:type="boolean">false</lba_support>
|
||||
<linear config:type="boolean">false</linear>
|
||||
<location>mbr</location>
|
||||
</bootloader>
|
||||
<general>
|
||||
<clock>
|
||||
<hwclock>GMT</hwclock>
|
||||
<timezone>#TABLE:site:key=timezone:value#</timezone>
|
||||
</clock>
|
||||
<keyboard>
|
||||
<keymap>english-us</keymap>
|
||||
</keyboard>
|
||||
<language>en_US</language>
|
||||
<mode>
|
||||
<confirm config:type="boolean">false</confirm>
|
||||
<forceboot config:type="boolean">false</forceboot>
|
||||
<interactive_boot config:type="boolean">false</interactive_boot>
|
||||
<reboot config:type="boolean">true</reboot>
|
||||
</mode>
|
||||
<mouse>
|
||||
<id>non</id>
|
||||
</mouse>
|
||||
<signature-handling>
|
||||
<accept_non_trusted_gpg_key config:type="boolean">true</accept_non_trusted_gpg_key>
|
||||
<accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key>
|
||||
<accept_unsigned_file config:type="boolean">true</accept_unsigned_file>
|
||||
</signature-handling>
|
||||
</general>
|
||||
<partitioning config:type="list">
|
||||
<!-- XCAT-PARTITION-START -->
|
||||
<drive>
|
||||
<device>XCATPARTITIONHOOK</device>
|
||||
<initialize config:type="boolean">true</initialize>
|
||||
<use>all</use>
|
||||
<partitions config:type="list">
|
||||
<partition>
|
||||
<create config:type="boolean">true</create>
|
||||
<loop_fs config:type="boolean">false</loop_fs>
|
||||
<mountby config:type="symbol">device</mountby>
|
||||
<partition_id config:type="integer">65</partition_id>
|
||||
<partition_nr config:type="integer">1</partition_nr>
|
||||
<resize config:type="boolean">false</resize>
|
||||
<size>8225280</size>
|
||||
</partition>
|
||||
<partition>
|
||||
<create config:type="boolean">true</create>
|
||||
<crypt_fs config:type="boolean">false</crypt_fs>
|
||||
<filesystem config:type="symbol">swap</filesystem>
|
||||
<format config:type="boolean">true</format>
|
||||
<loop_fs config:type="boolean">false</loop_fs>
|
||||
<mount>swap</mount>
|
||||
<mountby config:type="symbol">uuid</mountby>
|
||||
<partition_id config:type="integer">130</partition_id>
|
||||
<partition_nr config:type="integer">2</partition_nr>
|
||||
<resize config:type="boolean">false</resize>
|
||||
<size>auto</size>
|
||||
</partition>
|
||||
<partition>
|
||||
<create config:type="boolean">true</create>
|
||||
<crypt_fs config:type="boolean">false</crypt_fs>
|
||||
<filesystem config:type="symbol">btrfs</filesystem>
|
||||
<format config:type="boolean">true</format>
|
||||
<loop_fs config:type="boolean">false</loop_fs>
|
||||
<mount>/</mount>
|
||||
<mountby config:type="symbol">uuid</mountby>
|
||||
<partition_id config:type="integer">131</partition_id>
|
||||
<partition_nr config:type="integer">3</partition_nr>
|
||||
<size>100%</size>
|
||||
</partition>
|
||||
</partitions>
|
||||
</drive>
|
||||
<!-- XCAT-PARTITION-END -->
|
||||
</partitioning>
|
||||
<software>
|
||||
<patterns config:type="list">
|
||||
#INCLUDE_DEFAULT_PTRNLIST_S#
|
||||
</patterns>
|
||||
<packages config:type="list">
|
||||
#INCLUDE_DEFAULT_PKGLIST_S#
|
||||
</packages>
|
||||
</software>
|
||||
</install>
|
||||
<configure>
|
||||
<users config:type="list">
|
||||
<user>
|
||||
<username>root</username>
|
||||
<user_password>#CRYPT:passwd:key=system,username=root:password#</user_password>
|
||||
<encrypted config:type="boolean">true</encrypted>
|
||||
<forename/>
|
||||
<surname/>
|
||||
</user>
|
||||
</users>
|
||||
<networking>
|
||||
<dns>
|
||||
<dhcp_hostname config:type="boolean">true</dhcp_hostname>
|
||||
<dhcp_resolv config:type="boolean">true</dhcp_resolv>
|
||||
<domain>local</domain>
|
||||
<hostname>linux</hostname>
|
||||
</dns>
|
||||
<interfaces config:type="list">
|
||||
<interface>
|
||||
<bootproto>dhcp</bootproto>
|
||||
<device>eth0</device>
|
||||
<startmode>onboot</startmode>
|
||||
</interface>
|
||||
</interfaces>
|
||||
<routing>
|
||||
<ip_forward config:type="boolean">false</ip_forward>
|
||||
<routes config:type="list"/>
|
||||
</routing>
|
||||
</networking>
|
||||
<scripts>
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.sles#
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/chroot.sles#
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.sles11#
|
||||
</scripts>
|
||||
</configure>
|
||||
</profile>
|
90
xCAT-server/share/xcat/install/sles/compute.sles12.tmpl
Normal file
90
xCAT-server/share/xcat/install/sles/compute.sles12.tmpl
Normal file
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE profile SYSTEM "/usr/share/YaST2/include/autoinstall/profile.dtd">
|
||||
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
|
||||
<install>
|
||||
<bootloader>
|
||||
<write_bootloader config:type="boolean">true</write_bootloader>
|
||||
<activate config:type="boolean">true</activate>
|
||||
<kernel_parameters></kernel_parameters>
|
||||
<lba_support config:type="boolean">false</lba_support>
|
||||
<linear config:type="boolean">false</linear>
|
||||
<location>mbr</location>
|
||||
</bootloader>
|
||||
<general>
|
||||
<clock>
|
||||
<hwclock>GMT</hwclock>
|
||||
<timezone>#TABLE:site:key=timezone:value#</timezone>
|
||||
</clock>
|
||||
<keyboard>
|
||||
<keymap>english-us</keymap>
|
||||
</keyboard>
|
||||
<language>en_US</language>
|
||||
<mode>
|
||||
<confirm config:type="boolean">false</confirm>
|
||||
<forceboot config:type="boolean">false</forceboot>
|
||||
<interactive_boot config:type="boolean">false</interactive_boot>
|
||||
<reboot config:type="boolean">true</reboot>
|
||||
</mode>
|
||||
<mouse>
|
||||
<id>non</id>
|
||||
</mouse>
|
||||
<signature-handling>
|
||||
<accept_non_trusted_gpg_key config:type="boolean">true</accept_non_trusted_gpg_key>
|
||||
<accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key>
|
||||
<accept_unsigned_file config:type="boolean">true</accept_unsigned_file>
|
||||
</signature-handling>
|
||||
</general>
|
||||
<partitioning config:type="list">
|
||||
<!-- XCAT-PARTITION-START -->
|
||||
<drive>
|
||||
<device>XCATPARTITIONHOOK</device>
|
||||
<initialize config:type="boolean">true</initialize>
|
||||
<use>all</use>
|
||||
</drive>
|
||||
<!-- XCAT-PARTITION-END -->
|
||||
</partitioning>
|
||||
<software>
|
||||
<patterns config:type="list">
|
||||
#INCLUDE_DEFAULT_PTRNLIST_S#
|
||||
</patterns>
|
||||
<packages config:type="list">
|
||||
#INCLUDE_DEFAULT_PKGLIST_S#
|
||||
</packages>
|
||||
</software>
|
||||
</install>
|
||||
<configure>
|
||||
<users config:type="list">
|
||||
<user>
|
||||
<username>root</username>
|
||||
<user_password>#CRYPT:passwd:key=system,username=root:password#</user_password>
|
||||
<encrypted config:type="boolean">true</encrypted>
|
||||
<forename/>
|
||||
<surname/>
|
||||
</user>
|
||||
</users>
|
||||
<networking>
|
||||
<dns>
|
||||
<dhcp_hostname config:type="boolean">true</dhcp_hostname>
|
||||
<dhcp_resolv config:type="boolean">true</dhcp_resolv>
|
||||
<domain>local</domain>
|
||||
<hostname>linux</hostname>
|
||||
</dns>
|
||||
<interfaces config:type="list">
|
||||
<interface>
|
||||
<bootproto>dhcp</bootproto>
|
||||
<device>eth0</device>
|
||||
<startmode>onboot</startmode>
|
||||
</interface>
|
||||
</interfaces>
|
||||
<routing>
|
||||
<ip_forward config:type="boolean">false</ip_forward>
|
||||
<routes config:type="list"/>
|
||||
</routing>
|
||||
</networking>
|
||||
<scripts>
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.sles#
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/chroot.sles#
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.sles11#
|
||||
</scripts>
|
||||
</configure>
|
||||
</profile>
|
@ -37,7 +37,11 @@ d-i partman-md/device_remove_md boolean true
|
||||
|
||||
#create the /tmp/partitioning based on the uefi or legacy bios
|
||||
d-i partman/early_command string \
|
||||
debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
|
||||
set -x; \
|
||||
DEV=`ls /dev/disk/by-path/* -l | egrep -o '/dev.*sd[^0-9]$' | sort -t : -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -g | head -n1 | egrep -o 'sd.*$'`; \
|
||||
if [[ $DEV == "" ]]; then DEV="sda"; fi; \
|
||||
echo "/dev/$DEV" > /tmp/boot_disk; \
|
||||
debconf-set partman-auto/disk "$(cat /tmp/boot_disk)"
|
||||
d-i partman-auto/expert_recipe_file string /tmp/partitioning
|
||||
|
||||
# This makes partman automatically partition without confirmation, provided
|
||||
|
@ -53,6 +53,7 @@ my $permission; # the permission works only for statelite mode currently
|
||||
my $tempfile;
|
||||
my $kerneldir;
|
||||
my $prompt;
|
||||
my $noupdate;
|
||||
|
||||
|
||||
sub xdie {
|
||||
@ -83,6 +84,7 @@ GetOptions(
|
||||
'rootimgdir=s' => \$destdir, #internal flag
|
||||
'interactive' =>\$prompt,
|
||||
'onlyinitrd' =>\$onlyinitrd,
|
||||
'noupdate' =>\$noupdate,
|
||||
);
|
||||
|
||||
if (@ARGV > 0) {
|
||||
@ -320,11 +322,13 @@ unless ($onlyinitrd) {
|
||||
}
|
||||
}
|
||||
|
||||
# run yum update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update = $yumcmd_base . " update ";
|
||||
$rc = system("$yumcmd_update");
|
||||
# ignore any return code
|
||||
if (!$noupdate) {
|
||||
# run yum update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update = $yumcmd_base . " update ";
|
||||
$rc = system("$yumcmd_update");
|
||||
# ignore any return code
|
||||
}
|
||||
|
||||
|
||||
postscripts(); #run 'postscripts'
|
||||
|
@ -57,6 +57,7 @@ my $permission; # the permission works only for statelite mode currently
|
||||
my $tempfile;
|
||||
my $kerneldir;
|
||||
my $prompt;
|
||||
my $noupdate;
|
||||
|
||||
|
||||
sub xdie {
|
||||
@ -87,6 +88,7 @@ GetOptions(
|
||||
'rootimgdir=s' => \$destdir, #internal flag
|
||||
'interactive' =>\$prompt,
|
||||
'onlyinitrd' =>\$onlyinitrd,
|
||||
'noupdate' =>\$noupdate,
|
||||
);
|
||||
|
||||
if (@ARGV > 0) {
|
||||
@ -320,11 +322,13 @@ unless ($onlyinitrd) {
|
||||
}
|
||||
}
|
||||
|
||||
# run yum update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update = $yumcmd_base . " update ";
|
||||
$rc = system("$yumcmd_update");
|
||||
# ignore any return code
|
||||
if (!$noupdate) {
|
||||
# run yum update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update = $yumcmd_base . " update ";
|
||||
$rc = system("$yumcmd_update");
|
||||
# ignore any return code
|
||||
}
|
||||
|
||||
|
||||
postscripts(); #run 'postscripts'
|
||||
|
@ -64,6 +64,7 @@ my $permission; # the permission works only for statelite mode currently
|
||||
my $tempfile;
|
||||
my $prompt;
|
||||
my $ignorekernelchk;
|
||||
my $noupdate;
|
||||
|
||||
|
||||
sub xdie {
|
||||
@ -110,6 +111,7 @@ GetOptions(
|
||||
'interactive' =>\$prompt,
|
||||
'onlyinitrd' =>\$onlyinitrd,
|
||||
'ignorekernelchk' => \$ignorekernelchk,
|
||||
'noupdate' => \$noupdate,
|
||||
);
|
||||
|
||||
if (@ARGV > 0) {
|
||||
@ -344,7 +346,7 @@ unless ($onlyinitrd) {
|
||||
}
|
||||
}
|
||||
|
||||
#Now let's handle extra packages
|
||||
#Now let's handle extra packages
|
||||
unless ($imagename) {
|
||||
$otherpkglist = imgutils::get_profile_def_filename($osver, $profile, $arch, $customdir, "otherpkgs.pkglist");
|
||||
unless ($otherpkglist) { $otherpkglist=imgutils::get_profile_def_filename($osver, $profile, $arch, $pathtofiles, "otherpkgs.pkglist"); }
|
||||
@ -358,116 +360,115 @@ unless ($onlyinitrd) {
|
||||
|
||||
my %repohash;
|
||||
if (keys(%extra_hash) > 0) {
|
||||
open($yumconfig,">>","/tmp/genimage.$$.yum.conf");
|
||||
my $index=1;
|
||||
foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) {
|
||||
foreach (keys(%{$extra_hash{$pass}})) {
|
||||
open($yumconfig,">>","/tmp/genimage.$$.yum.conf");
|
||||
my $index=1;
|
||||
foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) {
|
||||
foreach (keys(%{$extra_hash{$pass}})) {
|
||||
|
||||
if($_ eq "INCLUDEBAD") {
|
||||
print "Unable to open the following pkglist files:\n".join("\n",@{$extra_hash{$pass}{INCLUDEBAD}});
|
||||
exit 1;
|
||||
}
|
||||
if($_ eq "INCLUDEBAD") {
|
||||
print "Unable to open the following pkglist files:\n".join("\n",@{$extra_hash{$pass}{INCLUDEBAD}});
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;}
|
||||
print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n";
|
||||
$repohash{$pass}{$index} = 1;
|
||||
$index++;
|
||||
my $pa=$extra_hash{$pass}{$_};
|
||||
$extrapkgnames{$pass} .= " " . join(' ', @$pa);
|
||||
if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;}
|
||||
print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs/$_\ngpgpcheck=0\n\n";
|
||||
$repohash{$pass}{$index} = 1;
|
||||
$index++;
|
||||
my $pa=$extra_hash{$pass}{$_};
|
||||
$extrapkgnames{$pass} .= " " . join(' ', @$pa);
|
||||
}
|
||||
}
|
||||
}
|
||||
close($yumconfig);
|
||||
$index--;
|
||||
my $yumcmd_base = "yum $non_interactive -c /tmp/genimage.$$.yum.conf --installroot=$rootimg_dir/ --disablerepo=* ";
|
||||
close($yumconfig);
|
||||
$index--;
|
||||
my $yumcmd_base = "yum $non_interactive -c /tmp/genimage.$$.yum.conf --installroot=$rootimg_dir/ --disablerepo=* ";
|
||||
|
||||
#yum/rpm/zypper has defect on calculating diskspace usage when installing rpm on a NFS mounted installroot
|
||||
if(isNFSdir("$rootimg_dir")){
|
||||
$yumcmd_base .= "--setopt=diskspacecheck=0 ";
|
||||
}
|
||||
#yum/rpm/zypper has defect on calculating diskspace usage when installing rpm on a NFS mounted installroot
|
||||
if(isNFSdir("$rootimg_dir")){
|
||||
$yumcmd_base .= "--setopt=diskspacecheck=0 ";
|
||||
}
|
||||
|
||||
foreach (0..$repnum) {
|
||||
$yumcmd_base .= "--enablerepo=$osver-$arch-$_ ";
|
||||
}
|
||||
# for (1..$index) {
|
||||
# $yumcmd .= "--enablerepo=otherpkgs$_ ";
|
||||
# }
|
||||
foreach (0..$repnum) {
|
||||
$yumcmd_base .= "--enablerepo=$osver-$arch-$_ ";
|
||||
}
|
||||
# for (1..$index) {
|
||||
# $yumcmd .= "--enablerepo=otherpkgs$_ ";
|
||||
# }
|
||||
|
||||
foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) {
|
||||
$yumcmd = $yumcmd_base;
|
||||
foreach my $repo_index ( keys %{$repohash{$pass}} ) {
|
||||
$yumcmd .= "--enablerepo=otherpkgs$repo_index ";
|
||||
}
|
||||
foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) {
|
||||
$yumcmd = $yumcmd_base;
|
||||
foreach my $repo_index ( keys %{$repohash{$pass}} ) {
|
||||
$yumcmd .= "--enablerepo=otherpkgs$repo_index ";
|
||||
}
|
||||
|
||||
system("$yumcmd clean all");
|
||||
system("$yumcmd clean all");
|
||||
|
||||
my $envlist;
|
||||
if(exists($extra_hash{$pass}{ENVLIST})){
|
||||
$envlist = join(' ', @{$extra_hash{$pass}{ENVLIST}});
|
||||
}
|
||||
# remove the packages that are specified in the otherpkgs.list files with leading '-'
|
||||
my $yumcmd_remove= "$yumcmd erase ";
|
||||
if (exists ($extra_hash{$pass}{'PRE_REMOVE'})) {
|
||||
my $pa=$extra_hash{$pass}{'PRE_REMOVE'};
|
||||
my $rm_packges= join(' ', @$pa);
|
||||
if ($rm_packges) {
|
||||
print "$envlist $yumcmd_remove $rm_packges\n";
|
||||
$rc = system("$envlist $yumcmd_remove $rm_packges");
|
||||
}
|
||||
}
|
||||
my $envlist;
|
||||
if(exists($extra_hash{$pass}{ENVLIST})){
|
||||
$envlist = join(' ', @{$extra_hash{$pass}{ENVLIST}});
|
||||
}
|
||||
# remove the packages that are specified in the otherpkgs.list files with leading '-'
|
||||
my $yumcmd_remove= "$yumcmd erase ";
|
||||
if (exists ($extra_hash{$pass}{'PRE_REMOVE'})) {
|
||||
my $pa=$extra_hash{$pass}{'PRE_REMOVE'};
|
||||
my $rm_packges= join(' ', @$pa);
|
||||
if ($rm_packges) {
|
||||
print "$envlist $yumcmd_remove $rm_packges\n";
|
||||
$rc = system("$envlist $yumcmd_remove $rm_packges");
|
||||
}
|
||||
}
|
||||
|
||||
# # mount /proc file system since several packages need it.
|
||||
# print "mount /proc file system\nchroot $rootimg_dir /bin/mount -t proc proc /proc\n";
|
||||
# system("chroot $rootimg_dir /bin/mount -t proc proc /proc");
|
||||
# # mount /proc file system since several packages need it.
|
||||
# print "mount /proc file system\nchroot $rootimg_dir /bin/mount -t proc proc /proc\n";
|
||||
# system("chroot $rootimg_dir /bin/mount -t proc proc /proc");
|
||||
|
||||
# install extra packages
|
||||
my $yumcmd_base = $yumcmd;
|
||||
$yumcmd .= "install ";
|
||||
# append extra pkg names to yum command
|
||||
if ($extrapkgnames{$pass}) {
|
||||
$yumcmd .= " $extrapkgnames{$pass} ";
|
||||
$yumcmd =~ s/ $/\n/;
|
||||
# install extra packages
|
||||
my $yumcmd_base = $yumcmd;
|
||||
$yumcmd .= "install ";
|
||||
# append extra pkg names to yum command
|
||||
if ($extrapkgnames{$pass}) {
|
||||
$yumcmd .= " $extrapkgnames{$pass} ";
|
||||
$yumcmd =~ s/ $/\n/;
|
||||
|
||||
# debug
|
||||
#print "yumcmd=$yumcmd\n";
|
||||
#my $repo=`cat /tmp/genimage.$$.yum.conf`;
|
||||
#print "repo=$repo";
|
||||
|
||||
print "$envlist $yumcmd\n";
|
||||
my $rc = system("$envlist $yumcmd");
|
||||
if ($rc) {
|
||||
print "yum invocation failed\n";
|
||||
exit 1;
|
||||
}
|
||||
} else {
|
||||
print "No Packages marked for install\n";
|
||||
}
|
||||
# debug
|
||||
#print "yumcmd=$yumcmd\n";
|
||||
#my $repo=`cat /tmp/genimage.$$.yum.conf`;
|
||||
#print "repo=$repo";
|
||||
|
||||
# # umount /proc file system that just mounted
|
||||
# print "umount /proc file system\nchroot $rootimg_dir /bin/umount /proc\n";
|
||||
# system("chroot $rootimg_dir /bin/umount /proc");
|
||||
print "$envlist $yumcmd\n";
|
||||
my $rc = system("$envlist $yumcmd");
|
||||
if ($rc) {
|
||||
print "yum invocation failed\n";
|
||||
exit 1;
|
||||
}
|
||||
} else {
|
||||
print "No Packages marked for install\n";
|
||||
}
|
||||
|
||||
# # umount /proc file system that just mounted
|
||||
# print "umount /proc file system\nchroot $rootimg_dir /bin/umount /proc\n";
|
||||
# system("chroot $rootimg_dir /bin/umount /proc");
|
||||
|
||||
# remove the packages that are specified in the otherpkgs.list files with leading '--'
|
||||
if (exists ($extra_hash{$pass}{'POST_REMOVE'})) {
|
||||
my $pa=$extra_hash{$pass}{'POST_REMOVE'};
|
||||
my $rm_packges= join(' ', @$pa);
|
||||
if ($rm_packges) {
|
||||
print "$envlist $yumcmd_remove $rm_packges\n";
|
||||
$rc = system("$envlist $yumcmd_remove $rm_packges");
|
||||
}
|
||||
}
|
||||
$yumcmd = $yumcmd_base;
|
||||
# remove the packages that are specified in the otherpkgs.list files with leading '--'
|
||||
if (exists ($extra_hash{$pass}{'POST_REMOVE'})) {
|
||||
my $pa=$extra_hash{$pass}{'POST_REMOVE'};
|
||||
my $rm_packges= join(' ', @$pa);
|
||||
if ($rm_packges) {
|
||||
print "$envlist $yumcmd_remove $rm_packges\n";
|
||||
$rc = system("$envlist $yumcmd_remove $rm_packges");
|
||||
}
|
||||
}
|
||||
$yumcmd = $yumcmd_base;
|
||||
|
||||
# run yum update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update = $yumcmd_base . " update ";
|
||||
$rc = system("$yumcmd_update");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# ignore any return code
|
||||
|
||||
postscripts(); #run 'postscripts'
|
||||
if (!$noupdate) {
|
||||
# run yum update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update = $yumcmd_base . " update ";
|
||||
$rc = system("$yumcmd_update");
|
||||
}
|
||||
}
|
||||
}
|
||||
# ignore any return code
|
||||
postscripts(); #run 'postscripts'
|
||||
}
|
||||
|
||||
#get the rpm version, if the rpm version is different then the db verison may change.
|
||||
|
@ -61,6 +61,7 @@ my $tempfile;
|
||||
my $prompt;
|
||||
my $timezone; #the TIMEZONE of the stateless and statelite node
|
||||
my $ignorekernelchk;
|
||||
my $noupdate;
|
||||
|
||||
sub xdie {
|
||||
system("rm -rf /tmp/xcatinitrd.$$");
|
||||
@ -108,6 +109,7 @@ GetOptions(
|
||||
'interactive' =>\$prompt,
|
||||
'onlyinitrd' =>\$onlyinitrd,
|
||||
'ignorekernelchk' => \$ignorekernelchk,
|
||||
'noupdate' => \$noupdate,
|
||||
);
|
||||
|
||||
if (@ARGV > 0) {
|
||||
@ -559,15 +561,17 @@ unless ($onlyinitrd) {
|
||||
}
|
||||
}
|
||||
|
||||
# run zypper update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update;
|
||||
if ($osver_host == 11) {
|
||||
$yumcmd_update = "zypper -R $rootimg_dir $non_interactive update ";
|
||||
} else {
|
||||
$yumcmd_update = "zypper -R $rootimg_dir $non_interactive update ";
|
||||
if (!$noupdate) {
|
||||
# run zypper update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update;
|
||||
if ($osver_host == 11) {
|
||||
$yumcmd_update = "zypper -R $rootimg_dir $non_interactive update ";
|
||||
} else {
|
||||
$yumcmd_update = "zypper -R $rootimg_dir $non_interactive update ";
|
||||
}
|
||||
$rc = system("$yumcmd_update");
|
||||
}
|
||||
$rc = system("$yumcmd_update");
|
||||
}
|
||||
|
||||
#remove the old repository for extra packages
|
||||
|
@ -47,6 +47,7 @@ my $srcdir_otherpkgs;
|
||||
my $otherpkglist;
|
||||
my $postinstall_filename;
|
||||
my $rootimg_dir;
|
||||
my $noupdate;
|
||||
|
||||
sub xdie {
|
||||
system("rm -rf /tmp/xcatinitrd.$$");
|
||||
@ -80,6 +81,7 @@ GetOptions(
|
||||
't=s' => \$tmplimit,
|
||||
'k=s' => \$kernelver,
|
||||
'onlyinitrd' =>\$onlyinitrd,
|
||||
'noupdate' => \$noupdate,
|
||||
);
|
||||
if (@ARGV > 0) {
|
||||
$imagename=$ARGV[0];
|
||||
@ -364,11 +366,13 @@ unless ($onlyinitrd) {
|
||||
$rc = system("$yumcmd_remove $rm_packges");
|
||||
}
|
||||
|
||||
# run zypper update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update = "zypper -R $rootimg_dir update ";
|
||||
$rc = system("$yumcmd_update");
|
||||
# ignore any return code
|
||||
if (!$noupdate) {
|
||||
# run zypper update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update = "zypper -R $rootimg_dir update ";
|
||||
$rc = system("$yumcmd_update");
|
||||
# ignore any return code
|
||||
}
|
||||
|
||||
|
||||
postscripts(); #run 'postscripts'
|
||||
|
@ -63,6 +63,7 @@ my $rootimg_dir;
|
||||
my $permission; # the permission works only for statelite mode currently
|
||||
my $tempfile;
|
||||
my $prompt;
|
||||
my $noupdate;
|
||||
|
||||
|
||||
sub xdie {
|
||||
@ -93,6 +94,7 @@ GetOptions(
|
||||
'rootimgdir=s' => \$destdir, #internal flag
|
||||
'interactive' =>\$prompt,
|
||||
'onlyinitrd' =>\$onlyinitrd,
|
||||
'noupdate' =>\$noupdate,
|
||||
);
|
||||
|
||||
if (@ARGV > 0) {
|
||||
@ -463,14 +465,16 @@ unless ($onlyinitrd) {
|
||||
}
|
||||
}
|
||||
|
||||
# run apt-get upgrade to update any installed debs
|
||||
# needed when running genimage again after updating software in repositories
|
||||
#my $aptgetcmd_update = $yumcmd_base . " upgrade ";
|
||||
my $aptgetcmd_update = $aptgetcmd . "&&". $aptgetcmdby . " upgrade ";
|
||||
$rc = system("$aptgetcmd_update");
|
||||
print("Umount /proc, /dev, /sys, pkgdir and otherpkgdir to the rootimg.\n");
|
||||
umount_chroot($rootimg_dir);
|
||||
# ignore any return code
|
||||
if (!$noupdate) {
|
||||
# run apt-get upgrade to update any installed debs
|
||||
# needed when running genimage again after updating software in repositories
|
||||
#my $aptgetcmd_update = $yumcmd_base . " upgrade ";
|
||||
my $aptgetcmd_update = $aptgetcmd . "&&". $aptgetcmdby . " upgrade ";
|
||||
$rc = system("$aptgetcmd_update");
|
||||
print("Umount /proc, /dev, /sys, pkgdir and otherpkgdir to the rootimg.\n");
|
||||
umount_chroot($rootimg_dir);
|
||||
# ignore any return code
|
||||
}
|
||||
|
||||
# Add the local repo from MN
|
||||
my $master = xCAT::TableUtils->get_site_Master();
|
||||
|
@ -8,7 +8,7 @@ end
|
||||
start:tabrestore_table
|
||||
cmd:tabdump site > /tmp/site.csv
|
||||
check:rc==0
|
||||
cmd:chtab key=xcatdport site.value=3333
|
||||
cmd:chtab key=db2installloc site.value=/test
|
||||
check:rc==0
|
||||
cmd:tabrestore /tmp/site.csv
|
||||
check:rc==0
|
||||
|
@ -106,9 +106,10 @@ if [ "$arch" = "x86_64" ]; then
|
||||
fi
|
||||
fi
|
||||
elif [ "$arch" = "ppc64" ]; then
|
||||
echo "run yaboot to configure the MBR."
|
||||
echo "Choose suitale boot loader to configure the MBR."
|
||||
if [ -f "/usr/lib/yaboot/yaboot" ]; then
|
||||
# set bootloader
|
||||
echo "Using /usr/lib/yaboot/yaboot"
|
||||
echo "dd if=/usr/lib/yaboot/yaboot of=/dev/sda1 bs=4096"
|
||||
dd if=/usr/lib/yaboot/yaboot of=/dev/sda1 bs=4096
|
||||
|
||||
@ -116,12 +117,14 @@ elif [ "$arch" = "ppc64" ]; then
|
||||
# echo A | dd of=/dev/sda bs=1 count=1 seek=450
|
||||
elif [ -f "/lib/lilo/pmac/yaboot" ]; then
|
||||
# set bootloader
|
||||
echo "using /lib/lilo/pmac/yaboot"
|
||||
echo "dd if=/lib/lilo/pmac/yaboot of=/dev/sda1 bs=4096"
|
||||
dd if=/lib/lilo/pmac/yaboot of=/dev/sda1 bs=4096
|
||||
|
||||
# Set 0x41 as the partition type of the first partition
|
||||
# echo A | dd of=/dev/sda bs=1 count=1 seek=450
|
||||
elif [ -f "/boot/grub2/grub" ];then
|
||||
echo "using /boot/grub2/grub"
|
||||
echo "dd if=/boot/grub2/grub of=/dev/sda1 bs=4096"
|
||||
dd if=/boot/grub2/grub of=/dev/sda1 bs=4096
|
||||
|
||||
|
@ -114,8 +114,18 @@ EOF
|
||||
sed -i s/BOOTPROTO=dhcp/BOOTPROTO=static/ $NICFILE
|
||||
sed -i s/BOOTPROTO=\'dhcp\'/BOOTPROTO=static/ $NICFILE
|
||||
sed -i s/BOOTPROTO=\"dhcp\"/BOOTPROTO=static/ $NICFILE
|
||||
grep ^IPADDR= $NICFILE >/dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
sed -i '/IPADDR=/d' $NICFILE
|
||||
fi
|
||||
echo IPADDR=$IPADDR >> $NICFILE
|
||||
echo NETMASK=$NETMASK >> $NICFILE
|
||||
grep ^NETMASK= $NICFILE >/dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
sed -i '/NETMASK=/d' $NICFILE
|
||||
fi
|
||||
echo NETMASK=$NETMASK >> $NICFILE
|
||||
fi
|
||||
|
||||
#for netboot/statelite case, restart the network interface. For diskful installation, it is not necessary because the restart of the network will happen at the first boot.
|
||||
|
@ -64,17 +64,28 @@ echo "si_updateclient --server $str_server_ip --yes"
|
||||
export PERL5LIB=/usr/lib/perl5/site_perl/;LANG=C si_updateclient --server $str_server_ip --yes
|
||||
|
||||
if [[ -f /sbin/dracut ]]; then
|
||||
# redhat6.x/centos6.x
|
||||
# redhat6.x/centos6.x/rhels7.x
|
||||
echo "Running dracut to regenerate the initrd with the drivers needed by this node:"
|
||||
dracut --force
|
||||
arch=`uname -m`
|
||||
#echo "arch=$arch"
|
||||
initrdfile=`find /boot -name "initramfs-*.$arch.img"`
|
||||
#echo "initrdfile=$initrdfile"
|
||||
kernelversion=`echo $initrdfile |sed -e 's:/boot/initramfs-\(.*\)\.img:\1:g'`
|
||||
#echo "kernelversion=$kernelversion"
|
||||
mv $initrdfile $initrdfile.org
|
||||
echo "dracut $initrdfile $kernelversion"
|
||||
dracut $initrdfile $kernelversion
|
||||
else
|
||||
# suse/sles and redhat5.x/centos5.x
|
||||
echo "Running mkinitrd to regenerate the initrd with the drivers needed by this node:"
|
||||
osvers=`cat /etc/*release|sed -e 's/.*\([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/'`
|
||||
if [[ $osvers == 5\.* ]];then
|
||||
initrdfile=`find /boot -name "initrd-*.img"`
|
||||
#echo "initrdfile=$initrdfile"
|
||||
kernelversion=`echo $initrdfile |sed -e 's:/boot/initrd-\(.*\)\.img:\1:g'`
|
||||
#echo "kernelversion=$kernelversion"
|
||||
mv $initrdfile $initrdfile.org
|
||||
echo "mkinitrd $initrdfile $kernelversion"
|
||||
mkinitrd $initrdfile $kernelversion
|
||||
else
|
||||
mkinitrd
|
||||
|
@ -64,7 +64,7 @@ Requires: ipmitool-xcat >= 1.8.9
|
||||
Requires: xnba-undi
|
||||
%endif
|
||||
%ifos linux
|
||||
%ifarch ppc ppc64
|
||||
%ifarch ppc ppc64 ppc64le
|
||||
Requires: xCAT-genesis-scripts-ppc64
|
||||
Requires: ipmitool-xcat >= 1.8.9
|
||||
%endif
|
||||
|
@ -58,6 +58,12 @@ Requires: syslinux xCAT-genesis-scripts-x86_64 elilo-xcat
|
||||
Requires: ipmitool-xcat >= 1.8.9
|
||||
Requires: xnba-undi
|
||||
%endif
|
||||
%ifos linux
|
||||
%ifarch ppc ppc64 ppc64le
|
||||
Requires: xCAT-genesis-scripts-ppc64
|
||||
Requires: ipmitool-xcat >= 1.8.9
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if %notpcm
|
||||
%ifarch i386 i586 i686 x86 x86_64
|
||||
|
Loading…
x
Reference in New Issue
Block a user