Compare commits

..

443 Commits

Author SHA1 Message Date
arif ad5b605528 add systemd support 2015-06-09 22:09:25 +01:00
ligc 32345bc57c fix for bug 4456, change the rcons shebang line to /bin/bash 2014-12-08 14:37:04 +08:00
ligc fe342f041d fix for bug 4459: increase the timeout value in xcatinstallpost, 11 nics takes about 40 seconds, change the wait timeout to be 180 seconds 2014-12-08 10:19:23 +08:00
Casandra Qiu 35beb15503 Bug#4460 pgsqlsetup failed on the sles system 2014-12-05 14:11:37 -05:00
huweihua 1967441266 do some enhancement 2014-12-02 21:44:58 -05:00
daniceexi b02452e2fb defect 4453: In the Postage.pm, fix the issue that he xcatmaster attribute for node cannot be set to 'MASTER' env viriable in mypostscript 2014-12-03 01:12:31 -05:00
huweihua 4097b7f845 do some enhancement 2014-12-02 03:16:24 -05:00
immarvin 21da21dec2 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-12-01 07:56:49 -08:00
immarvin 628067db4d add centos7 stateless stuff 2014-12-01 07:56:25 -08:00
zhaoertao f5577e7921 fix bug 4441 xcat genimage won't install os upgrade, add the "http" started otherpkgdir into apt.list file 2014-12-01 09:12:29 -05:00
huweihua be301fac1e do some enhancement 2014-12-01 06:35:47 -05:00
immarvin 30623ebd13 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-28 01:49:50 -08:00
daniceexi 476f9f7b94 defect 4442: fix the issue in xcatd that new UDP won't exit with error message when it cannot get socket during the xcatd fast restart 2014-11-28 06:57:36 -05:00
immarvin b8602d756f fix defect #4299 Node provision failed because kickstart file have unreasonable conf which caused by switch discovery emthod 2014-11-28 01:49:33 -08:00
ligc 607e2bd385 fix for bug 4399: on Ubuntu, disable isc-dhcp-server in upstart to avoid two dhcp server daemons, let xcat totally mangae dhcp server 2014-11-28 10:13:34 +08:00
ligc 2e32683a52 fix for bug 4440: write /etc/network/interfaces to /etc/network/interfaces.d/<nicname>, check if the target file name is blank 2013-11-28 11:19:06 +08:00
ligc 5ef5b62877 Remove the AIX multicast route words from lsslp manpage, it is required after 2.7.8 2013-11-27 16:06:29 +08:00
huweihua f9430e7364 add /etc/inittab depending on doc in sourceforce 2014-11-26 02:36:13 -05:00
zhaoertao d9e87410d4 Fix bug 4381 :sles12 rcons could not work on P8LE. 2014-11-26 02:29:04 -05:00
zhaoertao 288ffa7b68 Enhance of fix bug 4381 :sles12 rcons could not work on P8LE. For ubuntu LE diskless 2014-11-26 01:23:27 -05:00
huweihua da02c2bce7 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-25 22:00:08 -05:00
huweihua 217887b177 xcat auto test provision test cases 2014-11-25 21:59:33 -05:00
daniceexi cdacb9a85f defect 4426: support persistent route setting for Ubuntu/Debian in routeop postscript 2014-11-25 12:41:13 -05:00
zhaoertao 641be270e9 fix bug 4381 :sles12 rcons could not work on P8LE. This checkin support rcons for ubuntu LE diskfull and diskless 2014-11-25 04:45:29 -05:00
immarvin d9b5d07882 fix defect #4430 On rhels7,the package util-linux-ng changed to util-linux 2014-11-24 22:28:30 -08:00
immarvin ee20161772 update the boot options of redhat family since some options are already deprecated or replaced 2014-11-24 21:50:32 -08:00
Junxiaw e6b4ca9913 add autotest testcase 2014-11-24 18:56:03 -08:00
Junxiaw c33901f267 add autotest testcase 2014-11-24 18:52:17 -08:00
root 56228c180b add autotest testcase 2014-11-24 18:49:17 -08:00
root c5549a6533 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-24 18:40:15 -08:00
daniceexi 9d0b4b1be7 4390: In DB Access process, recover the signal handle in %SIG which was cleaned up by accident. This fix should be removed if fixed the root cause of %SIG clean up. 2014-11-24 09:41:43 -05:00
Casandra Qiu c21a1d35a2 Merge branch 'master' of ssh://cxhong@216.34.181.155/p/xcat/xcat-core 2014-11-22 21:25:30 -05:00
Casandra Qiu 69bf4249be Bug#4385 mysqlsetup does not support mariaDB in Ubuntu 2014-11-22 21:24:28 -05:00
huweihua cb62009306 fix defect4393: confignics --ibport 2 Cannot find device ib0 on diskless node although ib drivers is installed 2014-11-21 06:51:20 -05:00
zhaoertao e14dc92c12 fix bug 4415: Ubuntu 14.10 diskfull installation failed on IBM PowerKVM guest 2014-11-21 02:50:51 -05:00
zhaoertao c264c8b3a8 fix bug 4424: Failed to genimage for Ubuntu 14.10 diskless node on ppc64el 2014-11-21 02:37:40 -05:00
zhaoertao c65b55b79d fix bug 4410: Command genimage failed on Ubuntu 14.04.1 ppc64el with kernelver attribute 2014-11-21 02:26:23 -05:00
immarvin 3f59552d0c fix defect #4307 [FVT]:chdef newimage -u give out wrong arch in ubuntu; fix defect #4345 Utils->osver routine does not support Redhat7 or SLES12;fix defect #4308 [FVT]: osarch default value of user defined osimage is ppc64le. needs to change to ppc64el 2014-11-21 00:19:37 -08:00
immarvin 72c058edc9 enhance the script to support various bootmgr 2014-11-20 01:57:27 -08:00
litingt b9f206c746 remove xCAT-UI xCAT-OpenStack xCAT-OpenStack-baremetal 2014-11-20 01:30:10 -08:00
zhaoertao 037ed0bcfd fix bug 4411: Typo in the command genimage output, "geniamge" -> "genimage" 2014-11-20 02:56:23 -05:00
daniceexi 029e6d18ca defect 4419: change the db notification runs in DB process instead of fork a new one since the fork new process will cause DBI connection gets into confusing 2014-11-20 07:14:50 -05:00
daniceexi 900963b1db defect 4375: fix the xcatd which has issue to receive request from xcatd which is longer than about 160,000 bytes 2014-11-20 07:08:36 -05:00
zhaoertao 089315126c fix bug 4410: Command genimage failed on Ubuntu 14.04.1 ppc64el 2014-11-20 02:00:45 -05:00
Casandra Qiu 28d2110a5e fix bug#4366 change /bin/sh to /bin/bash 2014-11-19 09:42:19 -05:00
huweihua 2b74e1de3c Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-19 06:10:05 -05:00
huweihua c5e82bb0fd fix defect4414: if there is rsync service already run, sysclone rsync server start unsuccessfully. 2014-11-19 06:09:23 -05:00
baiyuan ba51617afd fix /n after uname -p 2014-11-19 06:01:54 -05:00
huweihua 458d82a3b2 fix defect4407: Cloned rhels7 node doesn't have IP address in rh7 2014-11-19 03:32:12 -05:00
huweihua 1c0ff10789 fix defect4397: sysclone analysize genesis fs name failed in rh7.0 2014-11-19 03:23:19 -05:00
daniceexi 3a4cefe53b defect 4336,4352: in xcatd, for aix, make all the process (fix for udp process) to be stopped when received TERM singal from stopsrc command to the main process 2014-11-19 07:44:49 -05:00
zhaoertao 449ee0f808 correct postinstall scripts for ubuntu diskless 2014-11-19 03:16:44 -05:00
root a139146cba Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-18 19:18:14 -08:00
root 2d4e7c9fdd Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-16 21:33:05 -08:00
baiyuan 0d6d911fa5 defect 4394 buildkit preuninstall did not work 2014-11-14 04:50:30 -05:00
baiyuan f2f03bc718 defect 4394 buildkit preuninstall did not work 2014-11-14 04:50:15 -05:00
immarvin 72739e890d Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-14 01:30:14 -08:00
immarvin 11cd20ada5 add build timestamp to the xcat-dep 2014-11-14 01:29:29 -08:00
root 738f891d61 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-13 19:00:19 -08:00
zhaoertao 65814f3b59 fix bug 4395: ubuntu didn't get pkgdir from the osimage pkdir attribute 2014-11-13 21:54:17 -05:00
root 87fadccb22 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-13 05:45:22 -08:00
immarvin 6f4c3875d2 add xnba-undi and elilo to xCAT dependency list on ppc64le, since the 2 packages are all arch-indep 2014-11-13 00:47:49 -08:00
immarvin e9d56917fc remove some EOF ubuntu releases,add 14.10 release code 2014-11-13 00:45:46 -08:00
daniceexi ab8beaf15d change detect_dhcpd tool to support Ubuntu 2014-11-13 07:08:15 -05:00
zhaoertao e638a90375 fix bug 4392:xCAT upgrade failed because of xcat-genesis-scripts-amd64 and xcat-genesis-scripts 2014-11-13 03:25:54 -05:00
huweihua ac83f5c65f fix defect4389:omit the output of ifup command 2014-11-13 03:03:31 -05:00
huweihua 4607e8138f fix defect4388: forbid firmware update during Mellanox drives installation 2014-11-13 02:53:34 -05:00
zhaoertao e40229e41d fix bug 4391 xcat-genesis-scripts create mismatch directory with its arch 2014-11-13 02:12:03 -05:00
baiyuan 6f38163688 close debug mode 2014-11-13 01:10:55 -05:00
baiyuan 31d1cf9961 configure lsf cluster and start up lsf cluster 2014-11-13 01:07:56 -05:00
baiyuan 5f72bfa56f do lsf installation and basic configuration 2014-11-13 00:39:48 -05:00
daniceexi df970f4cb0 defect 4384: fix the issue that copycds command cannot be ctrl+c cleanly. The root cause was INT signal was not received by the plugin process after it sends out from relay_fds. The fix is to send both INT and TERM. TERM can be received in this case. 2014-11-13 03:24:33 -05:00
root 3a3256b518 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-12 21:18:07 -08:00
zhaoertao 834ae798ca fix bug 4387 :sles12:mkvm failed 2014-11-12 22:09:35 -05:00
zhaoertao b4d9167344 fix bug 4382 :increase /tmp size for default ubuntu diskless node 2014-11-12 21:34:33 -05:00
jjohnson2 e2c31bad27 Implement confluent usage by r/wcons 2014-11-12 16:48:44 -05:00
Casandra Qiu 2d1961c4f9 bug#4286 makedns should have a verbose mode 2014-11-12 10:24:38 -05:00
ligc b777d3dfa5 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-12 03:41:08 -05:00
ligc 7ee1498601 fix for bug 4341: xCAT needs perl-Digest-SHA1 but RHEL7 will not install perl-Digest-SHA1 by default 2014-11-12 03:40:54 -05:00
daniceexi 01f4cc8917 defect 4367: support rinv command to get disk information for block device like /dev/sda16 2014-11-12 05:16:27 -05:00
zhaoertao 502cc6aaad fix bug 4271 Avoid use a seperate /boot partition in the default partition strategy for Ubuntu 2014-11-12 03:38:16 -05:00
root 7bcc0909a9 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-11 22:32:53 -08:00
zhaoertao 9e86ac498c enhance for fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. 2014-11-11 21:33:47 -05:00
immarvin 84712be32c support apache2.4 in ubuntu 2014-11-11 19:04:52 -08:00
Victor Hu 3eaaa3b6f3 Bug 4373: enhance warning msg in otherpks to be more clear with yum. 2014-11-11 15:54:04 -05:00
Victor Hu a09f2d6faa add work around for umount partition question during ubuntu install 2014-11-11 15:37:29 -05:00
daniceexi 21d12983c9 Since xcatd fast restart cannot be supported in systemd enabled OS, we implemented fast restart in restartxcatd command 2014-11-11 12:18:58 -05:00
huweihua ba343557ec fix bug: disappeared in petitboot environment 2014-11-11 07:02:51 -05:00
huweihua 7f58d3fd6c fix bug: disappeared in prtitboot environment 2014-11-11 06:57:23 -05:00
zhaoertao 9f91e914d9 enhance for fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. 2014-11-11 05:11:48 -05:00
root 68fbecb21a Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-09 21:06:01 -08:00
daniceexi ce7ed0cb72 Check the version of perl-Net-DNS. If it's perl-Net-DNS-0.73-1.28, output an error message that require the update and return 2014-11-10 04:26:22 -05:00
root 084e71387b Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-09 21:04:03 -08:00
litingt 85af82dc02 add xCAT-genesis-scripts in 2014-11-09 21:44:00 -05:00
root 83bf291a3d Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-04 19:19:47 -08:00
huweihua 9f830ffc17 get rid of needless systemimager monitor service for sysclone 2014-11-04 21:52:13 -05:00
huweihua 23a132c497 fix the bug when use dracut to rebuild initrd 2014-11-04 21:45:44 -05:00
huweihua 51f9f121bc get rid of needless output 2014-11-04 21:43:02 -05:00
huweihua 06bbdbc33f support rhels7.0 2014-11-04 21:40:49 -05:00
linggao 8622f3f9bd fixed defect 2994 imgexport/imgimport problems 2014-11-04 11:39:58 -05:00
Lei Ai 1fb1b283bb set netboot to for PPC64LE 2014-11-04 22:16:09 +08:00
lissav df45650bfb defect 4355 2014-11-04 07:51:04 -05:00
lissav c31b275d54 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-03 12:42:19 -05:00
baiyuan 2ace529fee range lskit to support -K -R -C and theirs xml format 2014-11-03 03:55:24 -05:00
baiyuan 852fc3c164 back to original kit.pm 2014-11-03 03:49:19 -05:00
baiyuan b15e8e9db8 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-03 03:35:12 -05:00
zhaoertao 47c91ef186 defect lskit to support seperate -R -C as xml format 2014-11-03 07:48:57 -08:00
baiyuan c8426f9f43 pick up ligc fix for bug 4347: lsvpd does not output the word 'cpu' on Ubuntu LE 2014-11-03 03:34:33 -05:00
baiyuan 943b31d0ff defect4303 --- add -C support for lskit 2014-11-03 00:40:30 -05:00
baiyuan 5c9bd40b1f defect4303 --- add -R support for lskit 2014-11-03 00:08:49 -05:00
immarvin dd63773ee8 dd conf support for apache2.4:create a new file xcat-ws.conf.apache22 2014-10-31 03:12:25 -07:00
immarvin b6c35465dc update configuration file for apache2.4 on sles12 2014-10-31 02:48:33 -07:00
immarvin 9ba2726f83 add conf support for apache2.4 2014-10-31 02:43:22 -07:00
baiyuan ec1ef81ea8 fix defect 4349 [dev]after rmkit/rmkitcomp -i kitcomp list, kitrepo dir in otherpkgdir is not deleted 2014-10-31 04:40:09 -04:00
lissav 5078f8293b Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-30 08:49:40 -04:00
lissav 6b040b23f7 fix defect 4343 2014-10-30 08:49:19 -04:00
baiyuan 9539644ca1 fix 4344 kit repo lose mount after xcat MN reboot in ubuntu 2014-10-30 08:36:47 -04:00
zhaoertao aa0f63c2b7 fix bug 4340:could not do diskless install on p8le vm 2014-10-30 03:24:58 -04:00
root cc971870f9 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-19 17:56:15 -07:00
zhaoertao 255811ee1f fix bugs that no BOOTIF set for ubuntu diskless 2014-10-18 17:13:02 -07:00
baiyuan b9577cb9ef non_native package use this script, update sample using real content 2014-10-17 03:22:36 -04:00
immarvin 5ad09597bd replace ifconfig with ip 2014-10-16 03:00:18 -07:00
immarvin 5b5ad7d6d7 fix defect #4297 PMR 32466,L6Q,000 autoinst file generated hangs install at running postscripts 2014-10-16 02:26:27 -07:00
immarvin 2f6be40923 fix defect #4274 default otherpkgdir is /install/post/otherpkgs/ubuntu14.04/ppc64el in ubu 2014-10-15 21:24:38 -07:00
immarvin 2a494808f7 fix defect #4293 [[FVT]:genimage failed not finding otherpkg repo file 2014-10-15 08:42:35 -07:00
zhaoertao 053225fb26 fix bug 4296 :p8le hw discovery error info about syslog and dmidecode 2014-10-15 00:21:48 -07:00
ligc 3b05fc84b0 fix for bug 4290: add requires ipmitool-xcat for ppc64 2014-10-14 22:50:30 -04:00
mellor 2511cebef8 defect 4284 - fixed xcatd attempt to write to broken pipe which caused DB processes to not get killed 2014-10-14 20:48:51 -04:00
mellor c85c5acdee defect 4294 - fix rmkitcomp to recognize ubuntu prerequisite prep-kitcomp otherpkgslist entry 2014-10-14 18:35:41 -04:00
mellor 0c51f6e92a fix schema def mapping of missing kit and kitcomponent attrs 2014-10-14 18:00:39 -04:00
root 31c9e1f812 modify installation test case part sn installation on ppc64 for redhat 2014-09-18 02:04:56 -07:00
root af98c573fb modify xdcp test case part one 2014-09-17 20:08:35 -07:00
root 1eb7f10e2e modify xdcp test case part one 2014-09-17 20:06:11 -07:00
baiyuan 47d8713482 fix syntax error in postinst 2014-09-17 05:57:59 -04:00
baiyuan 7d84551ce5 fix syntax error in postinst and preinst 2014-09-17 05:57:28 -04:00
mellor b855150aee support -s PBMC for lsslp 2014-09-17 02:12:37 -07:00
root d041294800 modify rscan test case part one 2014-09-17 01:21:34 -07:00
baiyuan 8557d86359 fix absolute filename in Packages that make otherpkgs intall deb package fail 2014-09-17 04:03:46 -04:00
daniceexi a6b4056b2e Merge branch 'master' of ssh://daniceexi@git.code.sf.net/p/xcat/xcat-core 2014-09-17 02:38:08 -04:00
daniceexi e0bbf7b1db Code change to support SL6 2014-09-17 02:37:39 -04:00
baiyuan 6ec8d4c4e3 ubu power LE arch is ppc64el,ubu kit componet basename xxx-compute 2014-09-16 02:25:08 -04:00
ligc 252da58c78 fix for bug 4272: do not check php rpm, check file existence instead 2014-09-16 02:27:02 -04:00
immarvin 9d628fb636 fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) 2014-09-15 21:00:26 -07:00
baiyuan a4ac5c5187 add lskit/addkit/rmkit/lskitcomp/addkitcomp/rmkitcomp/chkkitcomp/lskitdeployparam 2014-09-15 22:52:27 -04:00
Bruce Potter ba9dc1cd5e Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
updated xCAT-SoftLayer for rhel
2014-09-15 11:54:06 -04:00
Bruce Potter 2cf01b06b3 updated xCAT-SoftLayer for rhel 2014-09-15 11:53:48 -04:00
lissav f2901b06d0 fix description 2014-09-15 07:02:11 -04:00
qyin fe890637c9 fix issue 241844 The added os packages are not installed when reinstall nodes. 2014-09-15 17:32:28 +08:00
immarvin 83ed138db2 fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) 2014-09-15 03:04:57 -07:00
immarvin 7f8b48ba40 fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) 2014-09-15 02:50:34 -07:00
immarvin d0585fe056 fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) 2014-09-15 02:41:51 -07:00
qyin ae1dde7d9a Fix: 242668 [Rank6][Vlan] [Switch] [sles]Cannot found secure vlan network after flex up node in cluster within vlan 2014-09-15 15:55:01 +08:00
lissav 80772ee81c missed a path 2014-09-12 09:22:29 -04:00
lissav 66a38f0075 Found undocumented attribute in xcatd and added some more info to auditnosyslog 2014-09-12 09:19:19 -04:00
daniceexi a7621d345f defect 4264: fix issue in configib postscript to make it only touch the ifcfg-* files which are passed in from command line params 2014-09-12 07:52:21 -04:00
lissav 6c46d5b75d set default value for auditnosyslog on install and init DB 2014-09-12 07:29:09 -04:00
immarvin 1a5de449ef fix defect #4080 investigate RH7 kdump support 2014-09-11 20:52:23 -07:00
lissav aff90b34ac Support for auditlog without syslog 2014-09-11 13:39:55 -04:00
lissav 61b8040369 Support for auditlog without syslog 2014-09-11 13:14:04 -04:00
lissav 9a237c699b Support for auditlog without syslog 2014-09-11 13:12:56 -04:00
mellor 42b0f43780 support mtms based hardware discovery 2014-09-11 02:38:47 -07:00
litingt c66fe0d131 change git directory 2014-09-10 21:30:11 -04:00
zhaoertao 088ee8e9cd add an attribute for findme used to check it is running powerNV model 2014-09-10 01:51:06 -07:00
Jarrod Johnson 541dcf53d3 Handle more invalid characters in SPD model field if encountered 2014-09-09 13:41:19 -04:00
Jarrod Johnson 532c7d618c Recognize Lenovo IMM2 for wvid 2014-09-09 10:40:53 -04:00
mellor aab450c4de added --uploaduser as option and fixed default 2014-09-09 10:04:17 -04:00
mellor 7bbc3e8add man page updates for a new --continue flag to getxcatdocs 2014-09-09 09:40:48 -04:00
mellor 9dd06c1047 second pass at new getxcatdocs - convert tables to pandoc, fix image downloads, and more 2014-09-09 09:31:06 -04:00
lissav 40b5891c4a defect 4254 2014-09-08 12:20:14 -04:00
lissav 0c77d04e7c Defect 4270 2014-09-08 08:15:09 -04:00
Jarrod Johnson c79eca69df Add support for System X M5 generation for firmware inventory 2014-09-05 10:44:55 -04:00
zhaoertao 0f4a674527 modify genesis to support system P hardware discovery 2014-09-05 02:10:54 -07:00
huweihua 447b31ee60 modify code format error 2014-09-04 02:07:02 -04:00
zhaoertao ae5320d82b fix bug 4267:Missing includes for Sys::Syslog in /opt/xcat/lib/perl/xCAT_plugin/petitboot.pm 2014-09-03 02:04:27 -07:00
zhaoertao d8faafb4b4 add option "password" for rspconfig to change password for default user through IPMI 2014-09-03 01:21:22 -07:00
Jarrod Johnson 573fc1790f Mellanox renamed their driver in later kernels. If new name detected, substitute it 2014-09-02 10:37:23 -04:00
immarvin 8a6b60a769 #4262 The type of error message in rmosdistro is not string ref 2014-09-02 01:54:01 -07:00
huweihua 201fb1871b add Prep partition flag setting 2014-09-01 04:08:01 -04:00
huweihua ab8e64217f move Prep partition flag setting to imgcapture.pm 2014-09-01 04:03:49 -04:00
huweihua 027d4ff52a add some exclude file for support system p 2014-09-01 04:00:47 -04:00
ligc 18a3c26864 fix for bug 4265: remove getxcatdocs from PCM build 2014-08-31 23:24:42 -04:00
immarvin 1e2329be1d Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-31 20:53:45 -07:00
immarvin 9fae510b2e correct a typo 2014-08-31 20:52:56 -07:00
immarvin fda569d340 fix defect #4263 Some packages in pkglist file are not exist in RHEL7 2014-08-31 20:35:11 -07:00
qyin f4ef1202fe Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-09-01 10:49:59 +08:00
qyin eb5655a9e4 fix issue 241844 The added os packages are not installed when reinstall nodes. 2014-09-01 10:46:05 +08:00
lissav e140fcd040 defect 4262 2014-08-29 07:29:32 -04:00
junxiaw 3eabe15ff3 modify autotest xCATreg code 2014-08-29 00:35:59 -07:00
immarvin eaf7325a1c fix defect #4242 In physical rhel7 env,set installnic=ethx can not provision compute node. 2014-08-29 00:31:56 -07:00
Jia Zhao d87440ec41 merge from 2.8 branch about name mistake 2014-08-28 17:27:15 +08:00
ligc baa3edb3ca fix for bug 4372, set selinux be in permissive mode for RHEL 7 2013-11-26 16:49:09 +08:00
ligc fea8c45131 fix for bug 4288, add the -i flag to pasu manpage 2013-11-26 15:48:20 +08:00
ligc 01da31702e fix for bug 4421: change the term 'rpms' to 'packages' to make it be common for both RHEL/SLES and Ubuntu. Removed the postscripts/otherpkgs.ubuntu 2013-11-26 15:04:09 +08:00
ligc 358959724d fix for bug 4422: fix the ubuntu template problem with x86_64 kvm virtual machnes 2013-11-21 14:16:20 +08:00
litingt 5d55cc5dbe add help option 2014-11-19 20:28:18 -08:00
litingt 95e9cc18fb remove packages xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-OpenStack xCAT-OpenStack-baremetal in ALLBUILD 2014-11-19 20:18:59 -08:00
mellor afe37ebeab initialize rc var in Table.pm and tabutils.pm to remove warnings when running xcatd in foreground 2014-11-19 17:34:04 -05:00
ligc b19461a479 fix for bug 3343: remove the print Dumper(xxx) from the code 2013-11-20 10:53:00 +08:00
ligc 3281a3d1c3 fix for bug 4404, systemctl import-environment does not work on RHEL 7, should use systemctl set-environment 2013-11-20 10:37:03 +08:00
Casandra Qiu 5373b22b61 Bug#4408 pgsqlsetup didn't work on ubuntu 2014-11-18 09:57:24 -05:00
zhaoertao f6761bb0b7 fix bug 4126:vios:mkvm failedo 2014-11-18 05:29:23 -05:00
zhaoertao 3eec0c921d fix bug 4206: lsvm return null if the cec is in off state 2014-11-18 03:49:37 -05:00
zhaoertao 280ad16dbe fix bug 4377: add postinstall file under /opt/xcat/share/xcat/netboot/ubuntu for ubuntu support 2014-11-17 08:34:16 -05:00
ligc a74177cb86 fix for bug 4400, export DEBIAN_FRONTEND=noninteractive when running apt-get commands to avoid interactive procedure 2013-11-18 17:46:07 +08:00
ligc 02269d22b5 fix for bug 4400: add additional apt-get flag to avoid prompting interactive ations during packages installation 2013-11-18 16:29:13 +08:00
ligc f0987c908f fix for bug 4374: support running postscripts under directories in /intall/postscripts/ 2013-11-12 16:42:03 +08:00
baiyuan a049714a3e fix defect 4371 [fvt]2.9:restart xcatd error for kit.pm compilationerror 2014-11-10 03:45:48 -05:00
zhaoertao 878d9443dd enable SMT for powerKVM VMs 2014-11-10 03:09:23 -05:00
daniceexi d047c4cdf5 defect 4370: minor change in message for makedns 2014-11-10 06:34:14 -05:00
ligc cad641241d fix for bug 4369: fix the missing info in xcat.log on Ubuntu 2013-11-11 09:17:10 +08:00
Victor Hu b865f08e2e Merge branch 'bug3963' 2014-11-07 08:43:55 -05:00
baiyuan cec473c646 find the only version from dpkg -I 2014-11-07 03:20:13 -05:00
zhaoertao 392fc1b3cb fix bug 4368 mkvm for lpars in different CECs will failed 2014-11-07 03:00:38 -05:00
zhaoertao 614594fa52 4342 Wrong cpucount number is counted for PowerKVM host 2014-11-07 02:13:00 -05:00
baiyuan 340c5fc553 fix duplicate lines for IPADDR and NETMASK 2014-11-06 21:27:43 -05:00
Victor Hu b59f72bd8e changes to support --noupdate flag on genimage 2014-11-06 16:58:19 -05:00
zhaoertao 0215a5bed2 add PReP partition for sles12 ppc64le 2014-11-06 05:17:34 -05:00
daniceexi f0b9cac61c 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. 2014-11-06 06:24:50 -05:00
ligc 43c9fecd1a add sles12 pkglist and autoyast template 2014-11-06 01:38:34 -05:00
ligc b8bd2acad8 SLES12 ppc64le support: build ppc64le RPMs 2013-11-07 09:05:46 +08:00
Casandra Qiu e83055a0a1 bug #4364 change default vmnicmodel to virtio 2014-11-05 11:32:44 -05:00
zhaoertao 0705721307 fix bug 4357:After run nodeset <node> runimage' may fail 2014-11-05 06:07:30 -05:00
zhaoertao c20b47d205 enhance for fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. 2014-11-05 05:11:13 -05:00
litingt 2490baf473 update case to remove operation for xcatdport 2014-11-05 01:17:34 -08:00
huweihua 3ebf2f7851 fix the bug when use dracut to rebuild initrd 2014-11-05 02:22:40 -05:00
huweihua 00e96b2b57 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-05 01:52:06 -05:00
huweihua 24cc328940 add comments 2014-11-05 01:50:45 -05:00
baiyuan 8f6bd7a584 add lskitcomp -C support 2014-11-05 01:18:51 -05:00
zhaoertao 522a815c3d fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. 2014-11-05 01:00:55 -05:00
ligc da874a91f2 fix for bug 4347: lsvpd does not output the word 'cpu' on Ubuntu LE, it outputs 'processor' instead 2013-11-04 15:42:23 +08:00
zhaoertao 2170c7196f defect 4303 arrange lskit options 2014-11-03 07:13:53 -08:00
ligc f101f97df4 fix for defect 4337, add TERM into the systemd through systemctl import-environment TERM 2013-10-31 13:23:19 +08:00
mellor 0b35d9edd7 defect 4335 - remove confluent.pm and kit.pm from AIX builds 2014-10-29 10:41:13 -04:00
baiyuan dff4cad29f fix defect 3847 buildkit addpkgs -k -r left useless kit component rpm in complete kit repos dir 2014-10-29 05:14:53 -04:00
immarvin 1c379b1590 fix defect #4326 [fvt]2.9:load config file failed if more than one mac during vm install 2014-10-29 02:49:02 -07:00
ligc f6d48a858b fix for bug 4333: add the powerkvm 2.1.1 disc info 2013-10-30 15:13:01 +08:00
ligc cd4c886ba1 fix for rcons problem with kvm on SLES 12 and on PowerKVM 2013-10-30 14:55:32 +08:00
immarvin b94dcb02e4 fix defect #4326 [fvt]2.9:load config file failed if more than one mac during vm install 2014-10-29 00:54:58 -07:00
mellor 4781a420d2 defect 3348 - rmkitcomp by basename now removes all kitcomponents matching that name instead of just the highest 2014-10-28 17:47:51 -04:00
lissav c40c63ad77 defect 4329 2014-10-28 09:38:02 -04:00
lissav 424886c5d0 defect 3723 2014-10-28 07:15:05 -04:00
zhaoertao e81496cac9 support ubuntu 14.04.1 ppc64el diskless 2014-10-28 06:09:37 -04:00
baiyuan cf5ae47428 add osarch comments for Ubuntu Power LE 2014-10-28 05:46:23 -04:00
baiyuan 50f2f825ac use Utils instead of BuildkitUtils.pm 2014-10-28 05:36:29 -04:00
baiyuan 475e64aa69 use ppc64el now for ubuntu package use ppc64el 2014-10-28 05:14:42 -04:00
baiyuan dcaa4416af remove xcat-buildkit,xCAT-buildkit is here 2014-10-28 04:19:59 -04:00
immarvin ab0cba2748 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-28 01:59:34 -07:00
immarvin fead0c878e fix defect #4327 [dev] copycds should use ppc64le instead of ppc64el in ubuntu ppc64le 2014-10-28 01:58:19 -07:00
baiyuan f8db0659f0 fix 4325 Use buildkit to create kit,the osarch is always ppc64el .It's not consistenct with real osarch 2014-10-28 03:45:23 -04:00
baiyuan dab45f5df2 change name compute.ubuntu14.04.ppc64el.pkglist to compute.ubuntu14.04.ppc64le.pkglist 2014-10-28 03:39:23 -04:00
baiyuan 15bc5437f4 fix 4313 rmkitcomp, there is no options for --noscripts 2014-10-27 10:07:26 -04:00
baiyuan c57e57fc3f fix 4313 update help iniformation for some kit commands 2014-10-27 10:04:02 -04:00
baiyuan 49e7a6d393 multipul env param 2014-10-27 09:34:57 -04:00
baiyuan 13c93831bf use read only mount for kitcomponent during addkitcomp 2014-10-27 08:53:44 -04:00
baiyuan 3ec9780b6e fix 4322,genimage failed with pperte KIT componentwhich has environment variable 2014-10-27 05:59:56 -04:00
zhaoertao f5cf1968df add dependency xcat-buildkit for package xcat 2014-10-27 04:49:39 -04:00
zhaoertao a44d508044 add package xcat depending on xcat-buildkit 2014-10-27 03:57:21 -07:00
huweihua 8431d6cad9 fix defect 4295, sysclone can't clone a SLES11.3 golden client 2014-10-26 22:38:25 -04:00
Victor Hu f00771ff92 add rhel6.6 compute node media info to discinfo.pm 2014-10-24 15:03:40 -04:00
daniceexi 6244920305 Enhance the ddns.pm to support the site.dnsinterfaces for DNS server to listen on specific interfaces instead of all 2014-10-24 09:43:31 -04:00
ligc a3028511fa remove the ifnarch s390x, the ifarch/ifnarch does not work for noarch package, grub2-xcat is shipped with s390 xcat-dep 2014-10-24 03:54:08 -04:00
ligc 215e4620b6 fix for bug 4319: should not require ipmitool-xcat and xCAT-genesis-base on AIX 2013-10-25 11:47:53 +08:00
litingt b4cd2e016b add kit bucket test data 2014-10-23 19:33:05 -07:00
litingt f1a75b17d3 add addkit test cases 2014-10-23 19:25:37 -07:00
litingt 851094e6a1 add buildkit test cases 2014-10-23 19:23:32 -07:00
litingt f383d4d0fc add addkitcomp test cases 2014-10-23 19:21:46 -07:00
litingt 37672312ba add chkkitcomp test cases 2014-10-23 19:20:06 -07:00
litingt 8133553481 add lskitdeployparam test cases 2014-10-23 19:18:43 -07:00
litingt ad2b7370cc add lskit test cases 2014-10-23 19:17:35 -07:00
litingt 0db64ebb8e add rmkit case 2014-10-23 19:15:59 -07:00
litingt 85075225ca add rmkitcomp cases 2014-10-23 19:14:53 -07:00
litingt f35a5b6071 add lskitcomp cases 2014-10-23 19:13:25 -07:00
litingt 91c67cea57 add KITDATA for kit case test 2014-10-23 19:10:39 -07:00
litingt ad0118ddf9 fix defect 4314 update for ubuntu specific case support 2014-10-23 19:06:34 -07:00
lissav be7dea96d5 add setup of MN/SN SLES12/rsyslog 8 support defect 4311 2014-10-23 09:20:13 -04:00
baiyuan ae11f1f4fe fix defect 4309 lskitdeployparam -k returns kit plugin bug 2014-10-23 05:19:46 -04:00
daniceexi 50a441209b Code drop for supporting KVM/VMware based virtualization in rest api interface 2014-10-23 08:17:16 -04:00
linggao 73d08b58fa added nmapoptions in the site table to resolve network slow response issues in nmap. defect 4300 2014-10-22 18:36:59 -04:00
mellor 7e8c02bf07 defect 4304 - fixed some more interprocess communication problems 2014-10-22 17:20:07 -04:00
Victor Hu f904ce2cc1 add media tags for rhels6.6 support, x86_64 and power 2014-10-22 16:12:27 -04:00
zhaoertao 0096a8dde0 fix bug: 4310 xdsh to Cisco SG300-52 switch does not work, don't affect the original supporting 2014-10-22 15:39:24 -07:00
zhaoertao de215daef3 fix bug: 4310 xdsh to Cisco SG300-52 switch does not work 2014-10-22 14:55:08 -07:00
lissav 75f15ce9b7 SLES12/rsyslog 8 support defect 4311 2014-10-22 07:42:42 -04:00
huweihua b5f708ed39 fix defect 4289: sysclone failed to update target node with rpm update 2014-10-22 05:36:16 -04:00
huweihua ccfa70d8c8 support lvm in legacy mode on x system 2014-10-22 05:23:43 -04:00
zhaoertao c270d5e563 support copycds and nodeset for SLES 12 ppc64le 2014-10-22 08:26:00 -07:00
zhaoertao a049575c4f fix bug 4305:error info :Unknown arch during ubuntu 14.04.01 osimage nodeset on p8le env 2014-10-22 03:21:39 -07:00
daniceexi d718ba8396 defect 4283: add note head of the subtourines (in hosts.pm) which called in ddns.pm. Generally xcat does not suggest that call subroutine of xcat_plugin from antoher xcat_plugin module, but since the change would be big, I add this note head the subroutines as a notification for the member who would change the involved subroutines. 2014-10-22 02:03:07 -04:00
lissav 402c91cfcc fix syntax error 2014-10-21 15:23:44 -04:00
baiyuan 79d784a384 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-21 05:18:51 -04:00
immarvin 5b59d6eddf Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-21 03:18:22 -07:00
immarvin 2c070624ff process the genimage with kit stuff 2014-10-21 03:18:04 -07:00
baiyuan 9552485df6 genimage cannot use Symbolic link in ubuntu,use mount --band instead 2014-10-21 05:18:14 -04:00
Victor Hu 1d781ea39f Bug #3832 rewrite logic for dhcpd config, avoid dual code path 2014-10-20 14:42:54 -04:00
baiyuan 49bf7c1200 defect 4302 lskit/lskitcomp --xml has no output 2014-10-20 05:24:09 -04:00
baiyuan d5320ca977 defect 4302 lskit/lskitcomp --xml has no output 2014-10-20 05:18:19 -04:00
baiyuan 3573ced9eb defect 4301: buildkit -v does not have correct output 2014-10-20 01:53:43 -04:00
ligc 0654fa65e6 fix for bug 2796: should not include AIX perl path in @INC on Linux 2013-10-22 16:58:19 +08:00
huweihua 8ea1539aa2 remove excess debug output 2014-10-21 04:40:02 -04:00
huweihua 3ce3e80a4c add support for Ubuntu14.04.1 in p8 le 2014-10-21 04:34:35 -04:00
huweihua 2959c875ed add support for Ubuntu14.04.1 in p8 le 2014-10-21 04:32:18 -04:00
ligc fd13ae7232 fix for 4260: otherpkgs to add the fix for SL 2013-10-22 15:37:07 +08:00
ligc f474dbd1b9 fix for bug 4260: otherpkgs add /etc/yum.repos.d/xCAT-* for centos 2013-10-22 15:02:48 +08:00
ligc 9b402bb656 fix a problem in the last checkin 2013-10-21 11:11:50 +08:00
ligc e570ed6e49 remoteshell fix for SLES 12 support, sshd is not enabled by default on SLES 12, enable sshd in remoteshell postscript 2013-10-21 11:02:37 +08:00
ligc 57c53ba533 copycds supports sles12 2013-10-15 15:36:23 +08:00
ligc 99e6319765 fix for building genesis-base for PCM on MCP 2013-10-15 09:51:21 +08:00
lissav c631a0107d new fix for 4285 2014-10-13 08:28:55 -04:00
ligc 24f771dbe6 fix rpm packaging problem with xCAT-genesis-scripts 2014-10-13 03:31:06 -04:00
ligc cde6b88011 xCAT-genesis-base: add head, basename, whoami for P8 LE firmware update 2013-10-14 14:47:21 +08:00
daniceexi 088cb897b2 add the dracut_033 dir for stateless support of centos,SL,ol. It's just a dir link to the rh 2014-10-13 06:59:19 -04:00
daniceexi fdfa1fe290 defect 4283: fix the syntax issues in the hosts.pm and NetworkUtils.pm for the code that support multiple domain and makehosts against nics table 2014-10-10 11:13:39 -04:00
baiyuan 037a8db481 fix prep pakage name in kit.conf for Ubuntu 2014-10-10 06:47:03 -04:00
lissav 8ff7a04ee3 defect 4285 2014-10-10 06:38:27 -04:00
lissav 85019012cb Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-10 06:19:42 -04:00
zhaoertao dd636f8108 support firmware update for p8LE 2014-10-10 03:14:52 -07:00
lissav 33213acfae Add --ip to the interface defect 4285 2014-10-10 06:14:05 -04:00
ligc 50d51f4e40 add xfs kernel module and binary for sysclone support on RHEL 7 2013-10-11 17:31:55 +08:00
ligc ae31875596 lsdef -t auditlog may return nothing 2013-10-11 11:44:21 +08:00
Victor Hu 64c3c7c273 missed ~ in =~ in changes from dhcp.pm 2014-10-09 13:38:22 -04:00
Victor Hu 062bc44605 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-09 13:37:49 -04:00
baiyuan 425dbf90ed wrong complete kit path 2014-10-09 03:19:08 -04:00
Victor Hu 9af411c290 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-08 14:24:05 -04:00
Casandra Qiu 5cb4f7a8d9 bug #4081, remove syntax warnings 2014-10-08 13:51:48 -04:00
Victor Hu 1c0f2b5bef clean up formatting of dhpc.pm 2014-10-08 13:33:23 -04:00
Victor Hu e438c2f766 Add check for Ubuntu on Power7 where iso called powerpc 2014-10-08 13:32:24 -04:00
baiyuan ee82fa97b4 add fix debian preinstall script errors 2014-10-08 09:06:52 -04:00
baiyuan 97df5ec9a6 In ubuntu, rpm can be installed, if rpm is installed,ubuntu will use rpm instead of dpkg,so check dpkg first 2014-10-08 04:32:48 -04:00
daniceexi b76e15c487 minor fix for configib 2014-10-08 08:10:51 -04:00
zhaoertao 32d389cbee add message for 'mknb' in ubuntu LE 2014-10-07 23:19:36 -07:00
mellor cc67df3caa minor error msg fixes for kit cmds 2014-10-07 18:03:47 -04:00
mellor f5296e4107 fix def mapping of kitrepo osbasename attribute 2014-10-07 17:47:53 -04:00
mellor e9dd282fdf defect 4282 fix debian preinstall script errors 2014-10-07 14:05:22 -04:00
mellor 590b18a34c defect 4277 - allow gpfs_updates script to create gpfs.csh profile that works for both csh and tcsh 2014-10-06 10:20:45 -04:00
zhaoertao aea40b0226 fix an issue about hardware discovery process: the sub process can not receive findme request immediately 2014-10-04 23:20:48 -07:00
Victor Hu c3f0760164 Bug:3832 - test sles OS before checking dhcpd6 file when ipv6 used, fix formatting 2014-10-01 18:02:46 -04:00
mellor 1d241dedf0 added undocumented flag to buildkit to allow our local build team to create Ubuntu kits on our RH build servers 2014-10-01 15:16:54 -04:00
mellor 3133cbeb3f 1. add xCAT depend on xcat-genesis-scripts, 2. fix mknb issue, 3. modify xcatconfig to call mknb <ppc64/x86_64> 2014-09-29 21:26:52 -07:00
mellor 03c9a17566 Miss xCAT-buildkit in build-ubunturepo 2014-09-29 20:28:05 -07:00
mellor 88003827c9 build xCAT-genesis-scripts for p8LE 2014-09-29 20:25:37 -07:00
mellor 1aa1f30cdc added xCAT-buildkit package to build-ubunturepo 2014-09-29 17:57:23 -04:00
mellor 87840527c2 enhance for p8 hardware discovery 2014-09-26 03:55:57 -07:00
mellor 4e008d7895 enhance for p8 hardware discovery 2014-09-26 03:54:52 -07:00
huweihua e2e8463d64 add test for update delta changes 2014-09-25 22:48:53 -04:00
litingt d0198f8592 add waiting time 2014-09-25 04:39:38 -04:00
litingt 769f05bd91 add time delay 2014-09-25 04:35:31 -04:00
yinle 365b378f4b add check before sending mail to avoid mail warning 2014-09-25 15:31:11 -07:00
yinle 7ab784ea38 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-09-25 15:28:10 -07:00
yinle 5054e01a26 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-09-25 14:52:34 -07:00
ligc 6aabbe5ae2 build xCAT-genesis-scripts for ppc64 2014-09-25 02:22:46 -04:00
ligc af16b12041 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-09-25 02:17:48 -04:00
ligc 0541a3361a add Requires: xCAT-genesis-scripts-ppc64 in xCAT.spec for ppc64 arch 2014-09-25 02:17:35 -04:00
huweihua 641d9bd78a add otherpkgs.pkglist file for rh5 + system x 2014-09-25 02:10:42 -04:00
mellor b06aa3afb0 enhance of creating default netboot configuration file for p8 hardware discovery 2014-09-24 20:23:20 -07:00
ligc 7ae2e3d8f3 change the xCAT-genesis-base version from 2.8 to 2.9 2014-09-24 22:58:51 -04:00
lissav b0eff0cf94 fix build of http://xcat.sourceforge.net/man5/xcatdb.5.html 2014-09-24 07:12:23 -04:00
baiyuan d29aea3c01 add get_latest_version_deb 2014-09-24 06:46:59 -04:00
mellor 08e0ce42f0 correct the default configuration file for p8 hardware discovery 2014-09-24 02:41:55 -07:00
mellor ee1a1574c3 generate default netboot configure file for p8 hardware discovery 2014-09-24 02:38:54 -07:00
baiyuan d8eeeb306b fix dpkg compare version op 2014-09-24 04:19:33 -04:00
daniceexi ac34247aba defect 4726: cold reset bmc for specific firmware in the end of bmcsetup to make bmc take effect. 2014-09-24 03:14:32 -04:00
baiyuan ec61ef27da add metadeb and all support 2014-09-23 22:47:52 -04:00
Jarrod Johnson 4100dd77e4 Add capability for plugins to supply a description in update_tables_with_templates 2014-09-23 10:46:28 -04:00
baiyuan fc8b2cc4eb prep deb support in buildrepo 2014-09-23 06:39:08 -04:00
huweihua 0fa2dbd486 add otherpkgs.pkglist for sysclone on rh6+p, rh7+x, rh7+p 2014-09-23 04:38:37 -04:00
huweihua 7edce8ec57 add pkglist for sysclone on sles 11 and p system 2014-09-23 04:36:31 -04:00
mellor 5576b8b1f4 enhance for finding bootnic in genesis 2014-09-22 20:37:29 -07:00
baiyuan 92d313bb20 change ubu arch in validate_os 2014-09-22 23:11:15 -04:00
mellor f39c0f46a1 enhance for MTM based p8 hardware discovery 2014-09-22 19:11:16 -07:00
lissav 547cbd4217 add xmlapi test cases, they do not need to ship with rpm 2014-09-22 10:28:08 -04:00
baiyuan 25ffc91f0f find latest deb pkg 2014-09-22 04:24:00 -04:00
baiyuan a5dceadccf NEW_kit_addpkgs support debian 2014-09-22 04:09:22 -04:00
mellor 1407d0044e Do clean up things for Power LE hardware discovery 2014-09-19 08:00:13 -07:00
mellor ba706470d0 support rspconfig <node> ip/netmask/gateway for Power LE machine 2014-09-19 07:50:53 -07:00
mellor 61517af5ce remove the lsslp defined pbmc node from the found nodes 2014-09-18 20:01:37 -07:00
baiyuan ec400ad4b4 add pkg1 sample for debian kit to let default buildkit.conf work 2014-09-18 05:35:23 -04:00
immarvin 425f741435 remove temp file fron git 2014-09-18 01:19:02 -07:00
immarvin d12e49efe3 remove temp files in the git 2014-09-18 01:16:33 -07:00
yinle 04f26ded54 minor fix 2014-08-21 10:49:08 -07:00
Jia Zhao e8d48b81e0 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-20 16:56:49 +08:00
Jia Zhao a2332700d5 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-20 16:56:02 +08:00
ligc 68758810b0 fix for xCAT-genesis-builder.spec, can not use /, will cause problem for RHEL 7 2014-08-20 04:55:55 -04:00
Jia Zhao 8ced43ef98 fix long name error during import node 2014-08-20 16:55:10 +08:00
huweihua b383556d34 make mkinitrd support rhels5.x and centos5.x 2014-08-20 04:06:33 -04:00
daniceexi fc55bc9fd7 fix the issue that config alias would remove the original ip on the dev 2014-08-20 08:52:08 -04:00
Jia Zhao 99365ff4a8 add lparid in nodeimport man page 2014-08-20 15:39:25 +08:00
Jia Zhao e1c67b0724 fix no bmc ip while reinstall node 2014-08-20 15:33:29 +08:00
mellor ec38cf3e61 add copycds man pg example for supplemental iso 2014-08-19 07:41:38 -04:00
zhaoertao 2c12505a11 fix bug 4251:nodeset return xnba plugin bug, pid 657 when node mac is not defined 2014-08-19 00:25:42 -07:00
zhaoertao 2a6fe02049 fix bug 4195:rinv returns different content between with and without -x flag 2014-08-18 20:31:55 -07:00
ligc 6a44ddea08 update xcatconfig to call mknb ppc64 on power 2013-09-26 14:51:52 +08:00
ligc d7081292fc fix for 4261: add the getnodesetstat support for grub2 2013-08-29 15:18:48 +08:00
huweihua ef94ee5642 sysclone support p: set target node boot from disk after clone install 2014-08-28 02:21:56 -04:00
ligc 3beec6c8b1 fix two copyright files xCAT-genesis-scripts/debian/copyright and xCAT-OpenStack-baremetal/debian/copyright, should use EPL license 2013-08-29 09:31:54 +08:00
ligc 13b71591e0 add the qlcnic module into genesis-base, it is for Q-Logic 10Gb Virtual Fabric Adaptor NICs, ibm nx360m4 is equipped with this adapter 2013-08-28 16:39:02 +08:00
ligc 5cccca9d1c fix a problem for compiling ppc64 genesis-base 2013-08-28 16:20:01 +08:00
zhaoertao 15cc210445 fix bug 4250 xcat crashes system console on IBM power system: 8248-L4T 2014-08-27 00:50:58 -07:00
ligc 90ed515fb3 support genesis-base on ppc64: use -N with dracut command on ppc64 2013-08-28 11:25:53 +08:00
ligc 9a05a5ea1f fix the file <xxxxdirectory> from install of xCAT-genesis-scripts-ppc64-1:2.9-snap201408210348.noarch conflicts with file from package xCAT-genesis-base-ppc64-1:2.9-snap201408210346.noarch, if the rpms are built on RHEL 7 or Fedora 20 2014-08-26 04:29:01 -04:00
ligc 151409cff9 Compile genesis-base on Fedora ppc64, the ibm virtual disk module is ibmvscsi 2014-08-26 02:36:13 -04:00
Jia Zhao 975b90e619 validate cec and lparid during nodeimport 2014-08-26 14:11:31 +08:00
immarvin 9b5f4e2d05 fix defect #4246 In rhel7/p8 env,sometimes cn provision status is failed. 2014-08-25 21:29:03 -07:00
huweihua f9e77f3ddf add sfdisk command for sysclone support p 2014-08-25 03:26:34 -04:00
huweihua 18a8cdf36a sysclone support p system 2014-08-25 03:23:47 -04:00
huweihua 246f7d1e2b sysclone support p system 2014-08-25 03:15:58 -04:00
huweihua 40f96179a6 only used by sysclone, change the disk by-id name of targer node when deploy it 2014-08-25 03:00:13 -04:00
immarvin 4e9ee2bbdc add kdump support for redhat7 stateless 2014-08-24 22:30:39 -07:00
immarvin a6ca187a16 add kdump support for redhat7 2014-08-24 07:54:52 -07:00
zhaoertao 7fffc07e54 Fix bug 4257: chvm hugepage doesn't work with dfm on Powerlinux 2014-08-22 03:27:41 -07:00
Lei Ai 4753c86b38 merge fix from 2.8 branch: clear currchain while regen chain 2014-08-22 17:01:54 +08:00
mellor 812fc4b3bc man page updates for rewritten getxcatdocs to work with Allura wiki on sourceforge 2014-08-21 19:03:46 -04:00
mellor 77625c7fe9 rewrote getxcatdocs to work with Allura wiki on sourceforge 2014-08-21 16:14:29 -04:00
immarvin 6bfb39fb7d Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-21 02:06:05 -07:00
immarvin d92fc99a3a add template and pkglist of kvm.rhel7 2014-08-21 02:05:18 -07:00
ligc 70668c86a8 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-21 03:44:23 -04:00
ligc 7ae7479c3a support xcat genesis on ppc64: check if the dmidecode exists before run dmidecode 2014-08-21 03:42:12 -04:00
zhaoertao c703748797 remove lowpower option for rpower from Usage 2014-08-21 00:26:37 -07:00
immarvin 79ad455b31 fix defect #4253 [DEV] the substitution bug in post.xcat 2014-08-21 00:08:37 -07:00
immarvin 33fd485628 fulfill the requirement of defect #4242 In physical rhel7 env,set installnic=ethx can not provision compute node. 2014-08-20 23:27:00 -07:00
ligc ac121cabbe support genesis on ppc64, compile on Fedora 20 ppc64 2013-08-22 16:04:33 +08:00
ligc c455d1dbe9 fix for bug 4249: use xCAT::Utils in ddns.pm 2013-08-20 11:02:16 +08:00
daniceexi ea56c3ebee Code change for the support of latest ganglia on ppc64 2014-08-18 10:05:09 -04:00
chenglch 7e90a37681 upgrade ironic baremetal driver for ironic update a abstract class 2014-08-17 22:21:25 -04:00
lissav 4903509b05 fix example 2014-08-14 08:09:21 -04:00
Jarrod Johnson 09ac1b8a27 Add DDR4 SPD decode 2014-08-13 17:00:37 -04:00
immarvin 83baec8526 #4227 Enhance configfirewall script to handle rhel7 firewall rule setting 2014-08-13 00:53:56 -07:00
immarvin 81e86de979 fix defect #4245 In rhels 7 env,setupntp script will show error message 2014-08-12 08:37:20 -07:00
ligc 7be4cc008c add the xCATsn into the PCM build, PCM team requires this 2014-08-12 05:43:54 -04:00
Lei Ai c635c4da8a Merge nodechmac enhance from 2.8 branch 2014-08-12 17:31:24 +08:00
huweihua 2e9cc3742f add --no-bootloader option for si_updateclient command 2014-08-12 04:55:52 -04:00
chudegao 6003b146ae merge getmacs function from 2.8.2-pcm and fix a bug 2014-08-10 22:09:21 +08:00
immarvin 3b194a3815 fix defect #4238 [FVT]: xcat installation on sles gives out /sbin/SuSEfirewall2: line 507: /proc/net/ip_tables_names: No such file or directory 2014-08-09 04:25:16 -07:00
immarvin 2c196c5b63 #4242 In physical rhel7 env,set installnic=ethx can not provision compute node. 2014-08-09 02:22:21 -07:00
immarvin 1f37d0d359 fix defect #4238 [FVT]: xcat installation on sles gives out /sbin/SuSEfirewall2: line 507: /proc/net/ip_tables_names: No such file or directory 2014-08-08 08:56:11 -07:00
immarvin 513c8d0e1b correct a typo 2014-08-07 20:35:57 -07:00
huweihua ce985114c6 add entries for support sysclone on p and LVM 2014-08-07 21:49:12 -04:00
chenglch 2366886fc9 ironic baremetal driver rsetboot net 2014-08-07 05:15:51 -04:00
daniceexi fd1a6dba31 defect 4232: fix1 - support interface named like em5 which is the general format of Ubuntu; fix2 - fix the issue that confignics cannot handle the networks attribute has multiple nets for one nic 2014-08-07 02:38:27 -04:00
yinle 4b7acd5bb1 record more log and adjust format 2014-08-06 14:48:58 -07:00
Jia Zhao 281b0ade7e fix importing node error in rh7 with power8 env 2014-08-06 13:53:15 +08:00
lissav d0ee775708 defect 4230 2014-08-05 07:31:04 -04:00
lissav da17bda0a5 fix comment for changes in 3870 2014-08-05 07:10:44 -04:00
huweihua 19e7c2071d fix bug4218:rscan -w writes wrong mgt for the CECs 2014-08-04 22:03:40 -04:00
324 changed files with 11954 additions and 3488 deletions
+11 -10
View File
@@ -53,7 +53,7 @@ for i in $*; do
done
# Supported distributions
dists="maverick natty oneiric precise saucy trusty"
dists="saucy trusty utopic"
c_flag= # xcat-core (trunk-delvel) path
d_flag= # xcat-dep (trunk) path
@@ -194,12 +194,13 @@ then
if [ ! -d ../../$package_dir_name ];then
mkdir -p "../../$package_dir_name"
fi
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-OpenStack xCAT-OpenStack-baremetal"
#packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-OpenStack xCAT-OpenStack-baremetal xCAT-buildkit"
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT xCATsn xCAT-test xCAT-buildkit"
target_archs=(amd64 ppc64el)
for file in `echo $packages`
do
file_low=`echo $file | tr '[A-Z]' '[a-z]'`
if [ "$file" = "xCAT" ]; then
if [ "$file" = "xCAT" -o "$file" = "xCAT-genesis-scripts" ]; then
target_archs="amd64 ppc64el"
else
target_archs="all"
@@ -208,8 +209,8 @@ then
do
if grep -q $file $update_log || [ "$BUILDALL" == 1 -o "$file" = "perl-xCAT" ]; then
rm -f ../../$package_dir_name/${file_low}_*.$target_arch.deb
#only for genesis package
rm -f ../../$package_dir_name/${file_low}-amd64_*.deb
#genesis scripts package, don't remove genesis amd64 files
#rm -f ../../$package_dir_name/${file_low}-amd64_*.deb
cd $file
dch -v $pkg_version -b -c debian/changelog $build_string
if [ "$target_arch" = "all" ]; then
@@ -262,7 +263,7 @@ then
mkdir conf
for dist in $dists; do
if [ "$dist" = "trusty" ]; then
if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then
tmp_out_arch="amd64 ppc64el"
else
tmp_out_arch="amd64"
@@ -289,7 +290,7 @@ __EOF__
amd_files=`ls ../$package_dir_name/*.deb | grep -v "ppc64el"`
all_files=`ls ../$package_dir_name/*.deb`
for dist in $dists; do
if [ "$dist" = "trusty" ]; then
if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then
deb_files=$all_files
else
deb_files=$amd_files
@@ -382,7 +383,7 @@ then
#create the conf/distributions file
for dist in $dists; do
if [ "$dist" = "trusty" ]; then
if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then
tmp_out_arch="amd64 ppc64el"
else
tmp_out_arch="amd64"
@@ -409,7 +410,7 @@ __EOF__
amd_files=`ls ../debs/*.deb | grep -v "ppc64el"`
all_files=`ls ../debs/*.deb`
for dist in $dists; do
if [ "$dist" = "trusty" ]; then
if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then
deb_files=$all_files
else
deb_files=$amd_files
@@ -444,7 +445,7 @@ __EOF__
chmod -R g+w xcat-dep
#create the tar ball
dep_tar_name=xcat-dep-ubuntu.tar.bz
dep_tar_name=xcat-dep-ubuntu-snap`date +%Y%m%d`.tar.bz
tar -hjcf $dep_tar_name xcat-dep
chgrp root $dep_tar_name
chmod g+w $dep_tar_name
+9 -5
View File
@@ -41,13 +41,15 @@ UPLOADUSER=bp-sawyers
FRS=/home/frs/project/x/xc/xcat
# These are the rpms that should be built for each kind of xcat build
ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-OpenStack xCAT-SoftLayer xCAT-OpenStack-baremetal"
#ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-OpenStack xCAT-SoftLayer xCAT-OpenStack-baremetal"
ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-SoftLayer"
ZVMBUILD="perl-xCAT xCAT-server xCAT-UI"
ZVMLINK="xCAT-client xCAT xCATsn"
# xCAT has PCM specific configuration - conserver-xcat, syslinux-xcat
# xCAT and xCATsn have PCM specific configuration - conserver-xcat, syslinux-xcat
# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
PCMBUILD="xCAT xCAT-server"
PCMLINK="perl-xCAT xCAT-client xCAT-buildkit xCAT-genesis-scripts-x86_64"
# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON)
PCMBUILD="xCAT xCAT-server xCAT-client xCATsn"
PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64"
# Note: for FSM, the FlexCAT rpm is built separately from gsa/git
FSMBUILD="perl-xCAT xCAT-client xCAT-server"
FSMLINK=""
@@ -264,6 +266,8 @@ if [ "$OSNAME" != "AIX" ]; then
ORIGFAILEDRPMS="$FAILEDRPMS"
./makerpm xCAT-genesis-scripts x86_64 "$EMBED"
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS xCAT-genesis-scripts-x86_64"; fi
./makerpm xCAT-genesis-scripts ppc64 "$EMBED"
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS xCAT-genesis-scripts-ppc64"; fi
if [ "$FAILEDRPMS" = "$ORIGFAILEDRPMS" ]; then # all succeeded
rm -f $DESTDIR/xCAT-genesis-scripts*rpm
rm -f $SRCDIR/xCAT-genesis-scripts*rpm
@@ -286,7 +290,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
+2
View File
@@ -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
+1 -1
View File
@@ -266,7 +266,7 @@ See http://www.perl.com/doc/manual/html/pod/perlre.html for information on perl
As of xCAT 2.8.1, you can use a modified version of the regular expression support described in the previous section. You do not need to enter the node information (1st part of the expression), it will be derived from the input nodename. You only need to supply the 2nd part of the expression to determine the value to give the attribute. For examples, see
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Listing_and_Modifying_the_Database#Easy_Regular_expressions
https://sourceforge.net/p/xcat/wiki/Listing_and_Modifying_the_Database/#easy-regular-expressions
=head1 OBJECT DEFINITIONS
+8 -6
View File
@@ -517,12 +517,14 @@ sub getmacs {
$data.= "\n$_\n";
push @$value, "\n$_\n";
} elsif ( /^ent\s+/ || /^hfi-ent\s+/ ) {
my @fields = split /\s+/, $_;
my $mac = $fields[2];
$mac = format_mac( $mac );
$fields[2] = $mac;
$data .= join(" ",@fields)."\n";
push @$value, join(" ",@fields)."\n";
#my @fields = split /\s+/, $_;
#my $mac = $fields[2];
#$mac = format_mac( $mac );
#$fields[2] = $mac;
#$data .= join(" ",@fields)."\n";
#push @$value, join(" ",@fields)."\n";
$data .= "$_\n";
push @$value, "$_\n";
}
}
push @$res,[$node,$data,0];
+63 -16
View File
@@ -206,8 +206,9 @@ sub chvm_parse_args {
# Process command-line arguments
#############################################
if ( !defined( $args )) {
$request->{method} = $cmd;
return( \%opt );
#$request->{method} = $cmd;
#return( \%opt );
return ( usage() );
}
#############################################
# Checks case in GetOptions, allows opts
@@ -422,7 +423,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 +616,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 +640,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
@@ -801,6 +803,19 @@ sub do_op_extra_cmds {
if ($op eq "lparname") {
$action = "set_lpar_name";
} elsif ($op eq "huge_page") {
my @td = @$d;
@td[0] = 0;
my $tmphash = &query_cec_info_actions($request, $name, \@td, 1, ["get_huge_page"]);
if ($tmphash->{huge_page_avail}) {
if ($param > $tmphash->{huge_page_avail}) {
push @values, [$name, "No enough huge pages, only $tmphash->{huge_page_avail} pages available", 0];
$param = $tmphash->{huge_page_avail};
}
$param = "1/$param/$param";
} else {
push @values, [$name, "No huge page available to configure", 0];
next;
}
$action = "set_huge_page";
} elsif ($op eq "vmcpus") {
$action = "part_set_lpar_pending_proc";
@@ -849,6 +864,10 @@ sub do_op_extra_cmds {
my @td = @$d;
@td[0] = 0;
$memhash = &query_cec_info_actions($request, $name, \@td, 1, ["part_get_hyp_process_and_mem"]);
unless (scalar keys(%$memhash)) {
push @values, [$mtms, "Can not get hypervisor information", 1];
next;
}
if (!exists($memhash->{run})) {
if ($param =~ /(\d+)([G|M]?)\/(\d+)([G|M]?)\/(\d+)([G|M]?)/i) {
my $memsize = $memhash->{mem_region_size};
@@ -907,10 +926,16 @@ sub do_op_extra_cmds {
push @values, [$name, "Success", '0'];
}
}
my $rethash = query_cec_info_actions($request, $name, $d, 1, \@query_array);
# need to add update db here
$lpar_hash{$name} = $rethash;
$lpar_hash{$name}->{parent} = @$d[3];
if (@query_array) {
my $rethash = query_cec_info_actions($request, $name, $d, 1, \@query_array);
unless (scalar keys(%$memhash)) {
push @values, [$mtms, "Can not get hypervisor information", 1];
next;
}
# need to add update db here
$lpar_hash{$name} = $rethash;
$lpar_hash{$name}->{parent} = @$d[3];
}
}
}
if (%lpar_hash) {
@@ -1682,7 +1707,7 @@ sub xCATdB {
$profile,
$parent );
return( xCAT::PPCdb::add_ppc( $hwtype, [$values] ));
return( xCAT::PPCdb::add_ppc( $hwtype, [$values],'','',"FSP" ));
}
return undef;
}
@@ -1957,12 +1982,24 @@ sub query_cec_info {
}
my $rethash = query_cec_info_actions($request, $name, $d, $usage, ["part_get_lpar_processing","part_get_lpar_memory","part_get_all_io_bus_info","part_get_all_vio_info","get_huge_page","get_cec_bsr"], \%tmp_hash);
#push @result, [$name, $rethash, 0];
push @result, @$rethash;
#push @result, @$rethash;
if (scalar (@$rethash)) {
push @result, @$rethash;
} else {
push @result, [$name, "No information got", -1];
last;
}
$lpar_hash{$name} = \%tmp_hash;
$lpar_hash{$name}->{parent} = @$d[3];
}
if (@td[0] == 0) {
my $rethash = query_cec_info_actions($request, @td[3],\@td, $usage);
if (scalar (@$rethash)) {
push @result, @$rethash;
} else {
push @result, [@td[3], "No information got", -1];
last;
}
#push @result, [@td[3], $rethash, 0];
push @result, @$rethash;
}
@@ -2238,7 +2275,7 @@ sub mkspeclpar {
return([["Error","Cannot open vm table", 1]]);
}
while (my ($mtms, $h) = each (%$hash)) {
my $memhash;
my $memhash = undef;
my @nodes = keys(%$h);
my $ent = $vmtab->getNodesAttribs(\@nodes, ['cpus', 'memory','physlots', 'othersettings', 'storage', 'nics']);
while (my ($name, $d) = each (%$h)) {
@@ -2247,12 +2284,17 @@ sub mkspeclpar {
last;
}
#if (!exists($memhash->{run}))
{
#{
my @td = @$d;
@td[0] = 0;
$memhash = &query_cec_info_actions($request, $name, \@td, 1, ["part_get_hyp_process_and_mem","lpar_lhea_mac","part_get_all_io_bus_info"]);
unless (scalar keys(%$memhash)) {
push @result, [$mtms, "Can not get hypervisor information", 1];
last;
}
#$memhash->{run} = 1;
}
#}
my $tmp_ent = $ent->{$name}->[0];
if (exists($opt->{vmcpus})) {
$tmp_ent->{cpus} = $opt->{vmcpus};
@@ -2413,6 +2455,10 @@ sub mkspeclpar {
push @result, @$values;
#need to add update db here
my $rethash = query_cec_info_actions($request, $name, $d, 1, ["part_get_lpar_processing","part_get_lpar_memory","part_get_all_vio_info","part_get_all_io_bus_info","get_huge_page","get_cec_bsr"]);
unless (scalar keys(%$rethash)) {
push @result, [$mtms, "Can not get hypervisor information", 1];
next;
}
$lpar_hash{$name} = $rethash;
$lpar_hash{$name}->{parent} = @$d[3];
@@ -2442,8 +2488,9 @@ sub mkfulllpar {
my @td = @$d;
@td[0] = 0;
$rethash = query_cec_info_actions($request, $name, \@td, 1);
if (ref($rethash) ne 'HASH') {
return ([[$mtms, "Cann't get hypervisor info hash", 1]]);
unless (scalar keys(%$rethash)) {
push @result, [$mtms, "Can not get hypervisor information", 1];
next;
}
$rethash->{run} = 1;
#print Dumper($rethash);
+63 -7
View File
@@ -629,7 +629,8 @@ sub get_adap_prop {
$cmd[0] = "\" supported-network-types\" " . $phandle . " get-package-property\r";
$msg[0] = "Status: rc and all supported network types now on stack\n";
#$pattern[0] = "(.*)3 >(.*)";
$pattern[0] = "3 >";
#$pattern[0] = "3 >";
$pattern[0] = "ok";
$newstate[0] = 1;
# state 1, return code and string on stack
@@ -637,7 +638,8 @@ sub get_adap_prop {
$cmd[1] = ".\r";
$msg[1] = "Status: All supported network types now on stack\n";
#$pattern[1] = "(.*)2 >(.*)";
$pattern[1] = "2 >";
#$pattern[1] = "2 >";
$pattern[1] = "ok";
$newstate[1] = 2;
# state 2, data ready to decode
@@ -691,6 +693,16 @@ sub get_adap_prop {
$timeout,
[ qr/$pattern[$state]/i,
sub {
if ($state eq 1) {
if ($rconsole->before() =~ /-\d+/) {
nc_msg($verbose, "Status: Error getting adapter property for phandle=$phandle.\n");
$state = 7;
$rconsole->clear_accum();
$rc = 1;
return 1;
}
}
nc_msg($verbose, $msg[$state]);
$state = $newstate[$state];
$rconsole->clear_accum();
@@ -878,6 +890,15 @@ sub get_mac_addr {
$timeout,
[qr/$pattern[$state]/=>
sub {
if ($state eq 1) {
if ($rconsole->before() =~ /-\d+/) {
nc_msg($verbose, "Status: Error getting MAC address for phandle=$phandle.\n");
$rconsole->clear_accum();
$state = 4;
$rc = 1;
return undef;
}
}
nc_msg($verbose, $msg[$state]);
$state = $newstate[$state];
$rconsole->clear_accum();
@@ -1019,7 +1040,8 @@ sub get_mac_addr {
$cmd[0] = "\" ibm,loc-code\" $phandle get-package-property\r";
$msg[0] = "Status: return code and loc-code now on stack\n";
#$pattern[0] = "(.*)3 >(.*)";
$pattern[0] = "3 >";
#$pattern[0] = "3 >";
$pattern[0] = "ok";
$newstate[0] = 1;
# cmd(1) is a dot (.). This is a stack manipulation command that removes one
@@ -1052,6 +1074,16 @@ sub get_mac_addr {
$timeout,
[qr/$pattern[$state]/=>
sub {
if ($state eq 1) {
if ($rconsole->before() =~ /-\d+/) {
nc_msg($verbose, "Status: Error getting adapter location for phandle=$phandle.");
$rconsole->clear_accum();
$state = 3;
$rc = 1;
return undef;
}
}
nc_msg($verbose, $msg[$state]);
$rconsole->clear_accum();
$state = $newstate[$state];
@@ -1125,10 +1157,19 @@ sub get_mac_addr {
return undef if ($rc eq 1);
}
# Did we find one or more adapters?
if ($result[3] =~ /(\w*):(.*):(\w*\.\w*\.\w*):/) {
$loc_code = $3;
}else {
my @loc_array = split /\n/,$result[3];
my $found = 0;
$loc_code = '';
foreach my $line ( @loc_array ) {
if ($line =~ /(\w*):(.*):([\w|\.|-]*):/) {
$loc_code .= $3;
$found = 1;
}
}
if ($found) {
$loc_code =~ s/\.$//;
return $loc_code;
} else {
return undef;
}
}
@@ -3006,6 +3047,21 @@ sub lparnetbootexp
$device_type = "physical";
}
if (defined($mac_address)) {
my @newmacs = ();
my @allmacs = split /\|/,$mac_address;
if ( !xCAT::Utils->isAIX() ) {
foreach my $mac_a ( @allmacs ) {
$mac_a = lc($mac_a);
$mac_a =~ s/(\w{2})/$1:/g;
$mac_a =~ s/:$//;
push @newmacs, $mac_a;
}
$mac_address = join("|",@newmacs);
}
}
if($colon) {
nc_msg($verbose, "$adap_type[$i]\:$loc_code\:$mac_address\:$full_path_name_array[$i]\:$ping_result\:$device_type\:\:\:\:\n");
$outputarrayindex++;
+37 -23
View File
@@ -138,8 +138,9 @@ This program module file, supports the xcat messaging and logging
N - Node informational goes to STDOUT
S - Message will be logged to syslog ( severe error)
Note S can be combined with other flags for example
SE logs message to syslog and is sent to STDERR.
SA logs message to syslog and to the auditlog DB table
SE logs message to syslog and is sent to STDERR.
SA logs message to syslog and to the auditlog DB table. (only xcatd)
A logs message auditlog DB table only. (only for xcatd)
V - verbose. This flag is not valid, the calling routine
should check for verbose mode before calling the message
@@ -175,7 +176,7 @@ This program module file, supports the xcat messaging and logging
# Message to Syslog
xCAT::MsgUtils->message('S', "Host $host not responding\n");
# Message to Syslog and auditlog table
# Message to Syslog and auditlog table (only used by xcatd)
# see tabdump -d auditlog
my $rsp = {};
$rsp->{syslogdata}->[0] = "$host not responding\n"; # for syslog
@@ -189,6 +190,18 @@ This program module file, supports the xcat messaging and logging
$rsp->{status} -> [0] = $status;
xCAT::MsgUtils->message('SA', $rsp);
# Message to only auditlog table (only used by xcatd)
# see tabdump -d auditlog
my $rsp = {};
$rsp->{userid} ->[0] = $user;
$rsp->{clientname} -> [0] = $client;
$rsp->{clienttype} -> [0] = $clienttype;
$rsp->{command} -> [0] = $command;
$rsp->{noderange} -> [0] = $noderange;
$rsp->{args} -> [0] = $arguments;
$rsp->{status} -> [0] = $status;
xCAT::MsgUtils->message('A', $rsp);
# Message to Log and Syslog
xCAT::MsgUtils->message('LS', "Host $host not responding\n");
@@ -197,44 +210,44 @@ This program module file, supports the xcat messaging and logging
Use with callback
# Message to callback
my $rsp = {};
my $rsp = {};
$rsp->{data}->[0] = "Job did not run. \n";
xCAT::MsgUtils->message("D", $rsp, $::CALLBACK);
my $rsp = {};
my $rsp = {};
$rsp->{error}->[0] = "No hosts in node list\n";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
my $rsp = {};
$rsp->{node}->[0]->{name}->[0] ="mynode";
$rsp->{node}->[0]->{data}->[0] ="mydata";
xCAT::MsgUtils->message("N", $rsp, $callback);
my $rsp = {};
$rsp->{node}->[0]->{name}->[0] ="mynode";
$rsp->{node}->[0]->{data}->[0] ="mydata";
xCAT::MsgUtils->message("N", $rsp, $callback);
my $rsp = {};
my $rsp = {};
$rsp->{info}->[0] = "No hosts in node list\n";
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
my $rsp = {};
my $rsp = {};
$rsp->{sinfo}->[0] = "No hosts in node list\n";
xCAT::MsgUtils->message("IS", $rsp, $::CALLBACK);
my $rsp = {};
my $rsp = {};
$rsp->{warning}->[0] = "No hosts in node list\n";
xCAT::MsgUtils->message("W", $rsp, $::CALLBACK);
my $rsp = {};
my $rsp = {};
$rsp->{error}->[0] = "Host not responding\n";
xCAT::MsgUtils->message("S", $rsp, $::CALLBACK);
# Message to Syslog and callback
my $rsp = {};
my $rsp = {};
$rsp->{error}->[0] = "Host not responding\n";
xCAT::MsgUtils->message("SE", $rsp, $::CALLBACK);
# Message to Syslog and callback
my $rsp = {};
my $rsp = {};
$rsp->{info}->[0] = "Host not responding\n";
xCAT::MsgUtils->message("SI", $rsp, $::CALLBACK);
@@ -274,17 +287,19 @@ sub message
my $call_back = shift; # optional
my $exitcode = shift; # optional
# should be I,IS, D, E, S, SA ,LS, W , L,N
# should be I,IS, D, E, S, SA,A ,LS, W , L,N
# or S(I, D, E, S, W, L,N)
#
# if new SA option need to split syslog messages from auditlog entry
# if SA option need to split syslog messages from auditlog entry
#
my $newrsp;
if ($sev eq 'SA')
{ # if SA then need to pull first entry from $rsp
# for syslog, to preserve old interface
if (($sev eq 'SA') || ($sev eq 'A'))
{ # if SA ( syslog and auditlog) or A ( only auditlog)then need to pull first entry from $rsp
# for syslog, to preserve old interface
$newrsp = $rsp;
if ($sev eq 'SA'){ # syslog and auditlog
$rsp = $newrsp->{syslogdata}->[0];
}
}
my $stdouterrf = \*STDOUT;
my $stdouterrd = '';
@@ -449,11 +464,10 @@ sub message
}
}
# is syslog requested
# is syslog option requested
if ($sev =~ /S/)
{
# If they want this msg to also go to syslog, do that now
eval {
openlog("xCAT", "nofatal,pid", "local4");
@@ -474,7 +488,7 @@ sub message
# if write to auditlog table requested, if not on service node
if (xCAT::Utils->isMN()){
if ($sev eq 'SA')
if (($sev eq 'SA') || ($sev eq 'A'))
{
require xCAT::Table;
my $auditlogentry;
+16 -9
View File
@@ -69,14 +69,14 @@ This program module file, is a set of network utilities used by xCAT commands.
#-------------------------------------------------------------------------------
sub getNodeDomains()
{
my $class = shift;
my $class = shift;
my $nodes = shift;
my @nodelist = @$nodes;
my %nodedomains;
# Get the network info for each node
my %nethash = xCAT::DBobjUtils->getNetwkInfo(\@nodelist);
my %nethash = xCAT::DBobjUtils->getNetwkInfo(\@nodelist);
# get the site domain value
my @domains = xCAT::TableUtils->get_site_attribute("domain");
@@ -85,12 +85,13 @@ sub getNodeDomains()
# for each node - set hash value to network domain or default
# to site domain
foreach my $node (@nodelist) {
if ($nethash{$node}{domain}) {
$nodedomains{$node} = $nethash{$node}{domain};
} else {
$nodedomains{$node} = $sitedomain;
}
}
unless (defined($node)) {next;}
if (defined($nethash{$node}) && $nethash{$node}{domain}) {
$nodedomains{$node} = $nethash{$node}{domain};
} else {
$nodedomains{$node} = $sitedomain;
}
}
return \%nodedomains;
}
@@ -2181,7 +2182,13 @@ sub pingNodeStatus {
foreach (@mon_nodes) {
$deadnodes{$_}=1;
}
open (NMAP, "nmap -PE --system-dns --send-ip -sP ". $nodes . " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
# get additional options from site table
my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions");
my $more_options = $nmap_options[0];
#call namp
open (NMAP, "nmap -PE --system-dns --send-ip -sP $more_options ". $nodes . " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
my $node;
while (<NMAP>) {
if (/Host (.*) \(.*\) appears to be up/) {
+1 -5
View File
@@ -311,9 +311,6 @@ sub notify {
my ($modname, $path, $suffix) = fileparse($_, ".pm");
# print "modname=$modname, path=$path, suffix=$suffix\n";
if ($suffix =~ /.pm/) { #it is a perl module
my $pid;
if ($pid=xCAT::Utils->xfork()) { }
elsif (defined($pid)) {
my $fname;
if (($path eq "") || ($path eq ".\/")) {
#default path is /opt/xcat/lib/perl/xCAT_monitoring/ if there is no path specified
@@ -328,8 +325,7 @@ sub notify {
else {
${"xCAT_monitoring::".$modname."::"}{processTableChanges}->($action, $tablename, $old_data, $new_data);
}
exit 0;
}
return 0;
}
else { #it is a command
my $pid;
+8 -2
View File
@@ -75,6 +75,7 @@ sub add_ppc {
my $values = shift;
my $not_overwrite = shift;
my $otherinterfaces = shift;
my $callfile = shift;
my @tabs = qw(ppc vpd nodehm nodelist nodetype hosts mac);
my %db = ();
###################################
@@ -119,7 +120,12 @@ sub add_ppc {
# Specify CEC and Frame's mgt as fsp and bpa
if ( $type =~ /^cec$/) {
$mgt = "fsp";
if ( $callfile eq "PPC" ) {
$mgt = "hmc";
}
if ( $callfile eq "FSP" ) {
$mgt = "fsp";
}
}
if ( $type =~ /^frame$/) {
$mgt = "bpa";
@@ -320,7 +326,7 @@ sub update_lpar {
}
}
if (defined($write)) {
&add_ppc($hwtype, \@write_list);
&add_ppc($hwtype, \@write_list,'','',"FSP");
return ([@update_list,@write_list]);
} else {
foreach ( @tabs ) {
+7 -3
View File
@@ -14,7 +14,7 @@ use xCAT::Usage;
use xCAT::NodeRange;
use xCAT::DBobjUtils;
use xCAT::FSPUtils;
use xCAT::TableUtils qw(get_site_Master);
use xCAT::TableUtils;
%::QUERY_ATTRS = (
'savingstatus' => 1,
'dsavingstatus' => 1,
@@ -223,7 +223,6 @@ sub renergy {
my ($node, $attrs) = %$nodehash;
my $cec_name = @$attrs[2];
my $hw_type = @$attrs[4];
if (!$cec_name) {
return ([[$node, "ERROR: Cannot find the cec name, check the attributes: vpd.serial, vpd.mtm.", 1]]);
@@ -295,7 +294,12 @@ sub renergy {
foreach (@hcps_ip) {
$deadnodes{$_}=1;
}
open (NMAP, "nmap -PE --system-dns --send-ip -sP ". join(' ',@hcps_ip) . " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
# get additional options from site table
my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions");
my $more_options = $nmap_options[0];
open (NMAP, "nmap -PE --system-dns --send-ip -sP $more_options ". join(' ',@hcps_ip) . " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
my $node;
while (<NMAP>) {
#print "$_\n";
+37 -10
View File
@@ -555,6 +555,9 @@ sub getmacs {
} else {
$type = "virtualio";
}
if ($mac_addr) {
$mac_addr = format_mac($mac_addr);
}
my %att = ();
$att{'MAC_Address'} = ($mac_addr) ? $mac_addr : "N/A";
@@ -627,9 +630,9 @@ sub getmacs {
}
foreach ( @$value ) {
if ( /^#\s?Type/ ) {
$data.= "\n$_\n";
$data.= "\n$_\n";
} else {
$data.= format_mac( $_ );
$data.= "$_\n";
}
}
@@ -756,7 +759,7 @@ sub getmacs {
if ( /^#\s?Type/ ) {
$data.= "\n$_\n";
} elsif ( /^ent\s+/ or /^hfi-ent\s+/ ) {
$data.= format_mac( $_ );
$data.= "$_\n";
}
}
#####################################
@@ -801,10 +804,8 @@ sub cal_mac {
##########################################################################
sub format_mac {
my $data = shift;
my $mac = shift;
$data =~ /^(\S+\s+\S+\s+)(\S+)(\s+.*)$/;
my $mac = $2;
#####################################
# Get adapter mac
#####################################
@@ -813,6 +814,10 @@ sub format_mac {
if ( !xCAT::Utils->isAIX() ) {
foreach my $mac_a ( @macs ) {
if (&checkmac($mac_a)) {
push @newmacs, $mac_a;
next;
}
#################################
# Delineate MAC with colons
#################################
@@ -821,14 +826,30 @@ sub format_mac {
$mac_a =~ s/:$//;
push @newmacs, $mac_a;
}
my $newmac = join("|",@newmacs);
$data =~ s/$mac/$newmac/;
$mac = join("|",@newmacs);
}
return( "$data\n" );
return( "$mac\n" );
}
##########################################################################
# checkmac format
##########################################################################
sub checkmac {
my $mac = shift;
if ( !xCAT::Utils->isAIX()) {
if ($mac =~ /\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2}/) {
return 1;
} else {
return 0;
}
} else {
return 1;
}
}
##########################################################################
# Write first valid adapter MAC to database
@@ -847,6 +868,9 @@ sub writemac {
# Find first valid adapter
#####################################
foreach ( @$data ) {
unless (&checkmac($_)) {
next;
}
if ( /^ent\s+/ or /^hfi-ent\s+/ ) {
$value = $_;
#####################################
@@ -869,6 +893,9 @@ sub writemac {
#####################################
if ( $pingret ne "successful" ) {
foreach ( @$data ) {
unless (&checkmac($_)) {
next;
}
if ( /^ent\s+/ or /^hfi-ent\s+/ ) {
$value = $_;
$ping_test = 0;
@@ -890,7 +917,7 @@ sub writemac {
#####################################
# Get adapter mac
#####################################
$value = format_mac( $value );
#$value = format_mac( $value );
@fields = split /\s+/, $value;
$mac = $fields[2];
+1 -1
View File
@@ -411,7 +411,7 @@ sub format_output {
# Strip errors for results
#######################################
my @val = grep( !/^#.*: ERROR /, @$values );
xCAT::PPCdb::add_ppc( $hwtype, \@val );
xCAT::PPCdb::add_ppc( $hwtype, \@val ,'','',"PPC");
}
###########################################
+1 -1
View File
@@ -1913,7 +1913,7 @@ sub xCATdB {
$profile,
$parent );
return( xCAT::PPCdb::add_ppc( $hwtype, [$values] ));
return( xCAT::PPCdb::add_ppc( $hwtype, [$values],'','',"PPC" ));
}
return undef;
}
+118 -8
View File
@@ -653,6 +653,39 @@ sub get_all_cecs
}
}
#-------------------------------------------------------------------------------
=head3 get_all_lparids
Description : Get all LPAR ids in system.
Arguments : ref of all cecs
Returns : ref for LPAR ids hash.
Example :
my $arrayref = xCAT::ProfiledNodeUtils->get_all_lparids(\%allcecs);
=cut
#-------------------------------------------------------------------------------
sub get_all_lparids
{
my $class= shift;
my $cecsref = shift;
my %allcecs = %$cecsref;
my %lparids;
my $ppctab = xCAT::Table->new('ppc');
foreach my $cec (keys %allcecs) {
my @ids = $ppctab->getAllAttribsWhere("hcp = '$cec'", 'id');
foreach (@ids) {
if ( $_->{'id'} ){
$lparids{$cec}{$_->{'id'}} = 0;
}
}
}
$ppctab->close();
return \%lparids;
}
#-------------------------------------------------------------------------------
=head3 is_discover_started
@@ -690,6 +723,7 @@ sub get_nodes_profiles
{
my $class = shift;
my $nodelistref = shift;
my $groupnamemode = shift;
my %profile_dict;
my $nodelisttab = xCAT::Table->new('nodelist');
@@ -709,8 +743,12 @@ sub get_nodes_profiles
if ( $idx == 2 ){
# The group string will like @NetworkProfile_<profile name>
# So, index should +3, 2 for '__', 1 for _.
my $append_index = length($profile) + 3;
$profile_dict{$_}{$profile} = substr $group, $append_index;
if ($groupnamemode) {
$profile_dict{$_}{$profile} = $group;
} else{
my $append_index = length($profile) + 3;
$profile_dict{$_}{$profile} = substr $group, $append_index;
}
last;
}
}
@@ -739,7 +777,7 @@ sub get_imageprofile_prov_method
my $nodetypestab = xCAT::Table->new('nodetype');
my $entry = ($nodetypestab->getAllAttribsWhere("node = '$imgprofilename'", 'ALL' ))[0];
my $osimgname = $entry->{'provmethod'};
return $entry->{'provmethod'};
#my $osimgtab = xCAT::Table->new('osimage');
#my $osimgentry = ($osimgtab->getAllAttribsWhere("imagename = '$osimgname'", 'ALL' ))[0];
@@ -800,13 +838,10 @@ sub check_profile_consistent{
}
}
# Profile consistent keys, arch=>netboot, mgt=>nictype
my %profile_dict = ('x86' => 'xnba','x86_64' => 'xnba', 'ppc64' => 'yaboot',
'fsp' => 'FSP', 'ipmi' => 'BMC');
# Get Imageprofile arch
my $nodetypetab = xCAT::Table->new('nodetype');
my $nodetypeentry = $nodetypetab->getNodeAttribs($imageprofile, ['arch']);
my $nodetypeentry = $nodetypetab->getNodeAttribs($imageprofile, ['os','arch']);
my $os = $nodetypeentry->{'os'};
my $arch = $nodetypeentry->{'arch'};
$nodetypetab->close();
@@ -847,6 +882,14 @@ sub check_profile_consistent{
return 0, "Provisioning network not defined for network profile."
}
# 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');
# 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."
@@ -1144,3 +1187,70 @@ sub check_nicips{
return (0, \%nics_hash, "");
}
#-------------------------------------------------------------------------------
=head3 gen_chain_for_profiles
Description: Generate a chain string based on Network/Hardware/Image profiles.
Arguments: $profiles_hash: The reference for profiles hash.
For example:
$profiles_hash = { 'HardwareProfile' => 'IBM_NeXtScale_M4',
'ImageProfile' => 'rhels6.5-x86_64-stateful-compute',
'NetworkProfile' => 'default_network_profile',
}
$hw_reconfig: the flag shows whether we need re-configure all hardware
relative settings or not: like runcmds, runimg...etc
Returns: ($retcode, $chain)
$retcode = 1. Generate chain failed, $chain stands for error message.
$retcode = 0. Generate chain OK. $chain stands for the chain string.
=cut
#-------------------------------------------------------------------------------
sub gen_chain_for_profiles{
my $class = shift;
my $profiles_hashref = shift;
my $hw_reconfig = shift;
my $final_chain = "";
if (! $profiles_hashref){
return (1, "Missing parameter for gen_chain_for_profiles.");
}
# A node must have at least imageprofile and network profile.
unless (defined $profiles_hashref->{'ImageProfile'}){
return (1, "No imageprofile specified in profiles hash.");
}
unless (defined $profiles_hashref->{'NetworkProfile'}){
return (1, "No networkprofile specified in profiles hash.");
}
my $hwprofile = $profiles_hashref->{'HardwareProfile'};
my $imgprofile = $profiles_hashref->{'ImageProfile'};
my $netprofile = $profiles_hashref->{'NetworkProfile'};
# Get node's provisioning method
my $provmethod = xCAT::ProfiledNodeUtils->get_imageprofile_prov_method($imgprofile);
unless ($provmethod ){
return (1, "Can not get provisioning method for image profile $imgprofile");
}
my $netprofileattr = xCAT::ProfiledNodeUtils->get_nodes_nic_attrs([$netprofile])->{$netprofile};
unless ($netprofileattr){
return (1, "Can not get attributes for network profile $netprofile");
}
$final_chain = 'osimage='.$provmethod.":--noupdateinitrd";
# get the chain attribute from hardwareprofile and insert it to node.
if (defined $hwprofile and $hwprofile and $hw_reconfig){
my $chaintab = xCAT::Table->new('chain');
my $chain = $chaintab->getNodeAttribs($hwprofile, ['chain']);
if (exists $chain->{'chain'}) {
my $hw_chain = $chain->{'chain'};
$final_chain = $hw_chain.',osimage='.$provmethod.":--noupdateinitrd";
}
}
#run bmcsetups.
if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig){
if (index($final_chain, "runcmd=bmcsetup") == -1){
$final_chain = 'runcmd=bmcsetup,'.$final_chain.':reboot4deploy';
}
else{
$final_chain = $final_chain.':reboot4deploy';
}
}
return (0, $final_chain);
}
+3
View File
@@ -116,6 +116,9 @@ sub dodiscover {
send_message($args{reqcallback}, 0, "The rarge is too large and may be time consuming. Broadcast is recommended.");
}
}
#no need to check site.nmapoptions because it specifilly
# uses T5 for certain performance requirement.
`/usr/bin/nmap $range -sn -PE -n --send-ip -T5 `;
my $nmapres = `/usr/bin/nmap $range -PE -p 427 -n --send-ip -T5 `;
foreach my $line (split(/\n\n/,$nmapres)) {
+68 -10
View File
@@ -650,7 +650,8 @@ sub decode_spd {
8 => "DDR2 SDRAM",
9 => "DDR2 SDRAM FB-DIMM",
10 => "DDR2 SDRAM FB-DIMM PROBE",
11 => "DDR3 SDRAM"
11 => "DDR3 SDRAM",
12 => "DDR4 SDRAM",
);
my %modtypes = (
@@ -668,33 +669,35 @@ sub decode_spd {
1333 => 10600,
1600 => 12800,
1867 => 14900,
2132 => 17000,
2133 => 17000,
2134 => 17000,
);
my %ddr3modcap = (
my %ddrmodcap = (
0 => 256,
1 => 512,
2 => 1024,
3 => 2048,
4 => 4096,
5 => 8192,
6 => 16384
6 => 16384,
7 => 32768,
);
my %ddr3devwidth = (
my %ddrdevwidth = (
0 => 4,
1 => 8,
2 => 16,
3 => 32
);
my %ddr3ranks = (
my %ddrranks = (
0 => 1,
1 => 2,
2 => 3,
3 => 4
);
my %ddr3buswidth = (
my %ddrbuswidth = (
0 => 8,
1 => 16,
2 => 32,
@@ -728,10 +731,10 @@ sub decode_spd {
$rethash->{product}->{name} .= " ECC";
}
$rethash->{product}->{name}.=" ".$modtypes{$spd[3]&0x0f};
my $sdramcap=$ddr3modcap{$spd[4]&0xf};
my $buswidth=$ddr3buswidth{$spd[8]&0b111};
my $sdramwidth=$ddr3devwidth{$spd[7]&0b111};
my $ranks = $ddr3ranks{($spd[7]&0b111000)>>3};
my $sdramcap=$ddrmodcap{$spd[4]&0xf};
my $buswidth=$ddrbuswidth{$spd[8]&0b111};
my $sdramwidth=$ddrdevwidth{$spd[7]&0b111};
my $ranks = $ddrranks{($spd[7]&0b111000)>>3};
my $capacity = $sdramcap/8*$buswidth/$sdramwidth*$ranks;
@@ -769,6 +772,61 @@ sub decode_spd {
# $rawspd .= sprintf("%02X ",$_);
#}
#push @{$rethash->{product}->{extra}},$rawspd;
} elsif ($spd[2] == 12) { #DDR4 spec applies
# spd[125] spd[18] spd[18is sdram min cycle time .. spd125 is fine offset for min time
# mtb and ftb are fixed in ddr4 spd spec.. mtb is always 0.125 ns and ftb is always 0.001 ns
my $speed;
my $clock;
if ($spd[17] == 0) {
my $fineoffset = $spd[125];
if ($fineoffset & 0b10000000) {
#negative value, twos complement
$fineoffset = 0-(($fineoffset ^ 0xff) + 1);
}
$clock = int(2/((0.125*$spd[18] + $fineoffset*0.001)*0.001));
$speed = $speedfromclock{$clock};
unless ($speed) { $speed = "UNKNOWN"; }
} else { # this would mean a different MTB and FTB than spec indicated..
$clock = "UNKNOWN";
$speed = "UNKNOWN";
}
$rethash->{product}->{name}="PC4-".$speed." ($clock MT/s)";
if ($spd[13]&0b11000 == 0b1000) {
$rethash->{product}->{name} .= " ECC";
}
$rethash->{product}->{name}.=" ".$modtypes{$spd[3]&0x0f};
my $sdramcap=$ddrmodcap{$spd[4]&0xf};
my $buswidth=$ddrbuswidth{$spd[13]&0b111};
my $sdramwidth=$ddrdevwidth{$spd[12]&0b111};
my $ranks = $ddrranks{($spd[12]&0b111000)>>3};
my $capacity = $sdramcap/8*$buswidth/$sdramwidth*$ranks;
if ($capacity < 1024) {
$capacity = $capacity."MB";
} else {
$capacity = ($capacity/1024)."GB";
}
$rethash->{product}->{name} = $capacity." ".$rethash->{product}->{name};
$rethash->{product}->{manufacturer} = decode_manufacturer($spd[320],$spd[321]);
$rethash->{product}->{buildlocation} = sprintf("%02x",$spd[322]);
if ($spd[120] != 0 or $spd[121] != 0) {
$rethash->{product}->{builddate} = sprintf("Week %x of 20%02x",$spd[323],$spd[324]);
}
foreach (@spd[329..348]) {
if ($_ > 126 or $_ < 32) {
$rethash->{product}->{model}="Malformed SPD";
}
}
unless ($rethash->{product}->{model}) {
$rethash->{product}->{model}=pack("C*",@spd[329..348]);
}
#my $rawspd="SPD Dump: ";
#foreach (@spd) {
# $rawspd .= sprintf("%02X ",$_);
#}
#push @{$rethash->{product}->{extra}},$rawspd;
} else {
$rethash->{product}->{model}="Unrecognized SPD";
}
+38 -5
View File
@@ -728,7 +728,7 @@ osimage => {
description => 'OS Image Description',
provmethod => 'The provisioning method for node deployment. The valid values are install, netboot,statelite,boottarget,dualboot,sysclone. If boottarget is set, you must set linuximage.boottarget to the name of the boottarget definition. It is not used by AIX.',
rootfstype => 'The filesystem type for the rootfs is used when the provmethod is statelite. The valid values are nfs or ramdisk. The default value is nfs',
osdistroname => 'The name of the OS distro definition. This attribute can be used to specify which OS distro to use, instead of using the osname,osvers,and osarch attributes.',
osdistroname => 'The name of the OS distro definition. This attribute can be used to specify which OS distro to use, instead of using the osname,osvers,and osarch attributes. For *kit commands, the attribute will be used to read the osdistro table for the osname, osvers, and osarch attributes. If defined, the osname, osvers, and osarch attributes defined in the osimage table will be ignored.',
osupdatename => 'A comma-separated list of OS distro updates to apply to this osimage.',
cfmdir => 'CFM directory name for PCM. Set to /install/osimages/<osimage name>/cfmdir by PCM. ',
profile => 'The node usage category. For example compute, service.',
@@ -924,8 +924,11 @@ site => {
" -----------------\n".
"DATABASE ATTRIBUTES\n".
" -----------------\n".
" auditnosyslog: If set to 1, then commands will only be written to the auditlog table.\n".
" This attribute set to 1 and auditskipcmds=ALL means no logging of commands.\n".
" Default is to write to both the auditlog table and syslog.\n".
" auditskipcmds: List of commands and/or client types that will not be\n".
" written to the auditlog table.\n".
" written to the auditlog table and syslog. See auditnosyslog.\n".
" 'ALL' means all cmds will be skipped. If attribute is null, all\n".
" commands will be written.\n".
" clienttype:web would skip all commands from the web client\n".
@@ -943,6 +946,7 @@ site => {
" nodestatus: If set to 'n', the nodelist.status column will not be updated during\n".
" the node deployment, node discovery and power operations. The default is to update.\n\n".
" skiptables: Comma separated list of tables to be skipped by dumpxCATdb\n\n".
" skipvalidatelog: If set to 1, then getcredentials and getpostscripts calls will not be logged in syslog.\n\n".
" -------------\n".
"DHCP ATTRIBUTES\n".
" -------------\n".
@@ -991,6 +995,16 @@ site => {
" dnsupdaters: The value are \',\' separated string which will be added to the zone config\n".
" section. This is an interface for user to add configuration entries to\n".
" the zone sections in named.conf.\n\n".
" dnsinterfaces: The network interfaces DNS server should listen on. If it is the same\n".
" for all nodes, use a simple comma-separated list of NICs. To\n".
" specify different NICs for different nodes:\n".
" xcatmn|eth1,eth2;service|bond0.\n".
" In this example xcatmn is the name of the xCAT MN, and DNS there\n".
" should listen on eth1 and eth2. On all of the nodes in group\n".
" 'service' DNS should listen on the bond0 nic.\n".
" NOTE: if using this attribute to block certain interfaces, make sure\n".
" the ip maps to your hostname of xCAT MN is not blocked since xCAT needs to\n".
" use this ip to communicate with the local NDS server on MN.\n\n".
" -------------------------\n".
"HARDWARE CONTROL ATTRIBUTES\n".
" -------------------------\n".
@@ -1118,6 +1132,13 @@ site => {
" httpport: The port number that the booting/installing nodes should contact the\n".
" http server on the MN/SN on. It is your responsibility to configure\n".
" the http server to listen on that port - xCAT will not do that.\n\n".
" nmapoptions: Additional options for the nmap command. nmap is used in pping, \n".
" nodestat, xdsh -v and updatenode commands. Sometimes additional \n".
" performance tuning may be needed for nmap due to network traffic.\n".
" For example, if the network response time is too slow, nmap may not\n".
" give stable output. You can increase the timeout value by specifying \n".
" '--min-rtt-timeout 1s'. xCAT will append the options defined here to \n".
" the nmap command.\n\n".
" ntpservers: A comma delimited list of NTP servers for the cluster - often the\n".
" xCAT management node.\n\n".
" svloglocal: if set to 1, syslog on the service node will not get forwarded to the\n".
@@ -1557,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',
@@ -3613,6 +3634,10 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
tabentry => 'kit.kitdeployparams',
access_tabentry => 'kit.kitname=attr:kitname',
},
{attr_name => 'kitdir',
tabentry => 'kit.kitdir',
access_tabentry => 'kit.kitname=attr:kitname',
},
);
#############################
@@ -3629,8 +3654,8 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
tabentry => 'kitrepo.kitname',
access_tabentry => 'kitrepo.kitreponame=attr:kitreponame',
},
{attr_name => 'osname',
tabentry => 'kitrepo.osname',
{attr_name => 'osbasename',
tabentry => 'kitrepo.osbasename',
access_tabentry => 'kitrepo.kitreponame=attr:kitreponame',
},
{attr_name => 'osmajorversion',
@@ -3698,6 +3723,10 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
tabentry => 'kitcomponent.kitpkgdeps',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'prerequisite',
tabentry => 'kitcomponent.prerequisite',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'driverpacks',
tabentry => 'kitcomponent.driverpacks',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
@@ -3710,6 +3739,10 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
tabentry => 'kitcomponent.postbootscripts',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'genimage_postinstall',
tabentry => 'kitcomponent.genimage_postinstall',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'exlist',
tabentry => 'kitcomponent.exlist',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
+2 -6
View File
@@ -10,12 +10,8 @@ BEGIN
# if AIX - make sure we include perl 5.8.2 in INC path.
# Needed to find perl dependencies shipped in deps tarball.
if ($^O =~ /^aix/i) {
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
use lib "/usr/opt/perl5/lib/5.8.2";
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
}
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
}
use lib "$::XCATROOT/lib/perl";
use strict;
#-----------------------------------------------------------------------------
+9 -1
View File
@@ -179,6 +179,10 @@ sub init_dbworker {
#setup signal in NotifHandler so that the cache can be updated
xCAT::NotifHandler::setup($$, 0);
# NOTE: There's a bug that sometimes the %SIG is cleaned up by accident, but we cannot figure out when and why
# this happens. The temporary fix is to backup the %SIG and recover it when necessary.
my %SIGbakup = %SIG;
while (not $exitdbthread) {
eval {
my @ready_socks = $clientset->can_read;
@@ -191,6 +195,7 @@ sub init_dbworker {
} else {
eval {
handle_dbc_conn($currcon,$clientset);
unless (%SIG && defined ($SIG{USR1})) { %SIG = %SIGbakup; }
};
if ($@) {
my $err=$@;
@@ -215,6 +220,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;
@@ -3834,7 +3842,7 @@ sub writeAllEntries
}
my $filename = shift;
my $fh;
my $rc;
my $rc = 0;
# open the file for write
unless (open($fh," > $filename")) {
my $msg="Unable to open $filename for write \n.";
+2 -5
View File
@@ -10,11 +10,8 @@ BEGIN
# if AIX - make sure we include perl 5.8.2 in INC path.
# Needed to find perl dependencies shipped in deps tarball.
if ($^O =~ /^aix/i) {
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
use lib "/usr/opt/perl5/lib/5.8.2";
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
}
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
}
use lib "$::XCATROOT/lib/perl";
use strict;
+1 -1
View File
@@ -33,7 +33,7 @@ my %usage = (
LPAR(with HMC) specific:
rpower <noderange> [on|off|reset|stat|state|boot|of|sms|softoff]
CEC(using Direct FSP Management) specific:
rpower <noderange> [on|onstandby|off|stat|state|lowpower|resetsp]
rpower <noderange> [on|onstandby|off|stat|state|resetsp]
Frame(using Direct FSP Management) specific:
rpower <noderange> [stat|state|rackstandby|exit_rackstandby|resetsp]
LPAR(using Direct FSP Management) specific:
+321 -4
View File
@@ -2162,7 +2162,72 @@ sub osver
my $line = '';
my @lines;
my $relfile;
if (-f "/etc/redhat-release")
if (-f "/etc/os-release"){
my $version;
my $version_id;
my $id;
my $id_like;
my $name;
my $prettyname;
my $verrel;
if (open($relfile,"<","/etc/os-release")) {
my @text = <$relfile>;
close($relfile);
chomp(@text);
#print Dumper(\@text);
foreach my $line (@text){
if($line =~ /^\s*VERSION=\"?([0-9\.]+).*/){
$version=$1;
}
if($line =~ /^\s*VERSION_ID=\"?([0-9\.]+).*/){
$version_id=$1;
}
if($line =~ /^\s*ID=\"?([0-9a-z\_\-\.]+).*/){
$id=$1;
}
if($line =~ /^\s*ID_LIKE=\"?([0-9a-z\_\-\.]+).*/){
$id_like=$1;
}
if($line =~ /^\s*NAME=\"?(.*)/){
$name=$1;
}
if($line =~ /^\s*PRETTY_NAME=\"?(.*)/){
$prettyname=$1;
}
}
}
$os=$id;
if (!$os and $id_like) {
$os=$id_like;
}
$verrel=$version;
if (!$verrel and $version_id) {
$verrel=$version_id;
}
if(!$name and $prettyname){
$name=$prettyname;
}
if($os =~ /rhel/ and $name =~ /Server/i){
$os="rhels";
}
if($verrel =~ /([0-9]+)\.?(.*)/) {
$ver=$1;
$rel=$2;
}
# print "$ver -- $rel";
}
elsif (-f "/etc/redhat-release")
{
open($relfile,"<","/etc/redhat-release");
$line = <$relfile>;
@@ -2269,8 +2334,10 @@ sub osver
close($relfile);
}
}
#print "xxxx $type === $rel \n";
if ( $type and $type =~ /all/ ) {
if ( $rel ) {
if ( $rel ne "") {
# print "xxx $os-$ver-$rel \n";
return( "$os" . "," . "$ver" . ".$rel" );
} else {
return( "$os" . "," . "$ver" );
@@ -3569,7 +3636,97 @@ sub gettimezone
}
1;
#--------------------------------------------------------------------------------
=head3 specialservicemgr
some special services cannot be processed in sysVinit, upstart and systemd framework, should be process here...
Arguments:
service name:
action: start/stop/restart/status/enable/disable
outputoption:
1: return a hashref with the keys:"retcode","retmsg"
otherwise: return retcode only
Returns:
a hashref if $outputoption is 1,the hash structure is:
{"retcode"=>(status code, 0 for running/active,1 for stopped/inactive,2 for failed)
"retmsg" =>(status string, running/active/stopped/inactive/failed)
}
the status code otherwise
retcode: 127 if the service specified is not processed
the exit code of the service operation if the service specified is processed
Globals:
none
Error:
none
Example:
my $ret=xCAT::Utils->specialservicemgr("firewall","start");
Comments:
none
=cut
#--------------------------------------------------------------------------------
sub specialservicemgr{
my $svcname=shift;
my $action=shift;
my $outputoption=shift;
my %ret;
$ret{retcode}=127;
if($svcname eq "firewall")
{
my $cmd="type -P SuSEfirewall2 >/dev/null 2>&1";
xCAT::Utils->runcmd($cmd,-1);
if($::RUNCMD_RC)
{
$ret{retcode}=127;
if(defined $outputoption and $outputoption == 1){
return \%ret;
}else{
return $ret{retcode};
}
}else{
if(($action eq "start") || ($action eq "stop"))
{
$cmd="SuSEfirewall2 $action";
}elsif($action eq "restart"){
$cmd="SuSEfirewall2 stop;SuSEfirewall2 start";
}elsif($action eq "disable"){
$cmd="SuSEfirewall2 off";
}elsif($action eq "enable"){
$cmd="SuSEfirewall2 on";
}elsif($action eq "status"){
$cmd="service SuSEfirewall2_setup status";
}else{
$ret{retcode}=127;
if(defined $outputoption and $outputoption == 1){
return \%ret;
}else{
return $ret{retcode};
}
}
$ret{retmsg}=xCAT::Utils->runcmd($cmd,-1);
$ret{retcode}= $::RUNCMD_RC;
if(defined $outputoption and $outputoption == 1){
return \%ret;
}else{
return $ret{retcode};
}
}
}
if(defined $outputoption and $outputoption == 1){
return \%ret;
}else{
return $ret{retcode};
}
}
#--------------------------------------------------------------------------------
@@ -3623,7 +3780,7 @@ sub servicemap{
"nfs" => ["nfsserver","nfs-server","nfs","nfs-kernel-server"],
"named" => ["named","bind9"],
"syslog" => ["syslog","syslogd","rsyslog"],
"firewall" => ["iptables","firewalld","SuSEfirewall2_setup","ufw"],
"firewall" => ["iptables","firewalld","ufw"],
"http" => ["apache2","httpd"],
"ntpserver" =>["ntpd","ntp"],
"mysql" => ["mysqld","mysql"],
@@ -3690,6 +3847,13 @@ sub startservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"start");
if($retval != 127)
{
return $retval;
}
my $cmd="";
#for Systemd
my $svcunit=undef;
@@ -3754,6 +3918,16 @@ sub stopservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"stop");
if($retval != 127)
{
return $retval;
}
my $cmd="";
my $svcunit=undef;
my $svcd=undef;
@@ -3816,6 +3990,14 @@ sub restartservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"restart");
if($retval != 127)
{
return $retval;
}
my $cmd="";
my $svcunit=undef;
my $svcd=undef;
@@ -3886,6 +4068,18 @@ sub checkservicestatus{
my $outputoption=shift;
my $retval;
$retval=specialservicemgr($svcname,"status",1);
if($retval->{retcode} != 127)
{
if(defined $outputoption and $outputoption == 1 ){
return $retval;
}elsif(exists $retval->{retcode}){
return $retval->{retcode};
}
}
my $cmd="";
my $svcunit=undef;
my $svcd=undef;
@@ -3979,6 +4173,16 @@ sub enableservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"enable");
if($retval != 127)
{
return $retval;
}
my $cmd="";
my $svcunit=undef;
my $svcd=undef;
@@ -4045,6 +4249,17 @@ sub disableservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"disable");
if($retval != 127)
{
return $retval;
}
my $cmd="";
my $svcunit=undef;
my $svcjob=undef;
@@ -4084,4 +4299,106 @@ sub disableservice{
xCAT::Utils->runcmd($cmd, -1);
return $::RUNCMD_RC;
}
sub cleanup_for_powerLE_hardware_discovery {
my $host_node = shift;
if( $host_node =~ /xCAT::Utils/)
{
$host_node=shift;
}
my $pbmc_node = shift;
my $subreq = shift;
my $ipmitab = xCAT::Table->new("ipmi");
unless($ipmitab) {
xCAT::MsgUtils->message("S", "Discovery Error: can not open ipmi table.");
return;
}
my @nodes = ($host_node, $pbmc_node);
my $ipmihash = $ipmitab->getNodesAttribs(\@nodes, ['node', 'bmc', 'username', 'password']);
if ($ipmihash) {
my $new_bmc_ip = $ipmihash->{$host_node}->[0]->{bmc};
my $new_bmc_password = $ipmihash->{$host_node}->[0]->{password};
xCAT::MsgUtils->message("S", "Discovery info: configure password for pbmc_node:$pbmc_node.");
`rspconfig $pbmc_node password=$new_bmc_password`;
#if ($new_bmc_password) {
# xCAT::Utils->runxcmd(
# {
# command => ["rspconfig"],
# node => ["$pbmc_node"],
# arg => [ "password=$new_bmc_password" ],
# },
# $subreq, 0,1);
# if ($::RUNCMD_RC != 0) {
# xCAT::MsgUtils->message("S", "Discovery Error: configure password failed for FSP.");
# return;
# }
#}
xCAT::MsgUtils->message("S", "Discover info: configure ip:$new_bmc_ip for pbmc_node:$pbmc_node.");
`rspconfig $pbmc_node ip=$new_bmc_ip`;
#if($new_bmc_ip) {
# xCAT::Utils->runxcmd(
# {
# command => ["rspconfig"],
# node => ["$pbmc_node"],
# arg => [ "ip=$new_bmc_ip" ],
# },
# $subreq, 0,1);
# if ($::RUNCMD_RC != 0) {
# xCAT::MsgUtils->message("S", "Discovery Error: configure IP address failed for FSP.");
# return;
# }
#}
xCAT::MsgUtils->message("S", "Discovery info: remove pbmc_node:$pbmc_node.");
`rmdef $pbmc_node`;
#xCAT::Utils->runxcmd(
# {
# command => ["rmdef"],
# node => ["$pbmc_node"],
# },
# $subreq, 0,1);
}
}
#The parseMacTabEntry parses the mac table entry and return the mac address of nic in management network
#Arguments:
#macString : the string of mac table entry
#HostName : the hostname of the node
#The mac address is taken as installnic when:
#1. the mac addr does not have a suffix "!xxxx"
#2. the mac addr has a fuffix "!<the node name in xcat nodelist table>"
#The schema description of mac table is:
# mac: The mac address or addresses for which xCAT will manage static bindings for this node.
#This may be simply a mac address, which would be bound to the node name (such as "01:02:03:04:05:0E").
#This may also be a "|" delimited string of "mac address!hostname" format (such as "01:02:03:04:05:0E!node5|01:02:03:05:0F!node6-eth1").
sub parseMacTabEntry{
my $macString=shift;
if( $macString =~ /xCAT::Utils/)
{
$macString=shift;
}
my $HostName=shift;
my $mac_ret;
my @macEntry=split(/\|/,$macString);
foreach my $mac_t (@macEntry){
if($mac_t =~ /!/){
if($mac_t =~ /(.+)!$HostName$/){
$mac_ret=$1;
}
}else{
$mac_ret=$mac_t;
}
}
return $mac_ret;
}
1;
+4
View File
@@ -67,12 +67,15 @@ require Exporter;
"1359576196.686790" => "rhels6.4", #ppc64
"1384196515.415715" => "rhels6.5", #x86_64
"1384198011.520581" => "rhels6.5", #ppc64
"1411733344.627228" => "rhels6.6", #x86_64
"1411733344.616389" => "rhels6.6", #ppc64
"1285193176.593806" => "rhelhpc6", #x86_64
"1305067719.718814" => "rhelhpc6.1",#x86_64
"1321545261.599847" => "rhelhpc6.2",#x86_64
"1339640148.070971" => "rhelhpc6.3",#x86_64
"1359576195.413831" => "rhelhpc6.4",#x86_64, RHEL ComputeNode
"1384196516.465862" => "rhelhpc6.5",#x86_64, RHEL ComputeNode
"1411733344.599861" => "rhelhpc6.6",#x86_64, RHEL ComputeNode
"1399449226.140088" => "rhelhpc7.0",#x86_64, RHEL ComputeNode
"1194015916.783841" => "fedora8",
"1194015385.299901" => "fedora8",
@@ -97,6 +100,7 @@ require Exporter;
"1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install
"1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM
"1413749127.352649" => "pkvm2.1.1", # ppc64, PowerKVM
);
my %numdiscs = (
"1156364963.862322" => 4,
@@ -103,7 +103,7 @@ else # assume Linux
fi
if [ ! -e $gpfsprofile.sh ]; then
echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh
echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
echo 'setenv PATH ${PATH}:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
# Turn off LANG support since we did not install other msg catalogs
echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh
echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh
+85 -35
View File
@@ -1,38 +1,88 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: xcat-openstack-baremetal
Source: <url://example.com>
Eclipse Public License - v 1.0
Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
License: <special license>
<Put the license of the package here indented by 1 space>
<This follows the format of Description: lines in control file>
.
<Including paragraphs>
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2014 root <root@unknown>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
1. DEFINITIONS
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
"Contribution" means:
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
"Contributor" means any person or entity that distributes the Program.
"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
"Program" means the Contributions distributed in accordance with this Agreement.
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
3. REQUIREMENTS
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
a) it complies with the terms and conditions of this Agreement; and
b) its license agreement:
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
When the Program is made available in source code form:
a) it must be made available under this Agreement; and
b) a copy of this Agreement must be included with each copy of the Program.
Contributors may not remove or alter any copyright notices contained within the Program.
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. GENERAL
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-2
View File
@@ -1,2 +0,0 @@
xcat-openstack-baremetal_2.8.4-1_all.deb admin extra
xcat-openstack-baremetal_2.8.4-1_all.deb admin extra
@@ -1,201 +0,0 @@
dh_installdirs
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
@@ -67,6 +67,13 @@ CONF.register_opts(pxe_opts, group='pxe')
CONF.register_opts(xcat_opts, group='xcat')
CONF.import_opt('use_ipv6', 'ironic.netconf')
REQUIRED_PROPERTIES = {
'pxe_deploy_kernel': _("UUID (from Glance) of the deployment kernel. "
"Required."),
'pxe_deploy_ramdisk': _("UUID (from Glance) of the ramdisk that is "
"mounted at boot time. Required."),
}
COMMON_PROPERTIES = REQUIRED_PROPERTIES
EM_SEMAPHORE = 'xcat_pxe'
def _check_for_missing_params(info_dict, param_prefix=''):
@@ -173,6 +180,8 @@ def _validate_glance_image(ctx, deploy_info):
class PXEDeploy(base.DeployInterface):
"""PXE Deploy Interface: just a stub until the real driver is ported."""
def get_properties(self):
return COMMON_PROPERTIES
def validate(self, task):
"""Validate the deployment information for the task's node.
@@ -34,8 +34,22 @@ CONF.import_opt('min_command_interval',
LOG = logging.getLogger(__name__)
VALID_BOOT_DEVICES = ['net', 'hd', 'cd', 'floppy', 'def', 'stat']
VALID_PRIV_LEVELS = ['ADMINISTRATOR', 'CALLBACK', 'OPERATOR', 'USER']
REQUIRED_PROPERTIES = {
'ipmi_address': _("IP address or hostname of the node. Required.")
}
OPTIONAL_PROPERTIES = {
'ipmi_password': _("password. Optional."),
'ipmi_priv_level': _("privilege level; default is ADMINISTRATOR. One of "
"%s. Optional.") % ', '.join(VALID_PRIV_LEVELS),
'ipmi_username': _("username; default is NULL user. Optional.")
}
COMMON_PROPERTIES = REQUIRED_PROPERTIES.copy()
COMMON_PROPERTIES.update(OPTIONAL_PROPERTIES)
CONSOLE_PROPERTIES = {
'ipmi_terminal_port': _("node's UDP port to connect to. Only required for "
"console access.")
}
TIMING_SUPPORT = None
@@ -298,6 +312,8 @@ class XcatPower(base.PowerInterface):
driver=self.__class__.__name__,
reason="Unable to locate usable xcat command in "
"the system path when checking xcat version")
def get_properties(self):
return COMMON_PROPERTIES
def validate(self, task):
"""Validate driver_info for xcat driver.
@@ -365,59 +381,6 @@ class XcatPower(base.PowerInterface):
if state != states.POWER_ON:
raise exception.PowerStateFailure(pstate=states.POWER_ON)
class VendorPassthru(base.VendorInterface):
@task_manager.require_exclusive_lock
def _set_boot_device(self, task, device, persistent=False):
"""Set the boot device for a node.
:param task: a TaskManager instance.
:param device: Boot device. One of [net, hd, cd, floppy, def, stat].
:param persistent: Whether to set next-boot, or make the change
permanent. Default: False.
:raises: InvalidParameterValue if an invalid boot device is specified
or if required ipmi parameters are missing.
:raises: IPMIFailure on an error from ipmitool.
"""
if device not in VALID_BOOT_DEVICES:
raise exception.InvalidParameterValue(_(
"Invalid boot device %s specified.") % device)
cmd = "rsetboot"
if persistent:
cmd = cmd + " options=persistent"
driver_info = _parse_driver_info(task.node)
try:
xcat_util.exec_xcatcmd(driver_info, cmd, device)
# TODO(deva): validate (out, err) and add unit test for failure
except xcat_exception.xCATCmdFailure:
LOG.error(_("rsetboot %(node)s %(device)s"),{'node':driver_info['xcat_node]'],
'device':device})
def validate(self, task, **kwargs):
""" run chdef command to config xcat node infomation """
method = kwargs['method']
if method == 'set_boot_device':
device = kwargs.get('device')
if device not in VALID_BOOT_DEVICES:
raise exception.InvalidParameterValue(_(
"Invalid boot device %s specified.") % device)
else:
raise exception.InvalidParameterValue(_(
"Unsupported method (%s) passed to xcat driver.")
% method)
driver_info = _parse_driver_info(task.node)
chdef_node(driver_info)
def vendor_passthru(self, task, **kwargs):
method = kwargs['method']
if method == 'set_boot_device':
return self._set_boot_device(
task,
kwargs.get('device'),
kwargs.get('persistent', False))
class IPMIShellinaboxConsole(base.ConsoleInterface):
"""A ConsoleInterface that uses ipmitool and shellinabox."""
@@ -429,6 +392,8 @@ class IPMIShellinaboxConsole(base.ConsoleInterface):
driver=self.__class__.__name__,
reason="Unable to locate usable xcat command in "
"the system path when checking xcat version")
def get_properties(self):
return COMMON_PROPERTIES
def validate(self, task):
"""Validate the Node console info.
@@ -23,8 +23,5 @@ class XCATBaremetalDriver(base.BaseDriver):
self.power = xcat_rpower.XcatPower()
self.console = ipmitool.IPMIShellinaboxConsole()
self.deploy = xcat_pxe.PXEDeploy()
self.pxe_vendor = pxe.VendorPassthru()
self.ipmi_vendor = ipmitool.VendorPassthru()
self.mapping = {'pass_deploy_info': self.pxe_vendor,
'set_boot_device': self.ipmi_vendor}
self.vendor = utils.MixinVendorInterface(self.mapping)
self.management = ipmitool.IPMIManagement()
self.vendor = pxe.VendorPassthru()
@@ -24,7 +24,24 @@ packages =
[entry_points]
ironic.drivers =
pxe_xcat = ironic.drivers.xcat:XCATBaremetalDriver
agent_ipmitool = ironic.drivers.agent:AgentAndIPMIToolDriver
agent_pyghmi = ironic.drivers.agent:AgentAndIPMINativeDriver
agent_ssh = ironic.drivers.agent:AgentAndSSHDriver
fake = ironic.drivers.fake:FakeDriver
fake_agent = ironic.drivers.fake:FakeAgentDriver
fake_iboot = ironic.drivers.fake:FakeIBootDriver
fake_ipminative = ironic.drivers.fake:FakeIPMINativeDriver
fake_ipmitool = ironic.drivers.fake:FakeIPMIToolDriver
fake_pxe = ironic.drivers.fake:FakePXEDriver
fake_seamicro = ironic.drivers.fake:FakeSeaMicroDriver
fake_ssh = ironic.drivers.fake:FakeSSHDriver
ilo = ironic.drivers.ilo:IloDriver
pxe_iboot = ironic.drivers.pxe:PXEAndIBootDriver
pxe_ipminative = ironic.drivers.pxe:PXEAndIPMINativeDriver
pxe_ipmitool = ironic.drivers.pxe:PXEAndIPMIToolDriver
pxe_seamicro = ironic.drivers.pxe:PXEAndSeaMicroDriver
pxe_ssh = ironic.drivers.pxe:PXEAndSSHDriver
pxe_xcat = ironic.drivers.xcat:XCATBaremetalDriver
[pbr]
autodoc_index_modules = True
+42 -16
View File
@@ -63,26 +63,50 @@ sub addKernelParms {
# get node ip and add it to the kernel parms
my ($nic, $ip, $netmask, $network, $broadcast, $gateway, $mac) = getNodeIpInfo($args);
if (!$ip) { die "Error: could not find the NIC that would connect to the xCAT mgmt node's IP (".$args->{mnip}.").\n"; }
# if we are booting genesis, need to add the BOOTIF parm
my $bootif;
#if (defined($PROVMETHOD) && $PROVMETHOD eq 'sysclone') {
if ($args->{kernelpath} =~ m/genesis\.kernel\.x86_64/) {
$bootif = $mac;
# genesis case, add additional parms for sysclone or nodeset shell
my $bootif = $mac;
$bootif =~ s/:/-/g;
$bootif = "BOOTIF=01-$bootif";
}
#todo: if you are running genesis shell (nodeset <node> shell), this if-else will depend on the nodeset done before that.
# really should check for currstate=shell, or something like that
if (defined($PROVMETHOD) && $PROVMETHOD eq 'sysclone') {
# add additional parms for sysclone
# DEVICE=eth0 IPADDR=10.0.0.99 NETMASK=255.255.255.0 NETWORK=10.0.0.0 BROADCAST=10.0.0.255 GATEWAY=10.0.0.1 GATEWAYDEV=eth0
#todo: should we also add ETHER_SLEEP=$WAITTIME textmode=1 dns=$mnip ?
$args->{kernelparms} .= " $bootif IPADDR=$ip NETMASK=$netmask NETWORK=$network BROADCAST=$broadcast GATEWAY=$gateway HOSTNAME=$nodename DEVICE=$nic GATEWAYDEV=$nic";
}
else { # scripted install
#todo: the parameters for kickstart are likely different
$args->{kernelparms} .= " $bootif hostip=$ip netmask=$netmask gateway=$gateway dns=$mnip hostname=$nodename netdevice=$nic netwait=$WAITTIME textmode=1";
# print Dumper($args->{kernelparms})
else { # scripted install (kickstart or autoyast)
if ($args->{kernelparms} =~ m/autoyast=/) { # sles
# if site.managedaddressmode=static is set, it will put several of these kernel parms on there for us. Do not duplicate in that case.
if ($args->{kernelparms} !~ m/ hostip=/) { $args->{kernelparms} .= " hostip=$ip"; }
if ($args->{kernelparms} !~ m/ netmask=/) { $args->{kernelparms} .= " netmask=$netmask"; }
if ($args->{kernelparms} !~ m/ gateway=/) { $args->{kernelparms} .= " gateway=$gateway"; }
if ($args->{kernelparms} !~ m/ hostname=/) { $args->{kernelparms} .= " hostname=$nodename"; }
if ($args->{kernelparms} !~ m/ dns=/) { $args->{kernelparms} .= " dns=$mnip"; }
# If they set installnic=mac (recommended), the netdevice will already be set to the mac.
# If they explicitly set installnic=<nic>, then ksdevice will be set to that and we will not disturb it here.
# Otherwise add netdevice set to the nic we calculated it should be.
if ($args->{kernelparms} !~ m/ netdevice=/) { $args->{kernelparms} .= " netdevice=$nic"; }
$args->{kernelparms} .= " netwait=$WAITTIME textmode=1";
# print Dumper($args->{kernelparms})
}
elsif ($args->{kernelparms} =~ m/ks=/) { # rhel/centos
# See https://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-kickstart2-startinginstall.html
# and http://fedoraproject.org/wiki/Anaconda/NetworkIssues for description of kickstart kernel parms
# if site.managedaddressmode=static is set, it will put several of these kernel parms on there for us. Do not duplicate in that case.
if ($args->{kernelparms} !~ m/ ip=/) { $args->{kernelparms} .= " ip=$ip"; }
if ($args->{kernelparms} !~ m/ netmask=/) { $args->{kernelparms} .= " netmask=$netmask"; }
if ($args->{kernelparms} !~ m/ gateway=/) { $args->{kernelparms} .= " gateway=$gateway"; }
if ($args->{kernelparms} !~ m/ hostname=/) { $args->{kernelparms} .= " hostname=$nodename"; }
if ($args->{kernelparms} !~ m/ dns=/) { $args->{kernelparms} .= " dns=$mnip"; }
# If they set installnic=mac (recommended), the ksdevice will already be set to the mac.
# If they explicitly set installnic=<nic>, then ksdevice will be set to that and we will not disturb it here.
# Otherwise ksdevice will be set to bootif, and we change it to the nic we calculated it should be.
if ($args->{kernelparms} =~ m/ ksdevice=bootif/) { $args->{kernelparms} =~ s/ ksdevice=bootif/ ksdevice=$nic/; }
elsif ($args->{kernelparms} !~ m/ ksdevice=/) { $args->{kernelparms} .= " ksdevice=$nic"; }
$args->{kernelparms} .= " nicdelay=$WAITTIME linksleep=$WAITTIME textmode=1";
# print Dumper($args->{kernelparms})
}
else { die "Error: for scripted installs, only support SLES or RHEL/CentOS as the target OS.\n"; }
}
}
@@ -134,8 +158,10 @@ sub getNodeIpInfo {
# so if we are on centos right now, we need to count down to determine the number that sles
# will give the nic that we have selected, because it is the sles naming that we care about,
# because that is the initrd that will be running in the scripted install case.
# For the sysclone case, genesis doxcat should be changed to use the mac to find the nic.
if (isRedhat()) {
# This works similarly (at least in some case) when rhel is the target OS.
# The preferred way is for the user to set installnic=mac, then we do not need to run this code.
# For the sysclone case, genesis doxcat uses the mac to find the nic.
if (isRedhat() && $args->{kernelparms} !~ m/ ksdevice=\S*:/ && $args->{kernelparms} !~ m/ netdevice=\S*:/) {
my @nics = grep(m/^\d+:\s+eth/, @output);
my $i = 0;
foreach my $line (@nics) {
@@ -143,8 +169,8 @@ sub getNodeIpInfo {
if (defined($nictmp) && $nictmp eq $realnic) { $realnic = "eth$i"; last; } # got ip, we are done
$i++;
}
print "Determined that SLES/RHEL will call the install NIC $realnic (it has mac $mac)\n";
}
print "Determined that SLES will call the install NIC $realnic (it has mac $mac)\n";
# finally, find the gateway
my $gateway;
+18 -9
View File
@@ -4,7 +4,7 @@
# even across vlans (w/o setting up pxe/dhcp broadcast relay). This assumes a working
# OS is on the node. This script is primarily meant to be used in the softlayer environment.
#todo: site attr for using static ip?
#todo: work with site.managedaddressmode=static for sles
use strict;
use Getopt::Long;
@@ -19,12 +19,12 @@ my $NOAUTOINST;
my $usage = sub {
my $exitcode = shift @_;
print "Usage: pushinitrd [-?|-h|--help] [-v|--verbose] [--dryrun] [-w <waittime>] <noderange>\n\n";
print "Usage: pushinitrd [-?|-h|--help] [-v|--verbose] [--dryrun] [-w <waittime>] [--noautoinst] <noderange>\n\n";
if (!$exitcode) {
print "Copy the initrd, kernel, params, and static IP info to nodes, so they can net install\n";
print "even across vlans (w/o setting up pxe/dhcp broadcast relay). This assumes a working\n";
print "OS is on the node, that you've run nodeset for these nodes, and that all of the nodes\n";
print "are using the same osimage.\n";
print "in this noderange are using the same osimage.\n";
}
exit $exitcode;
};
@@ -48,7 +48,7 @@ updateGrubOnNodes($noderange, \%bootparms);
if ($DRYRUN) { exit(0); }
if ($bootparms{osimageprovmethod} eq 'install' && !$NOAUTOINST) { modifyAutoinstFiles($noderange, \%bootparms); }
if ($bootparms{osimageprovmethod} eq 'install' && $bootparms{osimageosvers}=~ m/^sles/ && !$NOAUTOINST) { modifyAutoinstFiles($noderange, \%bootparms); }
if ($bootparms{osimageprovmethod} eq 'sysclone') { copySyscloneFiles(); }
@@ -77,11 +77,20 @@ sub getBootParms {
$bootparms{kcmdline} =~ s|/install/autoinst/\S+|/install/autoinst/<nodename>|;
# from the nodes provmethod, get the osimage provmethod, so we know the type of install
@output = runcmd("lsdef -t osimage $bootparms{provmethod} -ci provmethod");
chomp($output[0]);
if ($output[0] =~ m/^Could not find/) { die "Error: provmethod $bootparms{provmethod} is set for the node, but there is no osimage definition by that name."; }
my ($junk, $provmethod) = split(/=/, $output[0]);
$bootparms{osimageprovmethod} = $provmethod;
@output = runcmd("lsdef -t osimage $bootparms{provmethod} -ci provmethod,osvers");
foreach my $line (@output) {
chomp($line);
if ($line =~ m/^Could not find/) { die "Error: provmethod $bootparms{provmethod} is set for the node, but there is no osimage definition by that name."; }
if ($line =~ m/ provmethod=/) {
my ($junk, $provmethod) = split(/=/, $line);
$bootparms{osimageprovmethod} = $provmethod;
}
if ($line =~ m/ osvers=/) {
my ($junk, $osvers) = split(/=/, $line);
$bootparms{osimageosvers} = $osvers;
}
}
#print "provmethod=$bootparms{osimageprovmethod}, osvers=$bootparms{osimageosvers}\n"; exit;
# get the mgmt node cluster-facing ip addr
@output = runcmd('lsdef -t site -ci master');
-248
View File
@@ -1,248 +0,0 @@
#!/usr/bin/perl
# xCAT postscript for configuring bonding of nics.
# Usage: configbond bond1 eth1 [eth3]
#
# Note: this postscript currently has some assumptions that are specific to the softlayer environment.
# We only use this to configure bond1, because bond0 gets configured by the node provisioning process.
# (altho this script would work for bond0)
use strict;
# Check number of args
my $nargs = $#ARGV + 1;
if (scalar(@ARGV) < 2 || scalar(@ARGV) > 3) {
system("logger -t xcat -p local4.err 'Usage: configbond <bond> <dev0> [<dev1>]'");
exit 1;
}
my $bond = shift(@ARGV);
my $nic = $ARGV[0];
my @devs;
foreach my $a (@ARGV) { push(@devs,split('@',$a)); } # support the new syntax in the xcat configbond postscript
my $nicips = $ENV{NICIPS};
my $nicnetworks = $ENV{NICNETWORKS};
my $net_cnt = $ENV{NETWORKS_LINES};
#todo: change this script so they dont need to specify nicnetworks
if (!$nicips || !$nicnetworks) { system("logger -t xcat -p local4.err 'configbond: must specify attributes nicips and nicnetworks in the xcat db for this node.'"); exit 1; }
#todo: these are specific to softlayer. They should be another attribute or argument
my $bondingopts = 'mode=4 miimon=100 downdelay=0 updelay=0 lacp_rate=fast xmit_hash_policy=1';
my $netmask ='';
my $ipaddr = '';
my $nic_num = '';
my $subnet = '';
my $nic_net = '';
my $net_name = '';
my @nic_nets = (); # array of networks for this nic
my @nic_ips =(); # array of ipaddresses for this nic
my @networks = (); # array of all networks from networks table.
# { network_name, subnet, netmask }
system("logger -t xcat -p local4.err 'configbond: Master: $bond'");
system("logger -t xcat -p local4.err 'configbond: Slaves: @devs'");
#system("logger -t xcat -p local4.err 'configbond: NIC: $nic'");
system("logger -t xcat -p local4.err 'configbond: NICNETWORKS: $nicnetworks'");
system("logger -t xcat -p local4.err 'configbond: NICIPS: $nicips'");
# Update modprobe
my $file = "/etc/modprobe.d/$bond.conf";
if (!open(FILE, ">$file")) { system("logger -t xcat -p local4.err 'configbond: cannot open $file.'"); exit 1; }
print FILE "alias $bond bonding\n";
# the bonding options are put in the ifcfg file instead
#print FILE "options $bond mode=balance-rr miimon=100\n";
close FILE;
# create array of network info. Needed in case where there are
# more than one ip address per nic and shouldn't be many networks.
my $net_info;
my $cnt = 1;
while ( $cnt <= $net_cnt ) {
$net_info = $ENV{"NETWORKS_LINE$cnt"};
$net_info =~ /^netname=([^\|]*)\|\|/;
$net_name = $1;
$net_info =~ /net=([^\|]*)\|\|/;
$subnet = $1;
$net_info =~ /mask=([^\|]*)\|\|/;
$netmask = $1;
push @{ $networks[$cnt-1] }, ($net_name, $subnet, $netmask);
$cnt +=1;
}
# get network or networks for this nic from NICNETWORKS:
# eth0:1_0_0_0-255_255_0_0|network2,eth1:1_1_0_0
# create array of networks for this nic
foreach my $nic_networks (split(/,/,$nicnetworks)) {
my @net = ();
if ( $nic_networks =~ /!/ ) {
@net = split(/!/,$nic_networks);
} else {
@net = split(/:/,$nic_networks);
}
if ($net[0] eq $nic) {
@nic_nets = split(/\|/,$net[1]);
last;
}
}
# get all nic ipaddress from $nicips: i.e. eth0:1.0.0.1|2.0.0.1,eth1:1.1.1.1
# Then get all ips for this specific nic, i.e. eth0.
foreach my $ips (split(/,/,$nicips)) {
my @ip = ();
if ( $ips =~ /!/ ) {
@ip = split(/!/,$ips);
} else {
@ip = split(/:/,$ips);
}
if ($ip[0] eq $nic ) {
@nic_ips = split(/\|/,$ip[1]);
}
}
my $i;
for ($i=0; $i < (scalar @nic_ips) ; $i++ ) {
# Time to create the interfaces.
# loop through the nic networks, find the matching networks to get the
# subnet and netmask and then create the appropriate ifcfg file for linux
my $specific_nic = $nic;
if ($i > 0) {
$specific_nic = $nic . ":" . ($i);
}
#todo: support case in which nicnetworks is not specified, find the correct network by calculation
$cnt = 0;
$subnet = "";
$netmask = "";
$net_name = "";
while ( $cnt < $net_cnt ) {
if ( $networks[$cnt][0] eq $nic_nets[$i] ) {
$subnet = $networks[$cnt][1];
$netmask = $networks[$cnt][2];
$cnt = $net_cnt; # found match - get out.
}
else {
$cnt++;
}
}
# check that there is a subnet and netmask set
if ( !(length($subnet) > 0) || !(length($netmask) > 0) ) {
system("logger -t xcat -p local4.err 'configbond: network subnet or netmask not set.'");
exit 1;
}
system("logger -t xcat -p local4.err 'configbond: network subnet and netmask: $subnet, $netmask'");
system("logger -t xcat -p local4.err 'configbond: $specific_nic, $nic_ips[$i]'");
# Write the master info to the ifcfg file
if (-d "/etc/sysconfig/network-scripts") {
# rhel/centos/fedora
my $dir = "/etc/sysconfig/network-scripts";
if (!open(FILE, ">$dir/ifcfg-$bond")) { system("logger -t xcat -p local4.err 'configbond: cannot open $dir/ifcfg-$bond.'"); exit 1; }
print FILE "DEVICE=$bond\n";
print FILE "BOOTPROTO=none\n";
print FILE "IPADDR=$nic_ips[$i]\n";
print FILE "NETMASK=$netmask\n";
print FILE "ONBOOT=yes\n";
print FILE "USERCTL=no\n";
print FILE qq(BONDING_OPTS="$bondingopts"\n);
close FILE;
# Configure slaves
my @output = `ip addr show 2>&1`; # to check for existance of the device later
foreach my $dev (@devs) {
# as a convenience, make sure the device exists before adding it to the bond
if (!grep(m/^\d+:\s+$dev:/, @output)) {
system("logger -t xcat -p local4.err 'configbond: not configuring $dev because it does not exist.'");
unlink("$dir/ifcfg-$dev"); # in case it was left over in the image we are cloning
next;
}
system("logger -t xcat -p local4.err 'configbond: slave dev: $dev'");
if (!open(FILE, ">$dir/ifcfg-$dev")) { system("logger -t xcat -p local4.err 'configbond: cannot open $dir/ifcfg-$dev'"); exit 1; }
print FILE "DEVICE=$dev\n";
print FILE "BOOTPROTO=none\n";
print FILE "MASTER=$bond\n";
print FILE "ONBOOT=yes\n";
print FILE "SLAVE=yes\n";
print FILE "USERCTL=no\n";
close FILE;
}
}
elsif (-d "/etc/sysconfig/network") {
# sles
my $dir = "/etc/sysconfig/network";
if (!open(FILE, ">$dir/ifcfg-$bond")) { system("logger -t xcat -p local4.err 'configbond: cannot open $dir/ifcfg-$bond.'"); exit 1; }
print FILE "BOOTPROTO=static\n";
print FILE "BONDING_MASTER=yes\n";
print FILE "BONDING_MODULE_OPTS='$bondingopts'\n";
print FILE "NAME='Bonded Interface'\n";
print FILE "IPADDR=$nic_ips[$i]\n";
print FILE "NETMASK=$netmask\n";
print FILE "STARTMODE=onboot\n";
print FILE "USERCONTROL=no\n";
my $devnum = 0;
my @output = `ip addr show 2>&1`; # to check for existance of the device later
foreach my $dev (@devs) {
if (!grep(m/^\d+:\s+$dev:/, @output)) { next; }
print FILE "BONDING_SLAVE_$devnum=$dev\n";
$devnum++;
}
close FILE;
# Configure slaves
foreach my $dev (@devs) {
# as a convenience, make sure the device exists before adding it to the bond
if (!grep(m/^\d+:\s+$dev:/, @output)) {
system("logger -t xcat -p local4.err 'configbond: not configuring $dev because it does not exist.'");
unlink("$dir/ifcfg-$dev"); # in case it was left over in the image we are cloning
next;
}
system("logger -t xcat -p local4.err 'configbond: slave dev: $dev'");
if (!open(FILE, ">$dir/ifcfg-$dev")) { system("logger -t xcat -p local4.err 'configbond: cannot open $dir/ifcfg-$dev'"); exit 1; }
print FILE "BOOTPROTO=none\n";
print FILE "STARTMODE=hotplug\n";
close FILE;
}
}
else {
# do not recognize this distro
system("logger -t xcat -p local4.err 'configbond: network directory is not either the Red Hat or SuSE format.'");
exit 1;
}
# Apply the changes. Since we are only doing bond1 right now, lets not restart the whole network
# so we dont disrupt the installnic connection. Instead we just need to bring down the slave nics,
# and then bring up the bond nic.
#runcmd("service network restart");
foreach my $dev (@devs) {
runcmd("ifdown $dev");
}
runcmd("ifdown $bond"); # in case it was already up
runcmd("ifup $bond"); # note: this wont reload the bonding kernel module, so we are depending on the provisioning process to already have set the correct bonding options
system("logger -t xcat -p local4.info 'configbond: successfully configured $specific_nic.'");
}
exit 0;
sub runcmd {
my $cmd = shift @_;
$cmd .= ' 2>&1';
my @output = `$cmd`;
my $rc = $? >> 8;
if ($rc) {
system("logger -t xcat -p local4.err 'configeth: command $cmd failed with rc $rc: " . join('',@output) . "'");
my $errout= "configeth: command $cmd failed with rc $rc.";
`echo $errout`;
exit $rc;
}
}
@@ -1,28 +0,0 @@
#!/bin/bash
# set the default route of the node to the ip address and nic passed in
# this should be added to the postbootscripts, NOT postscripts
gateway="$1"
nic="$2"
# set it temporarily
echo "ip route replace to default via $gateway dev $nic"
ip route replace to default via $gateway dev $nic
# set it permanently
#todo: this is only for sles right now
file=/etc/sysconfig/network/routes
if grep -q -E '^default ' $file; then
# replace the default route that is already in there
sed -i 's/^default .*$/default '$gateway' - -/' $file
else
# no default route yet, append to file
echo "default $gateway - -" >>$file
fi
# While we are here, clean up the network wait hack, if it is still there.
# (It was added during scripted install, because autoyast will not use the bond
# configuration for 1 part of the process.) Do not know a better place to clean
# this up.
sed -i '/Waiting to reach xCAT mgmt node/d' /etc/init.d/network
+3 -9
View File
@@ -48,7 +48,7 @@ xCAT-SoftLayer provides Utilities to make xCAT work in a SoftLayer environment.
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/install
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts
#mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-SoftLayer
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
@@ -59,8 +59,8 @@ cp -p -R share/xcat/install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/install/
cp -d bin/* $RPM_BUILD_ROOT/%{prefix}/bin
chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
cp -d postscripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts
chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts/*
#cp -d postscripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts
#chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts/*
cp -d si-post-install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/post-install
chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/post-install/*
@@ -84,9 +84,3 @@ rm -rf $RPM_BUILD_ROOT
%post
# We are shipping the postscripts in a sysclone dir and then copying them to /install/postscripts here,
# because we want to allow base xcat to eventually ship them and not conflict on the file name/path
# But base xcat now has a newer/better configbond written in bash, so if that is there do not overwrite it.
head /install/postscripts/configbond | grep -q -E '^#! */bin/bash'
if [[ $? != 0 ]]; then
# the new configbond from xcat 2.8.5 is not there, so copy ours
cp -f /%{prefix}/share/xcat/sysclone/postscripts/* /install/postscripts
fi
+2 -4
View File
@@ -101,15 +101,13 @@ ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/webportal
# Inspect whether PHP related RPM packages are installed
%ifos linux
if [ -e "/etc/redhat-release" ]; then
rpm -q php >/dev/null
if [ $? != 0 ]; then
if [ ! -e "/etc/httpd/conf.d/php.conf" ]; then
echo ""
echo "Error! php has not been installed. Please run 'yum install php' before installing xCAT-UI.";
exit -1;
fi
else # SUSE
rpm -q apache2-mod_php5 php5 >/dev/null
if [ $? != 0 ]; then
if [ ! -e "/etc/apache2/conf.d/php5.conf" ]; then
echo ""
echo "Error! apache2-mod_php5 and php5 have not been installed. Please run 'zypper install apache2-mod_php5 php5' before installing xCAT-UI."
exit -1;
+265 -41
View File
@@ -322,6 +322,7 @@ if (
'k|kitversion=s' => \$::KITVERSION,
'r|kitrelease=s' => \$::KITRELEASE,
'l|kitloc=s' => \$::KITLOC,
'for=s' => \$::FOROSVERSARCH,
)
)
{
@@ -337,18 +338,34 @@ if ($::HELP)
}
my $debianflag = 0;
my $dpkg_flag = '-uc -us';
my $tempstring = xCAT::BuildKitUtils->osver();
if ( $tempstring =~ /debian/ || $tempstring =~ /ubuntu/ ){
$debianflag = 1;
}
# This is an undocumented flag to support our local build team
# to allow building Ubuntu kits on our RH build machines.
# It requires RH rpms such as dep, fakeroot, perl-File-DesktopEntry,
# perl-File-BaseDir, and html2text to be installed on the build server
# for this to work. To use this flag:
# buildkit --for ubuntu buildrepo <reponame>
# buildkit --for ubuntu buildtar
if ($::FOROSVERSARCH) {
if ( $::FOROSVERSARCH =~ /debian/ || $::FOROSVERSARCH =~ /ubuntu/ ) {
$debianflag=1;
$dpkg_flag .= ' -A -d';
}
}
# display the version statement if -v or --version is specified
if ($::VERSION)
{
my $versioncmd = "rpm -q --qf \"%{NAME}: %{VERSION}-%{RELEASE} \n\" xCAT-buildkit";
my $message = "Error quering xCAT-buildkit rpm. Version info is not available. \n";
if ( $debianflag ){
$versioncmd = "dpkg-query --show -f='\${PackageSpec}: \${Version}\n' xcat-buildkit";
$versioncmd = "dpkg-query --show -f='\${binary:Package}: \${Version}\n' xcat-buildkit";
$message = "Error quering xcat-buildkit package. Version info is not available. \n";
}
if ( system($versioncmd) ) {
@@ -764,20 +781,21 @@ sub kit_buildrepo1
}
}
# Build kitcomponent metapackages
# Build kitcomponent preppackages and metapackages
if ( $debianflag ){
foreach my $kc (@{$::bldkit_config->{kitcomponent}{entries}}) {
if ($repoid ne $kc->{kitrepoid}) { next; }
my $debname = "$repodir/".&comppkgname($kc);
if (-r $debname) { next; }
if ($::VERBOSE) { print "building kitcomponent metapackage for $kc->{basename} \n";}
if ($::VERBOSE) { print "building kitcomponent package for $kc->{basename} \n";}
if (&build_kitcomp_debian($kc)) {
print "Error building kitcomponent metapackage for $kc->{basename} \n";
return 1;
}
}
if ( system("dpkg-scanpackages $repodir > $repodir/Packages") ) {
print "Error building the repository meta-data with the dpkg-scanpackages command \n";
if ( system("cd $repodir;dpkg-scanpackages . > Packages") ) {
print "Error building the repository meta-data with the dpkg-scanpackages command \n";
return 1;
}
}
@@ -1005,7 +1023,7 @@ sub kit_buildtar
}
}
print "Creating tar file $tarfile.\n";
print "Creating tar file $::current_dir/$kitfilename.\n";
if ( system("cd $::deploy_dir; cd ..; tar -cjhf $tarfile $kitname/*") ) {
print "Error building tarfile $tarfile \n";
@@ -1145,8 +1163,16 @@ sub edit_bldkitconf
my ($osbasename,$osmore) = split(/\,/, $osinfo);
my ($osmajorversion,$osminorversion) = split(/\./, $osmore);
my $osarch=`uname -p`;
chomp($osarch);
my $kitcomponent_basename = $kitname."_compute";
if ($debianflag==1) {
if($osarch eq "ppc64le"){
$osarch="ppc64el";
}
$kitcomponent_basename = $kitname."-compute";
}
for (@lines) {
s/<<<INSERT_kitbasename_HERE>>>/$kitname/;
s/<<<INSERT_kitrepoid_HERE>>>/$kitrepoid/;
@@ -1865,6 +1891,12 @@ sub validate_os
my ($osmajorversion,$osminorversion) = split(/\./, $osmore);
my $osarch=`uname -p`;
chomp($osarch);
if ($debianflag==1) {
if($osarch eq "ppc64le"){
$osarch="ppc64el";
}
}
$osinfo =~ s/\,//;
my $repo_osinfo = "$repo->{osbasename}$repo->{osmajorversion}";
if (defined($repo->{osminorversion})){
@@ -1969,7 +2001,7 @@ sub build_kitcomp
$::VALID_PRER_COMPONENT = 0;
if ( !$::PREREQUISITE ) {
if ( $comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade} || $comp->{preuninstall} ) {
if ( $comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade} ) {
if ( &gen_kitcomp_spec($comp,\%repo, 'PREREQUISITE') ) { return 1; }
# run the rpmbuild command
@@ -2344,7 +2376,7 @@ sub gen_kitcomp_spec
s/<<<INSERT_kitcomponent_postinstall_script_HERE>>>/$postscript/;
s/<<<INSERT_kitcomponent_preupgrade_script_HERE>>>//;
s/<<<INSERT_kitcomponent_postupgrade_script_HERE>>>/$postupscript/;
s/<<<INSERT_kitcomponent_preuninstall_script_HERE>>>//;
s/<<<INSERT_kitcomponent_preuninstall_script_HERE>>>/$preunscript/;
s/<<<INSERT_kitcomponent_postuninstall_script_HERE>>>/$postunscript/;
}
}
@@ -2407,14 +2439,45 @@ sub build_kitcomp_debian{
}
}
#run the dpkg-buildpackage command
my $curdir = $::workdir;
my $cmd = "rm -Rf $debbuilddir";
system($cmd);
mkpath($debbuilddir);
#Create debian directory for this kit component
if ( &gen_kitcomp_debdir($comp,\%repo) ) { return 1; }
$::VALID_PREP_COMPONENT = 0;
if ( !$::PREREQUISITE ) {
if ( $comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade} || $comp->{preuninstall} ) {
#Create debian directory for this kit component preppackage
if ( &gen_kitcomp_debdir_prep($comp,\%repo) ) { return 1; }
$::VALID_PREP_COMPONENT = 1;
# build prep deb
my $prep_compversion = $comp->{version} . "-" . $comp->{release};
my $prep_buildstring = "Prep Kit component build package.";
my $prep_debbuilddir = $::workdir."/debbuild/"."prep-".$comp->{kitcompname};
my $prep_debianbuildcmd = "cd $prep_debbuilddir;debchange -v $prep_compversion -b -c debian/changelog $prep_buildstring;dpkg-buildpackage $dpkg_flag";
if ( system($prep_debianbuildcmd) ) {
print "Error running \"dpkg-buildpackage $dpkg_flag\" command for kit component prep-$comp->{kitcompname} meta package\n";
return 1;
}
}
#Create debian directory for this kit component metapackage
if ( &gen_kitcomp_debdir($comp,\%repo,'METADEB') ) { return 1; }
} else {
#Create debian directory for this kit component
if ( &gen_kitcomp_debdir($comp,\%repo,'ALL') ) { return 1; }
}
if (defined($comp->{non_native_pkgs}) ) {
my $sourcedir = $::workdir."/source_packages";
@@ -2436,11 +2499,11 @@ sub build_kitcomp_debian{
}
}
my $compversion = $comp->{version} . "-" . $comp->{release};
my $buildstring = "Kit component build package.";
my $debianbuildcmd = "cd $debbuilddir;dch -v $compversion -b -c debian/changelog $buildstring;dpkg-buildpackage -uc -us";
my $buildstring = "\'Kit component build package.\'";
my $debianbuildcmd = "cd $debbuilddir;debchange -v $compversion -b -c debian/changelog $buildstring;dpkg-buildpackage $dpkg_flag";
if ( !$::NON_NATIVE_PKGS->{$comp->{kitcompname}} ) {
if ( system($debianbuildcmd) ) {
print "Error running \"dpkg-buildpackage -uc -us\" command for kit component $comp->{kitcompname} meta package\n";
print "Error running \"dpkg-buildpackage $dpkg_flag\" command for kit component $comp->{kitcompname} meta package\n";
return 1;
}
my $repodir = $::base_repodir."/".$repo{kitreponame};
@@ -2456,6 +2519,99 @@ sub build_kitcomp_debian{
return 0;
}
#-----------------------------------------------------------------------------
=head3 gen_kitcomp_debdir_prep
=cut
#-----------------------------------------------------------------------------
sub gen_kitcomp_debdir_prep{
my $comp = shift;
my $repo = shift;
my $scriptdir = $::workdir."/scripts/";
my $combuilddir = $::workdir."/debbuild/"."prep-".$comp->{kitcompname};
#copy the debian dir template to the build path
mkpath("$combuilddir/debian");
my $cmd = "cp -Rf " . $::XCATSHARE . "/kits/debian_template/* $combuilddir/debian/";
system($cmd);
my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename};
my $kitcompname = "prep-".$comp->{kitcompname};
my $upgradeflag = "pre-".$comp->{basename} . ".tmp";
my ($prescript,$postscript,$preupscript,$postupscript,$preunscript,$postunscript,$nonnativepkgs) = '';
if (defined($comp->{preinstall})) {
$prescript = &load_script("$scriptdir$comp->{preinstall}");
}
if (defined($comp->{preupgrade})) {
$preupscript = &load_script("$scriptdir$comp->{preupgrade}");
}
if (defined($comp->{preuninstall})) {
$preunscript = &load_script("$scriptdir$comp->{preuninstall}");
}
#replace all special sub string in all files under debian
unless (opendir(DH, "${combuilddir}/debian/")){
print "Can not open the xCAT Kit Component debian dir: ${combuilddir}/debian/";
return 1;
}
foreach (readdir(DH)){
my $file = "${combuilddir}/debian/$_";
if ( -d $file){
next;
}
unless ( open ( FH, "<", $file )){
print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian template file $file.\n";
close(DH);
return 1;
}
if ($::VERBOSE){
print "Reading the xCAT Kit Component ${kitcompname}'s debian template file $file. \n";
}
my @lines = <FH>;
close(FH);
my $prep_comp_name="prep-".$comp->{basename};
for(@lines) {
chomp;
s/<<<INSERT_kitcomponent_basename_HERE>>>/$prep_comp_name/;
s/<<<INSERT_kitcomponent_ospkgdeps_HERE>>>/$comp->{ospkgdeps}/;
s/<<<INSERT_kitcomponent_kitpkgdeps_HERE>>>//;
s/<<<INSERT_kitcomponent_kitcompdeps_HERE>>>//;
s/<<<INSERT_kitcomponent_desc_HERE>>>/$comp->{description}/;
s/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>/$upgradeflag/;
s/<<<INSERT_kitcomponent_preinstall_script_HERE>>>/$prescript/;
s/<<<INSERT_kitcomponent_postinstall_script_HERE>>>//;
s/<<<INSERT_kitcomponent_preupgrade_script_HERE>>>/$preupscript/;
s/<<<INSERT_kitcomponent_postupgrade_script_HERE>>>//;
s/<<<INSERT_kitcomponent_preuninstall_script_HERE>>>/$preunscript/;
s/<<<INSERT_kitcomponent_postuninstall_script_HERE>>>//;
}
my $joined_lines = join("\n", @lines);
@lines = split(/\\n/,$joined_lines);
open (FH, ">", $file);
if ($::VERBOSE){
print "Created kitcomponent ${kitcompname}'s build file under debian dir $file";
}
print FH @lines;
close(FH);
}
closedir(DH);
return 0;
}
#-----------------------------------------------------------------------------
=head3 gen_kitcomp_debdir
@@ -2468,6 +2624,7 @@ sub build_kitcomp_debian{
sub gen_kitcomp_debdir{
my $comp = shift;
my $repo = shift;
my $level = shift;
my $scriptdir = $::workdir."/scripts/";
my $combuilddir = $::workdir."/debbuild/".$comp->{kitcompname};
@@ -2481,29 +2638,38 @@ sub gen_kitcomp_debdir{
my $upgradeflag = $comp->{basename} . ".tmp";
my ($prescript,$postscript,$preupscript,$postupscript,$preunscript,$postunscript,$nonnativepkgs) = '';
if (defined($comp->{preinstall})) {
$prescript = &load_script("$scriptdir$comp->{preinstall}");
}
if (defined($comp->{postinstall})) {
$postscript = &load_script("$scriptdir$comp->{postinstall}");
}
if (defined($comp->{preupgrade})) {
$preupscript = &load_script("$scriptdir$comp->{preupgrade}");
}
if (defined($comp->{postupgrade})) {
$postupscript = &load_script("$scriptdir$comp->{postupgrade}");
}
if (defined($comp->{preuninstall})) {
$preunscript = &load_script("$scriptdir$comp->{preuninstall}");
}
if (defined($comp->{postuninstall})) {
$postunscript = &load_script("$scriptdir$comp->{postuninstall}");
}
if (defined($comp->{non_native_pkgs})) {
$nonnativepkgs = "\n";
$nonnativepkgs .= "mkdir -p \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n";
$nonnativepkgs .= "cp -a * \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n";
if ($level eq 'METADEB' || $level eq 'ALL')
{
if (defined($comp->{postinstall})) {
$postscript = &load_script("$scriptdir$comp->{postinstall}");
}
if (defined($comp->{postupgrade})) {
$postupscript = &load_script("$scriptdir$comp->{postupgrade}");
}
if (defined($comp->{postuninstall})) {
$postunscript = &load_script("$scriptdir$comp->{postuninstall}");
}
if (defined($comp->{non_native_pkgs})) {
$nonnativepkgs = "\n";
$nonnativepkgs .= "mkdir -p \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n";
$nonnativepkgs .= "cp -a * \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n";
}
}
if ($level eq 'ALL')
{
if (defined($comp->{preinstall})) {
$prescript = &load_script("$scriptdir$comp->{preinstall}");
}
if (defined($comp->{preupgrade})) {
$preupscript = &load_script("$scriptdir$comp->{preupgrade}");
}
if (defined($comp->{preuninstall})) {
$preunscript = &load_script("$scriptdir$comp->{preuninstall}");
}
}
#replace all special sub string in all files under debian
unless (opendir(DH, "${combuilddir}/debian/")){
@@ -2528,12 +2694,20 @@ sub gen_kitcomp_debdir{
}
my @lines = <FH>;
close(FH);
my $prepcomp="prep-".$comp->{basename};
for(@lines) {
chomp;
s/<<<INSERT_kitcomponent_basename_HERE>>>/$comp->{basename}/;
s/<<<INSERT_kitcomponent_ospkgdeps_HERE>>>/$comp->{ospkgdeps}/;
s/<<<INSERT_kitcomponent_kitpkgdeps_HERE>>>/$comp->{kitpkgdeps}/;
s/<<<INSERT_kitcomponent_kitcompdeps_HERE>>>/$comp->{kitcompdeps}/;
if ( $::VALID_PREP_COMPONENT ) {
s/<<<INSERT_kitcomponent_kitcompdeps_HERE>>>/$comp->{kitcompdeps},$prepcomp/;
}
else
{
s/<<<INSERT_kitcomponent_kitcompdeps_HERE>>>/$comp->{kitcompdeps}/;
}
s/<<<INSERT_kitcomponent_desc_HERE>>>/$comp->{description}/;
s/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>/$upgradeflag/;
s/<<<INSERT_kitcomponent_preinstall_script_HERE>>>/$prescript/;
@@ -2682,8 +2856,13 @@ sub create_kitconf
$::kit_config->{$s}{entries}[$li]->{kitreponame} =
$se->{kitreponame};
if ( !$::PREREQUISITE and ($se->{ospkgdeps} || $se->{preinstall} || $se->{preupgrade} || $se->{preuninstall}) ) {
$::kit_config->{$s}{entries}[$li]->{prerequisite} =
if ( $debianflag ){
$::kit_config->{$s}{entries}[$li]->{prerequisite} =
"prep-" . $se->{basename};
}else{
$::kit_config->{$s}{entries}[$li]->{prerequisite} =
"prep_" . $se->{basename};
}
}
}
$li++;
@@ -3401,7 +3580,7 @@ sub kit_addpkgs
#for debian/ubuntu
my $repodir = $tmpdir . "/repos/".$non_native_kitreponame;
if ( $debianflag ){
my $debbuildcmd = "cd $source_dir;dpkg-buildpackage -uc -us";
my $debbuildcmd = "cd $source_dir;dpkg-buildpackage $dpkg_flag";
if ( system($debbuildcmd) ){
print "error running debian build cmd for kit component $non_native_basename meta package.\n";
return 1;
@@ -3587,9 +3766,13 @@ sub NEW_kit_addpkgs
if ($kp->{isexternalpkg} eq 'yes') {
my $ext_filename = $kp->{filename};
my $ext_reponames = $kp->{kitreponame};
my $files = xCAT::BuildKitUtils->find_latest_pkg(\@pkgdirlist, $ext_filename);
my $files;
if($debianflag){
$files = xCAT::BuildKitUtils->find_latest_pkg_deb(\@pkgdirlist, $ext_filename);
}
else {
$files = xCAT::BuildKitUtils->find_latest_pkg(\@pkgdirlist, $ext_filename);
}
if (!defined($files) ) {
print "Error: The product package file $ext_filename was not found in the package directory(s) @pkgdirlist.\n";
# Cleanup
@@ -3709,6 +3892,47 @@ sub NEW_kit_addpkgs
}
}
#When using -k -r, there are useless repodir
#delete useless repo dir
my $kitrepodirby=$::base_repodir;
my $cmdby = "/bin/ls $kitrepodirby 2>/dev/null";
my $outputby = `$cmdby`;
my @allrepolist = split(/\n/, $outputby);
my @dellist;
foreach my $reponame (@allrepolist)
{
my $match=0;
foreach my $kr (@{$::bldkit_config->{kitrepo}{entries}})
{
my $repodirname = "$kr->{kitreponame}";
if ( ${repodirname} eq ${reponame} )
{
${match}++;
}
}
if ( ${match} == 0 )
{
push(@dellist,$reponame);
}
}
foreach my $del (@dellist)
{
my $delrepodir=$::base_repodir."/".$del ;
if ( -d $delrepodir )
{
my $delcmd="rm -Rf $delrepodir";
if ( system($delcmd) )
{
print "Failed to delete useless repo directory \n";
}
}
}
# Build the full kit tar file
my $buildtar_rc = &kit_buildtar;
@@ -134,6 +134,87 @@ sub get_latest_version
}
}
#--------------------------------------------------------------------------
=head3 get_latest_version_deb
Find the latest version in a list of debs with the same basename
Arguments:
- the repo location
- a list of debs with the same basename
Returns:
- name of deb
- undef
Example:
my $new_d = xCAT::BuildKitUtils->get_latest_version($repodir, \@rpmlist);
Comments:
=cut
#--------------------------------------------------------------------------
sub get_latest_version_deb
{
my ($class, $repodir, $debs) = @_;
my @deblist = @$debs;
my %localversions_hash = ();
my $file_name;
my %founddeb;
my $latest;
my $i = 0;
foreach my $deb (@deblist)
{
# include path
my $fulldebpath = "$repodir/$deb*";
chomp $deb;
# get the basename, version, and release for this deb
print "dpkg -I $repodir/$deb |grep Package|awk '{print \$2}'";
my $basenamedeb = `dpkg -I $repodir/$deb |grep Package|awk '{print \$2}'`;
chomp $basenamedeb;
my $versiondeb = `dpkg -I $repodir/$deb |grep Version|awk '{print \$2}'`;
chomp $versiondeb;
$founddeb{$basenamedeb}{$deb}{version}=$versiondeb;
$i++;
}
if ($i == 0)
{
print "error\n";
return undef;
}
foreach my $r (keys %founddeb ) {
# if more than one with same basename then find the latest
my $latestmatch="";
foreach my $fdeb (keys %{$founddeb{$r}} ) {
# if we already found a match in some other dir
if ($latestmatch) {
# then we need to figure out which is the newest
# if the $fdeb is newer than use iti
if ( ! xCAT::BuildKitUtils->testVersion_deb($founddeb{$r}{$fdeb}{version}, 'gt', $founddeb{$r}{$latestmatch}{version}) ) {
$latestmatch = $fdeb;
}
} else {
$latestmatch = $fdeb;
}
}
$latest=$latestmatch;
}
if ($i == 0)
{
print "Error: Could not determine the latest version for the following list of debs: @deblist\n";
return undef;
} else {
return ($latest);
}
}
#--------------------------------------------------------------------------
=head3 find_latest_pkg
@@ -160,6 +241,7 @@ sub find_latest_pkg
my @rpms;
my %foundrpm;
# need to check each pkgdir for the rpm(s)
# - if more than one match need to pick latest
# find all the matches in all the directories
@@ -223,6 +305,128 @@ sub find_latest_pkg
}
}
#--------------------------------------------------------------------------
=head3 find_latest_pkg_deb
Find the latest deb package give the deb name and a list of
possible package locations.
Arguments:
- a list of package directories
- the name of the deb
Returns:
- \@founddeblist
- undef
Example:
my $newrpm = xCAT::BuildKitUtils->find_latest_pkg_deb(\@pkgdirs, $debname);
Comments:
=cut
#--------------------------------------------------------------------------
sub find_latest_pkg_deb
{
my ($class, $pkgdirs, $debname) = @_;
my @pkgdirlist = @$pkgdirs;
my @debs;
my %founddeb;
# need to check each pkgdir for the deb(s)
# - if more than one match need to pick latest
# find all the matches in all the directories
foreach my $debdir (@pkgdirlist) {
my $ffile = $debdir."/".$debname;
if ( system("/bin/ls $ffile > /dev/null 2>&1") ){
# if not then skip to next dir
next;
} else {
# if so then get the details and add it to the %founddeb hash
my $cmd = "/bin/ls $ffile 2>/dev/null";
my $output = `$cmd`;
my @deblist = split(/\n/, $output);
if ( scalar(@deblist) == 0) {
next;
}
foreach my $r (@deblist) {
my $basename = `dpkg -I $r* |grep Package|awk '{print \$2}'|head -1`;
chomp $basename;
my $version = `dpkg -I $r* |grep Version|awk '{print \$2}'|head -1`;
chomp $version;
$founddeb{$basename}{$r}{version}=$version;
}
}
}
# for each unique deb basename
foreach my $r (keys %founddeb ) {
# if more than one with same basename then find the latest
my $latestmatch="";
foreach my $fdeb (keys %{$founddeb{$r}} ) {
# if we already found a match in some other dir
if ($latestmatch) {
# then we need to figure out which is the newest
# if the $fdeb is newer than use it
if ( ! xCAT::BuildKitUtils->testVersion_deb($founddeb{$r}{$fdeb}{version}, 'gt', $founddeb{$r}{$latestmatch}{version}) ) {
$latestmatch = $fdeb;
}
} else {
$latestmatch = $fdeb;
}
}
push(@debs, $latestmatch);
}
if (scalar(@debs)) {
return \@debs;
} else {
return undef;
}
}
#------------------------------------------------------------------------------
=head3 testVersion_deb
Compare version1 and version2 according to the operator and
return 1 0 or 0.
Arguments:
$version1
$operator
$version2
Returns:
1 or 0
Example:
Comments:
The return value is generated with the Require query
=cut
#-----------------------------------------------------------------------------
sub testVersion_deb
{
my ($class, $version1, $operator, $version2) = @_;
if ($::VERBOSE) {
print "dpkg --compare-versions $version1 $operator $version2 \n";
}
my $result =`dpkg --compare-versions $version1 $operator $version2`;
return $result;
}
#------------------------------------------------------------------------------
@@ -21,7 +21,7 @@ set -e
case "$1" in
configure)
<<<INSERT_kitcomponent_postinstall_script_HERE>>>
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]; then
<<<INSERT_kitcomponent_postupgrade_script_HERE>>>
rm /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>
fi
@@ -17,10 +17,12 @@ set -e
case "$1" in
install)
<<<INSERT_kitcomponent_preinstall_script_HERE>>>
echo "preinstall processing"
;;
upgrade)
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]; then
echo "preupgrade processing"
<<<INSERT_kitcomponent_preupgrade_script_HERE>>>
fi
;;
@@ -96,7 +96,8 @@ kit:
#
# osminorversion (optional) OS minor version. (ex. "4")
#
# osarch (mandatory) OS architecture. (ex. "x86_64")
# osarch (mandatory) OS architecture. (ex.redhat x86_64 should be "x86_64", Ubuntu Power LE should be "ppc64el",
# For Ubuntu Power LE, system arch is ppc64le, for ubuntu software package, should use "ppc64el",
#
# compat_osbasenames (optional) Comma-separated list of compatible
# OS distribution base names. (ex. "centos")
@@ -1,3 +1,21 @@
#!/bin/sh
echo "running sample-comp1 genimage_post script"
rpmdir="/opt/xcat/kits/<<<buildkit_WILL_INSERT_kit_basename_HERE>>>/<<<buildkit_WILL_INSERT_kitcomponent_name_HERE>>>"
if [[ ! -z "$installroot" ]]; then
if [ -n "`ls $installroot$rpmdir/*.deb 2> /dev/null`" ] ; then
dpkg -i --force-all --instdir=$installroot $installroot$rpmdir/*.deb
elif [ -n "`ls $installroot$rpmdir/*.rpm 2> /dev/null`" ] ; then
rpm --force --root $installroot -Uvh $installroot$rpmdir/*.rpm
fi
else
if [ -n "`ls $rpmdir/*.deb 2> /dev/null`" ] ; then
dpkg -i --force-all $rpmdir/*.deb
elif [ -n "`ls $rpmdir/*.rpm 2> /dev/null`" ] ; then
rpm --force -Uvh $rpmdir/*.rpm
fi
fi
exit 0
@@ -26,9 +26,6 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
<<<INSERT_kitcomponent_files_HERE>>>
%changelog
@@ -48,6 +45,11 @@ rm -rf $RPM_BUILD_ROOT
%preun
<<<INSERT_kitcomponent_preuninstall_script_HERE>>>
%files
%defattr(-,root,root)
<<<INSERT_kitcomponent_files_HERE>>>
%postun
<<<INSERT_kitcomponent_postuninstall_script_HERE>>>
+8 -2
View File
@@ -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";
+366 -160
View File
@@ -1,191 +1,397 @@
#!/usr/bin/perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# Downloads/converts the xCAT docs on the sourceforge wiki to local HTML and PDF.
# Downloads/converts the xCAT docs on the sourceforge Allura wiki to local HTML and PDF.
# This script is not dependent on other xCAT code, so you can copy it to a machine
# that has internet access to run it. Before running this command, you must have
# wget, python, and pisa installed. See: http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Editing_xCAT_Documentation_Pages#Converting_Wiki_Pages_to_HTML_and_PDFs .
# curl, pandoc, and latex installed. See: http://sourceforge.net/p/xcat/wiki/Editing_and_Downloading_xCAT_Documentation/#converting-wiki-pages-to-html-and-pdfs
# Note: do not use the --upload option, unless your machine has authority to write to http://xcat.sourceforge.net/doc/ .
# You also need to set $UPLOADUSER to your sourceforge user.
# You also need to set $UPLOADUSER to your sourceforge user:
my $UPLOADUSER = 'bp-sawyers';
#BEGIN
#{
# $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr';
#}
use strict;
#use lib "$::XCATROOT/lib/perl";
#use xCAT::Utils;
use Getopt::Long;
#use File::Path;
use Cwd;
#use Data::Dumper;
use JSON;
use List::Util qw[max];
# URL for the xCAT Allura wiki API markdown on SourceForge
my $SF_URL='http://sourceforge.net/rest';
my $WIKI_URL=$SF_URL.'/p/xcat/wiki/';
# Update this list if you group any xcat docs on a separate page such that they
# are no longer linked from the main doc page:
my @INDEXDOCS = ('XCAT_Documentation',
'Power_775_Cluster_Documentation',
'Highly_Available_Management_Node',
'Mixed_Cluster_Support',
'IBM_HPC_Stack_in_an_xCAT_Cluster');
# Update this list if you group any xcat docs on a separate page such that they are no longer linked from the
# main doc page.
my @indexdocs = ('XCAT_Documentation', 'Power_775_Cluster_Documentation', 'Highly_Available_Management_Node', 'Mixed_Cluster_Support', 'IBM_HPC_Stack_in_an_xCAT_Cluster');
#my $VERSION;
my $HELP;
my $UPLOAD;
my $UPLOADONLY;
my $IGNOREERRORS;
my $CONTINUE;
my $SINGLE_DOC;
my $VERBOSE;
my $usage = sub {
my $exitcode = shift @_;
print "Usage: getxcatdocs [-?|-h|--help] [-v|--verbose] [-u|--upload] [--uploadonly] [<destination-dir>]\n";
exit $exitcode;
};
# Process the cmd line args
Getopt::Long::Configure("bundling");
#Getopt::Long::Configure("pass_through");
Getopt::Long::Configure("no_pass_through");
if (!GetOptions('h|?|help' => \$HELP, 'v|verbose' => \$VERBOSE, 'u|upload' => \$UPLOAD, 'uploadonly' => \$UPLOADONLY )) { $usage->(1); }
if ($HELP) { $usage->(0); }
#if ($VERSION) {
#print xCAT::Utils->Version(), "\n";
# exit;
#}
if ($^O =~ /^aix/i) { die "Error: this command is not yet supported on AIX.\n"; }
my $destdir = scalar(@ARGV) ? $ARGV[0] : '.';
chdir($destdir) or die "Can not cd to $destdir: $!\n";
#my $docdir = $ENV{'PWD'};
# Download the HTML docs and convert them all to pdfs
my @dir;
if (!$UPLOADONLY) {
@dir = gethtmldocs('html');
convert2pdf('pdf', \@dir);
}
# tar/compress
my $date=`date +%Y%m%d%H%M`;
chop $date;
my $docname="xcat-docs-snap$date.tar.gz";
#system('pwd');
my $cmd = "tar -zcf $docname html pdf 2>&1";
verbose($cmd);
system($cmd) == 0 or die "Error running $cmd: $!, rc=$?";
# Optionally upload the tarball to sourceforge
if ($UPLOAD || $UPLOADONLY) {
my $UPLOADUSER = 'bp-sawyers';
my $count = 1;
#my $cmd = "rsync -v $docname $UPLOADUSER," . 'xcat@web.sourceforge.net:htdocs/doc/';
my $cmd = "rsync -v $docname $UPLOADUSER," . 'xcat@web.sourceforge.net:/home/frs/project/x/xc/xcat/doc/';
print "$cmd\n";
while ($count<=5 && system("$cmd 2>&1")) { $count++; }
}
exit 0;
my $MDDIR;
my $HTMLDIR;
my $PDFDIR;
my $IMAGEDIR;
my %LOADEDDOCS;
sub verbose { if ($VERBOSE) { print shift, "\n"; } }
my $usage = sub {
my $exitcode = shift @_;
print "Usage: getxcatdocs [-?|-h|--help] \n";
print "Usage: getxcatdocs [-v|--verbose] [-u|--upload] [--uploadonly] [-U|--uploaduser sourceforge_id] [-i|--ignoreerrors] [<destination-dir>]\n";
print "Usage: getxcatdocs [-v|--verbose] [-c|--continue] [-d|--doc single_doc] [-i|--ignoreerrors] [<destination-dir>]\n";
exit $exitcode;
};
# Main processing
# Process the cmd line args
Getopt::Long::Configure("bundling");
#Getopt::Long::Configure("pass_through");
Getopt::Long::Configure("no_pass_through");
if (!GetOptions(
'h|?|help' => \$HELP,
'v|verbose' => \$VERBOSE,
'u|upload' => \$UPLOAD,
'uploadonly' => \$UPLOADONLY,
'uploaduser' => \$UPLOADUSER,
'c|continue' => \$CONTINUE,
'i|ignoreerrors' => \$IGNOREERRORS,
'd|doc=s' => \$SINGLE_DOC ))
{ $usage->(1); }
if ($HELP) { $usage->(0); }
if ($^O =~ /^aix/i) { die "Error: this command is not yet supported on AIX.\n"; }
my $DESTDIR = scalar(@ARGV) ? $ARGV[0] : '.';
chdir($DESTDIR) or die "Can not cd to $DESTDIR: $!\n";
my $json = JSON->new();
if ($SINGLE_DOC) {
$MDDIR = '.';
$HTMLDIR = '.';
$PDFDIR = '.';
$IMAGEDIR = '.';
download_doc($SINGLE_DOC);
convert_doc($SINGLE_DOC);
exit;
}
# Download the HTML docs and convert them all to pdfs
if (!$UPLOADONLY) { gethtmldocs(); }
# tar/compress
my $date=`date +%Y%m%d%H%M`;
chop $date;
my $docname="xcat-docs-snap$date.tar.gz";
my $cmd = "tar -zcf $docname html pdf images 2>&1";
verbose($cmd);
system($cmd) == 0 or die "Error running $cmd: $!, rc=$?";
# Optionally upload the tarball to sourceforge
if ($UPLOAD || $UPLOADONLY) {
my $count = 1;
#my $cmd = "rsync -v $docname $UPLOADUSER," . 'xcat@web.sourceforge.net:htdocs/doc/';
my $cmd = "rsync -v $docname $UPLOADUSER," . 'xcat@web.sourceforge.net:/home/frs/project/x/xc/xcat/doc/';
print "$cmd\n";
while ($count<=5 && system("$cmd 2>&1")) { $count++; }
}
exit 0;
# Download all of the html docs from several "index" docs
sub gethtmldocs {
my $dir = shift;
my $savedir = getcwd();
#File::Path::make_path($dir);
mkdir($dir);
chdir($dir);
#system('pwd');
unlink <*>; # delete all the files in the dir, in case they previously ran this
#system('ls');
my $indexes = '';
foreach my $index (@indexdocs) {
$indexes .= qq('http://sourceforge.net/apps/mediawiki/xcat/index.php?title=$index&printable=yes' );
}
print "Downloading the xCAT wiki documentation to $dir, from: $indexes ...\n";
runwget($indexes);
# Remove the funny chars from the links to other docs and rename the docs
#my $sedcmd = q(sed -i 's/<a href="\/apps\/mediawiki\/xcat\/index.php?title/<a href="index.php%3Ftitle/' *);
# sed -i 's/href="index.php%3Ftitle=/href="/g' index.php\?title\=
# sed -i 's/<a href="\([^"]*\)"/<a href="\1.html"/'
# This searches for '<a href="index.php?title=' and then all text before a '"' or '#', and then removes the front part and add .html on the end
# Note: this does not convert the 'MediaWiki:*' files because they are used in <link> tags, but converting them does not seem to do any good anyway.
my $cmd = q(sed -i 's/<a href="index.php?title=\\([^"#]*\\)\\("\|#\\)/<a href="\1.html\2/g' *);
verbose($cmd);
system($cmd) == 0 or die "Error running $cmd: $!, rc=$?";
# get the list of docs
opendir(DIR, '.') or die "Error: could not read the just created html directory.\n";
#my @docs = grep /^index.php\?title=/, readdir(DIR); # /
my @docs;
foreach my $f (readdir(DIR)) {
if ($f !~ /^index.php\?title=/ || $f =~ /^index.php\?title=MediaWiki:/) { next; }
my $newf = $f;
$newf =~ s/^index.php\?title=//;
if ($newf !~ /\./) { $newf .= '.html'; }
verbose("Renaming $f to $newf");
rename($f, $newf);
push @docs, $newf;
}
close(DIR);
chdir($savedir);
return @docs;
$MDDIR = 'md';
$HTMLDIR = 'html';
$PDFDIR = 'pdf';
$IMAGEDIR = 'images';
mkdir($MDDIR);
mkdir($HTMLDIR);
mkdir($PDFDIR);
mkdir($IMAGEDIR);
#delete all the files in the dirs in case they previously ran this
if ($CONTINUE) {
print "CONTINUING with files already in $MDDIR";
my @mdfiles = glob "$MDDIR/*.md";
foreach my $mdf (@mdfiles) {
$mdf =~ s/^$MDDIR\///;
$mdf =~ s/\.md//;
$LOADEDDOCS{$mdf}=1;
}
} else {
unlink <$MDDIR/*>;
unlink <$HTMLDIR/*>;
unlink <$PDFDIR/*>;
unlink <$IMAGEDIR/*>;
}
print "\nDownloading and converting the xCAT wiki document list from $WIKI_URL ...\n";
foreach my $index (@INDEXDOCS) {
my @related_docs = download_doc($index);
foreach my $docref (@related_docs) {
my $docref_name = $docref;
$docref_name =~ s/\/.*\/(.+)\/$/$1/;
download_doc($docref_name);
}
}
foreach my $doc (keys %LOADEDDOCS) {
convert_doc($doc);
}
return;
}
# Convert to pdf
sub convert2pdf {
my ($dir, $files) = @_;
my $savedir = getcwd();
#File::Path::make_path($dir);
mkdir($dir);
chdir($dir);
if (system('which xhtml2pdf >/dev/null 2>&1')) { die "xhtml2pdf is not installed. See http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Editing_xCAT_Documentation_Pages#Converting_Wiki_Pages_to_HTML_and_PDFs .\n"; }
unlink <*>; # delete all the files in the dir, in case they previously ran this
foreach my $file (@$files) {
#if ($file =~ /^index.php\?title=MediaWiki:/ || $file eq 'index.php?title=XCAT_Documentation') { next; }
if ($file eq 'XCAT_Documentation') { next; }
#my ($docname) = $file =~ /^index.php\?title=(.+)$/;
$file =~ s/\.html$//;
print "Converting $file to PDF format...\n";
my $url = 'http://sourceforge.net/apps/mediawiki/xcat/index.php?title=' . $file . '&printable=yes';
my $destfile = "$file.pdf";
my $cmd = "xhtml2pdf '$url' '$destfile' ";
runh2p($cmd);
}
chdir($savedir);
sub download_doc {
my $doc_name = shift;
if ( $LOADEDDOCS{$doc_name} ) { return; }
verbose("processing $doc_name");
$LOADEDDOCS{$doc_name}=1;
my $curlcmd = "curl --retry 5 -X GET $WIKI_URL/$doc_name";
verbose($curlcmd);
my $docjson = `$curlcmd`;
if ($? && !$IGNOREERRORS) { die "error encountered in $curlcmd \n";}
my $jsout = $json->decode($docjson);
foreach my $att (@{$jsout->{attachments}}) {
my $wgetcmd = "wget -P $IMAGEDIR/ $att->{url}";
verbose($wgetcmd);
system($wgetcmd);
if ($? && !$IGNOREERRORS) { die "error encountered in $wgetcmd \n";}
}
open(MDFILE, ">$MDDIR/${doc_name}.md") or die "Could not open >$MDDIR/${doc_name}.md";
print MDFILE $jsout->{text};
close MDFILE;
return @{$jsout->{related_artifacts}};
}
sub convert_doc {
my $doc_name = shift;
open(MDFILE, "<$MDDIR/${doc_name}.md") or die "Could not open <$MDDIR/${doc_name}.md";
my @doc_lines = <MDFILE>;
close MDFILE;
my $doc_text = join('',@doc_lines);
$doc_text = process_includes($doc_text,0);
if ($doc_text =~ /begin_xcat_table/) {
open(MDFILE, ">$MDDIR/${doc_name}.md") or die "Could not open >$MDDIR/${doc_name}.md";
print MDFILE $doc_text;
close MDFILE;
convert_tables($doc_name);
open(MDFILE, "<$MDDIR/${doc_name}.md") or die "Could not open <$MDDIR/${doc_name}.md";
@doc_lines = <MDFILE>;
close MDFILE;
$doc_text = join('',@doc_lines);
}
## Make image refs local
$doc_text =~ s/\!\[\]\(.+\/(.+)\.png\)/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.png\)/g;
$doc_text =~ s/\!\[\]\(.+\/(.+)\.PNG\)/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.PNG\)/g;
$doc_text =~ s/\!\[\]\(.+\/(.+)\.jpg\)/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.jpg\)/g;
$doc_text =~ s/\[img src=(.+)\.png\]/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.png\)/g;
$doc_text =~ s/\[img src=(.+)\.PNG\]/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.PNG\)/g;
$doc_text =~ s/\[img src=(.+)\.jpg\]/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.jpg\)/g;
## Remove [TOC] entries
$doc_text =~ s/\[TOC\]//g;
open(MDFILE, ">$MDDIR/${doc_name}.md") or die "Could not open >$MDDIR/${doc_name}.md";
print MDFILE $doc_text;
close MDFILE;
my $pandoccmd = "pandoc -s --toc $MDDIR/${doc_name}.md -o $HTMLDIR/${doc_name}.html";
verbose($pandoccmd);
system($pandoccmd);
if ($? && !$IGNOREERRORS) { die "error encountered in $pandoccmd \n";}
# This rename is probably a hack, but I didn't want to take the time to
# figure out what was going on:
# pandoc does different processing if target filetype is html
# but all internal refs only work in browser when there is no html filetype
rename "$HTMLDIR/${doc_name}.html","$HTMLDIR/${doc_name}";
$doc_text =~ s/\!\[\]\(\.\.\/$IMAGEDIR\/(.+)\.png\)/\!\[\]\(\.\/$IMAGEDIR\/$1\.png\)/g;
$doc_text =~ s/\!\[\]\(\.\.\/$IMAGEDIR\/(.+)\.PNG\)/\!\[\]\(\.\/$IMAGEDIR\/$1\.PNG\)/g;
$doc_text =~ s/\!\[\]\(\.\.\/$IMAGEDIR\/(.+)\.jpg\)/\!\[\]\(\.\/$IMAGEDIR\/$1\.jpg\)/g;
open(MDFILE, ">$MDDIR/${doc_name}.md") or die "Could not open >$MDDIR/${doc_name}.md";
print MDFILE $doc_text;
close MDFILE;
my $pandoccmd2 = "pandoc --toc $MDDIR/${doc_name}.md -o $PDFDIR/${doc_name}.pdf";
verbose($pandoccmd2);
system($pandoccmd2);
if ($? && !$IGNOREERRORS) { die "error encountered in $pandoccmd2 \n";}
}
# Run the wget cmd and filter out some of the silly output
sub runwget {
my $index = shift;
# options we might consider: --html-extension --restrict-file-names=windows --cut-dirs=3
# options that do not work: --relative
#my $rejectlist = q('*title=Special:*,*title=Talk:*,*title=-&*,*title=HowTos,*title=Main_Page,*title=MediaWiki:*,*title=Release_Notes,*title=Wish_List_for_xCAT_2,*&action=edit*,*&action=history*,*&printable=yes*,*&oldid=*,index.html,opensearch_desc.php,xcat,login.php,support');
my $rejectlist = q('*title=Special:*,*title=Talk:*,*title=-&*,*title=HowTos,*title=Main_Page,*title=Release_Notes,*title=Wish_List_for_xCAT_2,*&action=edit*,*&action=history*,*&printable=yes*,*&oldid=*,index.html,opensearch_desc.php,xcat,login.php,support');
my $cmd = qq(wget --recursive --convert-links --no-verbose --progress=bar --level=1 --page-requisites --no-parent --no-host-directories --no-directories --no-clobber --execute robots=off --post-data='printable=yes' --reject $rejectlist $index);
verbose($cmd);
open(OUT, "$cmd 2>&1 |") || die "can't fork $cmd: $!\n";
while (<OUT>) {
if (/URL:https*:\/\/sourceforge\.net.+\s+->\s+\"(\S+)\"\s+\[/) { print "Downloaded $1.\n"; }
else { print; }
}
close OUT || print "Error running $cmd: $! $?\n";
sub process_includes {
my $doc_text = shift;
my $include_nest = shift;
if ($include_nest++ > 10) { die "nested include processing greater than 10. Infinite recursion???"; }
while (1) {
if ($doc_text =~ /\[\[(\s*)include (\s*)ref=(\s*)(.+)(\s*)\]\]/) {
my $next_include = $4;
download_doc($next_include);
open(INCLDFILE, "<$MDDIR/${next_include}.md") or die "Could not open <$MDDIR/${next_include}.md";
my @include_lines = <INCLDFILE>;
close INCLDFILE;
# my $include_text = join('\n', @include_lines);
my $include_text = join('', @include_lines);
$include_text = process_includes($include_text,$include_nest);
$doc_text =~ s/\[\[(\s*)include (\s*)ref=(\s*)$next_include(\s*)\]\]/$include_text/g;
} else {
last;
}
}
return $doc_text;
}
# Run the xhtml2pdf cmd and filter out some of the silly output
sub runh2p {
my $cmd = shift;
verbose($cmd);
open(OUT, "$cmd 2>&1 |") || die "can't fork $cmd: $!\n";
while (<OUT>) {
next if /DeprecationWarning:\sthe sets module is deprecated/;
next if /from sets import ImmutableSet/;
next if /^\s*import sets\s*$/;
next if /^Converting\ssourceforge.net/;
print;
}
close OUT || print "Error running $cmd: $! $?\n";
sub convert_tables {
my $doc_name=shift;
my $infile="$MDDIR/${doc_name}.md";
my $outfile=$infile;
open(MDFILE, "<$infile") or die "Could not open <$infile";
my @inlines=<MDFILE>;
close MDFILE;
my @outlines;
my @tablines;
my $in_comment=0;
my $xcat_table=0;
my $numcols=1;
my @colwidths=(0);
my $tabcount=0;
verbose("converting tables in $doc_name");
foreach my $line (@inlines) {
if ($line =~ /\<\!---/) { $in_comment=1; next; }
if ($in_comment) {
if ($line =~ /begin_xcat_table/) {$xcat_table=1; next;}
if ($xcat_table) {
if ($line =~ /numcols=(\d+)/) { $numcols=$1; next;}
if ($line =~ /colwidths=([\d,]+)/) { @colwidths=split(',',$1); next;}
}
if ($line =~ /end_xcat_table/) {
my $separator = '+';
foreach my $c (@colwidths) {
if ($c > 0) { $separator .= '-' x $c; }
$separator .= '+';
}
$separator .= "\n";
my $headsep = $separator;
$headsep =~ s/-/=/g;
my $rowline = $separator;
$rowline =~ s/-/ /g;
my $nosep=0;
foreach my $tabline(@tablines) {
if ($tabline =~ /^\s*$/) { next;}
if ($tabline =~ /^\-\-/) {
push (@outlines,$headsep);
$nosep = 1;
next;
}
if ($nosep) { $nosep=0;} else {push (@outlines,$separator);}
$tabline =~ s/^\s*\|//;
my @vals = split (/\|/,$tabline);
my $last_cell_line=0;
my $colnum=0;
my @tabrow;
foreach my $c (@colwidths) {
if ($c > 0) {
my $colval=$vals[$colnum];
$colval =~ s/(\s*)$//;
my $vallen = length($colval);
my $cell_line=0;
while ($vallen > $c) {
$tabrow[$cell_line++][$colnum] = substr($colval,0,$c);
$vallen -= $c;
$colval = substr($colval,$c,$vallen);
}
$tabrow[$cell_line][$colnum] = substr($colval,0,$vallen);
if ($vallen < $c) {
$tabrow[$cell_line][$colnum] .= " " x ($c-$vallen);
}
$last_cell_line = max($cell_line,$last_cell_line);
}
$colnum++;
}
my @rowlines;
for (my $i=0;$i<=$last_cell_line;$i++) {
for (my $j=0;$j<=$numcols-1;$j++) {
$rowlines[$i] .= "|";
if ($tabrow[$i][$j]) { $rowlines[$i] .= $tabrow[$i][$j]; }
else { $rowlines[$i] .= " " x $colwidths[$j]; }
}
$rowlines[$i] .= "|\n";
}
push (@outlines,@rowlines);
}
push (@outlines,$separator);
# reset to process next table
@tablines = ();
$xcat_table=0; $numcols=1;@colwidths=(0);next;
}
if ($line =~ /--\>/) {$in_comment=0;next;}
next;
}
if ($xcat_table) { push (@tablines,$line); next; }
push (@outlines,$line);
next;
}
open(MD2FILE, ">$outfile") or die "Could not open >$outfile";
print MD2FILE @outlines;
close MD2FILE;
return;
}
+64 -18
View File
@@ -147,29 +147,41 @@ if ( -e "/etc/debian_version" ){
# determine whether redhat or sles
$::linuxos = xCAT::Utils->osver();
#
# check to see if mysql is installed
#
my $cmd = "rpm -qa | grep -i perl-DBD-mysql";
if ( $::debianflag ){
$cmd = "dpkg -l | grep mysql-server";
}
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
my $message =
"\nMySQL perl DBD is not installed. If on AIX, it should be first obtained from the xcat dependency tarballs and installed before running this command.\n If on Linux, install from the OS CDs.";
xCAT::MsgUtils->message("E", " $cmd failed. $message");
exit(1);
}
# is this MariaDB or MySQL
$::MariaDB=0;
$cmd = "rpm -qa | grep -i mariadb"; # check this is MariaDB not MySQL
my $cmd;
if ( $::debianflag ){
$cmd = "dpkg -l | grep mariadb";
} else {
$cmd = "rpm -qa | grep -i mariadb"; # check this is MariaDB not MySQL
}
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC == 0) {
$::MariaDB=1;
}
#
# check to see if mysql is installed
#
$cmd = "rpm -qa | grep -i perl-DBD-mysql";
my $msg = "\nMySQL perl DBD ";
if ( $::debianflag ){
if ( $::MariaDB ){
$cmd = "dpkg -l | grep -i mariadb-server";
$msg = "\nmariadb-server ";
} else {
$cmd = "dpkg -l | grep mysql-server";
$msg = "\nmysql-server ";
}
}
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
my $message =
"\n$msg is not installed. If on AIX, it should be first obtained from the xcat dependency tarballs and installed before running this command.\n If on Linux, install from the OS CDs.";
xCAT::MsgUtils->message("E", " $cmd failed. $message");
exit(1);
}
# check to see if MySQL is running
$::mysqlrunning = 0;
$::xcatrunningmysql = 0;
@@ -187,6 +199,29 @@ if (grep(/$mysqlcheck/, @output))
}
$::mysqlrunning = 1;
}
#for ubuntu 14, after install mysql/maria server, the mysql will running
#need to stop mysql in order to setup init xcat mysql
if ( $::debianflag ){
$cmd = "pidof mysqld";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC == 0)
{
if ($::INIT)
{
my $ret=xCAT::Utils->stopservice("mysql");
if ($ret != 0)
{
xCAT::MsgUtils->message("E", " failed to stop mysql/mariadb.");
exit(1);
}
}
else {
$::mysqlrunning = 1;
}
}
}
if (-e ("/etc/xcat/cfgloc")) # check to see if xcat is using mysql
{ # cfgloc exists
$cmd = "fgrep mysql /etc/xcat/cfgloc";
@@ -883,8 +918,11 @@ sub mysqlstart
else
{
if ($::MariaDB==1) { # running MariaDB
#$cmd = "service mariadb start";
$ret=xCAT::Utils->startservice("mariadb");
if ($::linuxos =~ /rh.*/) {
$ret=xCAT::Utils->startservice("mariadb");
} else { # sles
$ret=xCAT::Utils->startservice("mysql");
}
} else { # it is mysql
@@ -993,7 +1031,15 @@ sub mysqlreboot
{
if ($::MariaDB==1 ) { # MariaDB not MySQL
if ($::linuxos =~ /rh.*/) {
$cmd = "chkconfig mariadb on";
} else { #sles
$cmd = "chkconfig mysql on";
if ( $::debianflag ){
$cmd = "update-rc.d mysql defaults";
}
}
} else { # mysql
if ($::linuxos =~ /rh.*/)
{
+23 -8
View File
@@ -180,7 +180,8 @@ if ($::RUNCMD_RC != 0)
exit(1);
}
# check if 9.X release not built by us is installed, setup different
if (grep(/postgresql9/, @output)) { # postgresql 9.x
# SLES used default dir
if ( (grep(/postgresql9/, @output)) && ($::linuxos !~ /sles/) ){ # postgresql 9.x
# figure out which 9.x release and build path
my @parseout= split(/\-/, $output[0]);
my @ptflevel= split ("postgresql9",$parseout[0]);
@@ -336,14 +337,14 @@ if (($INIT) && ($xcatrunningpgsql == 0))
#
# Init Pg database and setup pg_hba.conf and postgresql.conf
#
&initpgdb;
&initpgdb;
#
# Start Postgresql server
#
if ($pgsqlrunning == 0) # if not already running
{
&pgstart;
&pgstart(0);
}
#
@@ -705,6 +706,7 @@ sub runpgcmd_chkoutput
sub initpgdb
{
my $cmd;
my $dbrestart = 0;
# init the database, must su to postgres
@@ -759,6 +761,7 @@ sub initpgdb
xCAT::MsgUtils->message("E", " $cmd failed.");
exit(1);
}
$dbrestart = 1;
}
# setup the postgresql.conf file
@@ -800,6 +803,7 @@ sub initpgdb
$cmd = qq~echo log_min_messages = notice >> $pgconf~;
`$cmd`;
}
$dbrestart = 1;
}
# make sure everything in /var/lib/pgsql/data is owned by postgres
if ($::installdatadir) { # for protection
@@ -819,6 +823,11 @@ sub initpgdb
}
}
if ($dbrestart){
&pgstart(1);
}
}
#-----------------------------------------------------------------------------
@@ -826,14 +835,18 @@ sub initpgdb
=head3 pgstart
Start the Postgresql server
Start or restart the Postgresql server
startflg = 0 start postgresql
startflg = 1 restart postgresql
=cut
#-----------------------------------------------------------------------------
sub pgstart
{
my $startflg = shift;
my $cmd;
my $ret=0;
xCAT::MsgUtils->message("I", "Starting the PosgreSQL Server");
@@ -853,9 +866,11 @@ sub pgstart
#$cmd = "service postgresql start";
$cmd = "postgresql";
}
#system($cmd)
#if ($? > 0) {
$ret=xCAT::Utils->startservice($cmd);
if ($startflg == 0) {
$ret=xCAT::Utils->startservice($cmd);
} else {
$ret=xCAT::Utils->restartservice($cmd);
}
if ($ret != 0) {
xCAT::MsgUtils->message("E", " failed to start $cmd.");
exit(1);
@@ -972,7 +987,7 @@ sub setupxcatdb
$cmd = "/var/lib/pgsql/bin/psql -d $::dbname -U postgres";
} else { # Linux
$cmd = "$::pgcmddir/psql -d $::dbname -U postgres";
if ($debianflag){
if ( ($debianflag) || ($::linuxos =~ /sles/) ){
$cmd = "su - postgres -c '$::pgcmddir/psql -d $::dbname -U postgres'";
}
}
+5 -1
View File
@@ -169,7 +169,11 @@ sub nmap_pping {
foreach (@$nodes) {
$deadnodes{$_}=1;
}
open (FPING, "nmap -PE --system-dns --send-ip -sP ".join(' ',@$nodes). " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
# get additional options from site table
my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions");
my $more_options = $nmap_options[0];
open (FPING, "nmap -PE --system-dns --send-ip -sP $more_options ".join(' ',@$nodes). " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
my $node;
while (<FPING>) {
if (/Host (.*) \(.*\) appears to be up/) {
+27 -3
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Provide serial console access to nodes
@@ -21,7 +21,11 @@ if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help"
exit 0
fi
if [ "$1" = "-v" ]; then
echo "Version 2.8"
echo "Version 2.9"
exit 0
fi
if [ "$1" = "--version" ]; then
echo "Version 2.9"
exit 0
fi
@@ -48,7 +52,27 @@ if [ -n "$2" ]; then
fi
fi
if [ -f "/usr/bin/console" ] || [ -f "/bin/console" ]; then
if [ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ]; then
#use confluent
CONFETTY="confetty"
if [ -x "/opt/confluent/bin/confetty" ]; then
CONFETTY="/opt/confluent/bin/confetty"
fi
if [ ! -z "$CONSCONTROLPATH" ]; then
CONSCONTROLPATH="-c $CONSCONTROLPATH"
fi
if [ -z "$CONSERVER" ]; then
CONSERVER=`nodels $1 nodehm.conserver 2>/dev/null | awk -F: '{print $2}' | tr -d ' '`
fi
if [ -z "$CONSERVER" ]; then
CONSERVER=$XCATHOST
fi
if [ ! -z "$CONSERVER" ]; then
CONSERVER="-s $CONSERVER"
fi
$CONFETTY $CONSCONTROLPATH $CONSERVER $1
elif [ -f "/usr/bin/console" ] || [ -f "/bin/console" ]; then
#use conserver
if [ -z "$CONSERVER" ]; then
CONSERVER=`nodels $1 nodehm.conserver 2>/dev/null | awk -F: '{print $2}' | tr -d ' '`
+21 -5
View File
@@ -3,6 +3,8 @@
use Getopt::Long qw(:config getopt_compat pass_through);
use File::Basename;
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
use IO::Socket::UNIX;
use Time::HiRes qw/sleep/;
use lib "$::XCATROOT/lib/perl";
use xCAT::Client;
#use Data::Dumper;
@@ -54,7 +56,6 @@ foreach (@nodes) {
$conservers{$_} =~ s/:.*//;
next;
}
$conservers{$_} = 'localhost';
}
@@ -82,7 +83,7 @@ if (defined($tilefact)) {
$screenheight=$1;
}
}
$rootinf = `xwininfo -name "Top Panel"`;
$rootinf = `xwininfo -name "Top Panel" 2> /dev/null`;
foreach (split /\n/,$rootinf) {
if (/-geometry\s+([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+)/) {
if ($1 > 640 and $2 < 480 and $3 == 0 and $4 == 0) {
@@ -91,7 +92,7 @@ if (defined($tilefact)) {
}
}
if ($panel_pad == 0) {
$rootinf = `xwininfo -name "Top Expanded Edge Panel"`;
$rootinf = `xwininfo -name "Top Expanded Edge Panel" 2> /dev/null`;
foreach (split /\n/,$rootinf) {
if (/-geometry\s+([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+)/) {
if ($1 > 640 and $2 < 480 and $3 == 0 and $4 == 0) {
@@ -102,9 +103,24 @@ if (defined($tilefact)) {
}
$ENV{CONSCONTROLPATH} = "/tmp/wconscontrol.$firstnode.$$";
system("xterm $xrm -bg black -fg white -title $firstnode -n $firstnode -geometry +0+0 ".join(" ",@ARGV)." -e /bin/bash -c \"$mydir/xtcd.pl ".$ENV{DISPLAY}." $firstnode $firstnode & let SDATE=`date +%s`+5; $mydir/rcons $firstnode ".$conservers{$firstnode}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi \" &");
sleep(2); #Give time for window manager to figure out everything
my $xinfo = `xwininfo -name $firstnode`;
my $remainwait = 2;
while (not -S "/tmp/wconscontrol.$firstnode.$$" and $remainwait > 0) {
sleep(0.1);
$remainwait -= 0.1;
}
my $xinfo;
if (-S "/tmp/wconscontrol.$firstnode.$$") { # confluent mode
my $controlchannel = IO::Socket::UNIX->new(Type=>SOCK_STREAM(), Peer => "/tmp/wconscontrol.$firstnode.$$");
print $controlchannel "GETWINID\n";
my $winid = <$controlchannel>;
$winid = <$controlchannel>;
$xinfo = `xwininfo -id $winid`;
} else {
$xinfo = `xwininfo -name $firstnode`;
}
my @xinfl = split(/\n/,$xinfo);
my $side_pad;
my $wmxo;
+33 -14
View File
@@ -443,22 +443,41 @@ sub parse_args_xdsh
}
# add config file with strict host checking no
my $cmd = "echo \"StrictHostKeyChecking no\" >> $home/.ssh/config";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{ # error
$msg = "Error from $cmd\n";
xCAT::MsgUtils->message("E", $msg);
# add config file with strict host checking no, if not already there
my $configinfo = "StrictHostKeyChecking no";
my $configfile= "$home/.ssh/config";
if (-e $configfile)
{
my $cmd = "grep StrictHostKeyChecking $configfile";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0)
{ # not there
$cmd = "echo $configinfo >> $configfile";
my @output = xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{ # error
xCAT::MsgUtils->message("E", "Error on $cmd, @output");
return 1;
}
}
}
else # file does not exist
{
my $cmd = "echo $configinfo >> $configfile";
my @output = xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{ # error
xCAT::MsgUtils->message("E", "Error on $cmd, @output");
return 1;
}
else
{
chmod 0600, $configfile;
}
}
my $cmd = "chmod 0600 $home/.ssh/config";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{ # error
$msg = "Error from $cmd\n";
xCAT::MsgUtils->message("E", $msg);
}
# if current_userid is not "root", we need to generate the keys
# here before becoming root while running under xcatd
+8
View File
@@ -88,4 +88,12 @@ opt/xcat/bin/xcatclient opt/xcat/bin/lshwconn
opt/xcat/bin/xcatclientnnr opt/xcat/sbin/makeroutes
opt/xcat/bin/xcatclientnnr opt/xcat/sbin/snmove
opt/xcat/bin/xcatclientnnr opt/xcat/bin/lsxcatd
opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskit
opt/xcat/bin/xcatclientnnr opt/xcat/bin/addkit
opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmkit
opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskitcomp
opt/xcat/bin/xcatclientnnr opt/xcat/bin/addkitcomp
opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmkitcomp
opt/xcat/bin/xcatclientnnr opt/xcat/bin/chkkitcomp
opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskitdeployparam
opt/xcat/bin/xcatclient opt/xcat/bin/postage
+14 -2
View File
@@ -6,13 +6,15 @@ B<configfpc> - discover the Fan Power Controllers (FPCs) and configure the FPC i
B<configfpc> B<-i> I<interface>
B<configfpc> B<-i> I<interface> B<--ip> I<default ip address>
B<configfpc> [B<-V>|B<--verbose>]
B<configfpc> [B<-h>|B<--help>|B<-?>]
=head1 DESCRIPTION
B<configfpc> will discover and configure all FPCs that are set to the default IP address.
B<configfpc> will discover and configure all FPCs that are set to the default IP address. If not supplied the default ip is 192.168.0.100.
The B<-i> B<interface> is required to direct B<configfpc> to the xCAT MN interface which is on the same VLAN as the FPCs.
@@ -24,7 +26,7 @@ The B<configfpc> command discovers the FPCs and collects the MAC address. The MA
This process is repeated until no more FPCs are discovered.
For more information on xCAT support of NeXtScale and configfpc see:
For more information on xCAT support of NeXtScale and configfpc see the following doc:
XCAT_NeXtScale_Clusters
=head1 OPTIONS
@@ -35,6 +37,10 @@ XCAT_NeXtScale_Clusters
Use this flag to specify which xCAT MN interface (example: eth4) that is connected to the NeXtScale FPCs. This option is required.
=item B<--ip> I<default ip address>
Use this flag to override the default ip address of 192.168.0.100 with a new address.
=item B<-V>|B<--verbose>
Verbose mode
@@ -51,5 +57,11 @@ To discover and configure all NeXtScale Fan Power Controllers (FPCs) connected o
B<configfpc> B<-i> I<eth0>
=item 2
To override the default ip address and run in Verbose mode.
B<configfpc> B<-i> I<eth0> B<--ip> I<196.68.0.100> B<-V>
=back
+6 -2
View File
@@ -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.
+22 -14
View File
@@ -4,19 +4,23 @@ B<getxcatdocs> - downloads the xCAT documentation and converts to HTML and PDF
=head1 SYNOPSIS
B<getxcatdocs> [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>] [I<destination-dir>]
B<getxcatdocs> [B<-?> | B<-h> | B<--help>]
B<getxcatdocs> [B<-v> | B<--verbose>] [I<destination-dir>]
B<getxcatdocs> [B<-v> | B<--verbose>] [B<-c> | B<--continue>] [B<-d> | B<--doc> I<single_doc>] [I<destination-dir>]
=head1 DESCRIPTION
The B<getxcatdocs> command downloads the xCAT documentation from the wiki and converts it to both HTML and PDF.
This enables reading the documentation when you do not have internet access. Note that this command does not
download/convert the entire xCAT wiki - only the "official" xCAT documentation linked from https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Documentation .
download/convert the entire xCAT wiki - only the "official" xCAT documentation linked from http://sourceforge.net/p/xcat/wiki/XCAT_Documentation.
If I<destination-dir> is specified, B<getxcatdocs> will put the converted documentation in that directory, in 2 sub-directories: html, pdf.
Otherwise, it will put it in the current directory (in the same two sub-directories).
If I<destination-dir> is specified, B<getxcatdocs> will put the converted documentation in that directory, in 3 sub-directories: html, pdf, images.
Otherwise, it will put it in the current directory (in the same three sub-directories).
B<getxcatdocs> uses wget to do the download the documents and xhtml2pdf to convert them to PDF. To install xhtml2pdf, see:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Editing_xCAT_Documentation_Pages#Converting_Wiki_Pages_to_HTML_and_PDFs .
If B<--doc> I<single_doc> is specified, only that one wiki page will be downloaded and converted.
B<getxcatdocs> uses curl to run the Allura wiki API to download the document markdown text, and Pandoc with LaTex them to PDF. You must have all of these functions installed to run B<getxcatdocs>. See:
http://sourceforge.net/p/xcat/wiki/Editing_and_Downloading_xCAT_Documentation/#converting-wiki-pages-to-html-and-pdfs
=head2 Limitations:
@@ -26,24 +30,28 @@ https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Editing_xCAT_Documen
This command does not run on AIX or Windows.
=item *
The conversion to HTML does not yet honor the xCAT wiki style sheet.
=back
=head1 OPTIONS
=over 10
=item B<-v|--version>
Command Version.
=item B<-?|-h|--help>
Display usage message.
=item B<-v|--verbose>
Run the command in verbose mode.
=item B<-c|--continue>
If a previous run of this command failed (which often happens if you lose your network connection), continue processing using files already downloaded to your markdown directory.
=item B<-d|--doc> I<single_doc>
Run this command for a single document only. If you get errors about Official-xcat-doc.png not found, either download this image directly from http://sourceforge.net/p/xcat/wiki/XCAT_Documentation/attachment/Official-xcat-doc.png or run B<getxcatdocs -d XCAT_Documentation> first.
=back
=head1 RETURN VALUE
+7
View File
@@ -58,6 +58,7 @@ is a comma-delimited list of kit names. The B<lskit> command will only display t
=item B<-x|--xml|--XML>
Need XCATXMLTRACE=1 env when using -x|--xml|--XML, for example: XCATXMLTRACE=1 lskit -x testkit-1.0.0
Return the output with XML tags. The data is returned as:
<data>
<kitinfo>
@@ -156,6 +157,12 @@ To list the framework value of a Kit tarfile.
kitframework=2
compatible_kitframeworks=0,1,2
=item 5.
To list kit "testkit-1.0-1" with XML tags, enter:
XCATXMLTRACE=1 lskit -x testkit-1.0-1
=back
+7
View File
@@ -47,6 +47,7 @@ is a comma-delimited list of kit component names. The B<lskitcomp> command will
=item B<-x|--xml|--XML>
Need XCATXMLTRACE=1 env when using -x|--xml|--XML.
Return the output with XML tags. The data is returned as:
<data>
<kitinfo>
@@ -140,6 +141,12 @@ To list kit components compatible with "rhels-6.2-x86_64" osdistro and "computen
lskitcomp -O rhels-6.2-x86_64 -S computenode
=item 6.
To list the kit component "testkit-compute-1.0-1-ubuntu-14.04-ppc64el" with XML tags, enter:
XCATXMLTRACE=1 lskitcomp -x testkit-compute-1.0-1-ubuntu-14.04-ppc64el
=back
+1 -1
View File
@@ -14,7 +14,7 @@ I<lsslp [noderange] [-V] [-i ip[,ip..]][-w][-r|-x|-z][-n][-s CEC|FRAME|MM|IVM|RS
=head1 DESCRIPTION
The lsslp command discovers selected service types using the -s flag. All service types are returned if the -s flag is not specified. If a specific IP address is not specified using the -i flag, the request is sent out all available network adapters. The optional -r, -x, -z and --vpdtable flags format the output. If you can't receive all the hardware, please use -T to increase the waiting time. B<NOTE> lsslp on AIX has restriction. According to AIX design, you need to use these steps to discover nodes for each vlan: 1.Add multicast route, for example: route add 239.255.255.253 40.0.0.96. 2. Use lsslp -i to do discovery, for example, lsslp -i 40.0.0.96. 3. Delete the route: route delete 239.255.255.253 40.0.0.96. If you have several vlans and need to do discovery through several network interfaces, you need to repeat the steps above.
The lsslp command discovers selected service types using the -s flag. All service types are returned if the -s flag is not specified. If a specific IP address is not specified using the -i flag, the request is sent out all available network adapters. The optional -r, -x, -z and --vpdtable flags format the output. If you can't receive all the hardware, please use -T to increase the waiting time.
NOTE: SLP broadcast requests will propagate only within the subnet of the network adapter broadcast IPs specified by the -i flag.
+7 -7
View File
@@ -68,13 +68,13 @@ To display all information:
Output is similar to:
Version 2.7 (svn r, built Tue Jan 17 15:16:33 EST 2012)
This is a Management Node
cfgloc=mysql:dbname=xcatdb;host=10.6.0.1|xcatadmin
dbengine=mysql
dbname=xcatdb
dbhost=10.6.0.1
dbadmin=xcatadmin
Version 2.8.5 (git commit 0d4888af5a7a96ed521cb0e32e2c918a9d13d7cc, built Tue Jul 29 02:22:47 EDT 2014)
This is a Management Node
cfgloc=mysql:dbname=xcatdb;host=9.114.34.44|xcatadmin
dbengine=mysql
dbname=xcatdb
dbhost=9.114.34.44
dbadmin=xcatadmin
=back
+9
View File
@@ -128,6 +128,11 @@ To import nodes using a profile, follow the following steps:
__hostname__:
mac=b8:ac:6f:37:59:28
cec=mycec
__hostname__:
mac=b8:ac:6f:37:59:28
cec=mycec
lparid=2
# Node information file ends.
The node information file includes the following items:
@@ -152,6 +157,10 @@ B<cec=<cec-name>> This is a mandatory option for defining Power rack-mounted no
Description: Specifies the name of a Power rack-mount central electronic complex (CEC).
B<lparid=<lpar-id>> This is a optional option for defining Power rack-mounted nodes.
Description: Specifies the LPAR ID of a Power rack-mounted node, where <lpar-id> is the ID number. The default value is 1 if it is not defined.
B<ip=<ip-address>> This is an optional item.
Description: Specify the IP address used for provisioning a node, where <ip-address> is in the form xxx.xxx.xxx.xxx. If this item is not included, the IP address used to provision the node is generated automatically according to the Network Profile used by the node.
+6 -2
View File
@@ -4,9 +4,9 @@ B<pasu> - run the ASU to many nodes in parallel
=head1 SYNOPSIS
B<pasu> [B<-V>] [B<-d>] [B<-n>] [B<-l> I<user>] [B<-p> I<passwd>] [B<-f> I<fanout>] I<noderange> I<command>
B<pasu> [B<-V>] [B<-d>] [B<-n>] [B<-l> I<user>] [B<-p> I<passwd>] [B<-f> I<fanout>] [B<-i> I<hostname-suffix>] I<noderange> I<command>
B<pasu> [B<-V>] [B<-d>] [B<-n>] [B<-l> I<user>] [B<-p> I<passwd>] [B<-f> I<fanout>] B<-b> I<batchfile> I<noderange>
B<pasu> [B<-V>] [B<-d>] [B<-n>] [B<-l> I<user>] [B<-p> I<passwd>] [B<-f> I<fanout>] [B<-i> I<hostname-suffix>] B<-b> I<batchfile> I<noderange>
B<pasu> [B<-h> | B<--help>]
@@ -60,6 +60,10 @@ By default, pasu filters out (i.e. does not display) the standard initial output
If you want this output to be displayed, use this flag.
=item B<-i|--interface> I<hostname-suffix>
The hostname suffix to be appended to the node names.
=item B<-V|--verbose>
Display verbose messages.
+26 -3
View File
@@ -1,6 +1,6 @@
=head1 NAME
B<restartxcatd> - Restart the xCAT daemon (xcatd) on AIX.
B<restartxcatd> - Restart the xCAT daemon (xcatd).
=head1 SYNOPSIS
@@ -9,9 +9,32 @@ B<restartxcatd> [[B<-h>|B<--help>] | [B<-v>|B<--version>] | [B<-r>|B<--reload>]]
=head1 DESCRIPTION
The B<restartxcatd> command restarts the xCAT daemon (xcatd) on AIX.
It uses the startsrc and stopsrc commands to do the restart work. If the xcatd subsystem was not created, B<restartxcatd> will create it automatically.
The B<restartxcatd> command restarts the xCAT daemon (xcatd).
B<Linux Specific>
=over 2
It will perform the xcatd I<fast restart>. The xcatd I<fast restart> is a specific restart which has two advantages compares to the I<stop> and then I<start>.
1. The interval of xcatd out of service is very short.
2. The in processing request which initiated by old xcatd will not be stopped by force. The old xcatd will hand over the sockets to new xcatd, but old xcat will still be waiting for the in processing request to finish before the exit.
It does the same thing as 'service xcatd restart' on NON-systemd enabled Operating System like rh6.x and sles11.x. But for the systemd enabled Operating System like rh7 and sles12, the 'service xcatd restart' just do the I<stop> and I<start> instead of xcatd I<fast restart>.
It's recommended to use B<restartxcatd> command to restart xcatd on systemd enable system like rh7 and sles12 instead of 'service xcatd restart' or 'systemctl restart xcatd'.
=back
B<AIX Specific>
=over 2
It runs 'stopsrc -s xcatd' to stop xcatd first if xcatd is active, then runs 'startsrc -s xcatd' to start xcatd.
If the xcatd subsystem was not created, B<restartxcatd> will create it automatically.
=back
=head1 OPTIONS
+2 -2
View File
@@ -96,7 +96,7 @@ Retrieves deconfigured resources. Deconfigured resources are hw components (cpus
=item B<-x>
To output the information of deconfigured resources in XML format.
To output the raw information of deconfigured resources for CEC.
=item B<asset>
@@ -223,7 +223,7 @@ To retrieve all information available from blade node4, enter:
=item *
To output the information of deconfigured resources in XML format for CEC cec01, enter:
To output the raw information of deconfigured resources for CEC cec01, enter:
rinv cec01 deconfig -x
+1 -1
View File
@@ -48,7 +48,7 @@ osimage name that include this kit component.
=item B<kitcompname_list>
A comma-delimited list of valid full kit component names or kit component basenames that are to be removed from the osimage.
A comma-delimited list of valid full kit component names or kit component basenames that are to be removed from the osimage. If a basename is specified, all kitcomponents matching that basename will be removed from the osimage.
=back
+4 -3
View File
@@ -89,7 +89,7 @@ Files may be distributed and synchronized for both diskless and
diskfull nodes. Syncing files to NFS-based statelite nodes is not supported.
More information on using the synchronization file function is in
Using_Updatenode.
the following doc: Using_Updatenode.
=head3 Create the synclist file
@@ -345,7 +345,8 @@ Display usage message.
=item B<-k|--security>
Update the ssh keys and host keys for the service nodes and compute nodes;
Update the ca and credentials to the service nodes. Never run this command to the Management Node, it will take down xcatd.
Update the ca and credentials to the service nodes. Never run this command to the Management Node, it will take down xcatd.
You must be running updatenode as root to use the -k flag.
=item B<-l>|B<--user> I<user_ID>
@@ -365,7 +366,7 @@ be run during install. You should use updatenode <noderange> -F instead.
=item B<-S|--sw>
Specifies that node software should be updated. In Sysclone environment, specifies pushing the delta changes to target nodes.
Specifies that node software should be updated. In Sysclone environment, specifies pushing the delta changes to target nodes.
=item B<-s|--sn>
+10
View File
@@ -91,6 +91,16 @@ Output will be similar to:
For the attributes that are not recognized, the value will be blank.
=item *
To copy the packages from a supplemental DVD ISO file:
copycds -n /isodir/RHEL6.5/RHEL6.5-Supplementary-20131114.2-Server-ppc64-DVD1.iso -n rhels6.5-supp
Also, remember to add the new directory to your osimage definition:
chdef -t osimage myosimage -p pkgdir=/install/rhels6.5-supp/ppc64
=back
=head1 SEE ALSO
+6 -2
View File
@@ -6,9 +6,9 @@ B<makedns> - sets up domain name services (DNS).
B<makedns> [I<-h>|I<--help>]
B<makedns> [-e|--external] [I<-n>|I<--new>] [I<noderange>]
B<makedns> [-V|--verbose] [-e|--external] [I<-n>|I<--new>] [I<noderange>]
B<makedns> [-e|--external] [I<-d>|I<--delete> I<noderange>]
B<makedns> [-V|--verbose] [-e|--external] [I<-d>|I<--delete> I<noderange>]
=head1 DESCRIPTION
@@ -37,6 +37,10 @@ Cluster_Name_Resolution
=over 6
=item B<-V>|B<--verbose>
Verbose mode.
=item B<-n>|B<--new>
Use this flag to create new named configuration and db files.
+10
View File
@@ -13,6 +13,8 @@ Prefix: /opt/xcat
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%define fsm %(if [ "$fsm" = "1" ];then echo 1; else echo 0; fi)
%define pcm %(if [ "$pcm" = "1" ];then echo 1; else echo 0; fi)
%define notpcm %(if [ "$pcm" = "1" ];then echo 0; else echo 1; fi)
# AIX will build with an arch of "ppc"
%ifos linux
@@ -115,6 +117,14 @@ cp share/xcat/tools/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools
#cp usr/share/xcat/scripts/setup-local-client.sh $RPM_BUILD_ROOT/usr/share/xcat/scripts/setup-local-client.sh
#chmod 755 $RPM_BUILD_ROOT/usr/share/xcat/scripts/setup-local-client.sh
# PCM does not need getxcatdocs
# getxcatdocs causes xCAT-client requires perl-JSON, which is not shipped with PCM
%if %pcm
rm -f $RPM_BUILD_ROOT/%{prefix}/bin/getxcatdocs
rm -f $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/getxcatdocs.1.html
rm -f $RPM_BUILD_ROOT/%{prefix}/share/man/man1/getxcatdocs.1
%endif
# These links get made in the RPM_BUILD_ROOT/prefix area
ln -sf xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/rpower
ln -sf xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/rscan
+35 -2
View File
@@ -10,7 +10,15 @@ DIR=`dirname $0`
DIR=`readlink -f $DIR`
# get the input files for dracut in the right place
DRACUTMODDIR=/usr/share/dracut/modules.d/97xcat
# Fedora 20 ppc64 uses /usr/lib/dracut/modules.d
# CentOS 7 probably uses /usr/lib/dracut/modules.d also
if [ -e "/usr/share/dracut/modules.d" ]
then
DRACUTMODDIR=/usr/share/dracut/modules.d/97xcat
else
DRACUTMODDIR=/usr/lib/dracut/modules.d/97xcat
fi
mkdir -p $DRACUTMODDIR
cp $DIR/* $DRACUTMODDIR
# For ppc64 platform, needs to remove some files,
@@ -22,6 +30,20 @@ if [ `uname -m` = "ppc64" ]; then
sed -i 's/\/usr\/lib\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.13/' $DRACUTMODDIR/install
sed -i 's/\/lib\/libgcc_s.so.1/\/lib64\/libgcc_s.so.1/' $DRACUTMODDIR/install
sed -i 's/\/lib\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.7/' $DRACUTMODDIR/install
# following changes are required on Fedora 20 ppc64
sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install
sed -i 's/\/lib\/libc.so.6/\/lib64\/libc.so.6/' $DRACUTMODDIR/install
sed -i 's/\/lib\/ld-linux.so.2/\/lib64\/ld-2.18.so/' $DRACUTMODDIR/install
sed -i 's/\/lib\/libdl.so.2/\/lib64\/libdl.so.2/' $DRACUTMODDIR/install
sed -i 's/\/lib\/libm.so.6/\/lib64\/libm.so.6/' $DRACUTMODDIR/install
sed -i 's/\/lib\/libpthread.so.0/\/lib64\/libpthread.so.0/' $DRACUTMODDIR/install
sed -i 's/\/lib64\/libncurses.so.5.7/\/lib64\/libncurses.so.5.9/' $DRACUTMODDIR/install
sed -i 's/\/usr\/lib64\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.19/' $DRACUTMODDIR/install
sed -i 's/\/lib64\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.9/' $DRACUTMODDIR/install
sed -i 's/\/usr\/lib64\/libsasl2.so.2/\/usr\/lib64\/libsasl2.so.3/' $DRACUTMODDIR/install
sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install
sed -i 's/\/lib\/terminfo\/l\/linux/\/usr\/share\/terminfo\/l\/linux/g' $DRACUTMODDIR/install
sed -i 's/\/lib\/terminfo\/v\/vt100/\/usr\/share\/terminfo\/v\/vt100/g' $DRACUTMODDIR/install
fi
if [ "$HOSTOS" = "mcp" ]; then
@@ -29,6 +51,8 @@ if [ "$HOSTOS" = "mcp" ]; then
sed -i 's/\/etc\/redhat-release/\/etc\/base-release \/etc\/system-release/' $DRACUTMODDIR/install
sed -i 's/btrfs//' $DRACUTMODDIR/installkernel
sed -i 's/\/usr\/bin\/basename/\/bin\/basename/' $DRACUTMODDIR/install
# these are needed for sysclone, but are not yet in mcp
sed -i 's/ bc//' $DRACUTMODDIR/install
sed -i 's/ mkdosfs//' $DRACUTMODDIR/install
@@ -36,6 +60,10 @@ if [ "$HOSTOS" = "mcp" ]; then
sed -i 's/ kexec//' $DRACUTMODDIR/install
sed -i 's/ klogd//' $DRACUTMODDIR/install
sed -i 's/ mdadm//' $DRACUTMODDIR/install
sed -i 's/ mkfs\.xfs//' $DRACUTMODDIR/install
sed -i 's/ xfs_db//' $DRACUTMODDIR/install
sed -i 's/ mkreiserfs//' $DRACUTMODDIR/install
sed -i 's/ reiserfstune//' $DRACUTMODDIR/install
# These timezone files are not available in the latest mcp build
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Asia\/Riyadh87//' $DRACUTMODDIR/install
@@ -55,8 +83,13 @@ if [ "$HOSTOS" = "mcp" ]; then
else
echo Creating the initramfs in /tmp/xcatgenesis.$$.rfs using dracut ...
fi
dracut -m "xcat base" -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION
# On Fedora 20 ppc64, dracut uses host-only mode by default
if [ `uname -m` = "ppc64" ]; then
dracut -m "xcat base" -N -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION
else
dracut -m "xcat base" -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION
fi
echo Expanding the initramfs into /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/fs ...
cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/fs
zcat /tmp/xcatgenesis.$$.rfs|cpio -dumi
+9 -4
View File
@@ -1,17 +1,17 @@
#!/bin/sh
echo $drivers
dracut_install wget openssl tar mstflint ipmitool cpio gzip lsmod ethtool modprobe touch echo cut wc
dracut_install wget openssl tar mstflint ipmitool cpio gzip lsmod ethtool modprobe touch echo cut wc bash
dracut_install netstat # broadcom update requires
dracut_install uniq # mellanox update requires
dracut_install grep ip hostname /usr/bin/awk egrep grep dirname expr
dracut_install mount.nfs sshd vi reboot lspci parted screen mkfs mkfs.ext4 #mkfs.btrfs removed
dracut_install mount.nfs sshd vi reboot lspci parted screen mkfs mkfs.ext4 mkfs.xfs xfs_db #mkfs.btrfs removed
dracut_install efibootmgr
#dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm
dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad
dracut_install lldptool /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2
dracut_install poweroff ntpq ntpd hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services
dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc
dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/head /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements
dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail /usr/bin/basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements
dracut_install dmidecode /usr/lib64/libstdc++.so.6 #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si
dracut_install dmidecode /usr/lib64/libstdc++.so.5 #broadcom firmware update links against old lib
dracut_install /lib/libpthread.so.0 #32 bit lib because UXSPI will not ship a native 64 bit build
@@ -617,4 +617,9 @@ dracut_install /lib64/rsyslog/lmnet.so
dracut_install /lib64/rsyslog/lmstrmsrv.so
dracut_install /lib64/rsyslog/imuxsock.so
dracut_install /usr/lib64/libnfsidmap/nsswitch.so
dracut_install killall logger nc nslookup bc chown chroot dd expr kill mkdosfs parted rsync shutdown sort ssh-keygen tr blockdev findfs insmod kexec lvm mdadm mke2fs pivot_root sshd swapon tune2fs mkreiserfs reiserfstune # for sysclone
dracut_install killall logger nc nslookup bc chown chroot dd expr kill mkdosfs parted rsync shutdown sort ssh-keygen tr blockdev findfs insmod kexec lvm mdadm mke2fs pivot_root sshd swapon tune2fs mkreiserfs reiserfstune pvcreate lvremove vgremove vgcreate lvcreate lvscan lvchange vgchange pvdisplay lvdisplay vgdisplay blkid dmsetup sfdisk # for sysclone
dracut_install /lib/udev/rules.d/10-dm.rules
dracut_install /lib/udev/rules.d/11-dm-lvm.rules
dracut_install /lib/udev/rules.d/13-dm-disk.rules
dracut_install /lib/udev/rules.d/69-dm-lvm-metad.rules
dracut_install /lib/udev/rules.d/95-dm-notify.rules
+4 -2
View File
@@ -1,9 +1,11 @@
#!/bin/bash
instmods nfs sunrpc
instmods e1000 e1000e virtio_net igb ines sfc mlx4_en cxgb3 cxgb4 tg3 bnx2 bnx2x bna ixgb ixgbe qlge mptsas mpt2sas mpt3sas ata_piix megaraid_sas virtio_blk ahci ibmaem xhci-hcd sd_mod pmcraid be2net vfat ext3 ext4 btrfs reiserfs usb_storage scsi_wait_scan kvm kvm-intel kvm-amd ipmi_si ipmi_devintf
instmods e1000 e1000e virtio_net igb ines sfc mlx4_en cxgb3 cxgb4 tg3 bnx2 bnx2x bna ixgb ixgbe qlge mptsas mpt2sas mpt3sas ata_piix megaraid_sas virtio_blk ahci ibmaem xhci-hcd sd_mod pmcraid be2net vfat ext3 ext4 btrfs reiserfs usb_storage scsi_wait_scan kvm kvm-intel kvm-amd ipmi_si ipmi_devintf qlcnic xfs
instmods macvlan macvtap 8021q bridge bonding vmxnet3 cpufreq_ondemand acpi-cpufreq powernow-k8 cdc_ether
instmods mptctl #LSI firmware management requires this
instmods mlx4_ib ib_umad #make the mellanox ib available enough to examine /sys
instmods reiserfs #reiserfs on sysclone
instmods ibmveth # ppc64 virtual ethernet
instmods ibmvscsic # ppc64 virtual disk
instmods ibmvscsi # ppc64 virtual disk
instmods ehea # ppc64 hea ethernet
instmods dm-mod #support LVM for sysclone
+1 -1
View File
@@ -1,4 +1,4 @@
%define version 2.8
%define version 2.9
%ifarch i386 i586 i686 x86
%define tarch x86
%endif
@@ -41,4 +41,4 @@ cd -
%Files
%defattr(-,root,root)
%doc LICENSE.html
/
/opt/xcat/share/xcat/netboot/genesis/builder
+34 -2
View File
@@ -12,10 +12,23 @@ echo sshd:x:30:30:SSH User:/var/empty/sshd:/sbin/nologin >> /etc/passwd
echo rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:/sbin/nologin >> /etc/passwd
echo rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin >> /etc/passwd
echo qemu:x:107:107:qemu user:/:/sbin/nologin >> /etc/passwd
echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/xcatroot.sh
# Fedora 20 ppc64 uses /lib/dracut/hooks/initqueue/finished
# CentOS 7 probably uses /lib/dracut/hooks/initqueue/finished also
if [ -d "/initqueue-finished" ]; then
echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/xcatroot.sh
else
#echo 'if [ -e /proc ]; then /bin/doxcat; fi' > /lib/dracut/hooks/initqueue/finished/xcatroot.sh
echo '[ -e /proc ]' > /lib/dracut/hooks/initqueue/finished/xcatroot.sh
fi
mkdir /dev/cgroup
mount -t cgroup -o cpu,memory,devices cgroup /dev/cgroup
udevd --daemon
# Fedora 20 ppc64 does not udevd
# CentOS 7 probably does not have udevd either
if [ -f "/sbin/udevd" ]; then
udevd --daemon
else
/usr/lib/systemd/systemd-udevd --daemon
fi
udevadm trigger
mkdir -p /var/lib/dhclient/
mkdir -p /var/log
@@ -25,4 +38,23 @@ if grep console=ttyS /proc/cmdline > /dev/null; then
while :; do sleep 1; screen -x console < /dev/tty1 > /dev/tty1 2>&1; clear; done &
fi
while :; do screen -ln < /dev/tty2 > /dev/tty2 2>&1; done &
# The section below is just for System P LE hardware discovery
# Need to wait for NIC initialization
sleep 20
ARCH=`uname -m`
if [ $ARCH == 'ppc64' ]; then
ALL_NICS=`ip link show | grep -v "^ " | awk '{print $2}' | sed -e 's/:$//' | grep -v lo`
for tmp in $ALL_NICS; do
tmp_data=`ip link show $tmp | grep -v "^ " | grep "UP"`
if [ "$tmp_data" == "" ]; then
ip link set $tmp up
fi
tmp_data="UP"
sleep 1
done
fi
while :; do screen -L -ln doxcat; done
+15
View File
@@ -387,6 +387,21 @@ if [ ! "$IPMIVER" == "1.5" ]; then
if [ $TRIES -gt $TIMEOUT ]; then echo "ERROR"; else echo "OK"; fi
fi
# Reset the BMC for the x3755 M4 (8722), otherwise the BMC will not be pingable after running of bmcsetup
XPROD=`ipmitool mc info|grep "^Product ID"|awk '{print $4}'`
if [ "$XPROD" = "309" ] ; then
echo "Resetting BMC ..."
ipmitool mc reset cold
echo "Waiting for the BMC to appear ..."
sleep 15
TRIES=0
while ! ipmitool lan print $LANCHAN > /dev/null; do
sleep 3
let TRIES=TRIES+1
if [ $TRIES -gt $TIMEOUT ]; then break; fi
done
fi
# update the node status to 'bmcready'
for parm in `cat /proc/cmdline`; do
key=`echo $parm|awk -F= '{print $1}'`
+37 -12
View File
@@ -58,6 +58,7 @@ MTM=unknown
SERIAL=unknown
ARCH=unknown
ARCH=`uname -m` #32-bit only is old news
PLATFORM=unknown
if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86
PRODNAME=`cat /sys/devices/virtual/dmi/id/product_name`
IAMAVM=0
@@ -71,10 +72,27 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86
MTM=`cat /sys/devices/virtual/dmi/id/product_name|awk -F'[' '{print $2}'|awk -F']' '{print $1}'`
SERIAL=`cat /sys/devices/virtual/dmi/id/product_serial`
fi
CPUCOUNT=`cat /proc/cpuinfo |grep "model name"|wc -l`
grep "model name" /proc/cpuinfo | while read line; do #to avoid pulling in tail, we do a goofy thing
echo $line > /tmp/cpumod
done
CPUTYPE=`cat /tmp/cpumod|awk -F':' '{print $2}'|sed -e 's/^ //'`
UUID=`sed -e 's/\(..\)\(..\)\(..\)\(..\)-\(..\)\(..\)-\(..\)\(..\)/\4\3\2\1-\6\5-\8\7/' /sys/devices/virtual/dmi/id/product_uuid`
elif [ -r /proc/device-tree/model ]; then #POWER
MTM=`cat /proc/device-tree/model |awk -F, '{print $2}'`
#MTM=`cat /proc/device-tree/model |awk -F, '{print $2}'`
MTM=`cat /proc/device-tree/model | sed -e 's/\^.*,//'`
CPUCOUNT=`cat /proc/cpuinfo |grep -e "^cpu\s*:"|wc -l`
PLATFORM=`cat /proc/cpuinfo | grep -e "^platform\s*:" | awk '{print \$3}'`
grep -e "^cpu\s*:" /proc/cpuinfo | while read line; do #to avoid pulling in tail, we do a goofy thing
echo $line > /tmp/cpumod
done
CPUTYPE=`cat /tmp/cpumod|awk -F':' '{print $2}'|sed -e 's/^ //'`
SERIAL=`cat /proc/device-tree/system-id`
UUID=`sed -e 's/\(..\)\(..\)\(..\)\(..\)-\(..\)\(..\)-\(..\)\(..\)/\4\3\2\1-\6\5-\8\7/' /proc/sys/kernel/random/uuid`
fi
CPUCOUNT=`cat /proc/cpuinfo |grep "model name"|wc -l`
#CPUCOUNT=`cat /proc/cpuinfo |grep "model name"|wc -l`
# The MEMORY will look like this: 32868920
MEMORY=`cat /proc/meminfo |grep MemTotal|awk '{printf "%.0fMB\n", $2/1024}'`
@@ -86,11 +104,11 @@ MEMORY=`cat /proc/meminfo |grep MemTotal|awk '{printf "%.0fMB\n", $2/1024}'`
# The DISKSIZE will look like this: sdb:250GB,sda:250GB
DISKSIZE=`cat /proc/partitions |grep -e "sd.\>" |awk -F' ' '{printf "%s:%.0fGB\n", $4, $3*0.000001024}' |sed 'N;s/\n/,/'`
UUID=`sed -e 's/\(..\)\(..\)\(..\)\(..\)-\(..\)\(..\)-\(..\)\(..\)/\4\3\2\1-\6\5-\8\7/' /sys/devices/virtual/dmi/id/product_uuid`
grep "model name" /proc/cpuinfo | while read line; do #to avoid pulling in tail, we do a goofy thing
echo $line > /tmp/cpumod
done
CPUTYPE=`cat /tmp/cpumod|awk -F':' '{print $2}'|sed -e 's/^ //'`
#UUID=`sed -e 's/\(..\)\(..\)\(..\)\(..\)-\(..\)\(..\)-\(..\)\(..\)/\4\3\2\1-\6\5-\8\7/' /sys/devices/virtual/dmi/id/product_uuid`
#grep "model name" /proc/cpuinfo | while read line; do #to avoid pulling in tail, we do a goofy thing
# echo $line > /tmp/cpumod
#done
#CPUTYPE=`cat /tmp/cpumod|awk -F':' '{print $2}'|sed -e 's/^ //'`
echo '<xcatrequest>' > /tmp/discopacket
echo "<command>findme</command>" >> /tmp/discopacket
echo "<arch>$ARCH</arch>" >> /tmp/discopacket
@@ -101,17 +119,24 @@ echo "<cpucount>$CPUCOUNT</cpucount>" >> /tmp/discopacket
echo "<cputype>$CPUTYPE</cputype>" >> /tmp/discopacket
echo "<memory>$MEMORY</memory>" >> /tmp/discopacket
echo "<disksize>$DISKSIZE</disksize>" >> /tmp/discopacket
echo "<uuid>$UUID</uuid>" >> /tmp/discopacket
if [ "$UUID" != "unknown" ]; then
echo "<uuid>$UUID</uuid>" >> /tmp/discopacket
fi
if [ "$MTM" != "unknown" ]; then
echo "<mtm>$MTM</mtm>" >> /tmp/discopacket
fi
if [ "$SERIAL" != "unknown" ]; then
echo "<serial>$SERIAL</serial>" >> /tmp/discopacket
fi
if [ "$PLATFORM" != "unknown" ]; then
echo "<platform>$PLATFORM</platform>" >> /tmp/discopacket
fi
#so we have some cases where DMI table explictly records every function number, and some where only first function is enumerated
#so for each onboard device, we record it. If it is also the first function, we'll seek out other function numbers and append
#if that other function number does not show up in its own dmi type 41 record
for onboard in `dmidecode -t 41|egrep '(Type:|Bus Address)'|grep -A1 Ethernet|grep -v Ethernet|sed -e 's/.*Address: //'`; do
if [ -f "/usr/sbin/dmidecode" ]; then
for onboard in `dmidecode -t 41|egrep '(Type:|Bus Address)'|grep -A1 Ethernet|grep -v Ethernet|sed -e 's/.*Address: //'`; do
obdevs=("${obdevs[@]}" $onboard)
if [ ${onboard#*.}=0 ]; then
truncslot=${onboard%.*}
@@ -121,8 +146,8 @@ for onboard in `dmidecode -t 41|egrep '(Type:|Bus Address)'|grep -A1 Ethernet|gr
fi
done
fi
done
done
fi
#TODO: downed nics, also examine /sys/bus/pci/*/ for more network class devices that might not have driver suppert
for dev in `ip link|grep -B1 ether|grep UP|awk '{print $2}'|sed -e s/://|grep -v usb0`; do
FIRMDESC=""
@@ -131,7 +156,7 @@ for dev in `ip link|grep -B1 ether|grep UP|awk '{print $2}'|sed -e s/://|grep -v
PCI_SLOT=`grep PCI_SLOT_NAME /sys/class/net/$dev/device/uevent|awk -F= '{print $2}'`
ADDRESS=`ip address show dev $dev|grep "inet "|grep global|awk '{print $2}'`
MAC=`ip link show dev $dev|grep ether|awk '{print $2}'| tr /a-f/ /A-F/`
if [ ! -z "$PCI_SLOT" ]; then
if [[ ! -z "$PCI_SLOT" && -f "/usr/sbin/dmidecode" ]]; then
SLOTNAME=`dmidecode -t 9|egrep '(Designation|Address)'|grep -B1 $PCI_SLOT|grep Designation|sed -e 's/.*Designation:[ ]*//'`
if [ -z "$SLOTNAME" ]; then #check for on board device
index=1
+42 -6
View File
@@ -59,7 +59,7 @@ echo "Done"
PUBKEY=`openssl rsa -in /etc/xcat/privkey.pem -pubout 2> /dev/null|grep -v "PUBLIC KEY"`
PUBKEY=`echo $PUBKEY|sed -e 's/ //g'`
export PUBKEY
/sbin/rsyslogd -c4
/sbin/rsyslogd -4
mkdir -p /var/lib/lldpad
echo 'lldp :' >> /var/lib/lldpad/lldpad.conf
echo '{' >> /var/lib/lldpad/lldpad.conf
@@ -145,6 +145,29 @@ if [[ -n $hostip && -n $netmask && -n $gateway && -n $bootnic ]]; then
sleep 3
else
echo "Setting IP via DHCP..."
# This section is for System P hardware discovery, which won't have a BOOTIF value set
tries=0
while [ $tries -lt 5 ]; do
if [ -z "$bootnic" ]; then
ALLUP_NICS=`ip link show | grep -v "^ " | grep "state UP" | awk '{print $2}' | sed -e 's/:$//'|grep -v lo`
for tmp1 in $ALLUP_NICS; do
bootnic=$tmp1
break
done
else
break
fi
sleep 2
tries=$(($tries+1))
done
if [ -z "$bootnic" ]; then
ALL_NICS=`ip link show | grep -v "^ " | awk '{print $2}' | sed -e 's/:$//' | grep -v lo`
for tmp in $ALL_NICS; do
bootnic=$tmp
break
done
fi
dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$bootnic.pid $bootnic &
#we'll kick of IPv6 and IPv4 on all nics, but not wait for them to come up unless doing discovery, to reduce
#chances that we'll perform a partial discovery
@@ -176,9 +199,18 @@ ntpd -g -x
# rv 0 state does not work with the new ntp versions
#(while ! ntpq -c "rv 0 state"|grep 'state=4' > /dev/null; do sleep 1; done; hwclock --systohc) &
(while [ "`ntpq -c \"rv 0 offset\" | grep \"offset=\" | awk -F \"=\" '{print $2}' | awk -F \".\" '{print $1}' | sed s/-//`" -ge 1000 ]; do sleep 1; done; hwclock --systohc) &
if dmidecode|grep IPMI > /dev/null; then
modprobe ipmi_si
modprobe ipmi_devintf
IPMI_ERROR=`ipmitool mc info`
IPMI_RC=$?
IPMI_SUPPORT=1
if [ $IPMI_RC -ne 0 ]; then
IPMI_SUPPORT=0
fi
if [ -f "/usr/sbin/dmidecode" ]; then
if dmidecode|grep IPMI > /dev/null; then
modprobe ipmi_si
modprobe ipmi_devintf
fi
fi
DEVICE=$bootnic
export DEVICE
@@ -242,10 +274,14 @@ while :; do
cd -
elif [ "$dest" = "reboot" -o "$dest" = "boot" ]; then
/bin/nextdestiny $XCATMASTER:$XCATPORT
ipmitool chassis bootdev pxe
if [ $IPMI_SUPPORT -ne 0 ]; then
ipmitool chassis bootdev pxe
fi
reboot -f
elif [ "$dest" = "install" -o "$dest" = "netboot" ]; then
ipmitool chassis bootdev pxe
if [ $IPMI_SUPPORT -ne 0 ]; then
ipmitool chassis bootdev pxe
fi
reboot -f
elif [ "$dest" = sysclone ]; then
/bin/dosysclone
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
SOURCE_FILE="pseries_platform"
PLATFORM_FILE=/proc/cpuinfo
export PLATFORM_UNKNOWN=0
export PLATFORM_POWERKVM_HOST=1
export PLATFORM_POWERKVM_GUEST=2
export PLATFORM_PSERIES_LPAR=3
export platform_name="Unknown"
export platform=$PLATFORM_UNKNOWN
if grep -q "PowerNV" $PLATFORM_FILE; then
platform_name="PowerKVM Host"
platform=$PLATFORM_POWERKVM_HOST
elif grep -q "IBM pSeries (emulated by qemu)" $PLATFORM_FILE; then
platform_name="PowerKVM pSeries Guest"
platform=$PLATFORM_POWERKVM_GUEST
elif grep -q "pSeries" $PLATFORM_FILE; then
platform_name="PowerVM pSeries LPAR"
platform=$PLATFORM_PSERIES_LPAR
fi
PARAM=$0
BASENAME=`basename $0`
echo "basename:$BASENAME, param:$PARAM"
if [ $SOURCE_FILE = `basename $0` ]; then
echo $platform_name
fi
+457
View File
@@ -0,0 +1,457 @@
#!/bin/sh
# Copyright (c) 2003, 2004, 2008 International Business Machines
# Common Public License Version 1.0 (see COPYRIGHT)
#
# Authors: John Rose <johnrose@us.ibm.com>
# Mike Strosaker <strosake@austin.ibm.com>
# Simple script to update flash. The kernel module rtas_flash does
# the real work at reboot time.
# This script has minimal dependencies so it can operate in a rescue
# environment. This is probably overkill since it is easy enough to
# flash without this script.
#set -x
# For now firmware can only handle 4k pages. At some point in the
# future they will be able to handle large pages. When that (hopefully)
# happens we will need to use getconf to retrieve the systems page size.
PAGE_SIZE=4096
# Error Codes
E_SUCCESS=0 # Success
E_UNSUPPORTED=1 # Flash update is not supported on this system
E_USAGE=3 # Usage error
E_PERM=4 # Permission error
E_IMAGE=5 # Image file error
E_PROC_FS=6 # Proc file either doesn't exist, or behaves unexpectedly
E_MODULE=7 # Error loading module
E_RTAS=8 # RTAS call failed
E_USER=9 # User aborted operation
E_OVERWRITE=10 # Auto overwrite permanent side image
E_WRNTY=15 # Update Access Key Expired
# Script Constants
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
PROCFLASH=/proc/ppc64/rtas/firmware_update
PROCMANAGE=/proc/ppc64/rtas/manage_flash
PROCVALIDATE=/proc/ppc64/rtas/validate_flash
OLDPROCFLASH=/proc/ppc64/rtas/firmware_flash
PSERIES_PLATFORM=$(dirname $0)/pseries_platform
# firmware_update Status Values
FLASH_AUTH=-9002 # RTAS Not Service Authority Partition
FLASH_NO_OP=-1099 # No operation initiated by user
FLASH_IMG_SHORT=-1005 # Flash image shorter than expected
FLASH_IMG_BAD_LEN=-1004 # Bad length value in flash list block
FLASH_IMG_NULL_DATA=-1003 # Bad data value in flash list block
FLASH_IMG_READY=0 # Firmware img ready for flash on reboot
# manage_flash Status Values
MANAGE_AUTH=-9002 # RTAS Not Service Authority Partition
MANAGE_ACTIVE_ERR=-9001 # RTAS Cannot Overwrite Active Img
MANAGE_NO_OP=-1099 # No operation initiated by user
MANAGE_PARAM_ERR=-3 # RTAS Parameter Error
MANAGE_HW_ERR=-1 # RTAS Hardware Error
MANAGE_SUCCESS=0 # Operation Successful
# validate_flash Status Values
VALIDATE_AUTH=-9002 # RTAS Not Service Authority Partition
VALIDATE_INCOMPLETE=-1002 # User copied < VALIDATE_BUF_SIZE
VALIDATE_READY=-1001 # Firmware image ready for validation
VALIDATE_PARAM_ERR=-3 # RTAS Parameter Error
VALIDATE_HW_ERR=-1 # RTAS Hardware Error
VALIDATE_TMP_UPDATE=0 # RPA Section 7.3, Table 63
VALIDATE_FLASH_AUTH=1 # RPA Section 7.3, Table 63
VALIDATE_INVALID_IMG=2 # RPA Section 7.3, Table 63
VALIDATE_CUR_UNKNOWN=3 # RPA Section 7.3, Table 63
VALIDATE_TMP_COMMIT_DL=4 # RPA Section 7.3, Table 63
VALIDATE_TMP_COMMIT=5 # RPA Section 7.3, Table 63
VALIDATE_TMP_UPDATE_DL=6 # RPA Section 7.3, Table 63
VALIDATE_OUT_OF_WRNTY=7 # RPA Section 7.3, Table 63
error() {
local exit_code=$1
if [ $# -lt 1 ]; then
echo "error(): usage" >&2
return $E_USAGE
fi
shift;
echo update_flash: $* >&2
exit $exit_code
}
usage() {
local exit_code;
if [ "$1" == $E_SUCCESS ]; then
exit_code=$E_SUCCESS
else
exit_code=$E_USAGE
fi
echo "USAGE: update_flash {-h | -s | -r | -c | [-v|-n] -f <image filename>}" >&2
echo " -h Print this message." >&2
echo " -s Determine if partition has access to" >&2
echo " perform flash image management." >&2
echo " -r Reject temporary image." >&2
echo " -c Commit temporary image." >&2
echo " -v Validate ONLY with given image file." >&2
echo " -n Do not overwrite Permanent side" >&2
echo " image automatically." >&2
echo " -f <filename> Update with given image file. If possible," >&2
echo " the image is automatically validated prior" >&2
echo " to update." >&2
echo "" >&2
exit $exit_code
}
query_support() {
local exit_status=$E_UNSUPPORTED
if [ ! -r "$PROCVALIDATE" ]; then
modprobe rtas_flash || error $E_MODULE "could not load rtas_flash kernel module"
fi
if [ -e "/proc/device-tree/rtas/ibm,manage-flash-image" ]; then
grep \\"$VALIDATE_AUTH" "$PROCVALIDATE" > /dev/null
if [ $? -ne 0 ]; then
# validate-flash did not return "not authorized"
head --bytes=4k /dev/zero > $PROCVALIDATE 2>/dev/null
grep 1 "$PROCVALIDATE" > /dev/null
if [ $? -ne 0 ]; then
# validate-flash did not return "not authorized"
exit_status=0
fi
fi
else
if [ -e "/proc/device-tree/rtas/ibm,update-flash-64-and-reboot" ] || [ -e "/proc/device-tree/rtas/udpate-flash-and-reboot" ]; then
exit_status=0
fi
fi
if [ $exit_status -ne 0 ]; then
echo update_flash: flash image cannot be managed from this partition
else
echo update_flash: flash image management is supported
fi
exit $exit_status;
}
echo_validate_rtas_buf() {
local output="$1"
local cur_t_name=$(echo "$output" | grep "^MI" | head -n 1 | awk ' { print $2 } ')
local cur_p_name=$(echo "$output" | grep "^MI" | head -n 1 | awk ' { print $3 } ')
local new_t_name=$(echo "$output" | grep "^MI" | tail -n 1 | awk ' { print $2 } ')
local new_p_name=$(echo "$output" | grep "^MI" | tail -n 1 | awk ' { print $3 } ')
echo "Projected Flash Update Results:"
echo "Current T Image: $cur_t_name"
echo "Current P Image: $cur_p_name"
echo "New T Image: $new_t_name"
echo "New P Image: $new_p_name"
}
echo_entitlement_expiry_date() {
local build_date=`cat $PROCVALIDATE | grep "^MG" | tail -n 1 | cut -d " " -f2`
local entl_date=`cat $PROCVALIDATE | grep "^ME" | cut -d " " -f2`
echo "The selected firmware image cannot be applied."
echo ""
echo -n "The Build Date of the firmware image selected is "
if [ "$build_date" != "" ]; then
echo "$(date --date=$build_date +"%B %d, %Y")."
else
echo "UNKNOWN."
fi
echo -n "The System's Update Access Key Expiration Date is "
if [ "$entl_date" != "" ]; then
echo "$(date --date=$entl_date +"%B %d, %Y")."
else
echo "UNKNOWN."
fi
echo ""
echo "Please go to http://www.ibm.com/servers/eserver/ess to obtain "
echo "a replacement update access key."
}
echo_validate_return_status() {
local output="$1"
local rc=$(echo "$output" | head -n 1)
local rtas_buf=$(echo "$output" | tail -n +2)
[ $# -eq 1 ] || error $E_USAGE "echo_validate_return_status(): usage"
case "$rc" in
$VALIDATE_PARAM_ERR)
error $E_RTAS "RTAS: validate() Parameter Error";;
$VALIDATE_HW_ERR)
error $E_RTAS "RTAS: validate() Hardware Error";;
$VALIDATE_FLASH_AUTH)
error $E_RTAS "RTAS: validate() Partition does not have authority";;
$VALIDATE_AUTH)
error $E_RTAS "RTAS: validate() Partition does not have authority";;
$VALIDATE_INVALID_IMG)
error $E_RTAS "RTAS: validate() Invalid candidate image for this platform";;
$VALIDATE_TMP_UPDATE)
echo "info: Temporary side will be updated with a newer or"
echo "identical image";;
$VALIDATE_CUR_UNKNOWN)
echo "info: Current fixpack level is unknown";;
$VALIDATE_TMP_COMMIT_DL)
echo "info: Current Temporary image will be committed to"
echo "Permanent side before being replaced with new image, and"
echo "the new image is downlevel from current image";;
$VALIDATE_TMP_COMMIT)
echo "info: Current Temporary side will be committed to"
echo "Permanent side before being replaced with the new image";;
$VALIDATE_TMP_UPDATE_DL)
echo "info: Temporary side will be updated with a downlevel"
echo "image";;
$VALIDATE_OUT_OF_WRNTY)
echo_entitlement_expiry_date
error $E_WRNTY "Please contact your service support structure.";;
*) error $E_RTAS "RTAS: Unknown validate-flash-image Return Status"
esac
echo
echo_validate_rtas_buf "$rtas_buf"
# Do not commit T side image to P side
if [ $no_overwrite_opt -eq 1 ]; then
if [ $rc -eq $VALIDATE_TMP_COMMIT_DL ] || [ $rc -eq $VALIDATE_TMP_COMMIT ]; then
echo ""
echo "update_flash: Run without -n option to flash new image"
exit $E_OVERWRITE
fi
fi
}
validate_flash() {
local img_file=$1
local output=""
[ $# -eq 1 ] || error $E_USAGE "validate_flash(): usage"
[ -r $PROCVALIDATE ] || return $E_PROC_FS
grep \\"$VALIDATE_AUTH" "$PROCVALIDATE" > /dev/null
if [ $? -eq 0 ]; then # validate-flash returned "not authorized"
return $E_RTAS
fi
# Copy image file to proc file
cp "$img_file" "$PROCVALIDATE" || error $E_PROC_FS "error copying flash image to rtas_flash validate module"
# Display appropriate message, exiting if necessary
output="$(cat $PROCVALIDATE)"
echo_validate_return_status "$output"
return 0
}
validate_flash_from_file() {
local img_file=$1
[ $# -eq 1 ] || error $E_USAGE "validate_flash_from_file(): usage"
if [ ! -r "$PROCVALIDATE" ]; then
modprobe rtas_flash || error $E_MODULE "could not load rtas_flash kernel module"
[ -r "$PROCVALIDATE" ] || error $E_PROC_FS "rtas_flash kernel module did not create $PROCVALIDATE"
fi
if validate_flash $img_file; then
return 0;
else
case "$?" in
$E_PROC_FS) error $E_PROC_FS "validate: $PROCVALIDATE does not exist";;
$E_RTAS) error $E_RTAS "validate: firmware validation not supported on this system";;
esac
fi
}
echo_update_status() {
local rc="$1"
[ $# -eq 1 ] || error $E_USAGE "echo_update_status(): usage"
case "$rc" in
$FLASH_AUTH)
error $E_RTAS "RTAS: Partition does not have authority";;
$FLASH_IMG_SHORT)
error $E_IMAGE "Flash image shorter than expected";;
$FLASH_IMG_BAD_LEN)
error $E_PROC_FS "Bad length value in flash list block";;
$FLASH_IMG_NULL_DATA)
error $E_PROC_FS "Bad data value in flash list block";;
$FLASH_IMG_READY)
echo "Flash image ready...rebooting the system...";;
*) error $E_PROC_FS "RTAS: Unknown update flash status"
esac
}
update_flash_from_file() {
local img_file=$1
local output=""
local oldkernel=0
[ $# -eq 1 ] || error $E_USAGE "update_flash_from_file(): usage"
[ -r "$img_file" ] || error $E_IMAGE "cannot read $img_file"
flashfile=$PROCFLASH
if [ ! -r "$PROCFLASH" ]; then
modprobe rtas_flash
if [ ! -r "$PROCFLASH" ]; then
if [ -r "$OLDPROCFLASH" ]; then
oldkernel=1
else
error $E_PROC_FS "rtas_flash kernel module did not create $PROCFLASH"
fi
fi
fi
if [ -r "$PROCVALIDATE" ]; then
validate_flash "$img_file"
fi
if [ $oldkernel -eq 0 ]; then
dd if="$img_file" of="$PROCFLASH" bs=$PAGE_SIZE 2>/dev/null || error $E_PROC_FS "error copying flash image to rtas_flash kernel module"
output="$(cat $PROCFLASH)"
echo_update_status "$output"
else
dd if="$img_file" of="$OLDPROCFLASH" bs=PAGE_SIZE 2>/dev/null || error $E_PROC_FS "error copying flash image to rtas_flash kernel module"
cat "$OLDPROCFLASH"
fi
#XXX
reboot
return 0;
}
echo_manage_return_status() {
local is_commit=$1
local output=$2
local rc=$(echo $output)
[ $# -eq 2 ] || error $E_USAGE "echo_manage_return_status(): usage"
case "$rc" in
$MANAGE_AUTH)
error $E_RTAS "RTAS: manage() Partition does not have authority";;
$MANAGE_ACTIVE_ERR)
error $E_RTAS "RTAS: manage() Cannot Overwrite the Active Firmware Image";;
$MANAGE_PARAM_ERR)
error $E_RTAS "RTAS: manage() Parameter Error";;
$MANAGE_HW_ERR)
error $E_RTAS "RTAS: manage() Hardware Error";;
$MANAGE_SUCCESS)
if [ $is_commit -eq 0 ]; then
echo "success: Rejected temporary firmware image"
else
echo "success: Committed temporary firmware image"
fi
;;
*) error $E_RTAS "Unknown manage-flash-image Return Status"
esac
}
manage_flash() {
local is_commit=$1
local commit_str="1"
local reject_str="0"
local output=""
[ $# -eq 1 ] || error $E_USAGE "manage_flash(): usage"
if [ ! -r "$PROCMANAGE" ]; then
modprobe rtas_flash || error $E_MODULE "could not load rtas_flash kernel module"
[ -r "$PROCMANAGE" ] || error $E_PROC_FS "rtas_flash kernel module did not create $PROCMANAGE"
fi
if [ $is_commit -eq 1 ]; then
echo $commit_str > $PROCMANAGE
else
echo $reject_str > $PROCMANAGE
fi
output=$(cat $PROCMANAGE)
echo_manage_return_status $is_commit "$output"
if echo $output | grep "^success" > /dev/null; then
return 0
else
return $E_RTAS
fi
}
file=""
check_opt=0
commit_opt=0
reject_opt=0
validate_opt=0
no_overwrite_opt=0
file_opt=0
[ -d /proc/device-tree ] || error $E_PROC_FS "iSeries or /proc not mounted"
#XXX
#[ "`whoami`" = "root" ] || error $E_PERM "must be root to execute this command"
# Check for platform and if PowerNV call update_flash_nv
# PowerNV update_flash tool
UPDATE_FLASH_NV=$(dirname $0)/update_flash_nv
. $PSERIES_PLATFORM
case "$platform" in
$PLATFORM_UNKNOWN | $PLATFORM_POWERKVM_GUEST)
echo "update_flash: is not supported on the $platform_name platform"
exit 1;;
$PLATFORM_POWERKVM_HOST)
if [ ! -r "$UPDATE_FLASH_NV" ]; then
error $E_PERM "Couldn't find $UPDATE_FLASH_NV file."
fi
/bin/sh $UPDATE_FLASH_NV $@
exit $?
esac
while [ -n "$1" ]; do
arg="$1"
shift
case "$arg" in
-q|-l|-D|-S) error $E_USAGE "the $arg option is not implemented";;
-h) usage $E_SUCCESS;;
-s) check_opt=1;;
-c) commit_opt=1;;
-r) reject_opt=1;;
-v) validate_opt=1;;
-n) no_overwrite_opt=1;;
-f) file_opt=1; file="$1"; shift;;
*) error $E_USAGE "unknown option $arg"
esac
done
if [ -n "$file" ]; then
if [ $commit_opt -eq 1 ] || [ $reject_opt -eq 1 ] ||
[ $check_opt -eq 1 ]; then
usage
elif [ $validate_opt -eq 1 ] && [ $no_overwrite_opt -eq 1 ]; then
usage
elif [ $validate_opt -eq 1 ]; then
validate_flash_from_file $file
else
update_flash_from_file $file
fi
else
[ $check_opt -eq 1 ] && query_support
[ $commit_opt -eq 0 ] && [ $reject_opt -eq 0 ] && usage
[ $commit_opt -eq 1 ] && [ $reject_opt -eq 1 ] && usage
manage_flash $commit_opt
fi
+416
View File
@@ -0,0 +1,416 @@
#!/bin/sh
# Copyright (c) 2013 International Business Machines
# Common Public License Version 1.0 (see COPYRIGHT)
#
# Authors: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
#
# Simple script for code update on "KVM on Power" machines. This
# is a simple wrapper script to pass the image. The Linux kernel
# and FW does the real work during system reboot.
#
# This script has minimal dependencies so it can operate in a
# rescue environment.
#set -x
# Error codes
E_SUCCESS=0 # Success
E_UNSUPPORTED=1 # Firmware update is not supported
E_USAGE=3 # Usage error
E_PERM=4 # Permission error
E_IMAGE=5 # Image file error
E_SYS_FS=6 # Firmware update related sysfs file doesn't exist
E_MODULE=7 # Error loading module
E_OPAL=8 # OPAL call failed
E_USER=9 # User aborted operation
E_OVERWRITE=10 # Auto overwrite permanent side image
E_WRNTY=15 # Update Access Key Expired
# Firmware update related files
SYS_IMAGE_FILE=/sys/firmware/opal/image
SYS_VALIDATE_FLASH=/sys/firmware/opal/validate_flash
SYS_MANAGE_FLASH=/sys/firmware/opal/manage_flash
SYS_UPDATE_FLASH=/sys/firmware/opal/update_flash
# Code update status values
FLASH_SUCCESS=0 # Success
FLASH_PARAM_ERR=-1 # Parameter error
FLASH_BUSY=-2 # OPAL busy
FLASH_HW_ERR=-6 # Hardware error
FLASH_INTERNAL_ERR=-11 # Internal error
FLASH_NO_OP=-1099 # No operation initiated by user
FLASH_NO_AUTH=-9002 # Inband firmware update is not allowed
# Validate image status values
FLASH_IMG_READY=-1001 # Image ready for validation
FLASH_IMG_INCOMPLETE=-1002 # User copied < VALIDATE_BUF_SIZE
# Manage image status values
FLASH_ACTIVE_ERR=-9001 # Cannot overwrite active img
# Flash image status values
FLASH_IMG_READY=0 # Image ready for flash on reboot
FLASH_INVALID_IMG=-1003 # Flash image shorter than expected
FLASH_IMG_NULL_DATA=-1004 # Bad data
FLASH_IMG_BAD_LEN=-1005 # Bad length
# Validate image update result tokens
#
# T side will be updated
VALIDATE_TMP_UPDATE=0
#
# Partition does not have authority
VALIDATE_FLASH_AUTH=1
#
# Candidate image is not valid for this platform
VALIDATE_INVALID_IMG=2
#
# Current fixpack level is unknown
VALIDATE_CUR_UNKNOWN=3
#
# Current T side will be committed to P side before being replace
# with new image, and the new image is downlevel from current image
VALIDATE_TMP_COMMIT_DL=4
#
# Current T side will be committed to P side before being replaced
# with new image
VALIDATE_TMP_COMMIT=5
#
# T side will be updated with a downlevel image
VALIDATE_TMP_UPDATE_DL=6
#
# The candidate image's release date is later than the system's Update
# Access Key Expiration date - service warranty period has expired
VALIDATE_OUT_OF_WRNTY=7
error() {
local exit_code=$1
if [ $# -lt 1 ]; then
echo "error(): usage." >&2
return $E_USAGE
fi
shift;
echo update_flash: $* >&2
exit $exit_code
}
usage() {
local exit_code;
if [ "$1" == $E_SUCCESS ]; then
exit_code=$E_SUCCESS
else
exit_code=$E_USAGE
fi
echo "USAGE: update_flash {-h | -s | -r | -c | [-v|-n] -f <image filename>}" >&2
echo " -h Print this message." >&2
echo " -s Determine if partition has access to" >&2
echo " perform flash image management." >&2
echo " -r Reject temporary image." >&2
echo " -c Commit temporary image." >&2
echo " -v Validate the given image file." >&2
echo " -n Do not overwrite Permanent side" >&2
echo " image automatically." >&2
echo " -f <filename> Update with given image file. If possible," >&2
echo " the image is automatically validated prior" >&2
echo " to update." >&2
echo "" >&2
exit $exit_code
}
# Validate sysfs interface
validate_sysfs_file() {
local file="$1"
if [ -r "$file" ]; then
return $E_SUCCESS
fi
error $E_SYS_FS "sysfs interface for firmware update does not exists."
}
# Copy image to sysfs file
copy_candidate_image() {
local img_file=$1
[ $# -eq 1 ] || error $E_USAGE "copy_candidate_image(): usage."
[ -r "$img_file" ] || error $E_IMAGE "Cannot read ${img_file}."
# Copy candidate image
dd if=$img_file of=$SYS_IMAGE_FILE 2>/dev/null
if [ $? -ne 0 ]; then
echo "update_flash: Error copying firmware image."
error $E_IMAGE "Please retry with valid firmware image."
fi
}
echo_opal_return_status() {
case "$1" in
$FLASH_PARAM_ERR)
error $E_OPAL "Parameter Error.";;
$FLASH_BUSY)
error $E_OPAL "OPAL Busy.";;
$FLASH_HW_ERR)
error $E_OPAL "Hardware error.";;
$FLASH_INTERNAL_ERR)
error $E_OPAL "OPAL internal error.";;
$FLASH_NO_AUTH)
error $E_PERM "System does not have authority to perform firmware update.";;
$FLASH_IMG_INCOMPLETE)
error $E_IMAGE "Invalid candidate image.";;
$FLASH_ACTIVE_ERR)
error $E_OVERWRITE "Cannot Overwrite the Active Firmware Image.";;
$FLASH_INVALID_IMG)
error $E_IMAGE "Invalid candidate image.";;
$FLASH_IMG_NULL_DATA)
error $E_IMAGE "Bad data value in flash list block.";;
$FLASH_IMG_BAD_LEN)
error $E_IMAGE "Bad length value in flash list block.";;
*) error $E_OPAL "Unknown return status.";;
esac
}
# Determine if partition has access to perform flash image management
query_flash_support() {
# Validate sysfs interface
validate_sysfs_file $SYS_IMAGE_FILE
# By default KVM on Power host is allowed to do firmware management
echo "update_flash: Firmware image management is supported."
exit $E_SUCCESS
}
echo_validate_buf() {
local output="$1"
local cur_t=$(echo "$output" | grep "^MI" | head -n 1 | awk ' { print $2 } ')
local cur_p=$(echo "$output" | grep "^MI" | head -n 1 | awk ' { print $3 } ')
local new_t=$(echo "$output" | grep "^MI" | tail -n 1 | awk ' { print $2 } ')
local new_p=$(echo "$output" | grep "^MI" | tail -n 1 | awk ' { print $3 } ')
echo "Projected Flash Update Results:"
echo "Current T Image: $cur_t"
echo "Current P Image: $cur_p"
echo "New T Image: $new_t"
echo "New P Image: $new_p"
}
echo_validate_return_status() {
local output="$1"
local rc=$(echo "$output" | head -n 1)
local opal_buf=$(echo "$output" | tail -n +2)
[ $# -eq 1 ] || error $E_USAGE "echo_validate_return_status(): usage."
if [ $rc -lt 0 ]; then
echo_opal_return_status $rc
fi
# Validation result
case "$rc" in
$VALIDATE_TMP_UPDATE)
echo -n "info: Temporary side will be updated with a newer or"
echo " identical image.";;
$VALIDATE_FLASH_AUTH)
error $E_OPAL "System does not have authority.";;
$VALIDATE_INVALID_IMG)
error $E_OPAL "Invalid candidate image for this platform.";;
$VALIDATE_CUR_UNKNOWN)
echo "info: Current fixpack level is unknown.";;
$VALIDATE_TMP_COMMIT_DL)
echo "info: Current Temporary image will be committed to"
echo "Permanent side before being replaced with new image,"
echo "and the new image is downlevel from current image.";;
$VALIDATE_TMP_COMMIT)
echo "info: Current Temporary side will be committed to"
echo "Permanent side before being replaced with the new"
echo "image.";;
$VALIDATE_TMP_UPDATE_DL)
echo "info: Temporary side will be updated with a downlevel image.";;
*) error $E_OPAL "Unknown return status."
esac
echo
echo_validate_buf "$opal_buf"
# Do not commit T side image to P side
if [ $no_overwrite_opt -eq 1 ]; then
if [ $rc -eq $VALIDATE_TMP_COMMIT_DL ] ||
[ $rc -eq $VALIDATE_TMP_COMMIT ]; then
echo ""
echo "update_flash: Run without -n option to flash new image."
exit $E_OVERWRITE
fi
fi
}
validate_flash() {
local output=""
# Validate candidate image
echo 1 > $SYS_VALIDATE_FLASH 2>/dev/null
# Display appropriate message, exiting if necessary
output="$(cat $SYS_VALIDATE_FLASH)"
echo_validate_return_status "$output"
}
validate_flash_from_file() {
local img_file=$1
[ $# -eq 1 ] || error $E_USAGE "validate_flash_from_file(): usage."
# Validate sysfs interface
validate_sysfs_file $SYS_VALIDATE_FLASH
# Copy candiadate image
copy_candidate_image $img_file
# Validate candidate image
validate_flash
exit $E_SUCCESS
}
echo_update_return_status() {
local rc="$1"
[ $# -eq 1 ] || error $E_USAGE "echo_update_return_status(): usage."
if [ $rc -lt 0 ]; then
echo_opal_return_status $rc
elif [ $rc -eq $FLASH_IMG_READY ]; then
echo
echo "FLASH: Image ready...rebooting the system..."
echo "FLASH: This will take several minutes."
echo "FLASH: Do not power off!"
else
error $E_SYS_FS "Unknown return status."
fi
}
update_flash_from_file() {
local img_file=$1
local output=""
[ $# -eq 1 ] || error $E_USAGE "update_flash_from_file(): usage."
# Validate sysfs interface
validate_sysfs_file $SYS_UPDATE_FLASH
# Copy candidate image
copy_candidate_image $img_file
# Validate candidate image
validate_flash
# Update image
echo 1 > $SYS_UPDATE_FLASH 2>/dev/null
output="$(cat $SYS_UPDATE_FLASH)"
echo_update_return_status "$output"
# Reboot system, so that we can flash new image
reboot -f
exit $E_SUCCESS
}
echo_manage_return_status() {
local is_commit=$1
local output=$2
local rc=$(echo $output)
[ $# -eq 2 ] || error $E_USAGE "echo_manage_return_status(): usage."
if [ $rc -lt 0 ]; then
echo_opal_return_status $rc
elif [ $rc -eq $FLASH_SUCCESS ]; then
if [ $is_commit -eq 0 ]; then
echo "Success: Rejected temporary firmware image."
else
echo "Success: Committed temporary firmware image."
fi
else
error $E_OPAL "Unknown return status."
fi
}
manage_flash() {
local is_commit=$1
local commit_str="1"
local reject_str="0"
local output=""
[ $# -eq 1 ] || error $E_USAGE "manage_flash(): usage."
# Validate sysfs interface
validate_sysfs_file $SYS_MANAGE_FLASH
# Commit operation
if [ $is_commit -eq 1 ]; then
echo $commit_str > $SYS_MANAGE_FLASH
else
echo $reject_str > $SYS_MANAGE_FLASH
fi
# Result
output=$(cat $SYS_MANAGE_FLASH)
echo_manage_return_status $is_commit "$output"
exit $E_SUCCESS
}
file=""
check_opt=0
commit_opt=0
reject_opt=0
validate_opt=0
no_overwrite_opt=0
file_opt=0
# Only root user can perform firmware update
[ "`whoami`" == "root" ] || error $E_PERM "Must be root to execute this command."
# Parse command line options
while [ -n "$1" ]; do
arg="$1"
shift
case "$arg" in
-q|-l|-D|-S) error $E_USAGE "The $arg option is not implemented.";;
-h) usage $E_SUCCESS;;
-s) check_opt=1;;
-c) commit_opt=1;;
-r) reject_opt=1;;
-v) validate_opt=1;;
-n) no_overwrite_opt=1;;
-f) file_opt=1; file="$1"; shift;;
*) error $E_USAGE "Unknown option ${arg}."
esac
done
if [ -n "$file" ]; then
if [ $commit_opt -eq 1 ] || [ $reject_opt -eq 1 ] ||
[ $check_opt -eq 1 ]; then
usage
elif [ $validate_opt -eq 1 ] && [ $no_overwrite_opt -eq 1 ]; then
usage
elif [ $validate_opt -eq 1 ]; then
validate_flash_from_file $file
else
update_flash_from_file $file
fi
else
if [ $check_opt -eq 1 ]; then
if [ $commit_opt -eq 1 ] || [ $reject_opt -eq 1 ]; then
usage
else
query_flash_support
fi
fi
[ $commit_opt -eq 0 ] && [ $reject_opt -eq 0 ] && usage
[ $commit_opt -eq 1 ] && [ $reject_opt -eq 1 ] && usage
manage_flash $commit_opt
fi
+1 -1
View File
@@ -1,4 +1,4 @@
xcat-genesis-scripts-amd64 (2.8-snap20130205) precise; urgency=low
xcat-genesis-scripts (2.8-snap20130205) precise; urgency=low
* Nightly_Builds
+5 -4
View File
@@ -1,13 +1,14 @@
Source: xcat-genesis-scripts-amd64
Source: xcat-genesis-scripts
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.2
Package: xcat-genesis-scripts-amd64
Architecture: all
Depends: xcat-genesis-base-amd64
Package: xcat-genesis-scripts
Architecture: amd64 ppc64el
Depends: xcat-genesis-base-amd64[any-amd64],xcat-genesis-base-ppc64[any-ppc64el]
Replaces: xcat-genesis-scripts-amd64[any-amd64]
Description: xCAT genesis
(Genesis Enhanced Netboot Environment for System Information and Servicing) is a small, embedded-like environment for xCAT's use in discovery and management actions when interaction with an OS is infeasible. This package reperesents the EPL content that is more tightly bound to specific xcat-core versions
+85 -33
View File
@@ -1,36 +1,88 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: xcat-genesis-scripts
Source: <url://example.com>
Eclipse Public License - v 1.0
Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
License: <special license>
<Put the license of the package here indented by 1 space>
<This follows the format of Description: lines in control file>
.
<Including paragraphs>
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2013 root <root@unknown>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
1. DEFINITIONS
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
"Contribution" means:
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
"Contributor" means any person or entity that distributes the Program.
"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
"Program" means the Contributions distributed in accordance with this Agreement.
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
3. REQUIREMENTS
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
a) it complies with the terms and conditions of this Agreement; and
b) its license agreement:
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
When the Program is made available in source code form:
a) it must be made available under this Agreement; and
b) a copy of this Agreement must be included with each copy of the Program.
Contributors may not remove or alter any copyright notices contained within the Program.
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. GENERAL
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-1
View File
@@ -1 +0,0 @@
/opt/xcat/share/xcat/netboot/genesis/x86_64/fs
-3
View File
@@ -1,3 +0,0 @@
./etc/ opt/xcat/share/xcat/netboot/genesis/x86_64/fs
./bin/ opt/xcat/share/xcat/netboot/genesis/x86_64/fs
./sbin/ opt/xcat/share/xcat/netboot/genesis/x86_64/fs
+1
View File
@@ -20,6 +20,7 @@ set -e
case "$1" in
configure)
echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch> manually'"
touch /etc/xcat/genesis-scripts-updated
;;
+13 -1
View File
@@ -9,6 +9,15 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
ifneq ($(DEB_HOST_ARCH),ppc64el)
export TARGET_ARCH=x86_64
else
export TARGET_ARCH=ppc64
endif
export installdir=/opt/xcat/share/xcat/netboot/genesis/$(TARGET_ARCH)/fs
export installtodir=opt/xcat/share/xcat/netboot/genesis/$(TARGET_ARCH)/fs
build:
pwd
@@ -21,8 +30,11 @@ install:
pwd
dh_testdir
dh_testroot
dh_installdirs
dh_installdirs $(installdir)
dh_install -X".svn"
dh_install ./etc/ $(installtodir)
dh_install ./bin/ $(installtodir)
dh_install ./sbin/ $(installtodir)
dh_compress
dh_installdeb
dh_gencontrol
+35 -2
View File
@@ -7,6 +7,7 @@
%ifarch ppc ppc64
%define tarch ppc64
%endif
%define rpminstallroot /opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs
BuildArch: noarch
%define name xCAT-genesis-scripts-%{tarch}
%define __spec_install_post :
@@ -67,11 +68,43 @@ cd -
# should run mknb. Tried to use rpm triggers, but in several cases the trigger would
# get run multiple times.
#echo "touching /etc/xcat/genesis-scripts-updated"
echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch> manually'"
echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch>' manually"
mkdir -p /etc/xcat
touch /etc/xcat/genesis-scripts-updated
%Files
%defattr(-,root,root)
/opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs
#%dir %attr(-,root,root) %{rpminstallroot}
%{rpminstallroot}/bin/allowcred.awk
%{rpminstallroot}/bin/bmcsetup
%{rpminstallroot}/bin/dodiscovery
%{rpminstallroot}/bin/dosysclone
%{rpminstallroot}/bin/doxcat
%{rpminstallroot}/bin/getcert
%{rpminstallroot}/bin/getdestiny
%{rpminstallroot}/bin/getipmi
%{rpminstallroot}/bin/ifup
%{rpminstallroot}/bin/minixcatd.awk
%{rpminstallroot}/bin/nextdestiny
%{rpminstallroot}/bin/remoteimmsetup
%{rpminstallroot}/bin/udpcat.awk
%{rpminstallroot}/bin/updateflag.awk
%{rpminstallroot}/bin/pseries_platform
%{rpminstallroot}/bin/update_flash
%{rpminstallroot}/bin/update_flash_nv
%{rpminstallroot}/debian/changelog
%{rpminstallroot}/debian/compat
%{rpminstallroot}/debian/control
%{rpminstallroot}/debian/copyright
#%{rpminstallroot}/debian/dirs
%{rpminstallroot}/debian/docs
#%{rpminstallroot}/debian/install
%{rpminstallroot}/debian/postinst
%{rpminstallroot}/debian/postrm
%{rpminstallroot}/debian/preinst
%{rpminstallroot}/debian/prerm
%{rpminstallroot}/debian/rules
%{rpminstallroot}/etc/init.d/functions
%{rpminstallroot}/etc/udev/rules.d/99-imm.rules
%{rpminstallroot}/sbin/setupimmnic
-1
View File
@@ -1 +0,0 @@
xcat-rmc_2.5.0-1_all.deb admin extra
+1 -1
View File
@@ -7,6 +7,6 @@ Standards-Version: 3.7.2
Package: xcat-server
Architecture: all
Depends: ${perl:Depends}, grub2-xcat, perl-xcat (>= 2.5.0-1), xcat-client (>= 2.5.0-1), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl
Depends: ${perl:Depends}, grub2-xcat, perl-xcat (>= 2.5.0-1), xcat-client (>= 2.5.0-1), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl,libjson-perl
Description: Server and configuration utilities of the xCAT management project
xCAT-server provides the core server and configuration management components of xCAT. This package should be installed on your management server
+1
View File
@@ -22,6 +22,7 @@ opt/xcat/share/xcat/ib/netboot/sles
opt/xcat/share/xcat/ib/netboot/rh
opt/xcat/lib
opt/xcat/lib/perl
opt/xcat/lib/perl/Confluent
opt/xcat/lib/perl/xCAT
opt/xcat/lib/perl/xCAT_plugin
opt/xcat/lib/perl/xCAT_schema
+1
View File
@@ -24,6 +24,7 @@ lib/xcat/plugins/* opt/xcat/lib/perl/xCAT_plugin/
lib/xcat/schema/* opt/xcat/lib/perl/xCAT_schema/
lib/xcat/monitoring/* opt/xcat/lib/perl/xCAT_monitoring/
lib/xcat/dsh/Context/* opt/xcat/xdsh/Context
lib/xcat/Confluent/* opt/xcat/lib/perl/Confluent/
lib/xcat/shfunctions opt/xcat/lib
etc/init.d/xcatd etc/init.d
+1
View File
@@ -60,6 +60,7 @@ binary-arch:
chmod 644 $(rootdir)/lib/perl/xCAT_monitoring/samples/*
chmod 755 $(rootdir)/lib/perl/xCAT_monitoring/pcp
chmod 644 $(rootdir)/lib/perl/xCAT_monitoring/pcp/*
chmod 644 $(rootdir)/lib/perl/Confluent/*
chmod 644 $(rootdir)/lib/perl/xCAT_schema/*
chmod 755 $(rootdir)/lib/perl/xCAT_schema/samples
chmod 644 $(rootdir)/lib/perl/xCAT_schema/samples/*
Executable → Regular
+50
View File
@@ -2138,6 +2138,45 @@ sub parse_args
}
sub findme {
my $request = shift;
my $callback = shift;
my $subreq = shift;
if (!defined $request->{'mtm'} or !defined $request->{'serial'}) {
xCAT::MsgUtils->message("S", "Discovery Error: 'mtm' or 'serial' not found.");
return;
}
my @attr_array = ();
my $mtms = $request->{'mtm'}->[0]."*".$request->{'serial'}->[0];
my $tmp_nodes = $::XCATVPDHASH{$mtms};
my @nodes = ();
my $pbmc_node;
foreach (@$tmp_nodes) {
if ($::XCATPPCHASH{$_}) {
$pbmc_node = $_;
} else {
push @nodes, $_;
}
}
my $nodenum = $#nodes;
if ($nodenum < 0) {
xCAT::MsgUtils->message("S", "Discovery Error: Could not find any node.");
return;
} elsif ($nodenum > 0) {
xCAT::MsgUtils->message("S", "Discovery Error: More than one node were found.");
return;
}
{
my $req = {%$request};
$req->{command} = ['discovered'];
$req->{noderange} = [$nodes[0]];
$req->{pbmc_node} = [$pbmc_node];
$req->{discoverymethod} = ['mtms'];
$subreq->($req);
%{$req} = ();
}
}
##########################################################################
# Process request from xCat daemon
##########################################################################
@@ -2153,6 +2192,17 @@ sub process_request {
####################################
$package =~ s/xCAT_plugin:://;
####################################
# Deal with findme request
####################################
if ($req->{command}->[0] eq 'findme') {
# The arch of the node shall be check first to makesure it is a power machine
if (!defined $req->{'arch'} or $req->{'arch'}->[0] ne 'ppc64') {
return;
}
&findme($req, $callback, $subreq);
return;
}
####################################
# Build hash to pass around
####################################
+36 -3
View File
@@ -1394,7 +1394,7 @@ sub collect_all_attribs_for_tables_in_template
#for noderes.xcatmaster
if ($tabname =~ /^noderes$/ && $attrib =~ /^xcatmaster$/ &&
( ! exists($::GLOBAL_TAB_HASH{noderes}{$node}{xcatmaster}) ||
$::GLOBAL_TAB_HASH{noderes}{$node}{xcatmaster} == "" ) )
$::GLOBAL_TAB_HASH{noderes}{$node}{xcatmaster} eq "" ) )
{
my $value;
$value = xCAT::NetworkUtils->my_ip_facing($node);
@@ -1858,12 +1858,45 @@ sub getPostScripts
$result .= "setbootfromnet\n";
}
# add setbootfromdisk if the nodesetstate is install and arch is ppc64
if (($nodesetstate) && ($nodesetstate eq "install") && ($arch eq "ppc64"))
# add setbootfromdisk if the nodesetstate is install or sysclone and arch is ppc64
if (($nodesetstate) && (($nodesetstate eq "install") || ($nodesetstate eq "sysclone")) && ($arch eq "ppc64"))
{
$result .= "setbootfromdisk\n";
}
#for redhat 7, append "disableconsistentNICrename" to default postscripts
#if "net.ifnames=0" is specified in kcmdline/addkcmdline of node or osimage
my $tftpdir = xCAT::TableUtils::getTftpDir();
my $osimagetab=xCAT::Table->new('osimage',-create=>1);
my $osimgent = $osimagetab->getAttribs({imagename => $osimgname },'osvers');
my $os = $osimgent->{'osvers'};
my $nrret = $::GLOBAL_TAB_HASH{noderes}{$node};
my $netboot = $nrret->{'netboot'};
if( (($os =~ "rhel7*") || ($os =~ "rhels7*")) && ($nodesetstate) && ($nodesetstate eq "install") )
{
my $nodecfg;
if($netboot eq "grub2")
{
$nodecfg="$tftpdir/boot/grub2/$node";
}elsif($netboot eq "xnba")
{
$nodecfg="$tftpdir/xcat/xnba/nodes/$node";
}elsif($netboot eq "pxe")
{
$nodecfg="$tftpdir/pxelinux.cfg/$node";
}
my $rc=system("grep net.ifnames=0 $nodecfg >/dev/null 2>&1");
if($rc ==0)
{
$result .= "disableconsistentNICrename\n";
}
}
return $result;
}
+3 -2
View File
@@ -146,7 +146,8 @@ sub run_remote_shell_api {
my $pw_tried=0;
my $login_done=0;
my ($prematch, $match)= $t->waitfor(Match => '/login[: ]*$/i',
Match => '/username[: ]*$/i',
Match => '/username[: ]*$/i',
Match => '/User Name[: ]*$/i',
Match => '/password[: ]*$/i',
Match => "/$prompt/",
Errmode => "return");
@@ -155,7 +156,7 @@ sub run_remote_shell_api {
}
if ($match =~ /$prompt/) {
$login_done=1;
} elsif (($match =~ /username[: ]*$/i) || ($match =~ /login[: ]*$/i )) {
} elsif (($match =~ /User Name[: ]*$/i) || ($match =~ /username[: ]*$/i) || ($match =~ /login[: ]*$/i )) {
# user name
if ($user) {
if (! $t->put(String => "$user\n",

Some files were not shown because too many files have changed in this diff Show More