From 522a815c3dae84d1ef203855b5fb533f681cdae4 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 5 Nov 2014 01:00:55 -0500 Subject: [PATCH 01/19] fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. --- xCAT-server/share/xcat/install/ubuntu/compute.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl index d4e6b6096..d2ec827a0 100644 --- a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl @@ -37,7 +37,9 @@ 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 | head -n1 | egrep -o 'sd.*$'`; 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 From 8f6bd7a58449b4aeb87de9c0a7652e54b89c9c0b Mon Sep 17 00:00:00 2001 From: baiyuan Date: Wed, 5 Nov 2014 01:18:51 -0500 Subject: [PATCH 02/19] add lskitcomp -C support --- xCAT-server/lib/xcat/plugins/kit.pm | 131 +++++++++++++++++++++++++--- 1 file changed, 119 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 72a9a2c83..2f5070695 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -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); +} #---------------------------------------------------------------------------- From 24cc328940a3b476ac4ec92fee8c2911b46cdb8a Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 5 Nov 2014 01:50:45 -0500 Subject: [PATCH 03/19] add comments --- xCAT/postscripts/configefi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/configefi b/xCAT/postscripts/configefi index 1d71caaca..81fd70ad4 100644 --- a/xCAT/postscripts/configefi +++ b/xCAT/postscripts/configefi @@ -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 From 3ebf2f7851d859e5afb4fefa74a7ee85f59574a3 Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 5 Nov 2014 02:22:40 -0500 Subject: [PATCH 04/19] fix the bug when use dracut to rebuild initrd --- xCAT/postscripts/syscloneimgupdate | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/syscloneimgupdate b/xCAT/postscripts/syscloneimgupdate index a77835e7a..724463fbe 100755 --- a/xCAT/postscripts/syscloneimgupdate +++ b/xCAT/postscripts/syscloneimgupdate @@ -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 From 2490baf473992d676196f88b8318ddbb694389c2 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 5 Nov 2014 01:17:34 -0800 Subject: [PATCH 05/19] update case to remove operation for xcatdport --- xCAT-test/autotest/testcase/tabrestore/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/tabrestore/cases0 b/xCAT-test/autotest/testcase/tabrestore/cases0 index e1293398c..962c19a4f 100644 --- a/xCAT-test/autotest/testcase/tabrestore/cases0 +++ b/xCAT-test/autotest/testcase/tabrestore/cases0 @@ -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 From c20b47d205fc4b37547924808d557340e482cda8 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 5 Nov 2014 05:11:13 -0500 Subject: [PATCH 06/19] enhance for fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. --- xCAT-server/share/xcat/install/ubuntu/compute.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl index d2ec827a0..adcfab038 100644 --- a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl @@ -38,7 +38,9 @@ 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 \ set -x; \ - DEV=`ls /dev/disk/by-path/* -l | egrep -o '/dev.*sd[^0-9]$' | sort | head -n1 | egrep -o 'sd.*$'`; echo "/dev/$DEV" > /tmp/boot_disk; \ + 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 From 0705721307ae936d436213600430e612ed36a33e Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 5 Nov 2014 06:07:30 -0500 Subject: [PATCH 07/19] fix bug 4357:After run nodeset runimage' may fail --- xCAT-server/lib/xcat/plugins/destiny.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index d32601793..861bbadfd 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -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 "; From e83055a0a16f3af015b8bf13f56edc6b970ec204 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 5 Nov 2014 11:32:44 -0500 Subject: [PATCH 08/19] bug #4364 change default vmnicmodel to virtio --- xCAT-server/lib/xcat/plugins/kvm.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index ee2b58052..c40baa899 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -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}) { From b8bd2acad87f577cd37dfd41ca416ec9394458c7 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 7 Nov 2013 09:05:46 +0800 Subject: [PATCH 09/19] SLES12 ppc64le support: build ppc64le RPMs --- buildcore.sh | 2 +- xCAT/xCAT.spec | 2 +- xCATsn/xCATsn.spec | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/buildcore.sh b/buildcore.sh index 41866121e..7edc5cad1 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -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 diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 4593a7bd4..54bea22d2 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -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 diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index de0da70c6..df24475ab 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -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 From 43c9fecd1abb5e76e9ab7e5985cde055d981daf5 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 6 Nov 2014 01:38:34 -0500 Subject: [PATCH 10/19] add sles12 pkglist and autoyast template --- .../xcat/install/sles/compute.sles12.pkglist | 5 ++ .../xcat/install/sles/compute.sles12.tmpl | 90 +++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 xCAT-server/share/xcat/install/sles/compute.sles12.pkglist create mode 100644 xCAT-server/share/xcat/install/sles/compute.sles12.tmpl diff --git a/xCAT-server/share/xcat/install/sles/compute.sles12.pkglist b/xCAT-server/share/xcat/install/sles/compute.sles12.pkglist new file mode 100644 index 000000000..0aedcaff4 --- /dev/null +++ b/xCAT-server/share/xcat/install/sles/compute.sles12.pkglist @@ -0,0 +1,5 @@ +@base +@x11 +openssl +ntp +rsync diff --git a/xCAT-server/share/xcat/install/sles/compute.sles12.tmpl b/xCAT-server/share/xcat/install/sles/compute.sles12.tmpl new file mode 100644 index 000000000..53e0e7df4 --- /dev/null +++ b/xCAT-server/share/xcat/install/sles/compute.sles12.tmpl @@ -0,0 +1,90 @@ + + + + + + true + true + + false + false + mbr + + + + GMT + #TABLE:site:key=timezone:value# + + + english-us + + en_US + + false + false + false + true + + + non + + + true + true + true + + + + + + XCATPARTITIONHOOK + true + all + + + + + + #INCLUDE_DEFAULT_PTRNLIST_S# + + + #INCLUDE_DEFAULT_PKGLIST_S# + + + + + + + root + #CRYPT:passwd:key=system,username=root:password# + true + + + + + + + true + true + local + linux + + + + dhcp + eth0 + onboot + + + + false + + + + + #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# + + + From f0b9cac61c7a73e5900b94874c3c2a2ba69488db Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 6 Nov 2014 06:23:52 -0500 Subject: [PATCH 11/19] defect 4304: fixed several things: 1. how to handle ctrl+c; 2. handle the plugin process cannot be stopped by TERM signal to process group SSL_Listener. (make the plugin process locate in the SSL_listener process group); 3. Make DB Access process exits later than in processing request. --- perl-xCAT/xCAT/Table.pm | 3 +++ xCAT-server/sbin/xcatd | 23 +++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 880c7388f..bbe2ddbc8 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -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; diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index a0b2a58e7..6fe1d1c1a 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -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"; From 0215a5bed2bd90e04c8d4eb197de1d38680b623d Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Thu, 6 Nov 2014 05:17:34 -0500 Subject: [PATCH 12/19] add PReP partition for sles12 ppc64le --- .../install/sles/compute.sles12.ppc64le.tmpl | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl diff --git a/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl new file mode 100644 index 000000000..71f55dbdc --- /dev/null +++ b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl @@ -0,0 +1,126 @@ + + + + + + true + true + + false + false + mbr + + + + GMT + #TABLE:site:key=timezone:value# + + + english-us + + en_US + + false + false + false + true + + + non + + + true + true + true + + + + + + XCATPARTITIONHOOK + true + all + + + true + false + device + 65 + 1 + false + 8225280 + + + true + false + swap + true + false + swap + uuid + 130 + 2 + false + auto + + + true + false + btrfs + true + false + / + uuid + 131 + 3 + 100% + + + + + + + + #INCLUDE_DEFAULT_PTRNLIST_S# + + + #INCLUDE_DEFAULT_PKGLIST_S# + + + + + + + root + #CRYPT:passwd:key=system,username=root:password# + true + + + + + + + true + true + local + linux + + + + dhcp + eth0 + onboot + + + + false + + + + + #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# + + + From b59f72bd8eb2f001c50652b0e0ad43287ee87a9e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 6 Nov 2014 16:58:19 -0500 Subject: [PATCH 13/19] changes to support --noupdate flag on genimage --- xCAT-client/bin/genimage | 10 +- xCAT-client/pods/man1/genimage.1.pod | 8 +- xCAT-server/lib/xcat/plugins/genimage.pm | 3 + .../share/xcat/netboot/debian/genimage | 14 +- .../share/xcat/netboot/fedora12/genimage | 14 +- xCAT-server/share/xcat/netboot/rh/genimage | 195 +++++++++--------- xCAT-server/share/xcat/netboot/sles/genimage | 20 +- xCAT-server/share/xcat/netboot/suse/genimage | 14 +- .../share/xcat/netboot/ubuntu/genimage | 20 +- 9 files changed, 166 insertions(+), 132 deletions(-) diff --git a/xCAT-client/bin/genimage b/xCAT-client/bin/genimage index 1bcfe4216..2e00040b0 100755 --- a/xCAT-client/bin/genimage +++ b/xCAT-client/bin/genimage @@ -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 [-a ] -p -i -n [--onlyinitrd] [-r ] [-k ] [-g ] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission ] [--interactive] [--dryrun]'."\n\n"; - print ' genimage [-o ] [-a ] [-p ] [-i ] [-n ] [--onlyinitrd] [-r ] [-k ] [-g ] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission ] [--interactive] [--dryrun] '."\n\n"; + print ' genimage -o [-a ] -p -i -n [--onlyinitrd] [-r ] [-k ] [-g ] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission ] [--interactive] [--dryrun] [--noupdate]'."\n\n"; + print ' genimage [-o ] [-a ] [-p ] [-i ] [-n ] [--onlyinitrd] [-r ] [-k ] [-g ] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission ] [--interactive] [--dryrun] [--noupdate] '."\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"; diff --git a/xCAT-client/pods/man1/genimage.1.pod b/xCAT-client/pods/man1/genimage.1.pod index fdd3f5f88..7f8f17f02 100644 --- a/xCAT-client/pods/man1/genimage.1.pod +++ b/xCAT-client/pods/man1/genimage.1.pod @@ -6,9 +6,9 @@ B - Generates a stateless image to be used for a diskless install. B -B [B<-o> I] [B<-a> I] [B<-p> I] [B<-i> I] [B<-n> I] [B<--onlyinitrd>] [B<-r> I] [B<-k> I] [B<-g> I] [B<-m> I] [B<-l> I] [B<--permission> I] [B<--interactive>] [B<--dryrun>] [B<--ignorekernelchk>] I +B [B<-o> I] [B<-a> I] [B<-p> I] [B<-i> I] [B<-n> I] [B<--onlyinitrd>] [B<-r> I] [B<-k> I] [B<-g> I] [B<-m> I] [B<-l> I] [B<--permission> I] [B<--interactive>] [B<--dryrun>] [B<--ignorekernelchk>] [B<--noupdate>] I -B B<-o> I [B<-a> I] B<-p> I B<-i> I B<-n> I [B<--onlyinitrd>] [B<-r> I] [B<-k> I] [B<-g> I] [B<-m> I] [B<-l> I] [B<--permission> I] [B<--interactive>] [B<--dryrun>] +B B<-o> I [B<-a> I] B<-p> I B<-i> I B<-n> I [B<--onlyinitrd>] [B<-r> I] [B<-k> I] [B<-g> I] [B<-m> I] [B<-l> I] [B<--permission> I] [B<--interactive>] [B<--dryrun>] [B<--noupdate>] B [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. diff --git a/xCAT-server/lib/xcat/plugins/genimage.pm b/xCAT-server/lib/xcat/plugins/genimage.pm index d43ec2a05..5e66879d2 100644 --- a/xCAT-server/lib/xcat/plugins/genimage.pm +++ b/xCAT-server/lib/xcat/plugins/genimage.pm @@ -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"); diff --git a/xCAT-server/share/xcat/netboot/debian/genimage b/xCAT-server/share/xcat/netboot/debian/genimage index d1913a0ea..162355fbd 100755 --- a/xCAT-server/share/xcat/netboot/debian/genimage +++ b/xCAT-server/share/xcat/netboot/debian/genimage @@ -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' diff --git a/xCAT-server/share/xcat/netboot/fedora12/genimage b/xCAT-server/share/xcat/netboot/fedora12/genimage index 74ba09017..d00151217 100755 --- a/xCAT-server/share/xcat/netboot/fedora12/genimage +++ b/xCAT-server/share/xcat/netboot/fedora12/genimage @@ -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' diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index e142715bf..81ded62ec 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -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. diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index daedcca5a..80e2782ba 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -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 diff --git a/xCAT-server/share/xcat/netboot/suse/genimage b/xCAT-server/share/xcat/netboot/suse/genimage index 01c55a785..69f06c020 100755 --- a/xCAT-server/share/xcat/netboot/suse/genimage +++ b/xCAT-server/share/xcat/netboot/suse/genimage @@ -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' diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index efe37096c..2c3415189 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -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(); From 340c5fc5531941446b680aade1520a02f481c9f2 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Thu, 6 Nov 2014 21:27:43 -0500 Subject: [PATCH 14/19] fix duplicate lines for IPADDR and NETMASK --- xCAT/postscripts/hardeths | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index caa0b63cb..43ec7c84e 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -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. From 614594fa52dd36157e8d5c6ab0e9d3df49eb0166 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 7 Nov 2014 02:13:00 -0500 Subject: [PATCH 15/19] 4342 Wrong cpucount number is counted for PowerKVM host --- perl-xCAT/xCAT/Schema.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 3a0fd505c..268900a43 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -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', From 392fc1b3cbb8ed8625d727cc5acf2f0be03273b0 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 7 Nov 2014 03:00:38 -0500 Subject: [PATCH 16/19] fix bug 4368 mkvm for lpars in different CECs will failed --- perl-xCAT/xCAT/FSPvm.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/FSPvm.pm b/perl-xCAT/xCAT/FSPvm.pm index 45e5bfc4f..b31b4e942 100644 --- a/perl-xCAT/xCAT/FSPvm.pm +++ b/perl-xCAT/xCAT/FSPvm.pm @@ -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 From cec473c64657c2f20068dab3678df12015c825f7 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Fri, 7 Nov 2014 03:20:13 -0500 Subject: [PATCH 17/19] find the only version from dpkg -I --- xCAT-buildkit/lib/perl/xCAT/BuildKitUtils.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-buildkit/lib/perl/xCAT/BuildKitUtils.pm b/xCAT-buildkit/lib/perl/xCAT/BuildKitUtils.pm index cf2254abd..72e13c120 100644 --- a/xCAT-buildkit/lib/perl/xCAT/BuildKitUtils.pm +++ b/xCAT-buildkit/lib/perl/xCAT/BuildKitUtils.pm @@ -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; From cad641241d1dc758830097839b271860ce76e3f6 Mon Sep 17 00:00:00 2001 From: ligc Date: Mon, 11 Nov 2013 09:17:10 +0800 Subject: [PATCH 18/19] fix for bug 4369: fix the missing info in xcat.log on Ubuntu --- xCAT-server/share/xcat/install/scripts/post.ubuntu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/install/scripts/post.ubuntu b/xCAT-server/share/xcat/install/scripts/post.ubuntu index aba91af0d..d9eb677f2 100644 --- a/xCAT-server/share/xcat/install/scripts/post.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/post.ubuntu @@ -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 From 85af82dc02baddb42f023b74d53da6d22bce4a9e Mon Sep 17 00:00:00 2001 From: litingt Date: Sun, 9 Nov 2014 21:44:00 -0500 Subject: [PATCH 19/19] add xCAT-genesis-scripts in --- buildlocal.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildlocal.sh b/buildlocal.sh index a0d49c2c4..fceb39b98 100755 --- a/buildlocal.sh +++ b/buildlocal.sh @@ -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