From a7ee19d7404527cf6d67a5ed2053dbf405933070 Mon Sep 17 00:00:00 2001 From: ligc Date: Mon, 19 Jan 2015 14:19:52 +0800 Subject: [PATCH 01/10] fix for bug 4448: check rsyslogd existence before running rsyslogd --- xCAT/postscripts/syslog | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index 7bf9c068f..d98339f96 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -205,13 +205,15 @@ fi # We only update the /etc/rsyslog.d/remote.conf file to point to the xcatmaster. # Do not even touch rsyslog.conf # There is no /etc/sysconfig/rsyslog file, so we use rsyslogd -v to get the version -SYSLOGPROD=`rsyslogd -v | grep rsyslogd |awk {'print $1'}` -SYSLOGVER=`rsyslogd -v | grep rsyslogd |awk {'print $2'}` -if ( pmatch $SYSLOGPROD "*rsyslogd*" ) && ( pmatch $SYSLOGVER "8*" ); then - config_rsyslog_V8 -#keep a record - logger -t xCAT -p local4.info "Install: rsyslog version 8 setup" - exit 0 +if [ -e "/sbin/rsyslogd" -o -e "/usr/sbin/rsyslogd" ]; then + SYSLOGPROD=`rsyslogd -v | grep rsyslogd |awk {'print $1'}` + SYSLOGVER=`rsyslogd -v | grep rsyslogd |awk {'print $2'}` + if ( pmatch $SYSLOGPROD "*rsyslogd*" ) && ( pmatch $SYSLOGVER "8*" ); then + config_rsyslog_V8 + #keep a record + logger -t xCAT -p local4.info "Install: rsyslog version 8 setup" + exit 0 + fi fi if [ "$(uname -s)" = "Linux" ]; then From 421a2750f90f41b45322e2dde947b2cd7613ace0 Mon Sep 17 00:00:00 2001 From: qyin Date: Mon, 19 Jan 2015 15:26:49 +0800 Subject: [PATCH 02/10] fix copycds: on debian/ubuntu doesn't support -o option --- xCAT-server/lib/xcat/plugins/debian.pm | 28 ++++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 0fc849329..2a9fa17f6 100755 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -221,8 +221,8 @@ sub copycd return; } - if ( $copypath || $noosimage || $nonoverwrite ){ - $callback->({info=> ["copycd on debian/ubuntu doesn't support -p, -o, -w options!"]}); + if ( $copypath || $nonoverwrite ){ + $callback->({info=> ["copycd on debian/ubuntu doesn't support -p, -w options!"]}); return; } @@ -419,17 +419,19 @@ sub copycd } $callback->({data => "Media copy operation successful"}); - my @ret=xCAT::SvrUtils->update_tables_with_templates($distname, $arch, $temppath, $osdistroname); - if ($ret[0] != 0) { - $callback->({data => "Error when updating the osimage tables: " . $ret[1]}); - } - my @ret=xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "netboot", $temppath, $osdistroname); - if ($ret[0] != 0) { - $callback->({data => "Error when updating the osimage tables for stateless: " . $ret[1]}); - } - my @ret=xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "statelite", $temppath, $osdistroname); - if ($ret[0] != 0) { - $callback->({data => "Error when updating the osimage tables for statelite: " . $ret[1]}); + unless($noosimage) { + my @ret=xCAT::SvrUtils->update_tables_with_templates($distname, $arch, $temppath, $osdistroname); + if ($ret[0] != 0) { + $callback->({data => "Error when updating the osimage tables: " . $ret[1]}); + } + my @ret=xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "netboot", $temppath, $osdistroname); + if ($ret[0] != 0) { + $callback->({data => "Error when updating the osimage tables for stateless: " . $ret[1]}); + } + my @ret=xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "statelite", $temppath, $osdistroname); + if ($ret[0] != 0) { + $callback->({data => "Error when updating the osimage tables for statelite: " . $ret[1]}); + } } } } From b0408071484f5b4f7d7f677200bc191165d9b189 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Mon, 19 Jan 2015 16:48:40 -0500 Subject: [PATCH 03/10] fix hostname issue for diskless support --- xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot | 2 ++ xCAT-server/share/xcat/netboot/sles/genimage | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot index 801d3820c..a061a75e4 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot @@ -272,6 +272,8 @@ if [ -d "$NEWROOT/etc/sysconfig" -a ! -e "$NEWROOT/etc/sysconfig/selinux" ]; the echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux" fi +echo `hostname` > $NEWROOT/etc/hostname + # inject new exit_if_exists echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh # force udevsettle to break diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 02ff3f6e2..63d440b78 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -857,6 +857,12 @@ if (@new_order) { # add drivers for local disk support push @ndrivers, ("ext3.ko", "ext4.ko", "virtio_pci.ko", "virtio_blk.ko", "ata_piix.ko", "libata.ko", "scsi_mod.ko", "scsi_dh.ko", "ahci.ko", "ibmvscsi.ko", "ibmvscsic.ko", "megaraid_sas.ko", "pcieport.ko", "sd_mod.ko"); +if (-f "$rootimg_dir/lib/modules/$kernelver/kernel/drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko") { + for (@ndrivers) { + s/mlx_en/mlx4_en/; + } +} + open($moddeps,"<","$rootimg_dir/lib/modules/$kernelver/modules.dep"); my @moddeps = <$moddeps>; my @checkdeps = @ndrivers; From 3b86d90a7c26e0d41bb9a3cd866e2913f5ae28a0 Mon Sep 17 00:00:00 2001 From: Jia Zhao Date: Tue, 20 Jan 2015 14:15:07 +0800 Subject: [PATCH 04/10] merge from 2.9 about supporting powerkvm in nodeimport --- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 86 +++++++++++++------ xCAT-client/pods/man1/nodeimport.1.pod | 16 +++- xCAT-server/lib/xcat/plugins/profilednodes.pm | 17 ++++ 3 files changed, 91 insertions(+), 28 deletions(-) diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index f0ab430c2..35b53ea37 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -895,18 +895,21 @@ sub check_profile_consistent{ return 0, "Provisioning network not defined for network profile." } + # Remove check mechanism about arch and netboot attribute + # Attribute 'neboot' will be generated based on arch, management method, os + # Profile consistent keys, arch=>netboot, mgt=>nictype - my $ppc_netboot = 'yaboot'; - if( $os =~ /rhels7/ ){ - $ppc_netboot = 'grub2'; - } - my %profile_dict = ('x86' => 'xnba','x86_64' => 'xnba', 'ppc64' => $ppc_netboot, - 'ppc64el' => $ppc_netboot, - 'fsp' => 'FSP', 'ipmi' => 'BMC'); + #my $ppc_netboot = 'yaboot'; + #if( $os =~ /rhels7/ ){ + # $ppc_netboot = 'grub2'; + #} + #my %profile_dict = ('x86' => 'xnba','x86_64' => 'xnba', 'ppc64' => $ppc_netboot, + # 'ppc64el' => $ppc_netboot, + # 'fsp' => 'FSP', 'ipmi' => 'BMC'); # Check if imageprofile is consistent with networkprofile - if ($profile_dict{$arch} ne $netboot) { - return 0, "Imageprofile's arch is not consistent with networkprofile's netboot." - } + #if ($profile_dict{$arch} ne $netboot) { + # return 0, "Imageprofile's arch is not consistent with networkprofile's netboot." + #} # Check if networkprofile is consistent with hardwareprofile if (not $hardwareprofile) { # Not define hardwareprofile @@ -916,27 +919,27 @@ sub check_profile_consistent{ return 0, "$nictype networkprofile must use with hardwareprofile."; } } - - if ($mgt eq 'vm') - { - return 1, ""; - } + + my %mgt_dict = ('fsp' => 'FSP', 'ipmi' => 'BMC', 'kvm' => ''); - # For nodetype is lpar node, not need to check the nictype as it is not required for lpar node - if (not $nictype and $mgt and $nodetype ne 'lpar' ) { - # define hardwareprofile, not define fsp or bmc networkprofile, and the node type is not lpar - return 0, "$profile_dict{$mgt} hardwareprofile must use with $profile_dict{$mgt} networkprofile."; + if ($mgt eq 'vm') { + return 1, ""; } - if ($profile_dict{$mgt} ne $nictype and $nodetype ne 'lpar') { - # Networkprofile's nictype is not consistent with hadrwareprofile's mgt, and the node type is not lpar - return 0, "Networkprofile's nictype is not consistent with hardwareprofile's mgt."; + if ($nodetype eq 'lpar') { + if ($nictype) { + # Can not associate FSP/BMC network if the node type is lpar + return 0, "The node with hardware type $nodetype can not use with $nictype networkprofile."; + } + return 1, "" } - - if ($nodetype eq 'lpar' and $nictype eq 'FSP') - { - # can not associate FSP network if the node type is lpar - return 0, "The node with hardware type $nodetype can not use with $nictype networkprofile."; + + if ($mgt and $mgt_dict{$mgt} ne $nictype) { + my $errmsg = "$mgt hardwareprofile must use with $mgt_dict{$mgt} networkprofile."; + if ( $mgt eq 'kvm' ) { + $errmsg = "$mgt hardwareprofile must use with non-BMC and non-FSP networkprofile." + } + return 0, $errmsg; } return 1, ""; @@ -1267,3 +1270,32 @@ sub gen_chain_for_profiles{ } return (0, $final_chain); } + +#------------------------------------------------------------------------------- + +=head3 get_all_vmhosts + Description : Get all vm hosts/hypervisor from DB. + Arguments : N/A + Returns : ref for vm hosts/hypervisor hash. + Example : + my $hashref = xCAT::ProfiledNodeUtils->get_all_vmhosts(); +=cut + +#------------------------------------------------------------------------------- +sub get_all_vmhosts +{ + my %vmhostshash; + + my $nodelisttab = xCAT::Table->new('nodelist'); + # groups like '__Hypervisor_pkvm' means this node is Power KVM hypervisor + my @vmhosts = $nodelisttab->getAllAttribsWhere("groups like '%__Hypervisor_kvm%'", 'node'); + foreach (@vmhosts) { + if($_->{'node'}) { + $vmhostshash{$_->{'node'}} = 1; + } + } + $nodelisttab->close(); + + # Return the ref accordingly + return \%vmhostshash; +} diff --git a/xCAT-client/pods/man1/nodeimport.1.pod b/xCAT-client/pods/man1/nodeimport.1.pod index 41e962a52..e23dfbb3c 100644 --- a/xCAT-client/pods/man1/nodeimport.1.pod +++ b/xCAT-client/pods/man1/nodeimport.1.pod @@ -134,12 +134,22 @@ To import nodes using a profile, follow the following steps: cec=mycec lparid=2 # Node information file ends. + + Example of a node information file that specifies a PowerKVM Guest node that uses KVM management: + + # Node information file begins + # This entry defines a PowerKVM Guest node. + # Make sure the node 'vm01' is already created on Hypervisor + vm01: + mac=b8:ef:3f:28:31:15 + vmhost=pkvm1 + # Node information file ends. The node information file includes the following items: B<__hostname__:> This is a mandatory item. -Description: The name of the node, where __hostname__ is automatically generated by the node name format. You can also input a fixed node name, for example “compute-node”. +Description: The name of the node, where __hostname__ is automatically generated by the node name format. You can also input a fixed node name, for example "compute-node". B> This is a mandatory item. @@ -185,6 +195,10 @@ B> This is an optional item. Description: node location info, for rack server only. Specify the node's start unit number in rack, in U. this item must be specified together with rack and height. +B> This is a mandatory option for defining PowerKVM Guest nodes. + +Description: Specifies the vmhost of a Power KVM Guest node, where is the host name of PowerKVM Hypervisior. + 3. Import the nodes, by using the following commands. Note: If we want to import PureFlex X/P nodes, hardware profile must be set to a PureFlex hardware type. nodeimport file=/root/hostinfo.txt networkprofile=default_cn imageprofile=rhels6.3_packaged hostnameformat=compute-#NNN diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index 2f0cc335f..33544a373 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -42,6 +42,7 @@ my %allracks; my %allchassis; my %allswitches; my %all_switchports; +my %allvmhosts; my @switch_records; @@ -430,6 +431,10 @@ Usage: # Get all LPAR ids $recordsref = xCAT::ProfiledNodeUtils->get_all_lparids(\%allcecs); %alllparids = %$recordsref; + + # Get all vm hosts/hypervisiors + $recordsref = xCAT::ProfiledNodeUtils->get_all_vmhosts(); + %allvmhosts = %$recordsref; #TODO: can not use getallnode to get rack infos. $recordsref = xCAT::ProfiledNodeUtils->get_all_rack(1); @@ -2103,6 +2108,12 @@ sub gen_new_hostinfo_dict{ $hostinfo_dict{$item}{"mgt"} = "fsp"; } + # Generate VM host nodes' attribute + # Update netboot attribute if this is powerKVM node + if (exists $hostinfo_dict{$item}{"vmhost"}){ + $hostinfo_dict{$item}{"netboot"} = 'grub2'; + } + # get the chain attribute from hardwareprofile and insert it to node. my $chaintab = xCAT::Table->new('chain'); my $hardwareprofile = $args_dict{'hardwareprofile'}; @@ -2538,6 +2549,12 @@ sub validate_node_entry{ } } } + }elsif ($_ eq "vmhost") { + # Support PowerKVM vms + my $vm_host= $node_entry{"vmhost"}; + if (! exists $allvmhosts{$node_entry{$_}}){ + $errmsg .= "The VM host name $node_entry{$_} that is specified in the node information file is not defined in the system.\n"; + } }else{ $errmsg .= "Invalid attribute $_ specified\n"; } From 93e00147f80ba7e8a5a208e05f428cb49a4cf48a Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 20 Jan 2015 14:19:08 +0800 Subject: [PATCH 05/10] fix for bug 4515: start isc-dhcp-server when starting xcatd on Ubuntu MN --- perl-xCAT/xCAT/ServiceNodeUtils.pm | 7 +++++++ xCAT-server/lib/xcat/plugins/AAsn.pm | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/ServiceNodeUtils.pm b/perl-xCAT/xCAT/ServiceNodeUtils.pm index 049831309..3ec742830 100755 --- a/perl-xCAT/xCAT/ServiceNodeUtils.pm +++ b/perl-xCAT/xCAT/ServiceNodeUtils.pm @@ -185,6 +185,13 @@ sub isServiceReq if (!exists($servicehash->{'tftpserver'})) { $servicehash->{'tftpserver'} = 1; } + # On Ubuntu management node, we disabled the isc-dhcp-server in upstart, + # through file /etc/init/isc-dhcp-server.override, see bug 4399 + # however, this causes a new problem, bug 4515 + # the fix is to start dhcp server when starting xcatd + if (!exists($servicehash->{'dhcpserver'}) && xCAT::Utils->osver() =~ /ubuntu.*/i) { + $servicehash->{'dhcpserver'} = 1; + } } $servicenodetab->close; diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 953a4f658..0b4d03392 100755 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -544,9 +544,13 @@ sub setup_DHCP if (xCAT::Utils->isMN()) { # on the MN #my @output = xCAT::Utils->runcmd("service dhcpd status", -1); #if ($::RUNCMD_RC != 0) { # not running - my $retcode= xCAT::Utils->checkservicestatus("dhcpd"); + my $dhcpservice = "dhcpd"; + if (-e "/etc/init.d/isc-dhcp-server") { #Ubuntu + $dhcpservice = "isc-dhcp-server"; + } + my $retcode= xCAT::Utils->checkservicestatus($dhcpservice); if($retcode!=0){ - $rc = xCAT::Utils->startservice("dhcpd"); + $rc = xCAT::Utils->startservice($dhcpservice); if ($rc != 0) { return 1; From 2436fee9c8c06a71393fedf458811fe032f2110f Mon Sep 17 00:00:00 2001 From: ertaozh Date: Tue, 20 Jan 2015 03:34:10 -0500 Subject: [PATCH 06/10] fix bug 4528: Three identical otherpkglist files in /etc/apt/source.list.d on service node installed via xCAT --- xCAT/postscripts/otherpkgs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index c70af8d65..9fb057ffd 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -628,10 +628,10 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fn=`basename $x` path=`dirname $x` whole_path=$OTHERPKGDIR - - if [[ ! $OSVER =~ ^ubuntu|^debian ]]; then - echo "rhel package path" + if [[ ! $OSVER =~ ^debian ]]; then + # echo "rhel package path" whole_path=$OTHERPKGDIR/$path + whole_path=${whole_path%.} fi #find out if this path has already handled @@ -689,7 +689,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi echo "deb $type://$whole_path ./" > $REPOFILE fi - if [ -n "$OTHERPKGDIR_INTERNET" ];then + if [ -n "$OTHERPKGDIR_INTERNET" ] && [ $index -eq 0 ] ;then OLDIFS=$IFS IFS=$',' urlarray=($OTHERPKGDIR_INTERNET) From 5549d2e0330b351d0faaaed24da76a1edc65db49 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 20 Jan 2015 16:38:08 -0500 Subject: [PATCH 07/10] Certain system services are now started with the SLES12 operating system, to keep backwards compatiability, check if the service is in etc/init.d in the rootimg and only run inssrv on those. Smarter code added for loading kernel modules --- xCAT-server/share/xcat/netboot/sles/genimage | 52 +++++++++++++++----- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 63d440b78..6fd1d8942 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -855,7 +855,13 @@ if (@new_order) { } # add drivers for local disk support -push @ndrivers, ("ext3.ko", "ext4.ko", "virtio_pci.ko", "virtio_blk.ko", "ata_piix.ko", "libata.ko", "scsi_mod.ko", "scsi_dh.ko", "ahci.ko", "ibmvscsi.ko", "ibmvscsic.ko", "megaraid_sas.ko", "pcieport.ko", "sd_mod.ko"); +push @ndrivers, ("ext3.ko", "ext4.ko", "virtio_pci.ko", "virtio_blk.ko", "libata.ko", "scsi_mod.ko", "scsi_dh.ko", "ahci.ko", "megaraid_sas.ko", "sd_mod.ko"); + +if ($osver_host >= 12) { + push @ndrivers, ("ibmvscsi.ko"); +} else { # for sles11 or lower + push @ndrivers, ("ibmvscsic.ko", "ata_piix.ko", "pcieport.ko"); +} if (-f "$rootimg_dir/lib/modules/$kernelver/kernel/drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko") { for (@ndrivers) { @@ -1963,18 +1969,42 @@ sub generic_post { # This function is meant to leave the image in a state approx copy("$installroot/postscripts/xcatpostinit", "$rootimg_dir/etc/init.d/xcatpostinit"); chmod(0755, "$rootimg_dir/etc/init.d/xcatpostinit"); - #insserv with -f option to ignore the dependency on sles10.4 - system("chroot $rootimg_dir insserv -f network sshd gettyset xcatpostinit"); - my $rc = system("grep sshd $rootimg_dir/etc/init.d/.depend.start | grep TARGETS"); - if ($rc) { - system("sed -i '".'s/^\(TARGETS = .*\)$/\1 sshd/'."' $rootimg_dir/etc/init.d/.depend.start"); - system("ln -s ../sshd $rootimg_dir/etc/init.d/rc3.d/S20sshd"); + # + # set certain system services to start on boot, if the file exists in /etc/init.d as a script, + # use insserv to start it. If not, assume that the service is controlled by systemctl + # + # note: insserv is passed the -f option to ignore the dependency on sles10.4 + # + print "[genimage] setting services to start at boot time...\n"; + my @services; + push @services, qw/sshd network gettyset xcatpostinit/; + + foreach my $service (@services) { + my $cmd = "chroot $rootimg_dir "; + if (-r "$rootimg_dir/etc/init.d/$service" ) { + $cmd = $cmd . "insserv -f $service"; + system("$cmd"); + } + else { + print "[genimage] Not starting service $service, verify if started by systemctl\n"; + } } - my $rc = system("grep gettyset $rootimg_dir/etc/init.d/.depend.start | grep TARGETS"); - if ($rc) { - system("sed -i '".'s/^\(TARGETS = .*\)$/\1 gettyset/'."' $rootimg_dir/etc/init.d/.depend.start"); - system("ln -s ../gettyset $rootimg_dir/etc/init.d/rc3.d/S60gettyset"); + + # + # Check if .depend.start file exists. For SLES12 and later OS, this does not apply + # + if (-r '$rootimg_dir/etc/init.d/.depend.start') { + my $rc = system("grep sshd $rootimg_dir/etc/init.d/.depend.start | grep TARGETS"); + if ($rc) { + system("sed -i '".'s/^\(TARGETS = .*\)$/\1 sshd/'."' $rootimg_dir/etc/init.d/.depend.start"); + system("ln -s ../sshd $rootimg_dir/etc/init.d/rc3.d/S20sshd"); + } + my $rc = system("grep gettyset $rootimg_dir/etc/init.d/.depend.start | grep TARGETS"); + if ($rc) { + system("sed -i '".'s/^\(TARGETS = .*\)$/\1 gettyset/'."' $rootimg_dir/etc/init.d/.depend.start"); + system("ln -s ../gettyset $rootimg_dir/etc/init.d/rc3.d/S60gettyset"); + } } } From 5684af2cef9bcd0254374f87cddcae1135fd790d Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 20 Jan 2015 23:29:21 -0800 Subject: [PATCH 08/10] fix defect #4526 [FVT] Bash script /xcatpost/otherpkgs stuck at apt-get forever while installing ubuntu service node, eliminate the prompts while installing xcat packages --- xCAT/postscripts/otherpkgs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 9fb057ffd..ebcc423c4 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -903,9 +903,9 @@ EOF` elif [ $hasapt -eq 1 ]; then apt_get_update_if_repos_changed $REPOFILE if [ $VERBOSE ]; then - echo "$envlist DEBIAN_FRONTEND=noninteractive apt-get -q -y --force-yes install $repo_pkgs" + echo "$envlist DEBIAN_FRONTEND=noninteractive apt-get -q -y --force-yes -o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef' install $repo_pkgs" fi - result=`eval $envlist DEBIAN_FRONTEND=noninteractive apt-get -q -y --force-yes install $repo_pkgs 2>&1` + result=`eval $envlist DEBIAN_FRONTEND=noninteractive apt-get -q -y --force-yes -o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef' install $repo_pkgs 2>&1` R=$? if [ $R -ne 0 ]; then RETURNVAL=$R From b34537ec2ee43be13f8d235fdd0f5957ebe3ad9a Mon Sep 17 00:00:00 2001 From: mellor Date: Wed, 21 Jan 2015 16:08:34 -0500 Subject: [PATCH 09/10] defect 4529: send msg to install monitor process to reload perl modules when rescanplugins called --- xCAT-server/sbin/xcatd | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index f100aa0ad..a9dd0f2cc 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -278,6 +278,10 @@ sub daemonize { } my %cmd_handlers; +my $rescanreadpipe; +my $rescanwritepipe; +my $rescanrselect; +my $rescanrequest = "rescanplugins"; sub do_installm_service { unless ($sport) { return; } #This function servers as a handler for messages from installing nodes @@ -341,6 +345,19 @@ sleep 0.05; #up to 50 ms outage possible my $conn; next unless $conn = $socket->accept; + # check if a rescanplugins request has come in + my @rescans; + if (@rescans = $rescanrselect->can_read(0)) { + foreach my $rrequest (@rescans) { + my $rescan_request = fd_retrieve($rrequest); + if ($$rescan_request =~ /rescanplugins/) { + scan_plugins('','1'); + } else { + print "ignoring unrecognized pipe request received by install monitor from ssl listener: $rescan_request \n"; + } + } + } + my $client_name; my $client_aliases; my @clients; @@ -991,6 +1008,14 @@ unless ($pid_UDP) { xexit(0); } close($sslctl); + +# Set up communication pipe to have ssl listener tell install monitor to +# rescanplugins +if ( !(socketpair($rescanreadpipe, $rescanwritepipe,AF_UNIX,SOCK_STREAM,PF_UNSPEC)) ) { + xCAT::MsgUtils->message("S", "socketpair failed: $!"); +} +$rescanrselect = new IO::Select; +$rescanrselect->add($rescanreadpipe); $pid_MON = xCAT::Utils->xfork; if (! defined $pid_MON) { xCAT::MsgUtils->message("S", "Unable to fork installmonitor"); @@ -1509,6 +1534,9 @@ sub plugin_command { # rescanplugins request gets handled directly here in xcatd if ($req->{command}->[0] eq 'rescanplugins') { scan_plugins($chwritepipe,'1'); + if ($rescanwritepipe) { + store_fd(\$rescanrequest,$rescanwritepipe); + } } else { ${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request); } @@ -1602,6 +1630,9 @@ sub plugin_command { # rescanplugins request gets handled directly here in xcatd if ($req->{command}->[0] eq 'rescanplugins') { scan_plugins($chwritepipe,'1'); + if ($rescanwritepipe) { + store_fd(\$rescanrequest,$rescanwritepipe); + } } else { ${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request); } @@ -1836,6 +1867,9 @@ sub dispatch_request { # rescanplugins request gets handled directly here in xcatd if ($_->{command}->[0] eq 'rescanplugins') { scan_plugins($chwritepipe,'1'); + if ($rescanwritepipe) { + store_fd(\$rescanrequest,$rescanwritepipe); + } } else { ${"xCAT_plugin::".$modname."::"}{process_request}->($_,$dispatch_cb,\&do_request); } @@ -1925,6 +1959,9 @@ sub dispatch_request { # rescanplugins request gets handled directly here in xcatd if ($_->{command}->[0] eq 'rescanplugins') { scan_plugins($chwritepipe,'1'); + if ($rescanwritepipe) { + store_fd(\$rescanrequest,$rescanwritepipe); + } } else { ${"xCAT_plugin::".$modname."::"}{process_request}->($_,\&dispatch_callback,\&do_request); } From 788f0a4a97bd82618eaf1cb674c88c2d98eef3e9 Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 21 Jan 2015 18:11:56 -0500 Subject: [PATCH 10/10] Added support for mutiple sdk CDs for sles diskless --- xCAT-server/share/xcat/netboot/sles/genimage | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 6fd1d8942..15caac5a6 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -273,9 +273,13 @@ unless ($onlyinitrd) { #if(-e "$rootimg_dir/etc/zypp/repos.d/${osver}sdk.repo") { # system("rm -rf $rootimg_dir/etc/zypp/repos.d/${osver}sdk.repo"); #} - my $srcdir_sdk = "$installroot/$osver/$arch/sdk1"; - if ( -e "$srcdir_sdk") { - system("zypper -R $rootimg_dir $non_interactive ar file:$srcdir_sdk ${osver}sdk"); + my $index=1; + while (1) { + my $srcdir_sdk = "$installroot/$osver/$arch/sdk$index"; + if ( -e "$srcdir_sdk") { + system("zypper -R $rootimg_dir $non_interactive ar file:$srcdir_sdk ${osver}sdk$index"); + $index++; + } else { last; } } }else {