From e2689f5f00a36c6d06b4854d92497b22905e27b9 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 30 May 2018 16:16:40 -0700 Subject: [PATCH] StarlingX open source release updates Signed-off-by: Dean Troyer --- LICENSE | 202 +++ README.rst | 5 + anaconda/centos/build_srpm.data | 1 + ...te-package-versioning-for-TIS-format.patch | 25 + .../meta_patches/0002-Add-TIS-patches.patch | 38 + .../0003-revert-7.4-grub2-efi-handling.patch | 32 + .../0004-Upversion-rpm-devel-dependency.patch | 25 + ...0005-Add-TIS-patches-for-host-lookup.patch | 53 + anaconda/centos/meta_patches/PATCH_ORDER | 5 + ...0001-TIS-Progress-and-error-handling.patch | 394 ++++++ .../0002-revert-7.4-grub2-efi-handling.patch | 87 ++ ...03-Set-default-hostname-to-localhost.patch | 25 + .../0004-Cache-server-ip-in-etc-hosts.patch | 80 ++ anaconda/centos/srpm_path | 1 + crontabs/centos/build_srpm.data | 1 + ...te-package-versioning-for-TIS-format.patch | 25 + crontabs/centos/meta_patches/PATCH_ORDER | 2 + ...o-remove-printing-of-motd-script-nam.patch | 35 + ...tion-to-remove-printing-of-motd-scri.patch | 65 + crontabs/centos/srpm_path | 1 + dnsmasq/.gitignore | 7 + dnsmasq/PKG-INFO | 13 + dnsmasq/centos/build_srpm.data | 2 + ...te-package-versioning-for-TIS-format.patch | 25 + dnsmasq/centos/meta_patches/PATCH_ORDER | 4 + .../dnsmasq-spec-add-init-script.patch | 71 ++ ...ch-tftp-to-close-sockets-immediately.patch | 34 + .../meta_patches/spec-include-TiS-patch.patch | 49 + .../close-tftp-sockets-immediately.patch | 28 + ...smasq-update-ipv6-leases-from-config.patch | 84 ++ dnsmasq/centos/srpm_path | 1 + dnsmasq/files/init | 59 + grub2/centos/build_srpm.data | 3 + ...te-package-versioning-for-TIS-format.patch | 28 + ...x-mktitle-de-brand-the-grub.cfg-menu.patch | 21 + .../0003-grub2-Build-unsigned-package.patch | 72 ++ .../0004-grub2-Build-pxeboot-package.patch | 42 + .../centos/meta_patches/0005-add-tboot.patch | 44 + grub2/centos/meta_patches/PATCH_ORDER | 5 + grub2/centos/patches/10001-add-tboot.patch | 42 + ...x-mktitle-de-brand-the-grub.cfg-menu.patch | 47 + grub2/centos/srpm_path | 1 + mwa-gplv3.map | 10 + parted/PKG-INFO | 14 + parted/centos/build_srpm.data | 3 + ...te-package-versioning-for-TIS-format.patch | 25 + ...tting-removed-for-100-to-300-ms-on-p.patch | 33 + parted/centos/meta_patches/PATCH_ORDER | 3 + parted/centos/meta_patches/syscalls.patch | 63 + ...ed-for-100-to-300-ms-on-parted-print.patch | 1103 +++++++++++++++++ parted/centos/patches/syscalls.patch | 42 + parted/centos/srpm_path | 1 + parted/files/Makefile | 285 +++++ .../files/fix-compile-failure-while-dis.patch | 57 + parted/files/fix-doc-mandir.patch | 20 + parted/files/no_check.patch | 20 + parted/files/resizepart.sh | 24 + parted/files/run-ptest | 3 + parted/files/syscalls.patch | 55 + python-keyring/PKG-INFO | 16 + python-keyring/centos/build_srpm.data | 2 + ...01-move-package-from-tarball-to-srpm.patch | 78 ++ ...-buildrequires-python-setuptools_scm.patch | 20 + .../centos/meta_patches/PATCH_ORDER | 2 + python-keyring/centos/srpm_path | 1 + .../python-keyring/chmod_keyringlock2.patch | 37 + .../chown_keyringlock_file.patch | 12 + .../fix_keyring_lockfile_location.patch | 113 ++ .../python-keyring/keyring_path_change.patch | 24 + .../python-keyring/lock_keyring_file.patch | 45 + .../python-keyring/lock_keyring_file2.patch | 42 + .../python-keyring/no_keyring_password.patch | 70 ++ .../python-keyring/remove-reader-lock.patch | 136 ++ ...move_others_perms_on_keyringcfg_file.patch | 15 + .../python-keyring/use_new_lock.patch | 243 ++++ .../python-keyring/use_temporary_file.patch | 162 +++ python-psycopg2/centos/build_srpm.data | 2 + .../centos/meta_patches/PATCH_ORDER | 2 + .../centos/meta_patches/meta-patch0.patch | 33 + .../meta_patches/setup-spec-for-tis.patch | 25 + ...nually-patch-170-173-187-and-187-fix.patch | 96 ++ python-psycopg2/centos/srpm_path | 2 + rsync/centos/build_srpm.data | 2 + ...te-package-versioning-for-TIS-format.patch | 27 + rsync/centos/meta_patches/PATCH_ORDER | 1 + rsync/centos/srpm_path | 1 + rsync/files/rsyncd | 93 ++ rsync/files/rsyncd.conf | 51 + seabios/centos/build_srpm.data | 1 + ...te-package-versioning-for-TIS-format.patch | 26 + seabios/centos/meta_patches/PATCH_ORDER | 2 + ...strumentation-to-debug-boot-failures.patch | 41 + ...strumentation-to-debug-boot-failures.patch | 67 + seabios/centos/srpm_path | 1 + .../log-start-completion-of-init-steps.patch | 27 + sysvinit/sysvinit/log_timestamp.patch | 35 + 96 files changed, 5098 insertions(+) create mode 100644 LICENSE create mode 100644 README.rst create mode 100644 anaconda/centos/build_srpm.data create mode 100644 anaconda/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch create mode 100644 anaconda/centos/meta_patches/0002-Add-TIS-patches.patch create mode 100644 anaconda/centos/meta_patches/0003-revert-7.4-grub2-efi-handling.patch create mode 100644 anaconda/centos/meta_patches/0004-Upversion-rpm-devel-dependency.patch create mode 100644 anaconda/centos/meta_patches/0005-Add-TIS-patches-for-host-lookup.patch create mode 100644 anaconda/centos/meta_patches/PATCH_ORDER create mode 100644 anaconda/centos/patches/0001-TIS-Progress-and-error-handling.patch create mode 100644 anaconda/centos/patches/0002-revert-7.4-grub2-efi-handling.patch create mode 100644 anaconda/centos/patches/0003-Set-default-hostname-to-localhost.patch create mode 100644 anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch create mode 100644 anaconda/centos/srpm_path create mode 100644 crontabs/centos/build_srpm.data create mode 100644 crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch create mode 100644 crontabs/centos/meta_patches/PATCH_ORDER create mode 100644 crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch create mode 100644 crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch create mode 100644 crontabs/centos/srpm_path create mode 100644 dnsmasq/.gitignore create mode 100644 dnsmasq/PKG-INFO create mode 100644 dnsmasq/centos/build_srpm.data create mode 100644 dnsmasq/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch create mode 100644 dnsmasq/centos/meta_patches/PATCH_ORDER create mode 100644 dnsmasq/centos/meta_patches/dnsmasq-spec-add-init-script.patch create mode 100644 dnsmasq/centos/meta_patches/patch-tftp-to-close-sockets-immediately.patch create mode 100644 dnsmasq/centos/meta_patches/spec-include-TiS-patch.patch create mode 100644 dnsmasq/centos/patches/close-tftp-sockets-immediately.patch create mode 100644 dnsmasq/centos/patches/dnsmasq-update-ipv6-leases-from-config.patch create mode 100644 dnsmasq/centos/srpm_path create mode 100644 dnsmasq/files/init create mode 100644 grub2/centos/build_srpm.data create mode 100644 grub2/centos/meta_patches/0001-grub2-Update-package-versioning-for-TIS-format.patch create mode 100644 grub2/centos/meta_patches/0002-1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch create mode 100644 grub2/centos/meta_patches/0003-grub2-Build-unsigned-package.patch create mode 100644 grub2/centos/meta_patches/0004-grub2-Build-pxeboot-package.patch create mode 100644 grub2/centos/meta_patches/0005-add-tboot.patch create mode 100644 grub2/centos/meta_patches/PATCH_ORDER create mode 100644 grub2/centos/patches/10001-add-tboot.patch create mode 100644 grub2/centos/patches/1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch create mode 100644 grub2/centos/srpm_path create mode 100644 mwa-gplv3.map create mode 100644 parted/PKG-INFO create mode 100644 parted/centos/build_srpm.data create mode 100644 parted/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch create mode 100644 parted/centos/meta_patches/0003-fix-dev-nodes-getting-removed-for-100-to-300-ms-on-p.patch create mode 100644 parted/centos/meta_patches/PATCH_ORDER create mode 100644 parted/centos/meta_patches/syscalls.patch create mode 100644 parted/centos/patches/fix-dev-nodes-getting-removed-for-100-to-300-ms-on-parted-print.patch create mode 100644 parted/centos/patches/syscalls.patch create mode 100644 parted/centos/srpm_path create mode 100644 parted/files/Makefile create mode 100644 parted/files/fix-compile-failure-while-dis.patch create mode 100644 parted/files/fix-doc-mandir.patch create mode 100644 parted/files/no_check.patch create mode 100644 parted/files/resizepart.sh create mode 100644 parted/files/run-ptest create mode 100644 parted/files/syscalls.patch create mode 100644 python-keyring/PKG-INFO create mode 100644 python-keyring/centos/build_srpm.data create mode 100644 python-keyring/centos/meta_patches/0001-move-package-from-tarball-to-srpm.patch create mode 100644 python-keyring/centos/meta_patches/0002-meta-buildrequires-python-setuptools_scm.patch create mode 100644 python-keyring/centos/meta_patches/PATCH_ORDER create mode 100644 python-keyring/centos/srpm_path create mode 100644 python-keyring/python-keyring/chmod_keyringlock2.patch create mode 100644 python-keyring/python-keyring/chown_keyringlock_file.patch create mode 100644 python-keyring/python-keyring/fix_keyring_lockfile_location.patch create mode 100644 python-keyring/python-keyring/keyring_path_change.patch create mode 100644 python-keyring/python-keyring/lock_keyring_file.patch create mode 100644 python-keyring/python-keyring/lock_keyring_file2.patch create mode 100644 python-keyring/python-keyring/no_keyring_password.patch create mode 100644 python-keyring/python-keyring/remove-reader-lock.patch create mode 100644 python-keyring/python-keyring/remove_others_perms_on_keyringcfg_file.patch create mode 100644 python-keyring/python-keyring/use_new_lock.patch create mode 100644 python-keyring/python-keyring/use_temporary_file.patch create mode 100644 python-psycopg2/centos/build_srpm.data create mode 100644 python-psycopg2/centos/meta_patches/PATCH_ORDER create mode 100644 python-psycopg2/centos/meta_patches/meta-patch0.patch create mode 100644 python-psycopg2/centos/meta_patches/setup-spec-for-tis.patch create mode 100644 python-psycopg2/centos/patches/Manually-patch-170-173-187-and-187-fix.patch create mode 100644 python-psycopg2/centos/srpm_path create mode 100644 rsync/centos/build_srpm.data create mode 100644 rsync/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch create mode 100644 rsync/centos/meta_patches/PATCH_ORDER create mode 100644 rsync/centos/srpm_path create mode 100755 rsync/files/rsyncd create mode 100644 rsync/files/rsyncd.conf create mode 100644 seabios/centos/build_srpm.data create mode 100644 seabios/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch create mode 100644 seabios/centos/meta_patches/PATCH_ORDER create mode 100644 seabios/centos/meta_patches/meta-CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch create mode 100644 seabios/centos/patches/CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch create mode 100644 seabios/centos/srpm_path create mode 100644 sysvinit/sysvinit/log-start-completion-of-init-steps.patch create mode 100644 sysvinit/sysvinit/log_timestamp.patch diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) 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. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..fbf40db --- /dev/null +++ b/README.rst @@ -0,0 +1,5 @@ +========= +stx-gplv3 +========= + +StarlingX GPL v3 Licensed Packages diff --git a/anaconda/centos/build_srpm.data b/anaconda/centos/build_srpm.data new file mode 100644 index 0000000..024e3e1 --- /dev/null +++ b/anaconda/centos/build_srpm.data @@ -0,0 +1 @@ +TIS_PATCH_VER=5 diff --git a/anaconda/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/anaconda/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch new file mode 100644 index 0000000..16b724a --- /dev/null +++ b/anaconda/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch @@ -0,0 +1,25 @@ +From d52fda6215af4f2d51884a10c04d3c7a44d100dd Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Mon, 13 Nov 2017 16:38:15 -0500 +Subject: [PATCH] Update package versioning for TIS format + +--- + SPECS/anaconda.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/anaconda.spec b/SPECS/anaconda.spec +index e2d706d..00b19c4 100644 +--- a/SPECS/anaconda.spec ++++ b/SPECS/anaconda.spec +@@ -3,7 +3,7 @@ + Summary: Graphical system installer + Name: anaconda + Version: 21.48.22.121 +-Release: 1%{?dist} ++Release: 1.el7.centos%{?_tis_dist}.%{tis_patch_ver} + License: GPLv2+ and MIT + Group: Applications/System + URL: http://fedoraproject.org/wiki/Anaconda +-- +1.8.3.1 + diff --git a/anaconda/centos/meta_patches/0002-Add-TIS-patches.patch b/anaconda/centos/meta_patches/0002-Add-TIS-patches.patch new file mode 100644 index 0000000..8b02e3e --- /dev/null +++ b/anaconda/centos/meta_patches/0002-Add-TIS-patches.patch @@ -0,0 +1,38 @@ +From 6bec7d96120f7eef019ab2841265bf4b74ebc64d Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Mon, 13 Nov 2017 17:22:49 -0500 +Subject: [PATCH] Add TIS patches + +--- + SPECS/anaconda.spec | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/SPECS/anaconda.spec b/SPECS/anaconda.spec +index 00b19c4..79e1c55 100644 +--- a/SPECS/anaconda.spec ++++ b/SPECS/anaconda.spec +@@ -22,7 +22,10 @@ Patch6: anaconda-centos-help-text.patch + Patch7: anaconda-centos-skip-retry-if-not-connected.patch + Patch8: 9800-rpmostreepayload-Rework-remote-add-handling.patch + Patch1000: yumpayload-dont-verify-disabled-repos.patch +- ++ ++# WRS ++Patch10001: 0001-TIS-Progress-and-error-handling.patch ++ + # Versions of required components (done so we make sure the buildrequires + # match the requires versions of things). + %define gettextver 0.18.1 +@@ -243,6 +246,9 @@ runtime on NFS/HTTP/FTP servers or local disks. + %patch8 -p1 + %patch1000 -p1 + ++# WRS ++%patch10001 -p1 ++ + %build + %configure --disable-static \ + --enable-introspection \ +-- +1.8.3.1 + diff --git a/anaconda/centos/meta_patches/0003-revert-7.4-grub2-efi-handling.patch b/anaconda/centos/meta_patches/0003-revert-7.4-grub2-efi-handling.patch new file mode 100644 index 0000000..5ecc4d6 --- /dev/null +++ b/anaconda/centos/meta_patches/0003-revert-7.4-grub2-efi-handling.patch @@ -0,0 +1,32 @@ +From 9ebc2f9343cc214fb1e590221e4791f10a2f87d1 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Fri, 17 Nov 2017 12:08:27 -0500 +Subject: [PATCH] revert 7.4 grub2 efi handling + +--- + SPECS/anaconda.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/anaconda.spec b/SPECS/anaconda.spec +index 79e1c55..2e5ece9 100644 +--- a/SPECS/anaconda.spec ++++ b/SPECS/anaconda.spec +@@ -25,6 +25,7 @@ Patch1000: yumpayload-dont-verify-disabled-repos.patch + + # WRS + Patch10001: 0001-TIS-Progress-and-error-handling.patch ++Patch10002: 0002-revert-7.4-grub2-efi-handling.patch + + # Versions of required components (done so we make sure the buildrequires + # match the requires versions of things). +@@ -248,6 +249,7 @@ runtime on NFS/HTTP/FTP servers or local disks. + + # WRS + %patch10001 -p1 ++%patch10002 -p1 + + %build + %configure --disable-static \ +-- +1.8.3.1 + diff --git a/anaconda/centos/meta_patches/0004-Upversion-rpm-devel-dependency.patch b/anaconda/centos/meta_patches/0004-Upversion-rpm-devel-dependency.patch new file mode 100644 index 0000000..0f5c3f6 --- /dev/null +++ b/anaconda/centos/meta_patches/0004-Upversion-rpm-devel-dependency.patch @@ -0,0 +1,25 @@ +From 709f54c6e799c23a9a374dfca6196ec08102b658 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Thu, 23 Nov 2017 16:35:13 -0500 +Subject: [PATCH] Upversion rpm-devel dependency + +--- + SPECS/anaconda.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/anaconda.spec b/SPECS/anaconda.spec +index 2e5ece9..174dbee 100644 +--- a/SPECS/anaconda.spec ++++ b/SPECS/anaconda.spec +@@ -48,7 +48,7 @@ Patch10002: 0002-revert-7.4-grub2-efi-handling.patch + %define isomd5sum 1.0.10 + %define fcoeutilsver 1.0.12-3.20100323git + %define iscsiver 6.2.0.870-3 +-%define rpmver 4.10.0 ++%define rpmver 4.14.0 + %define libarchivever 3.0.4 + %define langtablever 0.0.31-3 + %define libxklavierver 5.4 +-- +1.8.3.1 + diff --git a/anaconda/centos/meta_patches/0005-Add-TIS-patches-for-host-lookup.patch b/anaconda/centos/meta_patches/0005-Add-TIS-patches-for-host-lookup.patch new file mode 100644 index 0000000..08307e0 --- /dev/null +++ b/anaconda/centos/meta_patches/0005-Add-TIS-patches-for-host-lookup.patch @@ -0,0 +1,53 @@ +From e54422230c27e53436fe94a639a04aaf65f787e1 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Thu, 23 Nov 2017 16:50:10 -0500 +Subject: [PATCH] Add TIS patches for host lookup + +--- + SPECS/anaconda.spec | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/SPECS/anaconda.spec b/SPECS/anaconda.spec +index 174dbee..8541334 100644 +--- a/SPECS/anaconda.spec ++++ b/SPECS/anaconda.spec +@@ -26,6 +26,8 @@ Patch1000: yumpayload-dont-verify-disabled-repos.patch + # WRS + Patch10001: 0001-TIS-Progress-and-error-handling.patch + Patch10002: 0002-revert-7.4-grub2-efi-handling.patch ++Patch10003: 0003-Set-default-hostname-to-localhost.patch ++Patch10004: 0004-Cache-server-ip-in-etc-hosts.patch + + # Versions of required components (done so we make sure the buildrequires + # match the requires versions of things). +@@ -250,6 +252,8 @@ runtime on NFS/HTTP/FTP servers or local disks. + # WRS + %patch10001 -p1 + %patch10002 -p1 ++%patch10003 -p1 ++%patch10004 -p1 + + %build + %configure --disable-static \ +@@ -268,6 +272,10 @@ desktop-file-install ---dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_ + mkdir -p %{buildroot}%{_datadir}/anaconda/site-python + install -m 0644 pyanaconda/sitecustomize.py %{buildroot}%{_datadir}/anaconda/site-python/ + %endif ++ ++# Add anaconda-preexec script ++install -m 0755 scripts/anaconda-preexec %{buildroot}%{_sbindir}/anaconda-preexec ++ + # NOTE: If you see "error: Installed (but unpackaged) file(s) found" that include liveinst files, + # check the IS_LIVEINST_ARCH in configure.ac to make sure your architecture is properly defined + +@@ -316,6 +324,7 @@ update-desktop-database &> /dev/null || : + %{_sysconfdir}/X11/xinit/xinitrc.d/* + %{_datadir}/applications/*.desktop + %endif ++%{_sbindir}/anaconda-preexec + + %files gui + %{_libdir}/python*/site-packages/pyanaconda/ui/gui/* +-- +1.8.3.1 + diff --git a/anaconda/centos/meta_patches/PATCH_ORDER b/anaconda/centos/meta_patches/PATCH_ORDER new file mode 100644 index 0000000..5cf93c3 --- /dev/null +++ b/anaconda/centos/meta_patches/PATCH_ORDER @@ -0,0 +1,5 @@ +0001-Update-package-versioning-for-TIS-format.patch +0002-Add-TIS-patches.patch +0003-revert-7.4-grub2-efi-handling.patch +0004-Upversion-rpm-devel-dependency.patch +0005-Add-TIS-patches-for-host-lookup.patch diff --git a/anaconda/centos/patches/0001-TIS-Progress-and-error-handling.patch b/anaconda/centos/patches/0001-TIS-Progress-and-error-handling.patch new file mode 100644 index 0000000..685baba --- /dev/null +++ b/anaconda/centos/patches/0001-TIS-Progress-and-error-handling.patch @@ -0,0 +1,394 @@ +From fa37cfcf560506f49bb00b9d216b1e7646a6905b Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Mon, 13 Nov 2017 17:21:05 -0500 +Subject: [PATCH] TIS Progress and error handling + +--- + data/tmux.conf | 3 +- + pyanaconda/errors.py | 24 +++++++-- + pyanaconda/flags.py | 1 + + pyanaconda/install.py | 4 ++ + pyanaconda/kickstart.py | 3 ++ + pyanaconda/packaging/rpmostreepayload.py | 5 ++ + pyanaconda/packaging/yumpayload.py | 15 +++++- + pyanaconda/tisnotify.py | 91 ++++++++++++++++++++++++++++++++ + pyanaconda/ui/gui/hubs/progress.py | 4 ++ + pyanaconda/ui/tui/spokes/progress.py | 4 ++ + 10 files changed, 147 insertions(+), 7 deletions(-) + create mode 100644 pyanaconda/tisnotify.py + +diff --git a/data/tmux.conf b/data/tmux.conf +index 89f788b..7903b06 100644 +--- a/data/tmux.conf ++++ b/data/tmux.conf +@@ -1,6 +1,7 @@ + # tmux.conf for the anaconda environment + + bind -n M-tab next ++bind -n C-o next + bind -n F1 list-keys + + set-option -s exit-unattached off +@@ -10,7 +11,7 @@ set-option -g history-limit 10000 + + new-session -s anaconda -n main "anaconda" + +-set-option status-right '#[fg=blue]#(echo -n "Switch tab: Alt+Tab | Help: F1 ")' ++set-option status-right '#[fg=blue]#(echo -n "Switch: Alt+Tab or Ctrl-o ")' + + new-window -d -n shell "bash --login" + new-window -d -n log "tail -F /tmp/anaconda.log" +diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py +index 860b228..1d1d34b 100644 +--- a/pyanaconda/errors.py ++++ b/pyanaconda/errors.py +@@ -19,6 +19,7 @@ + # Author(s): Chris Lumens + + from pyanaconda.i18n import _ ++from pyanaconda.tisnotify import tisnotify + + __all__ = ["ERROR_RAISE", "ERROR_CONTINUE", "ERROR_RETRY", + "InvalidImageSizeError", "MissingImageError", "MediaUnmountError", +@@ -81,6 +82,19 @@ ERROR_RAISE = 0 + ERROR_CONTINUE = 1 + ERROR_RETRY = 2 + ++# ++# WRS: If a fatal error occurs in a %pre, anaconda hasn't setup the UI yet, ++# and an exception occurs in the error handler. This is a basic dummy UI ++# to avoid this exception and print the error message. ++# ++class DefaultUI(object): ++ def __init__(self): ++ pass ++ ++ def showError(self, msg): ++ print "\n\n", msg ++ ++ + ### + ### TOP-LEVEL ERROR HANDLING OBJECT + ### +@@ -304,12 +318,12 @@ class ErrorHandler(object): + """ + rc = ERROR_RAISE + ++ # WRS: Notify the controller installation has failed ++ tisnotify.failed() ++ + if not self.ui: +- # While Pylint thinks something else, this should be likely OK +- # for an exception handler. +- # +- # pylint: disable=misplaced-bare-raise +- raise ++ # WRS: Use the basic UI ++ self.ui = DefaultUI() + + _map = {"PartitioningError": self._partitionErrorHandler, + "FSResizeError": self._fsResizeHandler, +diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py +index 8a97f95..3d0d2da 100644 +--- a/pyanaconda/flags.py ++++ b/pyanaconda/flags.py +@@ -70,6 +70,7 @@ class Flags(object): + self.ksprompt = True + self.rescue_mode = False + self.kexec = False ++ self.tisNotifyPort = "0" + # nosave options + self.nosave_input_ks = False + self.nosave_output_ks = False +diff --git a/pyanaconda/install.py b/pyanaconda/install.py +index 26e1b26..bd8f85b 100644 +--- a/pyanaconda/install.py ++++ b/pyanaconda/install.py +@@ -35,6 +35,9 @@ from pyanaconda.ui.lib.entropy import wait_for_entropy + from pyanaconda.kexec import setup_kexec + from pyanaconda.kickstart import runPostScripts, runPreInstallScripts + from pykickstart.constants import SNAPSHOT_WHEN_POST_INSTALL ++ ++from pyanaconda.tisnotify import tisnotify ++ + import logging + import blivet + log = logging.getLogger("anaconda") +@@ -139,6 +142,7 @@ def doConfiguration(storage, payload, ksdata, instClass): + with progress_report(N_("Creating snapshots")): + ksdata.snapshot.execute(storage, ksdata, instClass) + ++ tisnotify.installed() + progress_complete() + + def doInstall(storage, payload, ksdata, instClass): +diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py +index 50515c8..d95b2df 100644 +--- a/pyanaconda/kickstart.py ++++ b/pyanaconda/kickstart.py +@@ -81,6 +81,8 @@ from pykickstart.sections import NullSection, PackageSection, PostScriptSection, + from pykickstart.sections import Section + from pykickstart.version import returnClassForVersion, RHEL7 + ++from pyanaconda.tisnotify import tisnotify ++ + import logging + log = logging.getLogger("anaconda") + stderrLog = logging.getLogger("anaconda.stderr") +@@ -2342,6 +2344,7 @@ def runPreScripts(scripts): + if len(preScripts) == 0: + return + ++ tisnotify.preinstall() + log.info("Running kickstart %%pre script(s)") + stdoutLog.info(_("Running pre-installation scripts")) + +diff --git a/pyanaconda/packaging/rpmostreepayload.py b/pyanaconda/packaging/rpmostreepayload.py +index 7cf59d7..8896ba1 100644 +--- a/pyanaconda/packaging/rpmostreepayload.py ++++ b/pyanaconda/packaging/rpmostreepayload.py +@@ -36,6 +36,8 @@ from gi.repository import Gio + + from blivet.size import Size + ++from pyanaconda.tisnotify import tisnotify ++ + import logging + log = logging.getLogger("anaconda") + +@@ -69,6 +71,7 @@ class RPMOSTreePayload(ArchivePayload): + """Like iutil.execWithRedirect, but treat errors as fatal""" + rc = iutil.execWithRedirect(cmd, argv, **kwargs) + if rc != 0: ++ tisnotify.failed() + exn = PayloadInstallError("%s %s exited with code %d" % (cmd, argv, rc)) + if errors.errorHandler.cb(exn) == errors.ERROR_RAISE: + raise exn +@@ -170,6 +173,7 @@ class RPMOSTreePayload(ArchivePayload): + try: + repo.pull(ostreesetup.remote, [ostreesetup.ref], 0, progress, cancellable) + except GLib.GError as e: ++ tisnotify.failed() + exn = PayloadInstallError("Failed to pull from repository: %s" % e) + log.error(str(exn)) + if errors.errorHandler.cb(exn) == errors.ERROR_RAISE: +@@ -213,6 +217,7 @@ class RPMOSTreePayload(ArchivePayload): + try: + self._copyBootloaderData() + except (OSError, RuntimeError) as e: ++ tisnotify.failed() + exn = PayloadInstallError("Failed to copy bootloader data: %s" % e) + log.error(str(exn)) + if errors.errorHandler.cb(exn) == errors.ERROR_RAISE: +diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py +index c6aa234..a0497e0 100644 +--- a/pyanaconda/packaging/yumpayload.py ++++ b/pyanaconda/packaging/yumpayload.py +@@ -46,6 +46,8 @@ from pyanaconda.simpleconfig import simple_replace + from functools import wraps + from urlgrabber.grabber import URLGrabber, URLGrabError + ++from pyanaconda.tisnotify import tisnotify ++ + import logging + log = logging.getLogger("packaging") + +@@ -181,6 +183,8 @@ class YumPayload(PackagePayload): + # save repomd metadata + self._repoMD_list = [] + ++ self.tisNotifyPort = flags.cmdline.get("tisNotifyPort") ++ + self.reset() + + def reset(self, root=None, releasever=None): +@@ -1338,6 +1342,8 @@ reposdir=%s + if self.data.packages.handleMissing == KS_MISSING_IGNORE: + return + ++ tisnotify.failed() ++ + # If we're doing non-interactive ks install, raise CmdlineError, + # otherwise the system will just reboot automatically + if flags.automatedInstall and not flags.ksprompt: +@@ -1515,6 +1521,7 @@ reposdir=%s + try: + self.checkSoftwareSelection() + except DependencyError as e: ++ tisnotify.failed() + if errorHandler.cb(e) == ERROR_RAISE: + progressQ.send_quit(1) + while True: +@@ -1569,6 +1576,10 @@ reposdir=%s + key, text = line.split(":", 1) + msg = progress_map[key] + text + progressQ.send_message(msg) ++ if line.startswith("PROGRESS_POST"): ++ tisnotify.postinstall() ++ elif not text.startswith(" error "): ++ tisnotify.installing(text) + log.debug(msg) + elif line.startswith("DEBUG:"): + log.debug(line[6:]) +@@ -1581,7 +1592,8 @@ reposdir=%s + install_errors.append(line[6:]) + else: + log.debug(line) +- except IOError as e: ++ except (IOError, OSError) as e: ++ tisnotify.failed() + log.error("Error running anaconda-yum: %s", e) + exn = PayloadInstallError(str(e)) + if errorHandler.cb(exn) == ERROR_RAISE: +@@ -1603,6 +1615,7 @@ reposdir=%s + shutil.rmtree(iutil.getSysroot()+"/var/tmp/yum.cache") + + if install_errors: ++ tisnotify.failed() + exn = PayloadInstallError("\n".join(install_errors)) + if errorHandler.cb(exn) == ERROR_RAISE: + progressQ.send_quit(1) +diff --git a/pyanaconda/tisnotify.py b/pyanaconda/tisnotify.py +new file mode 100644 +index 0000000..bf5d9bd +--- /dev/null ++++ b/pyanaconda/tisnotify.py +@@ -0,0 +1,91 @@ ++""" ++Copyright (c) 2016-2017 Wind River Systems, Inc. ++ SPDX-License-Identifier: Apache-2.0 ++ ++ ++ ++""" ++ ++import os ++import re ++import subprocess ++import time ++ ++from pyanaconda.flags import flags ++ ++class TisNotify(): ++ ++ def __init__(self): ++ self.tisnotify = flags.cmdline.get("tisnotify") ++ self.regex = re.compile(r'\(([\d\/]*)\)$') ++ self.DEVNULL = open(os.devnull, "w") ++ self.last_installing = 0 ++ ++ def sendNotification(self, data): ++ try: ++ subprocess.call(['/usr/bin/curl', ++ '--data', data, ++ self.tisnotify], ++ stdout=self.DEVNULL, ++ stderr=self.DEVNULL) ++ except: ++ pass ++ ++ def preinstall(self): ++ if self.tisnotify is None: ++ return ++ ++ data = "install_state=preinstall" ++ self.sendNotification(data) ++ ++ def installing(self, text): ++ if self.tisnotify is None: ++ return ++ ++ match = self.regex.search(text) ++ if match is None: ++ return ++ ++ if (time.time() - self.last_installing) >= 5: ++ self.last_installing = time.time() ++ data = "install_state=installing&install_state_info=%s" % match.groups()[0] ++ self.sendNotification(data) ++ ++ def postinstall(self): ++ if self.tisnotify is None: ++ return ++ ++ data = "install_state=postinstall" ++ self.sendNotification(data) ++ ++ def installed(self): ++ if self.tisnotify is None: ++ return ++ ++ data = "install_state=installed" ++ self.sendNotification(data) ++ ++ def failed(self): ++ if self.tisnotify is None: ++ return ++ ++ data = "install_state=failed" ++ self.sendNotification(data) ++ ++ etc_dir = '/mnt/sysimage/etc' ++ platform_dir = etc_dir + '/platform' ++ failed_flag = platform_dir + '/platform/installation_failed' ++ motd_file = etc_dir + '/motd' ++ ++ # Set installation_failed flag, if possible and not already done ++ if os.path.exists(platform_dir) and not os.path.exists(failed_flag): ++ try: ++ subprocess.call(['touch', '/mnt/sysimage/etc/platform/installation_failed']) ++ with open(motd_file, 'a') as f: ++ f.write('Installation failure. Please check logs or reinstall.\n\n') ++ except: ++ pass ++ ++ ++tisnotify = TisNotify() ++ +diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py +index 0e4dbed..b342bd5 100644 +--- a/pyanaconda/ui/gui/hubs/progress.py ++++ b/pyanaconda/ui/gui/hubs/progress.py +@@ -44,6 +44,8 @@ from pykickstart.constants import KS_SHUTDOWN, KS_REBOOT + from pyanaconda.ui.gui.hubs import Hub + from pyanaconda.ui.gui.utils import gtk_action_nowait, gtk_call_once + ++from pyanaconda.tisnotify import tisnotify ++ + __all__ = ["ProgressHub"] + + class ProgressHub(Hub): +@@ -124,6 +126,8 @@ class ProgressHub(Hub): + # to indicate this method should be removed from the idle loop. + return False + elif code == progressQ.PROGRESS_CODE_QUIT: ++ if args[0] != 0: ++ tisnotify.failed() + sys.exit(args[0]) + + q.task_done() +diff --git a/pyanaconda/ui/tui/spokes/progress.py b/pyanaconda/ui/tui/spokes/progress.py +index 1feeb08..8221e31 100644 +--- a/pyanaconda/ui/tui/spokes/progress.py ++++ b/pyanaconda/ui/tui/spokes/progress.py +@@ -31,6 +31,8 @@ from pyanaconda.ui.tui.spokes import StandaloneTUISpoke + from pyanaconda.ui.tui.hubs.summary import SummaryHub + from pyanaconda.ui.tui.simpleline.base import ExitAllMainLoops + ++from pyanaconda.tisnotify import tisnotify ++ + __all__ = ["ProgressSpoke"] + + class ProgressSpoke(StandaloneTUISpoke): +@@ -101,6 +103,8 @@ class ProgressSpoke(StandaloneTUISpoke): + print('') + return True + elif code == progressQ.PROGRESS_CODE_QUIT: ++ if args[0] != 0: ++ tisnotify.failed() + sys.exit(args[0]) + + q.task_done() +-- +1.8.3.1 + diff --git a/anaconda/centos/patches/0002-revert-7.4-grub2-efi-handling.patch b/anaconda/centos/patches/0002-revert-7.4-grub2-efi-handling.patch new file mode 100644 index 0000000..71534cb --- /dev/null +++ b/anaconda/centos/patches/0002-revert-7.4-grub2-efi-handling.patch @@ -0,0 +1,87 @@ +From 76cd2b90fd4e550e162bc8fc7e247ed2f4e6e310 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Fri, 17 Nov 2017 12:06:39 -0500 +Subject: [PATCH] revert 7.4 grub2 efi handling + +--- + pyanaconda/bootloader.py | 36 +++--------------------------------- + 1 file changed, 3 insertions(+), 33 deletions(-) + +diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py +index 9db9cf3..24e8b56 100644 +--- a/pyanaconda/bootloader.py ++++ b/pyanaconda/bootloader.py +@@ -1388,9 +1388,7 @@ class GRUB2(GRUB): + + """ + name = "GRUB2" +- # grub2 is a virtual provides that's provided by grub2-pc, grub2-ppc64le, +- # and all of the primary grub components that aren't grub2-efi-${EFIARCH} +- packages = ["grub2", "grub2-tools"] ++ packages = ["grub2"] + _config_file = "grub.cfg" + _config_dir = "grub2" + _passwd_file = "user.cfg" +@@ -1664,28 +1662,12 @@ class GRUB2(GRUB): + return ret + + class EFIGRUB(GRUB2): +- _packages32 = ["grub2-efi-ia32", "shim-ia32"] +- _packages64 = ["grub2-efi-x64", "shim-x64"] +- _packages_common = ["efibootmgr"] ++ packages = ["grub2-efi", "efibootmgr", "shim"] + can_dual_boot = False + stage2_is_valid_stage1 = False + stage2_bootable = False + +- _is_32bit_firmware = False +- +- @property +- def _efi_binary(self): +- if self._is_32bit_firmware: +- return "\\shimia32.efi" +- return "\\shimx64.efi" +- +- @property +- def packages(self): +- if self._is_32bit_firmware: +- return self._packages32 + self._packages_common + \ +- super(EFIGRUB, self).packages +- return self._packages64 + self._packages_common + \ +- super(EFIGRUB, self).packages ++ _efi_binary = "\\shim.efi" + + @property + def _config_dir(self): +@@ -1695,15 +1677,6 @@ class EFIGRUB(GRUB2): + super(EFIGRUB, self).__init__() + self.efi_dir = 'BOOT' + +- try: +- f = open("/sys/firmware/efi/fw_platform_size", "r") +- value = f.readline().strip() +- except IOError: +- log.info("Reading /sys/firmware/efi/fw_platform_size failed, defaulting to 64-bit install.") +- value = '64' +- if value == '32': +- self._is_32bit_firmware = True +- + def efibootmgr(self, *args, **kwargs): + if flags.imageInstall or flags.dirInstall: + log.info("Skipping efibootmgr for image/directory install.") +@@ -1796,12 +1769,9 @@ class EFIGRUB(GRUB2): + return True + + class Aarch64EFIGRUB(EFIGRUB): +- _packages64 = ["grub2-efi-aa64", "shim-aa64"] + _serial_consoles = ["ttyAMA", "ttyS"] +- _efi_binary = "\\shimaa64.efi" + + class MacEFIGRUB(EFIGRUB): +- packages = [ "grub2-tools-efi", "mactel-boot" ] + def mactel_config(self): + if os.path.exists(iutil.getSysroot() + "/usr/libexec/mactel-boot-setup"): + rc = iutil.execInSysroot("/usr/libexec/mactel-boot-setup", []) +-- +1.8.3.1 + diff --git a/anaconda/centos/patches/0003-Set-default-hostname-to-localhost.patch b/anaconda/centos/patches/0003-Set-default-hostname-to-localhost.patch new file mode 100644 index 0000000..7099f46 --- /dev/null +++ b/anaconda/centos/patches/0003-Set-default-hostname-to-localhost.patch @@ -0,0 +1,25 @@ +From d14b48ec201b4f90042f6292d537d5af5d78c6a6 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Thu, 23 Nov 2017 16:43:58 -0500 +Subject: [PATCH] Set default hostname to localhost + +--- + pyanaconda/network.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyanaconda/network.py b/pyanaconda/network.py +index c6f7bb7..26c24a3 100644 +--- a/pyanaconda/network.py ++++ b/pyanaconda/network.py +@@ -63,7 +63,7 @@ networkConfFile = "%s/network" % (sysconfigDir) + hostnameFile = "/etc/hostname" + ipv6ConfFile = "/etc/sysctl.d/anaconda.conf" + ifcfgLogFile = "/tmp/ifcfg.log" +-DEFAULT_HOSTNAME = "localhost.localdomain" ++DEFAULT_HOSTNAME = "localhost" + + ifcfglog = None + +-- +1.8.3.1 + diff --git a/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch b/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch new file mode 100644 index 0000000..f3469aa --- /dev/null +++ b/anaconda/centos/patches/0004-Cache-server-ip-in-etc-hosts.patch @@ -0,0 +1,80 @@ +From 0b9c332f7101c890c5bb1c65f9c89d82bd759a04 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Thu, 23 Nov 2017 16:46:31 -0500 +Subject: [PATCH] Cache server ip in /etc/hosts + +--- + data/systemd/anaconda.service | 1 + + scripts/anaconda-preexec | 50 +++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 51 insertions(+) + create mode 100644 scripts/anaconda-preexec + +diff --git a/data/systemd/anaconda.service b/data/systemd/anaconda.service +index a80c6bb..8966258 100644 +--- a/data/systemd/anaconda.service ++++ b/data/systemd/anaconda.service +@@ -7,4 +7,5 @@ Wants=anaconda-noshell.service + Type=forking + Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin LANG=en_US.UTF-8 GDK_BACKEND=x11 XDG_RUNTIME_DIR=/tmp GIO_USE_VFS=local + WorkingDirectory=/root ++ExecStartPre=/usr/sbin/anaconda-preexec + ExecStart=/usr/bin/tmux -u -f /usr/share/anaconda/tmux.conf start +diff --git a/scripts/anaconda-preexec b/scripts/anaconda-preexec +new file mode 100644 +index 0000000..e3f79a4 +--- /dev/null ++++ b/scripts/anaconda-preexec +@@ -0,0 +1,50 @@ ++#!/bin/bash ++# ++# Copyright (c) 2017 Wind River Systems, Inc. ++# SPDX-License-Identifier: Apache-2.0 ++# ++# ++# ++# ++ ++exec >>/tmp/anaconda-preexec.log ++exec 2>>/tmp/anaconda-preexec.log ++set -x ++ ++function get_ip() ++{ ++ local host=$1 ++ ++ # Try the DNS query ++ host -t A $host | awk '{print $4}' | grep '^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' | head -1 ++} ++ ++# If the kickstart is net-based, wait for connectivity to server ++cat /proc/cmdline | grep -q 'inst\.ks=http://' ++if [ $? -eq 0 ] ++then ++ server=$(cat /proc/cmdline | sed -r 's#.*inst\.ks=http://([^/]*)/.*#\1#') ++ if [ -n "$server" ] ++ then ++ echo "Testing connectivity to server: $server" ++ let -i ping_count=0 ++ ping -c 1 -w 60 $server ++ while [ $? -ne 0 -a $ping_count -lt 600 ] ++ do ++ echo "Waiting for connectivity to server: $server" ++ sleep 1 ++ let -i ping_count++ ++ ping -c 1 -w 60 $server ++ done ++ ++ # Cache the host IP ++ ipaddr=$(get_ip $server) ++ if [ -n "$ipaddr" -a "$ipaddr" != "$server" ] ++ then ++ echo "$ipaddr $server" >> /etc/hosts ++ fi ++ ++ fi ++fi ++ ++exit 0 +-- +1.8.3.1 + diff --git a/anaconda/centos/srpm_path b/anaconda/centos/srpm_path new file mode 100644 index 0000000..4781e77 --- /dev/null +++ b/anaconda/centos/srpm_path @@ -0,0 +1 @@ +mirror:Source/anaconda-21.48.22.121-1.el7.centos.src.rpm diff --git a/crontabs/centos/build_srpm.data b/crontabs/centos/build_srpm.data new file mode 100644 index 0000000..70b4b5d --- /dev/null +++ b/crontabs/centos/build_srpm.data @@ -0,0 +1 @@ +TIS_PATCH_VER=2 diff --git a/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch new file mode 100644 index 0000000..8f3d7f6 --- /dev/null +++ b/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch @@ -0,0 +1,25 @@ +From a15d83975ed19367767e18354ea07cd5d281e265 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Tue, 27 Sep 2016 10:14:02 -0400 +Subject: [PATCH] Update package versioning for TIS format + +--- + SPECS/crontabs.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/crontabs.spec b/SPECS/crontabs.spec +index 7001d1a..4512bcc 100644 +--- a/SPECS/crontabs.spec ++++ b/SPECS/crontabs.spec +@@ -2,7 +2,7 @@ + Summary: Root crontab files used to schedule the execution of programs + Name: crontabs + Version: 1.11 +-Release: 6.%{snap_release}%{?dist} ++Release: 6.%{snap_release}.el7%{?_tis_dist}.%{tis_patch_ver} + License: Public Domain and GPLv2 + Group: System Environment/Base + URL: https://fedorahosted.org/crontabs +-- +1.8.3.1 + diff --git a/crontabs/centos/meta_patches/PATCH_ORDER b/crontabs/centos/meta_patches/PATCH_ORDER new file mode 100644 index 0000000..253c79a --- /dev/null +++ b/crontabs/centos/meta_patches/PATCH_ORDER @@ -0,0 +1,2 @@ +spec-add-patch-to-remove-printing-of-motd-script-nam.patch +0001-Update-package-versioning-for-TIS-format.patch diff --git a/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch b/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch new file mode 100644 index 0000000..5c61ad9 --- /dev/null +++ b/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch @@ -0,0 +1,35 @@ +From 9221bd11aec1590df2dc3f19e9a582d76ed7adc0 Mon Sep 17 00:00:00 2001 +From: Michel Thebeau +Date: Mon, 25 Jul 2016 11:45:55 -0400 +Subject: [PATCH] spec: add patch to remove printing of motd script name + +Signed-off-by: Michel Thebeau +--- + SPECS/crontabs.spec | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/SPECS/crontabs.spec b/SPECS/crontabs.spec +index d6a8c69..90098e1 100644 +--- a/SPECS/crontabs.spec ++++ b/SPECS/crontabs.spec +@@ -10,6 +10,8 @@ Source0: https://fedorahosted.org/releases/c/r/crontabs/%{name}-%{version}-1.%{s + BuildArch: noarch + Requires: /etc/cron.d + ++Patch1: run-parts-add-option-to-remove-printing-of-motd-scri.patch ++ + %description + This package is used by Fedora mainly for executing files by cron. + +@@ -25,6 +27,8 @@ your system. + %prep + %setup -q + ++%patch1 -p1 ++ + %build + #empty + +-- +1.8.3.1 + diff --git a/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch b/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch new file mode 100644 index 0000000..ffabb92 --- /dev/null +++ b/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch @@ -0,0 +1,65 @@ +From f0bd54cb83ba430ef81153c7a6da2a52daca5266 Mon Sep 17 00:00:00 2001 +From: Michel Thebeau +Date: Mon, 25 Jul 2016 11:23:18 -0400 +Subject: [PATCH] run-parts: add option to remove printing of motd script name + +The awk statement seems to be a round-about way of printing the name of +the motd script (/etc/motd.d/*). The pipe seems to allow awk to print +without user input; while the end of input causes awk to exit. Any +input to awk is echoed to terminal before the motd script name is +printed. + +The script name that is printed is appended to /etc/motd. This is +undesirable. Add an option to skip the awk program. + +Signed-off-by: Michel Thebeau +--- + run-parts | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) + +diff --git a/run-parts b/run-parts +index 7e148f8..b444f4e 100755 +--- a/run-parts ++++ b/run-parts +@@ -4,6 +4,14 @@ + # keep going when something fails + set +e + ++# First parameter to remove printing of the names of executed scripts. ++# The default is unmodified behaviour, print the name of scripts. ++with_progname="y" ++if [ "$1" == "--without-progname" ]; then ++ with_progname="" ++ shift ++fi ++ + if [ $# -lt 1 ]; then + echo "Usage: run-parts [--list | --test] " + exit 1 +@@ -87,12 +95,17 @@ for i in $(LC_ALL=C; echo ${1%/}/*[^~,]) ; do + + # run executable files + logger -p cron.notice -t "run-parts($1)[$$]" "starting $(basename $i)" +- $i 2>&1 | awk -v "progname=$i" \ +- 'progname { +- print progname ":\n" +- progname=""; +- } +- { print; }' ++ if [ -n "$with_progname" ]; then ++ $i 2>&1 | awk -v "progname=$i" \ ++ 'progname { ++ print progname ":\n" ++ progname=""; ++ } ++ { print; }' ++ else ++ $i 2>&1 ++ fi ++ + logger -i -p cron.notice -t "run-parts($1)" "finished $(basename $i)" + fi + fi +-- +1.8.3.1 + diff --git a/crontabs/centos/srpm_path b/crontabs/centos/srpm_path new file mode 100644 index 0000000..0f0dfed --- /dev/null +++ b/crontabs/centos/srpm_path @@ -0,0 +1 @@ +mirror:Source/crontabs-1.11-6.20121102git.el7.src.rpm diff --git a/dnsmasq/.gitignore b/dnsmasq/.gitignore new file mode 100644 index 0000000..f12bf17 --- /dev/null +++ b/dnsmasq/.gitignore @@ -0,0 +1,7 @@ +!.distro +.distro/centos7/rpmbuild/RPMS +.distro/centos7/rpmbuild/SRPMS +.distro/centos7/rpmbuild/BUILD +.distro/centos7/rpmbuild/BUILDROOT +.distro/centos7/rpmbuild/SOURCES/dnsmasq*tar.gz +.distro/centos7/rpmbuild/SOURCES/*.patch diff --git a/dnsmasq/PKG-INFO b/dnsmasq/PKG-INFO new file mode 100644 index 0000000..bc8e083 --- /dev/null +++ b/dnsmasq/PKG-INFO @@ -0,0 +1,13 @@ +Metadata-Version: 1.1 +Name: nova-api-proxy +Version: 1.0 +Summary: Nova Computer API Proxy +Home-page: +Author: Windriver +Author-email: info@windriver.com +License: Apache-2.0 + +Description: Nova Computer API Proxy + + +Platform: UNKNOWN diff --git a/dnsmasq/centos/build_srpm.data b/dnsmasq/centos/build_srpm.data new file mode 100644 index 0000000..3a9f629 --- /dev/null +++ b/dnsmasq/centos/build_srpm.data @@ -0,0 +1,2 @@ +COPY_LIST="files/*" +TIS_PATCH_VER=6 diff --git a/dnsmasq/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/dnsmasq/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch new file mode 100644 index 0000000..e90daa0 --- /dev/null +++ b/dnsmasq/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch @@ -0,0 +1,25 @@ +From 402d56affb9e0767c4406260522fb356ecc420a0 Mon Sep 17 00:00:00 2001 +From: jmckenna +Date: Fri, 9 Feb 2018 13:51:24 -0500 +Subject: [PATCH] update package patching + +--- + SPECS/dnsmasq.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/dnsmasq.spec b/SPECS/dnsmasq.spec +index b3f178f..a583cf2 100644 +--- a/SPECS/dnsmasq.spec ++++ b/SPECS/dnsmasq.spec +@@ -13,7 +13,7 @@ + + Name: dnsmasq + Version: 2.76 +-Release: 2%{?extraversion}%{?dist}.2 ++Release: 2.el7_4.2%{?_tis_dist}.%{tis_patch_ver} + Summary: A lightweight DHCP/caching DNS server + + Group: System Environment/Daemons +-- +1.8.3.1 + diff --git a/dnsmasq/centos/meta_patches/PATCH_ORDER b/dnsmasq/centos/meta_patches/PATCH_ORDER new file mode 100644 index 0000000..8dc7077 --- /dev/null +++ b/dnsmasq/centos/meta_patches/PATCH_ORDER @@ -0,0 +1,4 @@ +spec-include-TiS-patch.patch +dnsmasq-spec-add-init-script.patch +patch-tftp-to-close-sockets-immediately.patch +0001-Update-package-versioning-for-TIS-format.patch diff --git a/dnsmasq/centos/meta_patches/dnsmasq-spec-add-init-script.patch b/dnsmasq/centos/meta_patches/dnsmasq-spec-add-init-script.patch new file mode 100644 index 0000000..bec68a3 --- /dev/null +++ b/dnsmasq/centos/meta_patches/dnsmasq-spec-add-init-script.patch @@ -0,0 +1,71 @@ +From 13714ffa05d7d8a7ca9f9f61bfa75a3f7e8c2503 Mon Sep 17 00:00:00 2001 +From: Scott Little +Date: Mon, 2 Oct 2017 17:27:13 -0400 +Subject: [PATCH 2/5] WRS: dnsmasq-spec-add-init-script.patch + +Conflicts: + SPECS/dnsmasq.spec +--- + SPECS/dnsmasq.spec | 26 ++++++++++++++++---------- + 1 file changed, 16 insertions(+), 10 deletions(-) + +diff --git a/SPECS/dnsmasq.spec b/SPECS/dnsmasq.spec +index 63ff820..f8aace1 100644 +--- a/SPECS/dnsmasq.spec ++++ b/SPECS/dnsmasq.spec +@@ -21,6 +21,7 @@ License: GPLv2 or GPLv3 + URL: http://www.thekelleys.org.uk/dnsmasq/ + Source0: http://www.thekelleys.org.uk/dnsmasq/%{?extrapath}%{name}-%{version}%{?extraversion}.tar.gz + Source1: %{name}.service ++Source2: init + # upstream git: git://thekelleys.org.uk/dnsmasq.git + + # https://bugzilla.redhat.com/show_bug.cgi?id=1367772 +@@ -140,22 +141,26 @@ mkdir -p %{buildroot}%{_unitdir} + install -m644 %{SOURCE1} %{buildroot}%{_unitdir} + rm -rf %{buildroot}%{_initrddir} + ++# Systemv ++mkdir -p %{buildroot}/etc/init.d ++install -m 755 %{SOURCE2} %{buildroot}/etc/init.d/dnsmasq ++ + %clean + rm -rf $RPM_BUILD_ROOT + +-%post +-%systemd_post dnsmasq.service ++#%post ++#%systemd_post dnsmasq.service + +-%preun +-%systemd_preun dnsmasq.service ++#%preun ++#%systemd_preun dnsmasq.service + +-%postun +-%systemd_postun_with_restart dnsmasq.service ++#%postun ++#%systemd_postun_with_restart dnsmasq.service + +-%triggerun -- dnsmasq < 2.52-3 +-%{_bindir}/systemd-sysv-convert --save dnsmasq >/dev/null 2>&1 ||: +-/sbin/chkconfig --del dnsmasq >/dev/null 2>&1 || : +-/bin/systemctl try-restart dnsmasq.service >/dev/null 2>&1 || : ++#%triggerun -- dnsmasq < 2.52-3 ++#%{_bindir}/systemd-sysv-convert --save dnsmasq >/dev/null 2>&1 ||: ++#/sbin/chkconfig --del dnsmasq >/dev/null 2>&1 || : ++#/bin/systemctl try-restart dnsmasq.service >/dev/null 2>&1 || : + + %files + %defattr(-,root,root,-) +@@ -167,6 +172,7 @@ rm -rf $RPM_BUILD_ROOT + %{_unitdir}/%{name}.service + %{_sbindir}/dnsmasq + %{_mandir}/man8/dnsmasq* ++/etc/init.d/dnsmasq + + %files utils + %{_bindir}/dhcp_* +-- +1.9.1 + diff --git a/dnsmasq/centos/meta_patches/patch-tftp-to-close-sockets-immediately.patch b/dnsmasq/centos/meta_patches/patch-tftp-to-close-sockets-immediately.patch new file mode 100644 index 0000000..f0ed9eb --- /dev/null +++ b/dnsmasq/centos/meta_patches/patch-tftp-to-close-sockets-immediately.patch @@ -0,0 +1,34 @@ +From e257b88db5d62a1e44e94373917dd3f97de12522 Mon Sep 17 00:00:00 2001 +From: Scott Little +Date: Mon, 2 Oct 2017 17:27:13 -0400 +Subject: [PATCH 3/5] WRS: patch-tftp-to-close-sockets-immediately.patch + +Conflicts: + SPECS/dnsmasq.spec +--- + SPECS/dnsmasq.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/dnsmasq.spec b/SPECS/dnsmasq.spec +index f8aace1..a3a9e08 100644 +--- a/SPECS/dnsmasq.spec ++++ b/SPECS/dnsmasq.spec +@@ -42,6 +42,7 @@ Patch8: dnsmasq-2.76-coverity.patch + + # WRS patches + Patch30: dnsmasq-update-ipv6-leases-from-config.patch ++Patch31: close-tftp-sockets-immediately.patch + + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +@@ -88,6 +89,7 @@ query/remove a DHCP server's leases. + + # WRS patches + %patch30 -p1 ++%patch31 -p1 + + # use /var/lib/dnsmasq instead of /var/lib/misc + for file in dnsmasq.conf.example man/dnsmasq.8 man/es/dnsmasq.8 src/config.h; do +-- +1.9.1 + diff --git a/dnsmasq/centos/meta_patches/spec-include-TiS-patch.patch b/dnsmasq/centos/meta_patches/spec-include-TiS-patch.patch new file mode 100644 index 0000000..7073afc --- /dev/null +++ b/dnsmasq/centos/meta_patches/spec-include-TiS-patch.patch @@ -0,0 +1,49 @@ +From ecbe3b4e138cb5076b8cbbedf86fea3044449132 Mon Sep 17 00:00:00 2001 +From: Scott Little +Date: Mon, 2 Oct 2017 17:27:13 -0400 +Subject: [PATCH 1/5] WRS: spec-include-TiS-patch.patch + +Conflicts: + SPECS/dnsmasq.spec +--- + SPECS/dnsmasq.spec | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/SPECS/dnsmasq.spec b/SPECS/dnsmasq.spec +index 8a6450a..63ff820 100644 +--- a/SPECS/dnsmasq.spec ++++ b/SPECS/dnsmasq.spec +@@ -39,6 +39,9 @@ Patch6: dnsmasq-2.76-label-warning.patch + Patch7: dnsmasq-2.76-label-man.patch + Patch8: dnsmasq-2.76-coverity.patch + ++# WRS patches ++Patch30: dnsmasq-update-ipv6-leases-from-config.patch ++ + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: dbus-devel +@@ -82,6 +85,9 @@ query/remove a DHCP server's leases. + %patch7 -p1 + %patch8 -p1 -b .coverity + ++# WRS patches ++%patch30 -p1 ++ + # use /var/lib/dnsmasq instead of /var/lib/misc + for file in dnsmasq.conf.example man/dnsmasq.8 man/es/dnsmasq.8 src/config.h; do + sed -i 's|/var/lib/misc/dnsmasq.leases|/var/lib/dnsmasq/dnsmasq.leases|g' "$file" +@@ -154,8 +160,8 @@ rm -rf $RPM_BUILD_ROOT + %files + %defattr(-,root,root,-) + %doc CHANGELOG COPYING COPYING-v3 FAQ doc.html setup.html dbus/DBus-interface +-%config(noreplace) %attr(644,root,root) %{_sysconfdir}/dnsmasq.conf +-%dir /etc/dnsmasq.d ++%config(noreplace) %attr(640,root,root) %{_sysconfdir}/dnsmasq.conf ++%dir %attr(750,root,root) /etc/dnsmasq.d + %dir %{_var}/lib/dnsmasq + %config(noreplace) %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/dnsmasq.conf + %{_unitdir}/%{name}.service +-- +1.9.1 + diff --git a/dnsmasq/centos/patches/close-tftp-sockets-immediately.patch b/dnsmasq/centos/patches/close-tftp-sockets-immediately.patch new file mode 100644 index 0000000..9ca838b --- /dev/null +++ b/dnsmasq/centos/patches/close-tftp-sockets-immediately.patch @@ -0,0 +1,28 @@ +From 858e259bf7125695c068301d0ef56cc4750d6544 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Thu, 15 Sep 2016 13:32:03 -0400 +Subject: [PATCH 1/1] Close tftp sockets immediately + +--- + src/tftp.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/tftp.c b/src/tftp.c +index d7d050f..ecc6ce8 100644 +--- a/src/tftp.c ++++ b/src/tftp.c +@@ -768,9 +768,11 @@ int do_tftp_script_run(void) + if ((transfer = daemon->tftp_done_trans)) + { + daemon->tftp_done_trans = transfer->next; ++#if 0 /* Disable delayed closing of TFTP UDP socket */ + #ifdef HAVE_SCRIPT + queue_tftp(transfer->file->size, transfer->file->filename, &transfer->peer); + #endif ++#endif + free_transfer(transfer); + return 1; + } +-- +1.9.1 + diff --git a/dnsmasq/centos/patches/dnsmasq-update-ipv6-leases-from-config.patch b/dnsmasq/centos/patches/dnsmasq-update-ipv6-leases-from-config.patch new file mode 100644 index 0000000..87bfc24 --- /dev/null +++ b/dnsmasq/centos/patches/dnsmasq-update-ipv6-leases-from-config.patch @@ -0,0 +1,84 @@ +From c68370ac5678b1052592877ede04886d5f62d2dc Mon Sep 17 00:00:00 2001 +From: Scott Little +Date: Tue, 18 Oct 2016 13:07:56 -0400 +Subject: [PATCH 1/4] WRS: Patch22: + dnsmasq-update-ipv6-leases-from-config.patch + +--- + src/lease.c | 53 +++++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 43 insertions(+), 10 deletions(-) + +diff --git a/src/lease.c b/src/lease.c +index e5fe8a6..ffa683a 100644 +--- a/src/lease.c ++++ b/src/lease.c +@@ -179,6 +179,18 @@ void lease_init(time_t now) + dns_dirty = 1; + } + ++static int lease_match_config_addr(struct dhcp_lease *lease, struct dhcp_config *config) ++{ ++ if (!(lease->flags & (LEASE_TA | LEASE_NA)) && (config->flags & CONFIG_ADDR)) ++ return (lease->addr.s_addr == config->addr.s_addr); ++#ifdef HAVE_DHCP6 ++ else if ((lease->flags & (LEASE_TA | LEASE_NA)) && (config->flags & CONFIG_ADDR6)) ++ return IN6_ARE_ADDR_EQUAL(&config->addr6, &lease->addr6); ++#endif ++ else ++ return 0; ++} ++ + void lease_update_from_configs(void) + { + /* changes to the config may change current leases. */ +@@ -187,16 +199,37 @@ void lease_update_from_configs(void) + struct dhcp_config *config; + char *name; + +- for (lease = leases; lease; lease = lease->next) +- if (lease->flags & (LEASE_TA | LEASE_NA)) +- continue; +- else if ((config = find_config(daemon->dhcp_conf, NULL, lease->clid, lease->clid_len, +- lease->hwaddr, lease->hwaddr_len, lease->hwaddr_type, NULL)) && +- (config->flags & CONFIG_NAME) && +- (!(config->flags & CONFIG_ADDR) || config->addr.s_addr == lease->addr.s_addr)) +- lease_set_hostname(lease, config->hostname, 1, get_domain(lease->addr), NULL); +- else if ((name = host_from_dns(lease->addr))) +- lease_set_hostname(lease, name, 1, get_domain(lease->addr), NULL); /* updates auth flag only */ ++ for (lease = leases; lease; lease = lease->next) { ++ if (lease->flags & LEASE_TA) ++ continue; /* we do not update temporary ipv6 leases */ ++ ++ config = find_config(daemon->dhcp_conf, NULL, lease->clid, lease->clid_len, ++ (lease->hwaddr_len > 0 ? lease->hwaddr : NULL), ++ lease->hwaddr_len, lease->hwaddr_type, NULL); ++ if (config) ++ { ++ if ((!(config->flags & (CONFIG_ADDR | CONFIG_ADDR6))) || ++ lease_match_config_addr(lease, config)) ++ { ++ /* ++ * Either we matched on a config that doesn't have an address in ++ * which case we'll just use the hostname, or we matched on a ++ * config that has the same IP address. ++ */ ++ if (!(lease->flags & (LEASE_TA | LEASE_NA))) ++ lease_set_hostname(lease, config->hostname, 1, get_domain(lease->addr), NULL); ++#ifdef HAVE_DHCP6 ++ else ++ lease_set_hostname(lease, config->hostname, 1, get_domain6(&lease->addr6), NULL); ++#endif ++ continue; /* lease updated; move on to next lease */ ++ } ++ } ++ ++ /* attempt to find a matching DNS cache entry for an IPv4 entry */ ++ if (!(lease->flags & (LEASE_TA | LEASE_NA)) && (name = host_from_dns(lease->addr))) ++ lease_set_hostname(lease, name, 1, get_domain(lease->addr), NULL); /* updates auth flag only */ ++ } + } + + static void ourprintf(int *errp, char *format, ...) +-- +1.9.1 + diff --git a/dnsmasq/centos/srpm_path b/dnsmasq/centos/srpm_path new file mode 100644 index 0000000..afdf8db --- /dev/null +++ b/dnsmasq/centos/srpm_path @@ -0,0 +1 @@ +mirror:Source/dnsmasq-2.76-2.el7_4.2.src.rpm diff --git a/dnsmasq/files/init b/dnsmasq/files/init new file mode 100644 index 0000000..1517197 --- /dev/null +++ b/dnsmasq/files/init @@ -0,0 +1,59 @@ +#!/bin/sh +if [ -f /etc/centos-release ]; then + DAEMON=/usr/sbin/dnsmasq +else + DAEMON=/usr/bin/dnsmasq +fi +NAME=dnsmasq +DESC="DNS forwarder and DHCP server" +PIDFILE="/var/run/dnsmasq.pid" + +test -f $DAEMON || exit 0 + +case "$1" in + start) + echo -n "starting $DESC: $NAME... " + test -d /var/lib/misc/ || mkdir /var/lib/misc/ + start-stop-daemon -S -x $DAEMON --pidfile $PIDFILE -- $ARGS + echo "done." + echo -n "Refresh hosts cache" + nscd -i hosts + echo "done." + ;; + stop) + echo -n "stopping $DESC: $NAME... " + start-stop-daemon -K -x $DAEMON --pidfile $PIDFILE + rm -f $PIDFILE + echo "done." + ;; + status) + echo -n "dnsmasq " + start-stop-daemon -q -K -t -x $DAEMON --pidfile $PIDFILE + RET=$? + if [ "$RET" = "0" ]; then + PID=`cat $PIDFILE` + echo "($PID) is running" + else + echo "is not running" + # For lsb compliance return 3 if process not running + exit 3 + fi + ;; + restart) + echo "restarting $DESC: $NAME... " + $0 stop + $0 start + echo "done." + ;; + reload) + echo -n "reloading $DESC: $NAME... " + killall -HUP $(basename ${DAEMON}) + echo "done." + ;; + *) + echo "Usage: $0 {start|stop|status|restart|reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/grub2/centos/build_srpm.data b/grub2/centos/build_srpm.data new file mode 100644 index 0000000..13895e8 --- /dev/null +++ b/grub2/centos/build_srpm.data @@ -0,0 +1,3 @@ +COPY_LIST="" +TIS_PATCH_VER=4 +BUILD_IS_SLOW=8 diff --git a/grub2/centos/meta_patches/0001-grub2-Update-package-versioning-for-TIS-format.patch b/grub2/centos/meta_patches/0001-grub2-Update-package-versioning-for-TIS-format.patch new file mode 100644 index 0000000..c9b76e5 --- /dev/null +++ b/grub2/centos/meta_patches/0001-grub2-Update-package-versioning-for-TIS-format.patch @@ -0,0 +1,28 @@ +From 7cb38901901be87761aee423b1c2f96b9907d785 Mon Sep 17 00:00:00 2001 +From: Scott Little +Date: Tue, 3 Jan 2017 13:45:49 -0500 +Subject: [PATCH 1/2] WRS: + 0001-grub2-Update-package-versioning-for-TIS-format.patch + +Conflicts: + SPECS/grub2.spec +--- + SPECS/grub2.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/grub2.spec b/SPECS/grub2.spec +index 9259c13..5baf5c4 100644 +--- a/SPECS/grub2.spec ++++ b/SPECS/grub2.spec +@@ -45,7 +45,7 @@ + Name: grub2 + Epoch: 1 + Version: 2.02 +-Release: 0.44%{?dist} ++Release: 0.44.el7.centos%{?_tis_dist}.%{tis_patch_ver} + Summary: Bootloader with support for Linux, Multiboot and more + + Group: System Environment/Base +-- +1.8.3.1 + diff --git a/grub2/centos/meta_patches/0002-1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch b/grub2/centos/meta_patches/0002-1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch new file mode 100644 index 0000000..a325957 --- /dev/null +++ b/grub2/centos/meta_patches/0002-1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch @@ -0,0 +1,21 @@ +From 662913fede85b09f54e5272451e4dc3f295a4e05 Mon Sep 17 00:00:00 2001 +From: Scott Little +Date: Tue, 3 Jan 2017 15:55:20 -0500 +Subject: [PATCH] WRS: spec-10_linux-mktitle-de-brand-the-grub.cfg-menu.patch + +--- + SOURCES/grub.patches | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/SOURCES/grub.patches b/SOURCES/grub.patches +index 8c7d946..fcd0a51 100644 +--- a/SOURCES/grub.patches ++++ b/SOURCES/grub.patches +@@ -210,3 +210,4 @@ Patch0210: 0210-Fix-duplicate-shell-entries-1226325.patch + Patch0211: 0211-Coverity-rightly-noticed-that-grub_ipv6_get_masksize.patch + Patch0212: 0212-Export-grub-get-kernel-settings-variables.patch + Patch0213: 0213-Normalize-slashes-in-tftp-paths.patch ++Patch1000: 1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch +-- +1.8.3.1 + diff --git a/grub2/centos/meta_patches/0003-grub2-Build-unsigned-package.patch b/grub2/centos/meta_patches/0003-grub2-Build-unsigned-package.patch new file mode 100644 index 0000000..add7746 --- /dev/null +++ b/grub2/centos/meta_patches/0003-grub2-Build-unsigned-package.patch @@ -0,0 +1,72 @@ +diff --git a/SPECS/grub2.spec b/SPECS/grub2.spec +index 9c32a93..676572e 100644 +--- a/SPECS/grub2.spec ++++ b/SPECS/grub2.spec +@@ -140,6 +140,16 @@ bootloader with modular architecture. It support rich varietyof kernel formats, + file systems, computer architectures and hardware devices. This subpackage + provides tools for support of all platforms. + ++%ifarch %{efiarchs} ++%ifnarch aarch64 ++%package efi-unsigned ++Summary: Unsigned versions of GRUB EFI binaries ++ ++%description efi-unsigned ++This package contains unsigned version of GRUB EFI binaries. ++%endif # aarch64 ++%endif # %{efiarchs} ++ + %prep + %setup -T -c -n grub-%{tarversion} + %ifarch %{efiarchs} +@@ -210,6 +220,10 @@ GRUB_MODULES="${GRUB_MODULES} linuxefi" + -d grub-core ${GRUB_MODULES} + ./grub-mkimage -O %{grubefiarch} -o %{grubeficdname}.orig -p /EFI/BOOT \ + -d grub-core ${GRUB_MODULES} ++ ++cp %{grubefiname}.orig %{grubefiname}.unsigned ++cp %{grubeficdname}.orig %{grubeficdname}.unsigned ++ + %ifarch aarch64 + mv %{grubefiname}.orig %{grubefiname} + mv %{grubeficdname}.orig %{grubeficdname} +@@ -292,6 +306,12 @@ do + TGT=$(echo $MODULE |sed "s,$RPM_BUILD_ROOT,.debugroot,") + # install -m 755 -D $BASE$EXT $TGT + done ++%ifarch %{efiarchs} ++%ifnarch aarch64 ++install -m 755 %{grubefiname}.unsigned $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubefiname}.unsigned ++install -m 755 %{grubeficdname}.unsigned $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubeficdname}.unsigned ++%endif ++%endif + install -m 755 %{grubefiname} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubefiname} + install -m 755 %{grubeficdname} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubeficdname} + install -D -m 644 unicode.pf2 $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/fonts/unicode.pf2 +@@ -444,7 +464,9 @@ fi + %files efi + %defattr(-,root,root,-) + %config(noreplace) %{_sysconfdir}/%{name}-efi.cfg +-%attr(0755,root,root)/boot/efi/EFI/%{efidir} ++%attr(0755,root,root) %dir /boot/efi/EFI/%{efidir} ++%attr(0755,root,root)/boot/efi/EFI/%{efidir}/%{grubefiname} ++%attr(0755,root,root)/boot/efi/EFI/%{efidir}/%{grubeficdname} + %attr(0755,root,root)/boot/efi/EFI/%{efidir}/fonts + %ghost %config(noreplace) /boot/efi/EFI/%{efidir}/grub.cfg + %doc grub-%{tarversion}/COPYING +@@ -520,6 +542,14 @@ fi + %dir %{_datarootdir}/grub/themes + %exclude %{_datarootdir}/grub/themes/starfield + ++%ifarch %{efiarchs} ++%ifnarch aarch64 ++%files efi-unsigned ++/boot/efi/EFI/%{efidir}/%{grubefiname}.unsigned ++/boot/efi/EFI/%{efidir}/%{grubeficdname}.unsigned ++%endif ++%endif ++ + %changelog + * Sun Nov 20 2016 Johnny Hughes - 2.02-0.44 + - Roll in CentOS Secureboot keys + diff --git a/grub2/centos/meta_patches/0004-grub2-Build-pxeboot-package.patch b/grub2/centos/meta_patches/0004-grub2-Build-pxeboot-package.patch new file mode 100644 index 0000000..6b36fa1 --- /dev/null +++ b/grub2/centos/meta_patches/0004-grub2-Build-pxeboot-package.patch @@ -0,0 +1,42 @@ +diff --git a/SPECS/grub2.spec b/SPECS/grub2.spec +index 53778b3..4829e91 100644 +--- a/SPECS/grub2.spec ++++ b/SPECS/grub2.spec +@@ -149,6 +149,14 @@ Summary: Unsigned versions of GRUB EFI binaries + + %description efi-unsigned + This package contains unsigned version of GRUB EFI binaries. ++ ++%package efi-pxeboot ++Summary: PXE bootable GRUB EFI binaries ++ ++%description efi-pxeboot ++This package contains the version of EFI GRUB that is served by the pxeboot ++server ++ + %endif # aarch64 + %endif # %{efiarchs} + +@@ -312,6 +320,7 @@ done + %ifnarch aarch64 + install -m 755 %{grubefiname}.unsigned $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubefiname}.unsigned + install -m 755 %{grubeficdname}.unsigned $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubeficdname}.unsigned ++install -D -m 755 %{grubefiname} $RPM_BUILD_ROOT/pxeboot/EFI/%{grubefiname} + %endif + %endif + install -m 755 %{grubefiname} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubefiname} +@@ -546,9 +555,14 @@ fi + + %ifarch %{efiarchs} + %ifnarch aarch64 ++ + %files efi-unsigned + /boot/efi/EFI/%{efidir}/%{grubefiname}.unsigned + /boot/efi/EFI/%{efidir}/%{grubeficdname}.unsigned ++ ++%files efi-pxeboot ++/pxeboot/EFI/%{grubefiname} ++ + %endif + %endif + diff --git a/grub2/centos/meta_patches/0005-add-tboot.patch b/grub2/centos/meta_patches/0005-add-tboot.patch new file mode 100644 index 0000000..56396ea --- /dev/null +++ b/grub2/centos/meta_patches/0005-add-tboot.patch @@ -0,0 +1,44 @@ +From 69f56affb4e910470072b79824f3c6ecccefa4c2 Mon Sep 17 00:00:00 2001 +From: Bin Qian +Date: Wed, 6 Dec 2017 10:45:42 -0500 +Subject: [PATCH 1/1] WRS: Add tboot support + +--- + SPECS/grub2.spec | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/SPECS/grub2.spec b/SPECS/grub2.spec +index 4d92bf9..5719df6 100644 +--- a/SPECS/grub2.spec ++++ b/SPECS/grub2.spec +@@ -65,6 +65,7 @@ Source6: gitignore + %include %{SOURCE3} + + Patch9999: 0001-centos-grub2-password-fix.patch ++Patch10001: 10001-add-tboot.patch + + BuildRequires: flex bison binutils python + BuildRequires: ncurses-devel xz-devel bzip2-devel +@@ -119,7 +120,7 @@ provides support for EFI systems. + Summary: Modules used to build custom grub.efi images + Group: System Environment/Base + Requires: %{name}-tools = %{epoch}:%{version}-%{release} +-Obsoletes: grub2-efi <= 1:2.00-20%{?dist} ++# Obsoletes: grub2-efi <= 1:2.00-20%{?dist} + + %description efi-modules + The GRand Unified Bootloader (GRUB) is a highly configurable and customizable +@@ -219,6 +220,10 @@ GRUB_MODULES=" all_video boot btrfs cat chain configfile echo efifwsetup \ + part_apple part_msdos part_gpt password_pbkdf2 png \ + reboot search search_fs_uuid search_fs_file search_label \ + sleep syslinuxcfg test tftp regexp video xfs" ++ ++# WRS: Adding new modules for tboot support ++GRUB_MODULES="${GRUB_MODULES} multiboot multiboot2" ++ + %ifarch aarch64 + GRUB_MODULES="${GRUB_MODULES} linux" + %else +-- +1.8.3.1 + diff --git a/grub2/centos/meta_patches/PATCH_ORDER b/grub2/centos/meta_patches/PATCH_ORDER new file mode 100644 index 0000000..09b8b49 --- /dev/null +++ b/grub2/centos/meta_patches/PATCH_ORDER @@ -0,0 +1,5 @@ +0001-grub2-Update-package-versioning-for-TIS-format.patch +0002-1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch +0003-grub2-Build-unsigned-package.patch +0004-grub2-Build-pxeboot-package.patch +0005-add-tboot.patch diff --git a/grub2/centos/patches/10001-add-tboot.patch b/grub2/centos/patches/10001-add-tboot.patch new file mode 100644 index 0000000..ef6e94c --- /dev/null +++ b/grub2/centos/patches/10001-add-tboot.patch @@ -0,0 +1,42 @@ +From 4a1a40ca64be1a2350ec90ceb9089dc0a3950231 Mon Sep 17 00:00:00 2001 +From: Bin Qian +Date: Tue, 21 Nov 2017 15:36:42 -0500 +Subject: [PATCH 1/1] add tboot + +--- + util/grub-mkconfig.in | 2 +- + util/grub.d/10_linux.in | 5 +++++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index 86801aa..b149cec 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -125,7 +125,7 @@ set $grub_probe dummy + if test -f "$1"; then + : + else +- gettext_print "%s: Not found.\n" "$1" 1>&2 ++ gettext_printf "%s: Not found.\n" "$1" 1>&2 + exit 1 + fi + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 3b29c23..61406e4 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -23,6 +23,11 @@ datarootdir="@datarootdir@" + + . "@datadir@/@PACKAGE@/grub-mkconfig_lib" + ++tboot=`cat /proc/cmdline | xargs -n1 | grep '^tboot=true$'` || true ++if [ -n "$tboot" ]; then ++ exit 0 ++fi ++ + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" + +-- +1.8.3.1 + diff --git a/grub2/centos/patches/1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch b/grub2/centos/patches/1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch new file mode 100644 index 0000000..10ba44d --- /dev/null +++ b/grub2/centos/patches/1000_linux-mktitle-de-brand-the-grub.cfg-menu.patch @@ -0,0 +1,47 @@ +From 6934956143557c548cc35dcc272aae1ee3d706c8 Mon Sep 17 00:00:00 2001 +From: RHEL Ninjas +Date: Wed, 5 Oct 2016 15:14:28 -0400 +Subject: [PATCH] 10_linux: mktitle: de-brand the grub.cfg menu + +Replace "CentOS" with a generic name. + +Signed-off-by: Michel Thebeau +--- + util/grub.d/10_linux.in | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index b3c460c..131c1f2 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -71,22 +71,20 @@ mktitle () + local title_type + local version + local OS_NAME +- local OS_VERS + + title_type=$1 && shift + version=$1 && shift + +- OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})" +- OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})" ++ OS_NAME="Linux" + + case $title_type in + recovery) +- title=$(printf '%s (%s) %s (recovery mode)' \ +- "${OS_NAME}" "${version}" "${OS_VERS}") ++ title=$(printf '%s (%s) (recovery mode)' \ ++ "${OS_NAME}" "${version}") + ;; + *) +- title=$(printf '%s (%s) %s' \ +- "${OS_NAME}" "${version}" "${OS_VERS}") ++ title=$(printf '%s (%s)' \ ++ "${OS_NAME}" "${version}") + ;; + esac + echo -n ${title} +-- +1.8.3.1 + diff --git a/grub2/centos/srpm_path b/grub2/centos/srpm_path new file mode 100644 index 0000000..404d20b --- /dev/null +++ b/grub2/centos/srpm_path @@ -0,0 +1 @@ +mirror:Source/grub2-2.02-0.44.el7.centos.src.rpm diff --git a/mwa-gplv3.map b/mwa-gplv3.map new file mode 100644 index 0000000..78defed --- /dev/null +++ b/mwa-gplv3.map @@ -0,0 +1,10 @@ +cgcs/recipes-bsp/grub2|grub2 +cgcs/recipes-core/sysvinit|sysvinit +cgcs/recipes-devtools/python-psycopg2|python-psycopg2 +cgcs/recipes-extended/crontabs|crontabs +cgcs/recipes-extended/parted|parted +cgcs/recipes-extended/python-keyring|python-keyring +cgcs/recipes-extended/rsync|rsync +cgcs/recipes-extended/seabios|seabios +cgcs/recipes-installer/initrd/anaconda|anaconda +cgcs/recipes-support/dnsmasq|dnsmasq diff --git a/parted/PKG-INFO b/parted/PKG-INFO new file mode 100644 index 0000000..c886bc5 --- /dev/null +++ b/parted/PKG-INFO @@ -0,0 +1,14 @@ +Metadata-Version: 1.1 +Name: parted +Version: 2.0.21 +Summary: Disk partition editing/resizing utility +Home-page: +Author: +Author-email: +License: GPLv3+ + +Description: +Disk partition editing/resizing utility + + +Platform: UNKNOWN diff --git a/parted/centos/build_srpm.data b/parted/centos/build_srpm.data new file mode 100644 index 0000000..b7ca4ec --- /dev/null +++ b/parted/centos/build_srpm.data @@ -0,0 +1,3 @@ +COPY_LIST="files/resizepart.sh" +TIS_PATCH_VER=3 +BUILD_IS_SLOW=5 diff --git a/parted/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/parted/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch new file mode 100644 index 0000000..0c37184 --- /dev/null +++ b/parted/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch @@ -0,0 +1,25 @@ +From 74ab16d7e0c23b933b3d6f42eac63d70d07ab62d Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Tue, 27 Sep 2016 10:50:03 -0400 +Subject: [PATCH] Update package versioning for TIS format + +--- + SPECS/parted.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/parted.spec b/SPECS/parted.spec +index 644c2df..b79ca4a 100644 +--- a/SPECS/parted.spec ++++ b/SPECS/parted.spec +@@ -4,7 +4,7 @@ + Summary: The GNU disk partition manipulation program + Name: parted + Version: 3.1 +-Release: 28%{?dist} ++Release: 28.el7%{?_tis_dist}.%{tis_patch_ver} + License: GPLv3+ + Group: Applications/System + URL: http://www.gnu.org/software/parted +-- +1.8.3.1 + diff --git a/parted/centos/meta_patches/0003-fix-dev-nodes-getting-removed-for-100-to-300-ms-on-p.patch b/parted/centos/meta_patches/0003-fix-dev-nodes-getting-removed-for-100-to-300-ms-on-p.patch new file mode 100644 index 0000000..de2d8b8 --- /dev/null +++ b/parted/centos/meta_patches/0003-fix-dev-nodes-getting-removed-for-100-to-300-ms-on-p.patch @@ -0,0 +1,33 @@ +From cfa8f478bd19cf706f87c3c5a8baf54df7f2ea16 Mon Sep 17 00:00:00 2001 +From: Ovidiu Poncea +Date: Fri, 2 Mar 2018 17:22:52 +0200 +Subject: [PATCH] + fix-dev-nodes-getting-removed-for-100-to-300-ms-on-parted-print.patch + +--- + SPECS/parted.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/parted.spec b/SPECS/parted.spec +index 6979b14..06a09f8 100644 +--- a/SPECS/parted.spec ++++ b/SPECS/parted.spec +@@ -15,6 +15,7 @@ Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz + Source1: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig + Source2: pubkey.jim.meyering + Source3: resizepart.sh ++Source4: fix-dev-nodes-getting-removed-for-100-to-300-ms-on-parted-print.patch + + Patch0: parted-3.0-libparted-copy-pmbr_boot-when-duplicating-GPT-disk.patch + Patch1: parted-3.1-libparted-check-PMBR-before-GPT-partition-table-8052.patch +@@ -64,6 +65,7 @@ Patch42: 0042-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch + + # WRS + Patch43: syscalls.patch ++Patch44: fix-dev-nodes-getting-removed-for-100-to-300-ms-on-parted-print.patch + + Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + BuildRequires: e2fsprogs-devel +-- +1.9.1 + diff --git a/parted/centos/meta_patches/PATCH_ORDER b/parted/centos/meta_patches/PATCH_ORDER new file mode 100644 index 0000000..3cd0fe8 --- /dev/null +++ b/parted/centos/meta_patches/PATCH_ORDER @@ -0,0 +1,3 @@ +syscalls.patch +0001-Update-package-versioning-for-TIS-format.patch +0003-fix-dev-nodes-getting-removed-for-100-to-300-ms-on-p.patch diff --git a/parted/centos/meta_patches/syscalls.patch b/parted/centos/meta_patches/syscalls.patch new file mode 100644 index 0000000..1dd07c4 --- /dev/null +++ b/parted/centos/meta_patches/syscalls.patch @@ -0,0 +1,63 @@ +From 4859fab94b298a4ca449216c3035b8b024c661a3 Mon Sep 17 00:00:00 2001 +From: Kristine Bujold +Date: Wed, 21 Dec 2016 15:28:53 -0500 +Subject: [PATCH 1/2] WRS: syscalls.patch + +--- + SPECS/parted.spec | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/SPECS/parted.spec b/SPECS/parted.spec +index 749687f..644c2df 100644 +--- a/SPECS/parted.spec ++++ b/SPECS/parted.spec +@@ -12,6 +12,7 @@ URL: http://www.gnu.org/software/parted + Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz + Source1: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig + Source2: pubkey.jim.meyering ++Source3: resizepart.sh + + Patch0: parted-3.0-libparted-copy-pmbr_boot-when-duplicating-GPT-disk.patch + Patch1: parted-3.1-libparted-check-PMBR-before-GPT-partition-table-8052.patch +@@ -59,6 +60,9 @@ Patch40: 0040-partprobe-Open-the-device-once-for-probing-1339705.patch + Patch41: 0041-tests-Stop-timing-t9040-1172675.patch + Patch42: 0042-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch + ++# WRS ++Patch43: syscalls.patch ++ + Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + BuildRequires: e2fsprogs-devel + BuildRequires: readline-devel +@@ -121,7 +125,7 @@ git commit -a -m "run iconv" + autoreconf + autoconf + CFLAGS="$RPM_OPT_FLAGS -Wno-unused-but-set-variable"; export CFLAGS +-%configure --enable-selinux --disable-static ++%configure --enable-selinux --disable-static --disable-device-mapper + # Don't use rpath! + %{__sed} -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool + %{__sed} -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +@@ -150,6 +154,9 @@ popd + + %find_lang %{name} + ++# WRS ++install -d %{buildroot}%{_sbindir} ++install -m 755 %{SOURCE3} %{buildroot}%{_sbindir}/resizepart.sh + + %check + export LD_LIBRARY_PATH=$(pwd)/libparted/.libs +@@ -185,6 +192,9 @@ fi + %{_libdir}/libparted-fs-resize.so* + %{_infodir}/parted.info.gz + ++# WRS ++%{_sbindir}/resizepart.sh ++ + %files devel + %defattr(-,root,root,-) + %{_includedir}/parted +-- +1.8.3.1 + diff --git a/parted/centos/patches/fix-dev-nodes-getting-removed-for-100-to-300-ms-on-parted-print.patch b/parted/centos/patches/fix-dev-nodes-getting-removed-for-100-to-300-ms-on-parted-print.patch new file mode 100644 index 0000000..74cc157 --- /dev/null +++ b/parted/centos/patches/fix-dev-nodes-getting-removed-for-100-to-300-ms-on-parted-print.patch @@ -0,0 +1,1103 @@ +From 9e7ad12a13665d975ddb9ee4669f781a1a695f8a Mon Sep 17 00:00:00 2001 +From: Phillip Susi +Date: Sun, 14 Oct 2012 23:59:58 -0400 +Subject: [PATCH] 'parted -s print' causes device nodes to be + deleted from /dev for ~100-300ms + +The main problem is that, immediately after 'parted print', device +nodes for block devices that exist are deleted for brief moments of time then +are readded by udev. This causes commands accessing these nodes to fail. +Although probability of this happening is small (after mount, partitions no +longer disappear), it can cause critical error as we now believe to have +happened in CGTS-8785 (ceph tried to configure an OSD at exactly the moment +parted was gathering info). + +To fix this the following commit where patched from upstream: +0. f0c0d53f998964e187f59de32ac92a2c0e2d5da9 libparted: refactor device-mapper partition sync code +1. 5910f1bc983fbab31f9ec86a7166feee4869c21a libparted: avoid disturbing partitions +2. 026736e9fed89ef00e6e6e84c7e422639ac2715c libparted: sync partitions > 16 +3. 9e07d797b18609613c53ceb2dabbb5e69d961186 libparted: remove old partitions *first* before adding new ones +4. dfdd8b0dd99b7fa990f40a3d3a225c5b3ef13c57 libparted: remove all old partitions, even if new label allows less +5. 7feb3b452c5ae57e75e16f8c00f46c9aa564a4cc libparted: don't create partition on loop label +6. 7e87ca3c531228d35e13e802d2622006138b104c libparted/arch/linux.c: Compile without ENABLE_DEVICE_MAPPER +7. 7cde99849ed321da2712248bc27c14a954d6b481 libparted: give correct partition device name on loop labels + +The most important is commit #1. Commit #0 is a prerequisite and the rest are bug fixes introduced by them. + +Details: + +libparted: refactor device-mapper partition sync code + +The device-mapper partition sync code was still using the remove all +partitions, then add new partitions method. Refactor to use the same +algorithm as regular disks: try to remove all, and ignore any that could +not be removed but have not changed. + +Conflicts: + NEWS + libparted/arch/linux.c + tests/Makefile.am + +libparted: avoid disturbing partitions + +The partition sync logic was first removing all +partitions, then trying to re-add them. This resulted in many +udev events triggering annoying behavior like auto mounting. +Refactor the code to avoid removing and re-adding unmodified +partitions. + +Conflicts: + NEWS + +libparted: sync partitions > 16 + +The linux partition sync code was hard coded to only flush +the first 16 partitions. + +Conflicts: + NEWS + libparted/arch/linux.c + +libparted: remove old partitions *first* before adding new ones + +"libparted: avoid disturbing partitions" put the remove of the old +partition in second pass. If you simultaneously removed partitions 1 +and 2, and created a new partition #1 that overlapped the previous second +partition, the sync would fail because it would try to create the new, +larger partition #1 before removing the old partition #2. + +Conflicts: + libparted/arch/linux.c + +libparted: remove all old partitions, even if new label allows less + +We were limiting partition sync operations to the lesser number allowed +by the device, or the label. This meant that when creating a new label +over an old label that had more partitions than the new one allows, the +higher partitions would not be removed. Use the greater of the two values +for the remove pass, and the lesser for the add. + +Conflicts: + NEWS + +libparted: don't create partition on loop label + +The loop label represents an unpartitioned disk, but creates +a dummy partition to represent the whole disk. This dummy partition +was actually being loaded into the kernel. Don't do that. + +Conflicts: + NEWS + +libparted/arch/linux.c: Compile without ENABLE_DEVICE_MAPPER + +Signed-off-by: Brian C. Lane + +libparted: give correct partition device name on loop labels + +ped_partition_get_path() was returning "/dev/foo1" instead of +"/dev/foo" on loop labels. This caused gparted to run tools like mkfs on +a device node that did not actually exist. + +Conflicts: + NEWS +--- + NEWS | 94 +++++- + libparted/arch/linux.c | 565 +++++++++++++++----------------- + tests/Makefile.am | 2 + + tests/t1104-remove-and-add-partition.sh | 50 +++ + tests/t6010-dm-busy.sh | 92 ++++++ + 5 files changed, 499 insertions(+), 304 deletions(-) + create mode 100644 tests/t1104-remove-and-add-partition.sh + create mode 100644 tests/t6010-dm-busy.sh + +diff --git a/NEWS b/NEWS +index d1ab2a6..42ee12c 100644 +--- a/NEWS ++++ b/NEWS +@@ -2,10 +2,98 @@ GNU parted NEWS -*- outline -*- + + * Noteworthy changes in release 3.1-18 (2014-08-12) [RHEL7.1] + +-** New features ++** New Features ++ ++ You can now choose to ignore errors about partitions that overlap, ++ or are longer than the disk. This allows you to use parted to ++ repair the problem. ++ ++** Bug Fixes ++ ++ libparted: ped_partition_get_path() was returning "/dev/foo1" instead ++ of "/dev/foo" for loop labels. ++ ++ partprobe: when called on a disk that has become a loop label, ++ remove any partitions left over from a previous label. ++ ++ libparted: The loop label represents an unpartitioned disk, but creates ++ a dummy partition to represent the whole disk. This dummy partition ++ was actually being loaded into the kernel. Don't do that. ++ ++ libparted: fix loop labels to not vanish if you don't create ++ a filesystem, and to not return an error syncing when you do. ++ ++ libparted: remove all old partitions, even if new label does not allow ++ as many. ++ ++ libparted: fat and ntfs boot sectors were misdetected as dos ++ partition tables instead of being treated as a loop label. ++ ++ libparted: previously if you chose to ignore the warning about ++ the gpt thinking the disk was smaller than it appears to be on ++ on disk, subsequent warnings on other disks would be suppressed. ++ Now parted will warn once per disk. ++ ++ Fix filesystem detection on non 512 byte sector sizes ++ ++ Fix linux partition sync code to flush partitions > 16 ++ ++ Do not reject a FAT boot sector as invalid because it has no ++ system ID string. ++ ++ libparted: /dev/md/ symlink can change after libparted dereferences it, ++ instead it should just use the symlink as given by the caller in the ++ same way we do with /dev/mapper/. ++ ++ libparted: On multipath systems new partitions would sometimes not ++ appear, reporting 'device-mapper: create ioctl failed: Device or ++ resource busy' until the system was rebooted. Added dm_udev_wait ++ calls to synchronize parted with udev. ++ ++ Fix help text for disk_{set,toggle} to show *disk* flags instead ++ of partition flags. ++ ++ Fix gpt to correctly handle non ASCII charcters in partition names ++ ++ If a drive was 100 times an even multiple of two, sizes specified as ++ a percentage would trigger the exact placement rule and refuse to round ++ to the nearest half percent. ++ ++ Avoid generating udev add/remove events for all unmodified partitions ++ when writing a new table. ++ ++ Fix cache coherency issue by flushing partition block devices. ++ This had been mistakenly disabled in parted 2.0, and resulted ++ in parted sometimes identifying the previous filesystem type ++ after running an mkfs to format a partition to a new type. ++ ++ libparted: fix gpt end of disk handling. Previously if the backup ++ copy of the gpt was not at the end of the disk and you chose to ++ ignore this error, parted would move it to the end of the disk ++ anyhow. It will now leave the backup in the same location if ++ you chose to ignore this error. ++ ++ libparted: handle logical partitions starting immediately after ++ the EBR. Creating a logical partition one sector after the EBR ++ used to cause parted to complain that it could not inform the ++ kernel of the changes, but after a reboot, everything was fine. ++ Parted will now correctly inform the kernel of the changes, but ++ only set the length of the extended partition to 1 sector instead ++ of two, which would cause it to overlap the logical partition. ++ ++ parted: fix EOF and ctrl-c handling. parted used to refuse to exit ++ in response to ctrl-c and would get stuck in an infinite loop ++ prompting for more input when it reached EOF on stdin. ++ ++ libparted: Don't fail to manipulate partitions on dmraid disks that ++ have other partitions in use. + +- Add support for prep flag to GPT to select PowerPC Reference Platform +- boot partition type. ++ libparted: mac: a MAC partition table could have a block_size larger ++ than the one the kernel told us about. Upon reading that partition ++ table, libparted would ask if it's ok to use the larger block size. ++ If you were to respond in the affirmative, libparted would read the ++ larger number of bytes into a buffer of the shorter length, ++ overrunning it. + + * Noteworthy changes in release 3.1-16 (2014-01-22) [RHEL7] + +diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c +index 67a5c2e..adb82f2 100644 +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -48,6 +48,7 @@ + #include "../architecture.h" + #include "dirname.h" + #include "xstrtol.h" ++#include "xalloc.h" + + #if ENABLE_NLS + # include +@@ -285,11 +286,12 @@ struct blkdev_ioctl_param { + /* Maximum number of partitions supported by linux. */ + #define MAX_NUM_PARTS 64 + +-static char* _device_get_part_path (PedDevice* dev, int num); ++static char* _device_get_part_path (PedDevice const *dev, int num); + static int _partition_is_mounted_by_path (const char* path); + static int _device_open (PedDevice* dev, int flags); + static int _device_open_ro (PedDevice* dev); + static int _device_close (PedDevice* dev); ++static unsigned int _device_get_partition_range(PedDevice const* dev); + + static int + _read_fd (int fd, char **buf) +@@ -1495,8 +1497,8 @@ linux_is_busy (PedDevice* dev) + return 0; + } + +-/* we need to flush the master device, and with kernel < 2.6 all the partition +- * devices, because there is no coherency between the caches with old kernels. ++/* we need to flush the master device, and all the partition devices, ++ * * because there is no coherency between the caches. + * We should only flush unmounted partition devices, because: + * - there is never a need to flush them (we're not doing IO there) + * - flushing a device that is mounted causes unnecessary IO, and can +@@ -1507,6 +1509,7 @@ _flush_cache (PedDevice* dev) + { + LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); + int i; ++ int lpn = _device_get_partition_range(dev); + + if (dev->read_only) + return; +@@ -1514,11 +1517,7 @@ _flush_cache (PedDevice* dev) + + ioctl (arch_specific->fd, BLKFLSBUF); + +- /* With linux-2.6.0 and newer, we're done. */ +- if (_have_kern26()) +- return; +- +- for (i = 1; i < 16; i++) { ++ for (i = 1; i < lpn; i++) { + char* name; + int fd; + +@@ -2265,34 +2264,72 @@ zasprintf (const char *format, ...) + return r < 0 ? NULL : resultp; + } + +-static char* +-_device_get_part_path (PedDevice *dev, int num) ++#ifdef ENABLE_DEVICE_MAPPER ++static char * ++dm_canonical_path (PedDevice const *dev) + { +- size_t path_len = strlen (dev->path); ++ LinuxSpecific const *arch_specific = LINUX_SPECIFIC (dev); + ++ /* Get map name from devicemapper */ ++ struct dm_task *task = dm_task_create (DM_DEVICE_INFO); ++ if (!task) ++ goto err; ++ if (!dm_task_set_major_minor (task, arch_specific->major, ++ arch_specific->minor, 0)) ++ goto err; ++ if (!dm_task_run(task)) ++ goto err; ++ char *dev_name = zasprintf ("/dev/mapper/%s", dm_task_get_name (task)); ++ if (dev_name == NULL) ++ goto err; ++ dm_task_destroy (task); ++ return dev_name; ++err: ++ return NULL; ++} ++#endif ++ ++static char* ++_device_get_part_path (PedDevice const *dev, int num) ++{ ++ char *devpath; ++ size_t path_len; + char *result; ++#ifdef ENABLE_DEVICE_MAPPER ++ devpath = (dev->type == PED_DEVICE_DM ++ ? dm_canonical_path (dev) : dev->path); ++#else ++ devpath = dev->path; ++#endif ++ path_len = strlen (devpath); + /* Check for devfs-style /disc => /partN transformation + unconditionally; the system might be using udev with devfs rules, + and if not the test is harmless. */ +- if (5 < path_len && !strcmp (dev->path + path_len - 5, "/disc")) { ++ if (5 < path_len && !strcmp (devpath + path_len - 5, "/disc")) { + /* replace /disc with /part%d */ + result = zasprintf ("%.*s/part%d", +- (int) (path_len - 5), dev->path, num); ++ (int) (path_len - 5), devpath, num); + } else { + char const *p = (dev->type == PED_DEVICE_DAC960 + || dev->type == PED_DEVICE_CPQARRAY + || dev->type == PED_DEVICE_ATARAID +- || isdigit (dev->path[path_len - 1]) ++ || isdigit (devpath[path_len - 1]) + ? "p" : ""); +- result = zasprintf ("%s%s%d", dev->path, p, num); ++ result = zasprintf ("%s%s%d", devpath, p, num); + } +- ++#ifdef ENABLE_DEVICE_MAPPER ++ if (dev->type == PED_DEVICE_DM) ++ free (devpath); ++#endif + return result; + } + + static char* + linux_partition_get_path (const PedPartition* part) + { ++ /* loop label means use the whole disk */ ++ if (strcmp (part->disk->type->name, "loop") == 0) ++ return xstrdup (part->disk->dev->path); + return _device_get_part_path (part->disk->dev, part->num); + } + +@@ -2361,6 +2398,8 @@ linux_partition_is_busy (const PedPartition* part) + + PED_ASSERT (part != NULL); + ++ if (strcmp (part->disk->type->name, "loop") == 0) ++ return linux_is_busy (part->disk->dev); + if (_partition_is_mounted (part)) + return 1; + if (part->type == PED_PARTITION_EXTENDED) { +@@ -2494,7 +2533,7 @@ _sysfs_ull_entry_from_part(PedPartition const* part, const char *entry, + unsigned long long *val) + { + char path[128]; +- char *part_name = linux_partition_get_path(part); ++ char *part_name = _device_get_part_path (part->disk->dev, part->num); + if (!part_name) + return false; + +@@ -2529,7 +2568,7 @@ _kernel_get_partition_start_and_length(PedPartition const *part, + PED_ASSERT(start); + PED_ASSERT(length); + +- char *dev_name = linux_partition_get_path (part); ++ char *dev_name = _device_get_part_path (part->disk->dev, part->num); + if (!dev_name) + return false; + +@@ -2583,6 +2622,8 @@ static unsigned int + _device_get_partition_range(PedDevice const* dev) + { + int range; ++ if (dev->type == PED_DEVICE_DM) ++ return MAX_NUM_PARTS; + bool ok = _sysfs_int_entry_from_dev(dev, "ext_range", &range); + + if (!ok) +@@ -2591,6 +2632,133 @@ _device_get_partition_range(PedDevice const* dev) + return range > 1 ? range : 0; + } + ++#ifdef ENABLE_DEVICE_MAPPER ++static int ++_dm_remove_partition(PedDisk* disk, int partno) ++{ ++ int rc; ++ char *part_name = _device_get_part_path (disk->dev, partno); ++ ++ int fd = open (part_name, O_RDONLY | O_EXCL); ++ if (fd == -1) { ++ if (errno == ENOENT) ++ errno = ENXIO; /* nothing to remove, device already doesn't exist */ ++ free (part_name); ++ return 0; ++ } ++ close (fd); ++ struct dm_task *task = dm_task_create(DM_DEVICE_REMOVE); ++ if (!task) { ++ free (part_name); ++ return 0; ++ } ++ dm_task_set_name (task, part_name); ++ rc = dm_task_run(task); ++ dm_task_update_nodes(); ++ dm_task_destroy(task); ++ free (part_name); ++ if (!rc) ++ return 0; ++ ++ return 1; ++} ++ ++static bool ++_dm_get_partition_start_and_length(PedPartition const *part, ++ unsigned long long *start, ++ unsigned long long *length) ++{ ++ struct dm_task* task = NULL; ++ int rc = 0; ++ ++ if (!(task = dm_task_create(DM_DEVICE_TABLE))) ++ return 0; ++ char *path = _device_get_part_path (part->disk->dev, part->num); ++ PED_ASSERT(path); ++ /* libdevmapper likes to complain on stderr instead of quietly ++ returning ENOENT or ENXIO, so try to stat first */ ++ struct stat st; ++ if (stat(path, &st)) ++ goto err; ++ dm_task_set_name(task, path); ++ if (!dm_task_run(task)) ++ goto err; ++ ++ int major, minor; ++ char *params; ++ char *target_type; ++ dm_get_next_target(task, NULL, (uint64_t *)start, (uint64_t *)length, &target_type, ¶ms); ++ if (sscanf (params, "%d:%d %Ld", &major, &minor, start) != 3) ++ goto err; ++ rc = 1; ++err: ++ free (path); ++ dm_task_destroy(task); ++ return rc; ++} ++ ++ ++static int ++_dm_add_partition (PedDisk* disk, const PedPartition* part) ++{ ++ LinuxSpecific* arch_specific = LINUX_SPECIFIC (disk->dev); ++ char *params = NULL; ++ char *vol_name = NULL; ++ ++ /* Get map name from devicemapper */ ++ struct dm_task *task = dm_task_create (DM_DEVICE_INFO); ++ if (!task) ++ goto err; ++ ++ if (!dm_task_set_major_minor (task, arch_specific->major, ++ arch_specific->minor, 0)) ++ goto err; ++ ++ if (!dm_task_run(task)) ++ goto err; ++ ++ const char *dev_name = dm_task_get_name (task); ++ size_t name_len = strlen (dev_name); ++ vol_name = zasprintf ("%s%s%d", ++ dev_name, ++ isdigit (dev_name[name_len - 1]) ? "p" : "", ++ part->num); ++ if (vol_name == NULL) ++ goto err; ++ ++ /* Caution: dm_task_destroy frees dev_name. */ ++ dm_task_destroy (task); ++ task = NULL; ++ if ( ! (params = zasprintf ("%d:%d %lld", arch_specific->major, ++ arch_specific->minor, part->geom.start))) ++ goto err; ++ ++ task = dm_task_create (DM_DEVICE_CREATE); ++ if (!task) ++ goto err; ++ ++ dm_task_set_name (task, vol_name); ++ dm_task_add_target (task, 0, part->geom.length, ++ "linear", params); ++ if (dm_task_run (task)) { ++ dm_task_update_nodes (); ++ dm_task_destroy (task); ++ free (params); ++ free (vol_name); ++ return 1; ++ } else { ++ _dm_remove_partition (disk, part->num); ++ } ++err: ++ dm_task_update_nodes(); ++ if (task) ++ dm_task_destroy (task); ++ free (params); ++ free (vol_name); ++ return 0; ++} ++#endif ++ + /* + * Sync the partition table in two step process: + * 1. Remove all of the partitions from the kernel's tables, but do not attempt +@@ -2611,12 +2779,31 @@ _disk_sync_part_table (PedDisk* disk) + PED_ASSERT(disk != NULL); + PED_ASSERT(disk->dev != NULL); + int lpn; +- + unsigned int part_range = _device_get_partition_range(disk->dev); ++ int (*add_partition)(PedDisk* disk, const PedPartition *part); ++ int (*remove_partition)(PedDisk* disk, int partno); ++ bool (*get_partition_start_and_length)(PedPartition const *part, ++ unsigned long long *start, ++ unsigned long long *length); ++ + +- /* lpn = largest partition number. */ ++#ifdef ENABLE_DEVICE_MAPPER ++ if (disk->dev->type == PED_DEVICE_DM) { ++ add_partition = _dm_add_partition; ++ remove_partition = _dm_remove_partition; ++ get_partition_start_and_length = _dm_get_partition_start_and_length; ++ } else ++#endif ++ { ++ add_partition = _blkpg_add_partition; ++ remove_partition = _blkpg_remove_partition; ++ get_partition_start_and_length = _kernel_get_partition_start_and_length; ++ } ++ ++ /* lpn = largest partition number. ++ * for remove pass, use greater of device or label limit */ + if (ped_disk_get_max_supported_partition_count(disk, &lpn)) +- lpn = PED_MIN(lpn, part_range); ++ lpn = PED_MAX(lpn, part_range); + else + lpn = part_range; + +@@ -2633,59 +2820,68 @@ _disk_sync_part_table (PedDisk* disk) + if (!errnums) + goto cleanup; + +- /* Attempt to remove each and every partition, retrying for +- up to max_sleep_seconds upon any failure due to EBUSY. */ +- unsigned int sleep_microseconds = 10000; +- unsigned int max_sleep_seconds = 1; +- unsigned int n_sleep = (max_sleep_seconds +- * 1000000 / sleep_microseconds); + int i; +- for (i = 0; i < n_sleep; i++) { +- if (i) +- usleep (sleep_microseconds); +- bool busy = false; +- int j; +- for (j = 0; j < lpn; j++) { +- if (!ok[j]) { +- ok[j] = _blkpg_remove_partition (disk, j + 1); +- errnums[j] = errno; +- if (!ok[j] && errnums[j] == EBUSY) +- busy = true; +- } +- } +- if (!busy) +- break; +- } +- ++ /* remove old partitions first */ + for (i = 1; i <= lpn; i++) { + PedPartition *part = ped_disk_get_partition (disk, i); + if (part) { +- if (!ok[i - 1] && errnums[i - 1] == EBUSY) { +- unsigned long long length; +- unsigned long long start; +- /* get start and length of existing partition */ +- if (!_kernel_get_partition_start_and_length(part, +- &start, &length)) +- goto cleanup; +- if (start == part->geom.start +- && length == part->geom.length) +- ok[i - 1] = 1; +- /* If the new partition is unchanged and the +- existing one was not removed because it was +- in use, then reset the error flag and do not +- try to add it since it is already there. */ ++ unsigned long long length; ++ unsigned long long start; ++ /* get start and length of existing partition */ ++ if (get_partition_start_and_length(part, ++ &start, &length) ++ && start == part->geom.start ++ && length == part->geom.length) ++ { ++ /* partition is unchanged, so nothing to do */ ++ ok[i - 1] = 1; + continue; + } +- +- /* add the (possibly modified or new) partition */ +- if (!_blkpg_add_partition (disk, part)) { +- ped_exception_throw ( +- PED_EXCEPTION_ERROR, +- PED_EXCEPTION_RETRY_CANCEL, +- _("Failed to add partition %d (%s)"), +- i, strerror (errno)); +- goto cleanup; +- } ++ } ++ /* Attempt to remove the partition, retrying for ++ up to max_sleep_seconds upon any failure due to EBUSY. */ ++ unsigned int sleep_microseconds = 10000; ++ unsigned int max_sleep_seconds = 1; ++ unsigned int n_sleep = (max_sleep_seconds ++ * 1000000 / sleep_microseconds); ++ do { ++ ok[i - 1] = remove_partition (disk, i); ++ errnums[i - 1] = errno; ++ if (ok[i - 1] || errnums[i - 1] != EBUSY) ++ break; ++ usleep (sleep_microseconds); ++ } while (n_sleep--); ++ if (!ok[i - 1] && errnums[i - 1] == ENXIO) ++ ok[i - 1] = 1; /* it already doesn't exist */ ++ } ++ /* lpn = largest partition number. ++ * for add pass, use lesser of device or label limit */ ++ if (ped_disk_get_max_supported_partition_count(disk, &lpn)) ++ lpn = PED_MIN(lpn, part_range); ++ else ++ lpn = part_range; ++ /* don't actually add partitions for loop */ ++ if (strcmp (disk->type->name, "loop") == 0) ++ lpn = 0; ++ for (i = 1; i <= lpn; i++) { ++ PedPartition *part = ped_disk_get_partition (disk, i); ++ if (!part) ++ continue; ++ unsigned long long length; ++ unsigned long long start; ++ /* get start and length of existing partition */ ++ if (get_partition_start_and_length(part, ++ &start, &length) ++ && start == part->geom.start ++ && length == part->geom.length) { ++ ok[i - 1] = 1; ++ /* partition is unchanged, so nothing to do */ ++ continue; ++ } ++ /* add the (possibly modified or new) partition */ ++ if (!add_partition (disk, part)) { ++ ok[i - 1] = 0; ++ errnums[i - 1] = errno; + } + } + +@@ -2724,235 +2920,6 @@ _disk_sync_part_table (PedDisk* disk) + return ret; + } + +-#ifdef ENABLE_DEVICE_MAPPER +-static int +-_dm_remove_map_name(char *name) +-{ +- struct dm_task *task = NULL; +- int rc = 0; +- uint32_t cookie = 0; +- +- task = dm_task_create(DM_DEVICE_REMOVE); +- if (!task) +- return 1; +- +- dm_task_set_name (task, name); +- if (!dm_task_set_cookie(task, &cookie, 0)) +- goto err; +- +- rc = dm_task_run(task); +- dm_udev_wait(cookie); +- dm_task_update_nodes(); +-err: +- dm_task_destroy(task); +- if (!rc) +- return 1; +- +- return 0; +-} +- +-static int +-_dm_is_part (struct dm_info *this, char *name) +-{ +- struct dm_task* task = NULL; +- struct dm_info* info = alloca(sizeof *info); +- struct dm_deps* deps = NULL; +- int rc = 0; +- unsigned int i; +- +- task = dm_task_create(DM_DEVICE_DEPS); +- if (!task) +- return 0; +- +- dm_task_set_name(task, name); +- if (!dm_task_run(task)) +- goto err; +- +- memset(info, '\0', sizeof *info); +- dm_task_get_info(task, info); +- if (!info->exists) +- goto err; +- +- deps = dm_task_get_deps(task); +- if (!deps) +- goto err; +- +- for (i = 0; i < deps->count; i++) { +- unsigned int ma = major(deps->device[i]), +- mi = minor(deps->device[i]); +- +- if (ma == this->major && mi == this->minor) +- rc = 1; +- } +- +-err: +- dm_task_destroy(task); +- return rc; +-} +- +-static int +-_dm_remove_parts (PedDevice* dev) +-{ +- struct dm_task* task = NULL; +- struct dm_info* info = alloca(sizeof *info); +- struct dm_names* names = NULL; +- unsigned int next = 0; +- int rc; +- LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); +- +- task = dm_task_create(DM_DEVICE_LIST); +- if (!task) +- goto err; +- +- if (!dm_task_set_major_minor (task, arch_specific->major, +- arch_specific->minor, 0)) +- goto err; +- +- if (!dm_task_run(task)) +- goto err; +- +- memset(info, '\0', sizeof *info); +- dm_task_get_info(task, info); +- if (!info->exists) +- goto err; +- +- names = dm_task_get_names(task); +- if (!names) +- goto err; +- +- rc = 0; +- do { +- names = (void *) ((char *) names + next); +- +- if (_dm_is_part(info, names->name)) +- rc += _dm_remove_map_name(names->name); +- +- next = names->next; +- } while (next); +- +- dm_task_update_nodes(); +- dm_task_destroy(task); +- task = NULL; +- +- if (!rc) +- return 1; +-err: +- if (task) +- dm_task_destroy(task); +- ped_exception_throw (PED_EXCEPTION_WARNING, PED_EXCEPTION_IGNORE, +- _("parted was unable to re-read the partition " +- "table on %s (%s). This means Linux won't know " +- "anything about the modifications you made. "), +- dev->path, strerror (errno)); +- return 0; +-} +- +-static int +-_dm_add_partition (PedDisk* disk, PedPartition* part) +-{ +- char* vol_name = NULL; +- const char* dev_name = NULL; +- char* vol_uuid = NULL; +- const char* dev_uuid = NULL; +- char* params = NULL; +- LinuxSpecific* arch_specific = LINUX_SPECIFIC (disk->dev); +- uint32_t cookie = 0; +- +- /* Get map name from devicemapper */ +- struct dm_task *task = dm_task_create (DM_DEVICE_INFO); +- if (!task) +- goto err; +- +- if (!dm_task_set_major_minor (task, arch_specific->major, +- arch_specific->minor, 0)) +- goto err; +- +- if (!dm_task_run(task)) +- goto err; +- +- dev_name = dm_task_get_name (task); +- dev_uuid = dm_task_get_uuid (task); +- +- if (isdigit (dev_name[strlen (dev_name) - 1])) { +- if ( ! (vol_name = zasprintf ("%sp%d", dev_name, part->num))) +- goto err; +- } else if ( ! (vol_name = zasprintf ("%s%d", dev_name, part->num))) +- goto err; +- +- if ( dev_uuid && (strlen(dev_uuid) > 0) \ +- && ! (vol_uuid = zasprintf ("part%d-%s", part->num, dev_uuid))) +- goto err; +- +- /* Caution: dm_task_destroy frees dev_name. */ +- dm_task_destroy (task); +- task = NULL; +- +- /* device-mapper uses 512b units, not the device's sector size */ +- if ( ! (params = zasprintf ("%d:%d %lld", arch_specific->major, +- arch_specific->minor, +- part->geom.start * (disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT)))) +- goto err; +- +- task = dm_task_create (DM_DEVICE_CREATE); +- if (!task) +- goto err; +- +- dm_task_set_name (task, vol_name); +- if (vol_uuid) +- dm_task_set_uuid (task, vol_uuid); +- /* device-mapper uses 512b units, not the device's sector size */ +- dm_task_add_target (task, 0, part->geom.length * (disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT), +- "linear", params); +- if (!dm_task_set_cookie(task, &cookie, 0)) +- goto err; +- if (dm_task_run (task)) { +- //printf("0 %ld linear %s\n", part->geom.length, params); +- dm_udev_wait(cookie); +- dm_task_update_nodes(); +- dm_task_destroy(task); +- free(params); +- free(vol_uuid); +- free(vol_name); +- return 1; +- } else { +- dm_udev_wait(cookie); +- _dm_remove_map_name(vol_name); +- } +-err: +- dm_task_update_nodes(); +- if (task) +- dm_task_destroy (task); +- free (params); +- free (vol_uuid); +- free (vol_name); +- return 0; +-} +- +-static int +-_dm_reread_part_table (PedDisk* disk) +-{ +- int largest_partnum = ped_disk_get_last_partition_num (disk); +- int rc = 1; +- int i; +- +- sync(); +- if (!_dm_remove_parts(disk->dev)) +- rc = 0; +- +- for (i = 1; i <= largest_partnum; i++) { +- PedPartition* part; +- +- part = ped_disk_get_partition (disk, i); +- if (!part) +- continue; +- +- if (!_dm_add_partition (disk, part)) +- rc = 0; +- } +- return rc; +-} +-#endif +- + static int + _have_blkpg () + { +@@ -2970,10 +2937,6 @@ _have_blkpg () + static int + linux_disk_commit (PedDisk* disk) + { +-#ifdef ENABLE_DEVICE_MAPPER +- if (disk->dev->type == PED_DEVICE_DM) +- return _dm_reread_part_table (disk); +-#endif + if (disk->dev->type != PED_DEVICE_FILE) { + + /* We now require BLKPG support. If this assertion fails, +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 1cf859c..44518c8 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -34,6 +34,7 @@ TESTS = \ + t0501-duplicate.sh \ + t1100-busy-label.sh \ + t1101-busy-partition.sh \ ++ t1104-remove-and-add-partition.sh \ + t1700-probe-fs.sh \ + t2200-dos-label-recog.sh \ + t2201-pc98-label-recog.sh \ +@@ -58,6 +59,7 @@ TESTS = \ + t6002-dm-many-partitions.sh \ + t6003-dm-uuid.sh \ + t6004-dm-512b-sectors.sh \ ++ t6010-dm-busy.sh \ + t6100-mdraid-partitions.sh \ + t7000-scripting.sh \ + t8000-loop.sh \ +diff --git a/tests/t1104-remove-and-add-partition.sh b/tests/t1104-remove-and-add-partition.sh +new file mode 100644 +index 0000000..61cc392 +--- /dev/null ++++ b/tests/t1104-remove-and-add-partition.sh +@@ -0,0 +1,50 @@ ++#!/bin/sh ++# make sure that removing a higher numbered partition and adding a lower ++# one using that space at the same time works ++ ++# Copyright (C) 2014 Free Software Foundation, Inc. ++ ++# This program 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 3 of the License, or ++# (at your option) any later version. ++ ++# This program 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 . ++ ++. "${srcdir=.}/init.sh"; path_prepend_ ../parted ++path_prepend_ ../partprobe ++require_root_ ++ss=$sector_size_ ++ ++d1= f1= ++cleanup_fn_() ++{ ++ test -n "$d1" && losetup -d "$d1" ++ rm -f "$f1" ++} ++ ++f1=$(pwd)/1; d1=$(loop_setup_ "$f1") \ ++ || skip_ "is this partition mounted with 'nodev'?" ++ ++require_partitionable_loop_device_ $d1 ++ ++# create one big partition ++parted -s $d1 mklabel msdos mkpart primary ext2 1m 10m || fail=1 ++ ++# save this table ++dd if=$d1 of=saved count=1 || fail=1 ++ ++# create two small partitions ++parted -s $d1 mklabel msdos mkpart primary ext2 1m 5m mkpart primary ext2 5m 10m || fail=1 ++ ++# restore first table and make sure partprobe works ++dd if=saved of=$d1 || fail=1 ++partprobe $d1 || fail=1 ++ ++Exit $fail +diff --git a/tests/t6010-dm-busy.sh b/tests/t6010-dm-busy.sh +new file mode 100644 +index 0000000..9807b40 +--- /dev/null ++++ b/tests/t6010-dm-busy.sh +@@ -0,0 +1,92 @@ ++#!/bin/sh ++# ensure that parted can alter a partition on a dmraid disk ++# while another one is mounted ++ ++# Copyright (C) 2008-2012 Free Software Foundation, Inc. ++ ++# This program 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 3 of the License, or ++# (at your option) any later version. ++ ++# This program 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 . ++ ++. "${srcdir=.}/init.sh"; path_prepend_ ../parted ++ ++require_root_ ++ ++# We could make this work for arbitrary sector size, but I'm lazy. ++require_512_byte_sector_size_ ++ ++test "x$ENABLE_DEVICE_MAPPER" = xyes \ ++ || skip_ "no device-mapper support" ++ ++# Device maps names - should be random to not conflict with existing ones on ++# the system ++linear_=plinear-$$ ++ ++d1= ++f1= ++dev= ++cleanup_fn_() { ++ umount "${dev}p2" > /dev/null 2>&1 ++ dmsetup remove ${linear_}p1 ++ dmsetup remove ${linear_}p2 ++ dmsetup remove $linear_ ++ test -n "$d1" && losetup -d "$d1" ++ rm -f "$f1" ++} ++ ++f1=$(pwd)/1; d1=$(loop_setup_ "$f1") \ ++ || fail=1 ++ ++# setup: create a mapping ++n=204800 ++echo "0 $n linear $d1 0" | dmsetup create $linear_ || fail=1 ++dev="/dev/mapper/$linear_" ++ ++# Create msdos partition table ++parted -s $dev mklabel msdos > out 2>&1 || fail=1 ++compare /dev/null out || fail=1 ++ ++parted -s $dev -a none mkpart primary fat32 1s 1000s > out 2>&1 || fail=1 ++compare /dev/null out || fail=1 ++ ++parted -s $dev -a none mkpart primary fat32 1001s 200000s > out 2>&1 || fail=1 ++compare /dev/null out || fail=1 ++ ++# wait for new partition device to appear ++wait_for_dev_to_appear_ ${dev}p2 || fail_ ${dev}p2 did not appear ++ ++mkfs.vfat -F 32 ${dev}p2 || fail_ mkfs.vfat failed ++ ++mount_point=$(pwd)/mnt ++ ++mkdir $mount_point || fail=1 ++mount "${dev}p2" "$mount_point" || fail=1 ++ ++# Removal of unmounted partition must succeed. ++parted -s "$dev" rm 1 > /dev/null 2>&1 || fail=1 ++ ++# Removal of mounted partition must fail. ++parted -s "$dev" rm 2 > /dev/null 2>&1 && fail=1 ++ ++parted -m -s "$dev" u s print > out 2>&1 || fail=1 ++sed "s,^$dev,DEV," out > k; mv k out ++ ++# Create expected output file. ++cat <> exp || fail=1 ++BYT; ++DEV:${n}s:dm:512:512:msdos:Linux device-mapper (linear):; ++2:1001s:200000s:199000s:fat32::lba; ++EOF ++ ++compare exp out || fail=1 ++ ++Exit $fail +-- +1.9.1 + diff --git a/parted/centos/patches/syscalls.patch b/parted/centos/patches/syscalls.patch new file mode 100644 index 0000000..287a305 --- /dev/null +++ b/parted/centos/patches/syscalls.patch @@ -0,0 +1,42 @@ +From: "Allain Legacy" +--- +Index: parted-3.1/libparted/arch/linux.c +=================================================================== +--- parted-3.1.orig/libparted/arch/linux.c ++++ parted-3.1/libparted/arch/linux.c +@@ -1646,12 +1646,14 @@ _device_close (PedDevice* dev) + + #if SIZEOF_OFF_T < 8 + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + static _syscall5(int,_llseek, + unsigned int, fd, + unsigned long, offset_high, + unsigned long, offset_low, + loff_t*, result, + unsigned int, origin) ++#endif + + loff_t + llseek (unsigned int fd, loff_t offset, unsigned int whence) +@@ -1659,11 +1661,20 @@ llseek (unsigned int fd, loff_t offset, + loff_t result; + int retval; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + retval = _llseek(fd, + ((unsigned long long)offset) >> 32, + ((unsigned long long)offset) & 0xffffffff, + &result, + whence); ++#else ++ retval = syscall(__NR__llseek, fd, ++ ((unsigned long long)offset) >> 32, ++ ((unsigned long long)offset) & 0xffffffff, ++ &result, ++ whence); ++#endif ++ + return (retval==-1 ? (loff_t) retval : result); + } + diff --git a/parted/centos/srpm_path b/parted/centos/srpm_path new file mode 100644 index 0000000..97272a9 --- /dev/null +++ b/parted/centos/srpm_path @@ -0,0 +1 @@ +mirror:Source/parted-3.1-28.el7.src.rpm diff --git a/parted/files/Makefile b/parted/files/Makefile new file mode 100644 index 0000000..ee90be0 --- /dev/null +++ b/parted/files/Makefile @@ -0,0 +1,285 @@ +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no + +am__tty_colors = \ +$(am__tty_colors_dummy); \ +test "X$(AM_COLOR_TESTS)" != Xno \ +&& test "X$$TERM" != Xdumb \ +&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \ +&& { \ + am__color_tests=yes; \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ +} + +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +am__rst_section = { sed 'p;s/./=/g;' && echo; } +am__sh_e_setup = case $$- in *e*) set +e;; esac + +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`; \ +test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) + +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` + +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:.log=.log) +TEST_LOGS = $(am__test_logs2:.sh.log=.log) +SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +SH_LOG_COMPILE = $(SH_LOG_COMPILER) + +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac + +MKDIR_P = /bin/mkdir -p +SHELL = /bin/bash +VERSION = 3.1 +PACKAGE_STRING = GNU parted 3.1 +PACKAGE_BUGREPORT = bug-parted@gnu.org +abs_srcdir = $(PWD) +abs_top_builddir = $(PWD)/.. +abs_top_srcdir = $(PWD)/.. +srcdir = . +top_srcdir = .. +subdir = tests +SH_LOG_COMPILER = $(SHELL) + +TESTS = \ + help-version.sh \ + t0000-basic.sh \ + t0001-tiny.sh \ + t0010-script-no-ctrl-chars.sh \ + t0100-print.sh \ + t0101-print-empty.sh \ + t0200-gpt.sh \ + t0201-gpt.sh \ + t0202-gpt-pmbr.sh \ + t0203-gpt-tiny-device-abort.sh \ + t0203-gpt-shortened-device-primary-valid.sh \ + t0205-gpt-list-clobbers-pmbr.sh \ + t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh \ + t0207-IEC-binary-notation.sh \ + t0208-mkpart-end-in-IEC.sh \ + t0209-gpt-pmbr_boot.sh \ + t0210-gpt-resized-partition-entry-array.sh \ + t0211-gpt-rewrite-header.sh \ + t0212-gpt-many-partitions.sh \ + t0220-gpt-msftres.sh \ + t0250-gpt.sh \ + t0280-gpt-corrupt.sh \ + t0300-dos-on-gpt.sh \ + t0400-loop-clobber-infloop.sh \ + t0500-dup-clobber.sh \ + t0501-duplicate.sh \ + t1100-busy-label.sh \ + t1101-busy-partition.sh \ + t1700-probe-fs.sh \ + t2200-dos-label-recog.sh \ + t2201-pc98-label-recog.sh \ + t2300-dos-label-extended-bootcode.sh \ + t2310-dos-extended-2-sector-min-offset.sh \ + t2400-dos-hfs-partition-type.sh \ + t2500-probe-corrupt-hfs.sh \ + t3000-resize-fs.sh \ + t3200-type-change.sh \ + t3300-palo-prep.sh \ + t3310-flags.sh \ + t3400-whole-disk-FAT-partition.sh \ + t4000-sun-raid-type.sh \ + t4001-sun-vtoc.sh \ + t4100-msdos-partition-limits.sh \ + t4100-dvh-partition-limits.sh \ + t4100-msdos-starting-sector.sh \ + t4200-partprobe.sh \ + t4300-nilfs2-tiny.sh \ + t5000-tags.sh \ + t6000-dm.sh \ + t6001-psep.sh \ + t6100-mdraid-partitions.sh \ + t7000-scripting.sh \ + t8000-loop.sh \ + t8001-loop-blkpg.sh \ + t9010-big-sector.sh \ + t9020-alignment.sh \ + t9021-maxima.sh \ + t9022-one-unit-snap.sh \ + t9023-value-lt-one.sh \ + t9030-align-check.sh \ + t9040-many-partitions.sh \ + t9041-undetected-in-use-16th-partition.sh \ + t9042-dos-partition-limit.sh \ + t9050-partition-table-types.sh + +TESTS_ENVIRONMENT = \ + export \ + abs_top_builddir='$(abs_top_builddir)' \ + abs_top_srcdir='$(abs_top_srcdir)' \ + abs_srcdir='$(abs_srcdir)' \ + built_programs=parted \ + srcdir='$(srcdir)' \ + top_srcdir='$(top_srcdir)' \ + VERSION=$(VERSION) \ + ; 9>&2 + +.SUFFIXES: .log + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for i in $$bases; do \ + if grep "^$$ws*:copy-in-global-log:$$ws*no$$ws*$$" $$i.trs \ + >/dev/null; then continue; \ + fi; \ + glob_res=`sed -n -e "s/$$ws*$$//" \ + -e "s/^$$ws*:global-test-result:$$ws*//p" \ + $$i.trs`; \ + test -n "$$glob_res" || glob_res=RUN; \ + echo "$$glob_res: $$i" | $(am__rst_section); \ + if test ! -r $$i.log; then \ + echo "fatal: making $@: $$i.log is unreadable" >&2; \ + exit 1; \ + fi; \ + cat $$i.log; echo; \ + done; \ + } >$(TEST_SUITE_LOG).tmp; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @if test $@ != recheck; then \ + list='$(RECHECK_LOGS)'; \ + test -z "$$list" || rm -f $$list; \ + fi + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @ws='[ ]'; \ + log_list='' trs_list=''; $(am__set_TESTS_bases); \ + for i in $$bases; do \ + if test -z "$$log_list"; then \ + log_list="$$i.log"; \ + else \ + log_list="$$log_list $$i.log"; \ + fi; \ + if test -z "$$trs_list"; then \ + trs_list="$$i.trs"; \ + else \ + trs_list="$$trs_list $$i.trs"; \ + fi; \ + done; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list" + +.sh.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) -- $(SH_LOG_COMPILE) "$$tst" diff --git a/parted/files/fix-compile-failure-while-dis.patch b/parted/files/fix-compile-failure-while-dis.patch new file mode 100644 index 0000000..68ab715 --- /dev/null +++ b/parted/files/fix-compile-failure-while-dis.patch @@ -0,0 +1,57 @@ +From 060e74354774d36d2c11ef08e3e7ea9b9b6e23fb Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Thu, 13 Nov 2014 11:29:33 +0800 +Subject: [PATCH] libparted/arch/linux.c: fix compile failure while + --disable-device-mapper + +While --disable-device-mapper, the MACRO ENABLE_DEVICE_MAPPER is +undef, but it missed to scope some device mapper functions. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia +--- + libparted/arch/linux.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c +index 6fd73c5..2afa479 100644 +--- a/libparted/arch/linux.c ++++ b/libparted/arch/linux.c +@@ -2320,6 +2320,7 @@ zasprintf (const char *format, ...) + static char * + dm_canonical_path (PedDevice const *dev) + { ++#ifdef ENABLE_DEVICE_MAPPER + LinuxSpecific const *arch_specific = LINUX_SPECIFIC (dev); + + /* Get map name from devicemapper */ +@@ -2337,6 +2338,7 @@ dm_canonical_path (PedDevice const *dev) + dm_task_destroy (task); + return dev_name; + err: ++#endif + return NULL; + } + +@@ -2957,13 +2959,15 @@ _disk_sync_part_table (PedDisk* disk) + unsigned long long *start, + unsigned long long *length); + +- ++#ifdef ENABLE_DEVICE_MAPPER + if (disk->dev->type == PED_DEVICE_DM) { + add_partition = _dm_add_partition; + remove_partition = _dm_remove_partition; + resize_partition = _dm_resize_partition; + get_partition_start_and_length = _dm_get_partition_start_and_length; +- } else { ++ } else ++#endif ++ { + add_partition = _blkpg_add_partition; + remove_partition = _blkpg_remove_partition; + #ifdef BLKPG_RESIZE_PARTITION +-- +1.9.1 + diff --git a/parted/files/fix-doc-mandir.patch b/parted/files/fix-doc-mandir.patch new file mode 100644 index 0000000..0711d4e --- /dev/null +++ b/parted/files/fix-doc-mandir.patch @@ -0,0 +1,20 @@ +Upstream-Status: Submitted [bug-parted@gnu.org] + +| for po in `ls -1 ./*.pt_BR.po 2>/dev/null`; do \ +| make $(basename ${po%.pt_BR.po}); \ +| done +| Makefile:904: *** Recursive variable `mandir' references itself (eventually). Stop. + +Signed-off-by: Andreas Oberritter + +--- parted-3.1/doc/po4a.mk.orig 2012-03-15 14:09:11.555831872 +0100 ++++ parted-3.1/doc/po4a.mk 2012-03-15 14:10:44.243830985 +0100 +@@ -23,7 +23,7 @@ + # threshold is 80%), it won't be distributed, and the build won't fail. + # + +-mandir = $(mandir)/$(lang) ++mandir := $(mandir)/$(lang) + + # Inform automake that we want to install some man pages in section 1, 5 + # and 8. diff --git a/parted/files/no_check.patch b/parted/files/no_check.patch new file mode 100644 index 0000000..58d8db4 --- /dev/null +++ b/parted/files/no_check.patch @@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [configuration] + +If check is detected, it makes the builds non-determinstic so just force +it to be disabled. + +RP - 4/11/08 + +Index: parted-1.9.0/configure.ac +=================================================================== +--- parted-1.9.0.orig/configure.ac 2009-07-23 18:52:08.000000000 +0100 ++++ parted-1.9.0/configure.ac 2010-02-02 14:13:56.013905093 +0000 +@@ -477,7 +477,7 @@ + AM_CONDITIONAL([BUILD_LINUX], [test "$OS" = linux]) + + dnl check for "check", unit testing library/header +-PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no) ++have_check=no + if test "$have_check" != "yes"; then + AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building]) + fi diff --git a/parted/files/resizepart.sh b/parted/files/resizepart.sh new file mode 100644 index 0000000..29be2a0 --- /dev/null +++ b/parted/files/resizepart.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +################################################################################ +# Copyright (c) 2015 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# +################################################################################ + +DEVICE=$1 +PARTITION=$2 +SIZE=$(blockdev --getsize64 ${DEVICE}) +SIZE_MB=$((SIZE / (1024*1024))) + +## This is a workaround to allow cloud-init to invoke parted without needing to +## handle command prompts interactively. Support for non-interactive parted +## commands are not supported on mounted partitions. +## +/usr/sbin/parted ---pretend-input-tty ${DEVICE} resizepart ${PARTITION} << EOF +yes +${SIZE_MB} +EOF + +exit $? diff --git a/parted/files/run-ptest b/parted/files/run-ptest new file mode 100644 index 0000000..695c5e8 --- /dev/null +++ b/parted/files/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +make -C tests check-TESTS diff --git a/parted/files/syscalls.patch b/parted/files/syscalls.patch new file mode 100644 index 0000000..e9bbe9a --- /dev/null +++ b/parted/files/syscalls.patch @@ -0,0 +1,55 @@ +Upstream-Status: Pending + +--- + libparted/arch/linux.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +Index: parted-1.9.0/libparted/arch/linux.c +=================================================================== +--- parted-1.9.0.orig/libparted/arch/linux.c 2009-07-23 18:52:08.000000000 +0100 ++++ parted-1.9.0/libparted/arch/linux.c 2010-02-02 14:14:16.523904768 +0000 +@@ -17,6 +17,8 @@ + + #define PROC_DEVICES_BUFSIZ 16384 + ++#include ++ + #include + #include + +@@ -1477,12 +1479,14 @@ + + #if SIZEOF_OFF_T < 8 + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + static _syscall5(int,_llseek, + unsigned int, fd, + unsigned long, offset_high, + unsigned long, offset_low, + loff_t*, result, + unsigned int, origin) ++#endif + + loff_t + llseek (unsigned int fd, loff_t offset, unsigned int whence) +@@ -1490,11 +1494,20 @@ + loff_t result; + int retval; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + retval = _llseek(fd, + ((unsigned long long)offset) >> 32, + ((unsigned long long)offset) & 0xffffffff, + &result, + whence); ++#else ++ retval = syscall(__NR__llseek, fd, ++ ((unsigned long long)offset) >> 32, ++ ((unsigned long long)offset) & 0xffffffff, ++ &result, ++ whence); ++#endif ++ + return (retval==-1 ? (loff_t) retval : result); + } + diff --git a/python-keyring/PKG-INFO b/python-keyring/PKG-INFO new file mode 100644 index 0000000..6ee15e9 --- /dev/null +++ b/python-keyring/PKG-INFO @@ -0,0 +1,16 @@ +Metadata-Version: 1.1 +Name: python-keyring +Version: 5.7 +Summary: Python 2 library to store and access passwords safely +Home-page: https://github.com/jaraco/keyring +Author: +Author-email: +License: MIT and Python + +Description: +The Python keyring lib provides a easy way to access the system keyring +service from python. It can be used in any application that needs safe +password storage. + + +Platform: UNKNOWN diff --git a/python-keyring/centos/build_srpm.data b/python-keyring/centos/build_srpm.data new file mode 100644 index 0000000..3ffb508 --- /dev/null +++ b/python-keyring/centos/build_srpm.data @@ -0,0 +1,2 @@ +COPY_LIST="python-keyring/*" +TIS_PATCH_VER=2 diff --git a/python-keyring/centos/meta_patches/0001-move-package-from-tarball-to-srpm.patch b/python-keyring/centos/meta_patches/0001-move-package-from-tarball-to-srpm.patch new file mode 100644 index 0000000..151ad3d --- /dev/null +++ b/python-keyring/centos/meta_patches/0001-move-package-from-tarball-to-srpm.patch @@ -0,0 +1,78 @@ +From d7f5646de9ec990ed81489cc12d7942654bc017d Mon Sep 17 00:00:00 2001 +From: Kam Nasim +Date: Fri, 23 Dec 2016 14:30:17 -0500 +Subject: [PATCH] first meta patch to move python-keyring package from download + tarball to srpm. Also updated to add tis patch versioning + +--- + SPECS/python-keyring.spec | 30 +++++++++++++++++++++++++++--- + 1 file changed, 27 insertions(+), 3 deletions(-) + +diff --git a/SPECS/python-keyring.spec b/SPECS/python-keyring.spec +index 14e4e93..60d05ee 100644 +--- a/SPECS/python-keyring.spec ++++ b/SPECS/python-keyring.spec +@@ -2,7 +2,7 @@ + + Name: python-keyring + Version: 5.7.1 +-Release: 1%{?dist} ++Release: 1%{?_tis_dist}.%{tis_patch_ver} + Summary: Python 2 library to store and access passwords safely + License: MIT and Python + URL: http://bitbucket.org/kang/python-keyring-lib/ +@@ -10,10 +10,21 @@ Source0: https://pypi.io/packages/source/k/keyring/keyring-%{version}.tar + BuildArch: noarch + BuildRequires: python2-devel + BuildRequires: python-setuptools +-BuildRequires: python-setuptools_scm + Obsoletes: %{name}-kwallet < %{version}-%{release} + Obsoletes: %{name}-gnome < %{version}-%{release} + ++Patch0: no_keyring_password.patch ++Patch1: lock_keyring_file.patch ++Patch2: lock_keyring_file2.patch ++Patch3: use_new_lock.patch ++Patch4: fix_keyring_lockfile_location.patch ++Patch5: use_temporary_file.patch ++Patch6: chown_keyringlock_file.patch ++Patch7: chmod_keyringlock2.patch ++Patch8: keyring_path_change.patch ++Patch9: remove-reader-lock.patch ++Patch10: remove_others_perms_on_keyringcfg_file.patch ++ + %description + The Python keyring lib provides a easy way to access the system keyring + service from python. It can be used in any application that needs safe +@@ -39,7 +50,6 @@ Python keyring lib also provides following build-in keyrings. + Summary: Python 3 library to access the system keyring service + BuildRequires: python3-devel + BuildRequires: python3-setuptools +-BuildRequires: python3-setuptools_scm + + %description -n python3-keyring + The Python keyring lib provides a easy way to access the system keyring +@@ -64,6 +74,20 @@ Python keyring lib also provides following build-in keyrings. + + %prep + %setup -qn keyring-%{version} ++ ++# WRS ++%patch0 -p1 ++%patch1 -p1 ++%patch2 -p1 ++%patch3 -p1 ++%patch4 -p1 ++%patch5 -p1 ++%patch6 -p1 ++%patch7 -p1 ++%patch8 -p1 ++%patch9 -p1 ++%patch10 -p1 ++ + rm -frv keyring.egg-info + # Drop redundant shebangs. + sed -i '1{\@^#!/usr/bin/env python@d}' keyring/cli.py +-- +1.8.3.1 + diff --git a/python-keyring/centos/meta_patches/0002-meta-buildrequires-python-setuptools_scm.patch b/python-keyring/centos/meta_patches/0002-meta-buildrequires-python-setuptools_scm.patch new file mode 100644 index 0000000..28c9e49 --- /dev/null +++ b/python-keyring/centos/meta_patches/0002-meta-buildrequires-python-setuptools_scm.patch @@ -0,0 +1,20 @@ +diff --git a/SPECS/python-keyring.spec b/SPECS/python-keyring.spec +index 60d05ee..a41f849 100644 +--- a/SPECS/python-keyring.spec ++++ b/SPECS/python-keyring.spec +@@ -10,6 +10,7 @@ Source0: https://pypi.io/packages/source/k/keyring/keyring-%{version}.tar + BuildArch: noarch + BuildRequires: python2-devel + BuildRequires: python-setuptools ++BuildRequires: python2-setuptools_scm + Obsoletes: %{name}-kwallet < %{version}-%{release} + Obsoletes: %{name}-gnome < %{version}-%{release} + +@@ -50,6 +51,7 @@ Python keyring lib also provides following build-in keyrings. + Summary: Python 3 library to access the system keyring service + BuildRequires: python3-devel + BuildRequires: python3-setuptools ++BuildRequires: python3-setuptools_scm + + %description -n python3-keyring + The Python keyring lib provides a easy way to access the system keyring diff --git a/python-keyring/centos/meta_patches/PATCH_ORDER b/python-keyring/centos/meta_patches/PATCH_ORDER new file mode 100644 index 0000000..d6a7109 --- /dev/null +++ b/python-keyring/centos/meta_patches/PATCH_ORDER @@ -0,0 +1,2 @@ +0001-move-package-from-tarball-to-srpm.patch +0002-meta-buildrequires-python-setuptools_scm.patch diff --git a/python-keyring/centos/srpm_path b/python-keyring/centos/srpm_path new file mode 100644 index 0000000..1dce707 --- /dev/null +++ b/python-keyring/centos/srpm_path @@ -0,0 +1 @@ +mirror:Source/python-keyring-5.7.1-1.el7.src.rpm diff --git a/python-keyring/python-keyring/chmod_keyringlock2.patch b/python-keyring/python-keyring/chmod_keyringlock2.patch new file mode 100644 index 0000000..f95be88 --- /dev/null +++ b/python-keyring/python-keyring/chmod_keyringlock2.patch @@ -0,0 +1,37 @@ +Index: keyring-5.3/keyring/backends/file.py +=================================================================== +--- keyring-5.3.orig/keyring/backends/file.py ++++ keyring-5.3/keyring/backends/file.py +@@ -68,6 +68,9 @@ class BaseKeyring(FileBacked, KeyringBac + service = escape_for_ini(service) + username = escape_for_ini(username) + ++ # ensure the file exists ++ self._ensure_file_path() ++ + # load the passwords from the file + config = configparser.RawConfigParser() + if os.path.exists(self.file_path): +@@ -146,12 +149,16 @@ class BaseKeyring(FileBacked, KeyringBac + user_read_write = 0o644 + os.chmod(self.file_path, user_read_write) + if not os.path.isfile(lockdir + "/" + lockfile): +- import stat +- with open(lockdir + "/" + lockfile, 'w'): +- pass +- # must have the lock file with the correct group permissisions g+rw +- os.chmod(lockdir + "/" + lockfile, stat.S_IRWXG | stat.S_IRWXU) +- os.chown(lockdir + "/" + lockfile,-1,345) ++ with open(lockdir + "/" + lockfile, 'w'): ++ pass ++ if os.path.isfile(lockdir + "/" + lockfile): ++ import stat ++ import grp ++ if oct(stat.S_IMODE(os.stat(lockdir + "/" + lockfile).st_mode)) != '0770': ++ # Must have the lock file with the correct group and permissisions g+rw ++ os.chmod(lockdir + "/" + lockfile, stat.S_IRWXG | stat.S_IRWXU) ++ groupinfo = grp.getgrnam('wrs_protected') ++ os.chown(lockdir + "/" + lockfile,-1,groupinfo.gr_gid) + + + def delete_password(self, service, username): diff --git a/python-keyring/python-keyring/chown_keyringlock_file.patch b/python-keyring/python-keyring/chown_keyringlock_file.patch new file mode 100644 index 0000000..28c56bc --- /dev/null +++ b/python-keyring/python-keyring/chown_keyringlock_file.patch @@ -0,0 +1,12 @@ +Index: keyring-5.3/keyring/backends/file.py +=================================================================== +--- keyring-5.3.orig/keyring/backends/file.py ++++ keyring-5.3/keyring/backends/file.py +@@ -151,6 +151,7 @@ class BaseKeyring(FileBacked, KeyringBac + pass + # must have the lock file with the correct group permissisions g+rw + os.chmod(lockdir + "/" + lockfile, stat.S_IRWXG | stat.S_IRWXU) ++ os.chown(lockdir + "/" + lockfile,-1,345) + + + def delete_password(self, service, username): diff --git a/python-keyring/python-keyring/fix_keyring_lockfile_location.patch b/python-keyring/python-keyring/fix_keyring_lockfile_location.patch new file mode 100644 index 0000000..4287256 --- /dev/null +++ b/python-keyring/python-keyring/fix_keyring_lockfile_location.patch @@ -0,0 +1,113 @@ +Index: keyring-5.3/keyring/backends/file.py +=================================================================== +--- keyring-5.3.orig/keyring/backends/file.py ++++ keyring-5.3/keyring/backends/file.py +@@ -19,6 +19,8 @@ from ..util.escape import escape as esca + from oslo_concurrency import lockutils + + ++lockfile = "keyringlock" ++ + class FileBacked(object): + @abc.abstractproperty + def filename(self): +@@ -104,16 +106,18 @@ class BaseKeyring(FileBacked, KeyringBac + service = escape_for_ini(service) + username = escape_for_ini(username) + ++ # ensure the file exists ++ self._ensure_file_path() ++ + # encrypt the password + password_encrypted = self.encrypt(password.encode('utf-8')) + # encode with base64 + password_base64 = base64.encodestring(password_encrypted).decode() + ++ lockdir = os.path.dirname(self.file_path) + +- with lockutils.lock("keyringlock",external=True,lock_path="/tmp"): ++ with lockutils.lock(lockfile,external=True,lock_path=lockdir): + +- # ensure the file exists +- self._ensure_file_path() + + config = None + try: +@@ -159,14 +163,13 @@ class BaseKeyring(FileBacked, KeyringBac + + + +- +- + def _ensure_file_path(self): + """ + Ensure the storage path exists. + If it doesn't, create it with "go-rwx" permissions. + """ + storage_root = os.path.dirname(self.file_path) ++ lockdir = storage_root + if storage_root and not os.path.isdir(storage_root): + os.makedirs(storage_root) + if not os.path.isfile(self.file_path): +@@ -175,13 +178,22 @@ class BaseKeyring(FileBacked, KeyringBac + pass + user_read_write = 0o644 + os.chmod(self.file_path, user_read_write) ++ if not os.path.isfile(lockdir + "/" + lockfile): ++ import stat ++ with open(lockdir + "/" + lockfile, 'w'): ++ pass ++ # must have the lock file with the correct group permissisions g+rw ++ os.chmod(lockdir + "/" + lockfile, stat.S_IRWXG | stat.S_IRWXU) ++ + + def delete_password(self, service, username): + """Delete the password for the username of the service. + """ + service = escape_for_ini(service) + username = escape_for_ini(username) +- with lockutils.lock("keyringlock",external=True,lock_path="/tmp"): ++ ++ lockdir = os.path.dirname(self.file_path) ++ with lockutils.lock(lockfile,external=True,lock_path=lockdir): + config = configparser.RawConfigParser() + if os.path.exists(self.file_path): + config.read(self.file_path) +@@ -290,17 +302,6 @@ class EncryptedKeyring(Encrypted, BaseKe + # set a reference password, used to check that the password provided + # matches for subsequent checks. + +- # try to pre-create the /tmp/keyringlock if it doesn't exist +- lockfile = "/tmp/keyringlock" +- if os.geteuid() == 0 and (not os.path.exists(lockfile)): +- from pwd import getpwnam +- import stat +- nonrootuser = "wrsroot" +- with open(lockfile, 'w'): +- pass +- # must have the lock file with the correct group permissisions g+rw +- os.chmod(lockfile, stat.S_IRWXG | stat.S_IRWXU) +- + + self.set_password('keyring-setting', 'password reference', + 'password reference value') +@@ -313,9 +314,10 @@ class EncryptedKeyring(Encrypted, BaseKe + return False + self._migrate() + ++ lockdir = os.path.dirname(self.file_path) + # lock access to the file_path here, make sure it's not being written + # to while while we're checking for keyring-setting +- with lockutils.lock("keyringlock",external=True,lock_path="/tmp"): ++ with lockutils.lock(lockfile,external=True,lock_path=lockdir): + config = configparser.RawConfigParser() + config.read(self.file_path) + try: +@@ -325,7 +327,6 @@ class EncryptedKeyring(Encrypted, BaseKe + ) + except (configparser.NoSectionError, configparser.NoOptionError): + # The current file doesn't have the keyring-setting, check the backup +- logging.warning("_check_file: The current file doesn't have the keyring-setting, check the backup") + if os.path.exists(self.backup_file_path): + config = configparser.RawConfigParser() + config.read(self.backup_file_path) diff --git a/python-keyring/python-keyring/keyring_path_change.patch b/python-keyring/python-keyring/keyring_path_change.patch new file mode 100644 index 0000000..46aa235 --- /dev/null +++ b/python-keyring/python-keyring/keyring_path_change.patch @@ -0,0 +1,24 @@ +--- + keyring/util/platform_.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/keyring/util/platform_.py ++++ b/keyring/util/platform_.py +@@ -2,6 +2,7 @@ from __future__ import absolute_import + + import os + import platform ++from tsconfig.tsconfig import SW_VERSION + + def _settings_root_XP(): + return os.path.join(os.environ['USERPROFILE'], 'Local Settings') +@@ -19,7 +20,8 @@ def _data_root_Linux(): + Use freedesktop.org Base Dir Specfication to determine storage + location. + """ +- fallback = os.path.expanduser('/opt/platform/.keyring/') ++ keyring_dir = os.path.join('/opt/platform/.keyring', SW_VERSION) ++ fallback = os.path.expanduser(keyring_dir) + root = os.environ.get('XDG_DATA_HOME', None) or fallback + return os.path.join(root, 'python_keyring') + diff --git a/python-keyring/python-keyring/lock_keyring_file.patch b/python-keyring/python-keyring/lock_keyring_file.patch new file mode 100644 index 0000000..dab7248 --- /dev/null +++ b/python-keyring/python-keyring/lock_keyring_file.patch @@ -0,0 +1,45 @@ +Index: keyring-5.3/keyring/backends/file.py +=================================================================== +--- keyring-5.3.orig/keyring/backends/file.py ++++ keyring-5.3/keyring/backends/file.py +@@ -6,6 +6,7 @@ import base64 + import sys + import json + import abc ++import time + + from ..py27compat import configparser + +@@ -95,14 +96,29 @@ class BaseKeyring(FileBacked, KeyringBac + config = configparser.RawConfigParser() + config.read(self.file_path) + ++ # obtain lock for the keyring file ++ lock = '' ++ i = 60 ++ while i: ++ if not os.path.isfile('/tmp/.keyringlock'): ++ lock = open('/tmp/.keyringlock', 'w') ++ break ++ else: ++ time.sleep(0.500) ++ i=i-1 ++ + # update the keyring with the password + if not config.has_section(service): + config.add_section(service) + config.set(service, username, password_base64) + +- # save the keyring back to the file +- with open(self.file_path, 'w') as config_file: +- config.write(config_file) ++ if i: ++ # save the keyring back to the file ++ with open(self.file_path, 'w') as config_file: ++ config.write(config_file) ++ lock.close() ++ os.remove('/tmp/.keyringlock') ++ + + def _ensure_file_path(self): + """ diff --git a/python-keyring/python-keyring/lock_keyring_file2.patch b/python-keyring/python-keyring/lock_keyring_file2.patch new file mode 100644 index 0000000..7633b5e --- /dev/null +++ b/python-keyring/python-keyring/lock_keyring_file2.patch @@ -0,0 +1,42 @@ +Index: keyring-5.3/keyring/backends/file.py +=================================================================== +--- keyring-5.3.orig/keyring/backends/file.py ++++ keyring-5.3/keyring/backends/file.py +@@ -92,10 +92,6 @@ class BaseKeyring(FileBacked, KeyringBac + # ensure the file exists + self._ensure_file_path() + +- # load the keyring from the disk +- config = configparser.RawConfigParser() +- config.read(self.file_path) +- + # obtain lock for the keyring file + lock = '' + i = 60 +@@ -107,15 +103,21 @@ class BaseKeyring(FileBacked, KeyringBac + time.sleep(0.500) + i=i-1 + +- # update the keyring with the password +- if not config.has_section(service): +- config.add_section(service) +- config.set(service, username, password_base64) + + if i: +- # save the keyring back to the file ++ # Load the keyring from the disk ++ config = configparser.RawConfigParser() ++ config.read(self.file_path) ++ ++ # Update the keyring with the password ++ if not config.has_section(service): ++ config.add_section(service) ++ config.set(service, username, password_base64) ++ ++ # Save the keyring back to the file + with open(self.file_path, 'w') as config_file: + config.write(config_file) ++ + lock.close() + os.remove('/tmp/.keyringlock') + diff --git a/python-keyring/python-keyring/no_keyring_password.patch b/python-keyring/python-keyring/no_keyring_password.patch new file mode 100644 index 0000000..6ea22fd --- /dev/null +++ b/python-keyring/python-keyring/no_keyring_password.patch @@ -0,0 +1,70 @@ +Index: keyring-3.2/keyring/backends/file.py +=================================================================== +--- keyring-3.2.orig/keyring/backends/file.py ++++ keyring-3.2/keyring/backends/file.py +@@ -114,7 +114,7 @@ class BaseKeyring(KeyringBackend): + # create the file without group/world permissions + with open(self.file_path, 'w'): + pass +- user_read_write = 0o600 ++ user_read_write = 0o644 + os.chmod(self.file_path, user_read_write) + + def delete_password(self, service, username): +@@ -188,12 +188,19 @@ class EncryptedKeyring(BaseKeyring): + + def _get_new_password(self): + while True: +- password = getpass.getpass( +- "Please set a password for your new keyring: ") +- confirm = getpass.getpass('Please confirm the password: ') +- if password != confirm: +- sys.stderr.write("Error: Your passwords didn't match\n") +- continue ++#**************************************************************** ++# Forging the Keyring password to allow automation and still keep ++# the password encoded. TODO to be revisited when Barbican keyring ++# Will be used with the complete PKI solution ++#**************************************************************** ++# password = getpass.getpass( ++# "Please set a password for your new keyring: ") ++# confirm = getpass.getpass('Please confirm the password: ') ++# if password != confirm: ++# sys.stderr.write("Error: Your passwords didn't match\n") ++# continue ++ password = "Please set a password for your new keyring: " ++ + if '' == password.strip(): + # forbid the blank password + sys.stderr.write("Error: blank passwords aren't allowed.\n") +@@ -233,8 +240,15 @@ class EncryptedKeyring(BaseKeyring): + Unlock this keyring by getting the password for the keyring from the + user. + """ +- self.keyring_key = getpass.getpass( +- 'Please enter password for encrypted keyring: ') ++#**************************************************************** ++# Forging the Keyring password to allow automation and still keep ++# the password encoded. TODO to be revisited when Barbican keyring ++# Will be used with the complete PKI solution ++#**************************************************************** ++# self.keyring_key = getpass.getpass( ++# 'Please enter password for encrypted keyring: ') ++ self.keyring_key = "Please set a password for your new keyring: " ++ + try: + ref_pw = self.get_password('keyring-setting', 'password reference') + assert ref_pw == 'password reference value' +Index: keyring-3.2/keyring/util/platform_.py +=================================================================== +--- keyring-3.2.orig/keyring/util/platform_.py ++++ keyring-3.2/keyring/util/platform_.py +@@ -16,7 +16,7 @@ def _data_root_Linux(): + Use freedesktop.org Base Dir Specfication to determine storage + location. + """ +- fallback = os.path.expanduser('~/.local/share') ++ fallback = os.path.expanduser('/opt/platform/.keyring/') + root = os.environ.get('XDG_DATA_HOME', None) or fallback + return os.path.join(root, 'python_keyring') + diff --git a/python-keyring/python-keyring/remove-reader-lock.patch b/python-keyring/python-keyring/remove-reader-lock.patch new file mode 100644 index 0000000..137805d --- /dev/null +++ b/python-keyring/python-keyring/remove-reader-lock.patch @@ -0,0 +1,136 @@ +--- + keyring/backends/file.py | 85 ++++++++++++++++++++++------------------------- + 1 file changed, 41 insertions(+), 44 deletions(-) + +--- a/keyring/backends/file.py ++++ b/keyring/backends/file.py +@@ -18,6 +18,7 @@ from ..backend import KeyringBackend + from ..util import platform_, properties + from ..util.escape import escape as escape_for_ini + from oslo_concurrency import lockutils ++from tempfile import mkstemp + + + lockfile = "keyringlock" +@@ -102,11 +103,9 @@ class BaseKeyring(FileBacked, KeyringBac + # encode with base64 + password_base64 = base64.encodestring(password_encrypted).decode() + +- lockdir = os.path.dirname(self.file_path) +- +- with lockutils.lock(lockfile,external=True,lock_path=lockdir): +- ++ keyringdir = os.path.dirname(self.file_path) + ++ with lockutils.lock(lockfile, external=True, lock_path=keyringdir): + config = None + try: + # Load the keyring from the disk +@@ -121,16 +120,20 @@ class BaseKeyring(FileBacked, KeyringBac + config.add_section(service) + config.set(service, username, password_base64) + +- # Save the keyring back to the file +- storage_root = os.path.dirname(self.file_path) +- tmpfile = "tmpfile.%s" % os.getpid() +- with open(storage_root + "/" + tmpfile, 'w') as config_file: +- config.write(config_file) +- # copy will overwrite but move will not +- shutil.copy(storage_root + "/" + tmpfile,self.file_path) +- # wipe out tmpfile here +- os.remove(storage_root + "/" + tmpfile) ++ # remove any residual temporary files here ++ try: ++ for tmpfile in glob.glob("%s/tmp*" % keyringdir): ++ os.remove(tmpfile) ++ except: ++ logging.warning("_check_file: tmpfile removal failed") + ++ # Write the keyring to a temp file, then move the new file ++ # to avoid overwriting the existing inode ++ (fd, fname) = mkstemp(dir=keyringdir) ++ with os.fdopen(fd, "w") as config_file: ++ config.write(config_file) ++ os.chmod(fname, os.stat(self.file_path).st_mode) ++ shutil.move(fname, self.file_path) + + + def _ensure_file_path(self): +@@ -167,8 +170,8 @@ class BaseKeyring(FileBacked, KeyringBac + service = escape_for_ini(service) + username = escape_for_ini(username) + +- lockdir = os.path.dirname(self.file_path) +- with lockutils.lock(lockfile,external=True,lock_path=lockdir): ++ keyringdir = os.path.dirname(self.file_path) ++ with lockutils.lock(lockfile, external=True, lock_path=keyringdir): + config = configparser.RawConfigParser() + if os.path.exists(self.file_path): + config.read(self.file_path) +@@ -177,15 +180,21 @@ class BaseKeyring(FileBacked, KeyringBac + raise PasswordDeleteError("Password not found") + except configparser.NoSectionError: + raise PasswordDeleteError("Password not found") +- # update the file +- storage_root = os.path.dirname(self.file_path) +- tmpfile = "tmpfile.%s" % os.getpid() +- with open(storage_root + "/" + tmpfile, 'w') as config_file: ++ ++ # remove any residual temporary files here ++ try: ++ for tmpfile in glob.glob("%s/tmp*" % keyringdir): ++ os.remove(tmpfile) ++ except: ++ logging.warning("_check_file: tmpfile removal failed") ++ ++ # Write the keyring to a temp file, then move the new file ++ # to avoid overwriting the existing inode ++ (fd, fname) = mkstemp(dir=keyringdir) ++ with os.fdopen(fd, "w") as config_file: + config.write(config_file) +- # copy will overwrite but move will not +- shutil.copy(storage_root + "/" + tmpfile,self.file_path) +- # wipe out tmpfile +- os.remove(storage_root + "/" + tmpfile) ++ os.chmod(fname, os.stat(self.file_path).st_mode) ++ shutil.move(fname, self.file_path) + + + class PlaintextKeyring(BaseKeyring): +@@ -294,27 +303,15 @@ class EncryptedKeyring(Encrypted, BaseKe + return False + self._migrate() + +- lockdir = os.path.dirname(self.file_path) +- # lock access to the file_path here, make sure it's not being written +- # to while while we're checking for keyring-setting +- with lockutils.lock(lockfile,external=True,lock_path=lockdir): +- config = configparser.RawConfigParser() +- config.read(self.file_path) +- try: +- config.get( +- escape_for_ini('keyring-setting'), +- escape_for_ini('password reference'), +- ) +- except (configparser.NoSectionError, configparser.NoOptionError): +- return False +- +- # remove any residual temporary files here +- try: +- for tmpfile in glob.glob(os.path.dirname(self.file_path) + "/" + "tmpfile.*"): +- os.remove(tmpfile) +- except: +- logging.warning("_check_file: tmpfile removal failed") +- ++ config = configparser.RawConfigParser() ++ config.read(self.file_path) ++ try: ++ config.get( ++ escape_for_ini('keyring-setting'), ++ escape_for_ini('password reference'), ++ ) ++ except (configparser.NoSectionError, configparser.NoOptionError): ++ return False + + return True + diff --git a/python-keyring/python-keyring/remove_others_perms_on_keyringcfg_file.patch b/python-keyring/python-keyring/remove_others_perms_on_keyringcfg_file.patch new file mode 100644 index 0000000..dcc4c2e --- /dev/null +++ b/python-keyring/python-keyring/remove_others_perms_on_keyringcfg_file.patch @@ -0,0 +1,15 @@ +--- + keyring/backends/file.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/keyring/backends/file.py ++++ b/keyring/backends/file.py +@@ -149,7 +149,7 @@ class BaseKeyring(FileBacked, KeyringBac + # create the file without group/world permissions + with open(self.file_path, 'w'): + pass +- user_read_write = 0o644 ++ user_read_write = 0o640 + os.chmod(self.file_path, user_read_write) + if not os.path.isfile(lockdir + "/" + lockfile): + with open(lockdir + "/" + lockfile, 'w'): diff --git a/python-keyring/python-keyring/use_new_lock.patch b/python-keyring/python-keyring/use_new_lock.patch new file mode 100644 index 0000000..d1b483d --- /dev/null +++ b/python-keyring/python-keyring/use_new_lock.patch @@ -0,0 +1,243 @@ +Index: keyring-5.3/keyring/backends/file.py +=================================================================== +--- keyring-5.3.orig/keyring/backends/file.py ++++ keyring-5.3/keyring/backends/file.py +@@ -7,6 +7,8 @@ import sys + import json + import abc + import time ++import logging ++import shutil + + from ..py27compat import configparser + +@@ -14,6 +16,7 @@ from ..errors import PasswordDeleteError + from ..backend import KeyringBackend + from ..util import platform_, properties + from ..util.escape import escape as escape_for_ini ++from oslo_concurrency import lockutils + + + class FileBacked(object): +@@ -31,6 +34,13 @@ class FileBacked(object): + """ + return os.path.join(platform_.data_root(), self.filename) + ++ @properties.NonDataProperty ++ def backup_file_path(self): ++ """ ++ The path to the file where passwords are stored. This property ++ may be overridden by the subclass or at the instance level. ++ """ ++ return os.path.join(platform_.data_root(), self.backup_filename) + + class BaseKeyring(FileBacked, KeyringBackend): + """ +@@ -78,6 +88,16 @@ class BaseKeyring(FileBacked, KeyringBac + password = None + return password + ++ ++ def filecopy(self,src,dest): ++ """copy file src to dest with default buffer size ++ """ ++ with open(src, 'r') as f1: ++ with open(dest, 'w') as f2: ++ shutil.copyfileobj(f1,f2) ++ f2.flush() ++ ++ + def set_password(self, service, username, password): + """Write the password in the file. + """ +@@ -89,37 +109,56 @@ class BaseKeyring(FileBacked, KeyringBac + # encode with base64 + password_base64 = base64.encodestring(password_encrypted).decode() + +- # ensure the file exists +- self._ensure_file_path() + +- # obtain lock for the keyring file +- lock = '' +- i = 60 +- while i: +- if not os.path.isfile('/tmp/.keyringlock'): +- lock = open('/tmp/.keyringlock', 'w') +- break +- else: +- time.sleep(0.500) +- i=i-1 ++ with lockutils.lock("keyringlock",external=True,lock_path="/tmp"): + ++ # ensure the file exists ++ self._ensure_file_path() ++ ++ config = None ++ try: ++ # Load the keyring from the disk ++ config = configparser.RawConfigParser() ++ config.read(self.file_path) ++ except configparser.ParsingError as e: ++ logging.warning("set_password: keyring file corrupted, Reverting to Backup") ++ # Revert to the backup file (copy backup over current file) ++ try: ++ src = self.backup_file_path ++ dest = self.file_path ++ self.filecopy(src,dest) ++ except shutil.Error as e: ++ logging.warning("set_password: Revert from Backup failed. Error: %s" % e) ++ raise ++ # Load the keyring from the disk, if this fails exception is raised ++ try: ++ config = configparser.RawConfigParser() ++ config.read(self.file_path) ++ except: ++ e = sys.exc_info()[0] ++ logging.warning("set_password: Both keyring files are non useable. Error: %s" % e) ++ raise + +- if i: +- # Load the keyring from the disk +- config = configparser.RawConfigParser() +- config.read(self.file_path) + + # Update the keyring with the password + if not config.has_section(service): + config.add_section(service) + config.set(service, username, password_base64) + ++ # Make a back up of the keyring file here ++ try: ++ src = self.file_path ++ dest = self.backup_file_path ++ self.filecopy(src,dest) ++ except shutil.Error as e: ++ logging.warning("set_password: Backup failed. Error: %s" % e) ++ + # Save the keyring back to the file + with open(self.file_path, 'w') as config_file: + config.write(config_file) + +- lock.close() +- os.remove('/tmp/.keyringlock') ++ ++ + + + def _ensure_file_path(self): +@@ -142,17 +181,18 @@ class BaseKeyring(FileBacked, KeyringBac + """ + service = escape_for_ini(service) + username = escape_for_ini(username) +- config = configparser.RawConfigParser() +- if os.path.exists(self.file_path): +- config.read(self.file_path) +- try: +- if not config.remove_option(service, username): ++ with lockutils.lock("keyringlock",external=True,lock_path="/tmp"): ++ config = configparser.RawConfigParser() ++ if os.path.exists(self.file_path): ++ config.read(self.file_path) ++ try: ++ if not config.remove_option(service, username): ++ raise PasswordDeleteError("Password not found") ++ except configparser.NoSectionError: + raise PasswordDeleteError("Password not found") +- except configparser.NoSectionError: +- raise PasswordDeleteError("Password not found") +- # update the file +- with open(self.file_path, 'w') as config_file: +- config.write(config_file) ++ # update the file ++ with open(self.file_path, 'w') as config_file: ++ config.write(config_file) + + class PlaintextKeyring(BaseKeyring): + """Simple File Keyring with no encryption""" +@@ -161,6 +201,7 @@ class PlaintextKeyring(BaseKeyring): + "Applicable for all platforms, but not recommended" + + filename = 'keyring_pass.cfg' ++ backup_filename = 'crypted_pass_backup.cfg' + + def encrypt(self, password): + """Directly return the password itself. +@@ -214,6 +255,7 @@ class EncryptedKeyring(Encrypted, BaseKe + """PyCrypto File Keyring""" + + filename = 'crypted_pass.cfg' ++ backup_filename = 'crypted_pass_backup.cfg' + pw_prefix = 'pw:'.encode() + + @properties.ClassProperty +@@ -247,6 +289,19 @@ class EncryptedKeyring(Encrypted, BaseKe + self.keyring_key = self._get_new_password() + # set a reference password, used to check that the password provided + # matches for subsequent checks. ++ ++ # try to pre-create the /tmp/keyringlock if it doesn't exist ++ lockfile = "/tmp/keyringlock" ++ if os.geteuid() == 0 and (not os.path.exists(lockfile)): ++ from pwd import getpwnam ++ import stat ++ nonrootuser = "wrsroot" ++ with open(lockfile, 'w'): ++ pass ++ # must have the lock file with the correct group permissisions g+rw ++ os.chmod(lockfile, stat.S_IRWXG | stat.S_IRWXU) ++ ++ + self.set_password('keyring-setting', 'password reference', + 'password reference value') + +@@ -257,15 +312,41 @@ class EncryptedKeyring(Encrypted, BaseKe + if not os.path.exists(self.file_path): + return False + self._migrate() +- config = configparser.RawConfigParser() +- config.read(self.file_path) +- try: +- config.get( +- escape_for_ini('keyring-setting'), +- escape_for_ini('password reference'), +- ) +- except (configparser.NoSectionError, configparser.NoOptionError): +- return False ++ ++ # lock access to the file_path here, make sure it's not being written ++ # to while while we're checking for keyring-setting ++ with lockutils.lock("keyringlock",external=True,lock_path="/tmp"): ++ config = configparser.RawConfigParser() ++ config.read(self.file_path) ++ try: ++ config.get( ++ escape_for_ini('keyring-setting'), ++ escape_for_ini('password reference'), ++ ) ++ except (configparser.NoSectionError, configparser.NoOptionError): ++ # The current file doesn't have the keyring-setting, check the backup ++ logging.warning("_check_file: The current file doesn't have the keyring-setting, check the backup") ++ if os.path.exists(self.backup_file_path): ++ config = configparser.RawConfigParser() ++ config.read(self.backup_file_path) ++ try: ++ config.get( ++ escape_for_ini('keyring-setting'), ++ escape_for_ini('password reference'), ++ ) ++ except (configparser.NoSectionError, configparser.NoOptionError): ++ return False ++ # backup file has it, let's use it ++ try: ++ src = self.backup_file_path ++ dest = self.file_path ++ shutil.copy(src,dest) ++ except shutil.Error as e: ++ logging.warning("Revert from Backup failed. Error: %s" % e) ++ return False ++ else: ++ return False ++ + return True + + def _unlock(self): diff --git a/python-keyring/python-keyring/use_temporary_file.patch b/python-keyring/python-keyring/use_temporary_file.patch new file mode 100644 index 0000000..faa968d --- /dev/null +++ b/python-keyring/python-keyring/use_temporary_file.patch @@ -0,0 +1,162 @@ +Index: keyring-5.3/keyring/backends/file.py +=================================================================== +--- keyring-5.3.orig/keyring/backends/file.py ++++ keyring-5.3/keyring/backends/file.py +@@ -9,6 +9,7 @@ import abc + import time + import logging + import shutil ++import glob + + from ..py27compat import configparser + +@@ -36,13 +37,6 @@ class FileBacked(object): + """ + return os.path.join(platform_.data_root(), self.filename) + +- @properties.NonDataProperty +- def backup_file_path(self): +- """ +- The path to the file where passwords are stored. This property +- may be overridden by the subclass or at the instance level. +- """ +- return os.path.join(platform_.data_root(), self.backup_filename) + + class BaseKeyring(FileBacked, KeyringBackend): + """ +@@ -91,15 +85,6 @@ class BaseKeyring(FileBacked, KeyringBac + return password + + +- def filecopy(self,src,dest): +- """copy file src to dest with default buffer size +- """ +- with open(src, 'r') as f1: +- with open(dest, 'w') as f2: +- shutil.copyfileobj(f1,f2) +- f2.flush() +- +- + def set_password(self, service, username, password): + """Write the password in the file. + """ +@@ -125,23 +110,7 @@ class BaseKeyring(FileBacked, KeyringBac + config = configparser.RawConfigParser() + config.read(self.file_path) + except configparser.ParsingError as e: +- logging.warning("set_password: keyring file corrupted, Reverting to Backup") +- # Revert to the backup file (copy backup over current file) +- try: +- src = self.backup_file_path +- dest = self.file_path +- self.filecopy(src,dest) +- except shutil.Error as e: +- logging.warning("set_password: Revert from Backup failed. Error: %s" % e) +- raise +- # Load the keyring from the disk, if this fails exception is raised +- try: +- config = configparser.RawConfigParser() +- config.read(self.file_path) +- except: +- e = sys.exc_info()[0] +- logging.warning("set_password: Both keyring files are non useable. Error: %s" % e) +- raise ++ logging.warning("set_password: keyring file corrupted") + + + # Update the keyring with the password +@@ -149,17 +118,15 @@ class BaseKeyring(FileBacked, KeyringBac + config.add_section(service) + config.set(service, username, password_base64) + +- # Make a back up of the keyring file here +- try: +- src = self.file_path +- dest = self.backup_file_path +- self.filecopy(src,dest) +- except shutil.Error as e: +- logging.warning("set_password: Backup failed. Error: %s" % e) +- + # Save the keyring back to the file +- with open(self.file_path, 'w') as config_file: ++ storage_root = os.path.dirname(self.file_path) ++ tmpfile = "tmpfile.%s" % os.getpid() ++ with open(storage_root + "/" + tmpfile, 'w') as config_file: + config.write(config_file) ++ # copy will overwrite but move will not ++ shutil.copy(storage_root + "/" + tmpfile,self.file_path) ++ # wipe out tmpfile here ++ os.remove(storage_root + "/" + tmpfile) + + + +@@ -203,8 +170,15 @@ class BaseKeyring(FileBacked, KeyringBac + except configparser.NoSectionError: + raise PasswordDeleteError("Password not found") + # update the file +- with open(self.file_path, 'w') as config_file: ++ storage_root = os.path.dirname(self.file_path) ++ tmpfile = "tmpfile.%s" % os.getpid() ++ with open(storage_root + "/" + tmpfile, 'w') as config_file: + config.write(config_file) ++ # copy will overwrite but move will not ++ shutil.copy(storage_root + "/" + tmpfile,self.file_path) ++ # wipe out tmpfile ++ os.remove(storage_root + "/" + tmpfile) ++ + + class PlaintextKeyring(BaseKeyring): + """Simple File Keyring with no encryption""" +@@ -213,7 +187,6 @@ class PlaintextKeyring(BaseKeyring): + "Applicable for all platforms, but not recommended" + + filename = 'keyring_pass.cfg' +- backup_filename = 'crypted_pass_backup.cfg' + + def encrypt(self, password): + """Directly return the password itself. +@@ -267,7 +240,6 @@ class EncryptedKeyring(Encrypted, BaseKe + """PyCrypto File Keyring""" + + filename = 'crypted_pass.cfg' +- backup_filename = 'crypted_pass_backup.cfg' + pw_prefix = 'pw:'.encode() + + @properties.ClassProperty +@@ -326,27 +298,15 @@ class EncryptedKeyring(Encrypted, BaseKe + escape_for_ini('password reference'), + ) + except (configparser.NoSectionError, configparser.NoOptionError): +- # The current file doesn't have the keyring-setting, check the backup +- if os.path.exists(self.backup_file_path): +- config = configparser.RawConfigParser() +- config.read(self.backup_file_path) +- try: +- config.get( +- escape_for_ini('keyring-setting'), +- escape_for_ini('password reference'), +- ) +- except (configparser.NoSectionError, configparser.NoOptionError): +- return False +- # backup file has it, let's use it +- try: +- src = self.backup_file_path +- dest = self.file_path +- shutil.copy(src,dest) +- except shutil.Error as e: +- logging.warning("Revert from Backup failed. Error: %s" % e) +- return False +- else: +- return False ++ return False ++ ++ # remove any residual temporary files here ++ try: ++ for tmpfile in glob.glob(os.path.dirname(self.file_path) + "/" + "tmpfile.*"): ++ os.remove(tmpfile) ++ except: ++ logging.warning("_check_file: tmpfile removal failed") ++ + + return True + diff --git a/python-psycopg2/centos/build_srpm.data b/python-psycopg2/centos/build_srpm.data new file mode 100644 index 0000000..f261980 --- /dev/null +++ b/python-psycopg2/centos/build_srpm.data @@ -0,0 +1,2 @@ +TIS_PATCH_VER=2 + diff --git a/python-psycopg2/centos/meta_patches/PATCH_ORDER b/python-psycopg2/centos/meta_patches/PATCH_ORDER new file mode 100644 index 0000000..84f9de3 --- /dev/null +++ b/python-psycopg2/centos/meta_patches/PATCH_ORDER @@ -0,0 +1,2 @@ +setup-spec-for-tis.patch +meta-patch0.patch diff --git a/python-psycopg2/centos/meta_patches/meta-patch0.patch b/python-psycopg2/centos/meta_patches/meta-patch0.patch new file mode 100644 index 0000000..bec98c2 --- /dev/null +++ b/python-psycopg2/centos/meta_patches/meta-patch0.patch @@ -0,0 +1,33 @@ +From f964faeb50150b64ed2481f721e544f4c3e2ca55 Mon Sep 17 00:00:00 2001 +From: Al Bailey +Date: Tue, 29 Nov 2016 15:06:32 -0500 +Subject: [PATCH 1/1] meta patch0 + +--- + SPECS/python-psycopg2.spec | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/SPECS/python-psycopg2.spec b/SPECS/python-psycopg2.spec +index 2489fc5..c11a680 100644 +--- a/SPECS/python-psycopg2.spec ++++ b/SPECS/python-psycopg2.spec +@@ -36,6 +36,8 @@ Url: http://www.psycopg.org/psycopg/ + + Source0: http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-%{version}.tar.gz + ++Patch0: Manually-patch-170-173-187-and-187-fix.patch ++ + BuildRequires: postgresql-devel + BuildRequires: python-devel + BuildRequires: python-debug +@@ -103,6 +105,7 @@ Zope Database Adapter for PostgreSQL, called ZPsycopgDA + + %prep + %setup -q -n psycopg2-%{version} ++%patch0 -p1 + + %build + for python in %{python_runtimes} ; do +-- +1.8.3.1 + diff --git a/python-psycopg2/centos/meta_patches/setup-spec-for-tis.patch b/python-psycopg2/centos/meta_patches/setup-spec-for-tis.patch new file mode 100644 index 0000000..dfbb345 --- /dev/null +++ b/python-psycopg2/centos/meta_patches/setup-spec-for-tis.patch @@ -0,0 +1,25 @@ +From 78314a11e44751d23da70c5b935c73579650a2bd Mon Sep 17 00:00:00 2001 +From: Al Bailey +Date: Tue, 29 Nov 2016 14:29:21 -0500 +Subject: [PATCH 1/1] Setup spec for Titanium Cloud + +--- + SPECS/python-psycopg2.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/python-psycopg2.spec b/SPECS/python-psycopg2.spec +index 8492914..2489fc5 100644 +--- a/SPECS/python-psycopg2.spec ++++ b/SPECS/python-psycopg2.spec +@@ -28,7 +28,7 @@ + Summary: A PostgreSQL database adapter for Python + Name: python-psycopg2 + Version: 2.5.1 +-Release: 3%{?dist} ++Release: 3.el7%{?_tis_dist}.%{tis_patch_ver} + # The exceptions allow linking to OpenSSL and PostgreSQL's libpq + License: LGPLv3+ with exceptions + Group: Applications/Databases +-- +1.8.3.1 + diff --git a/python-psycopg2/centos/patches/Manually-patch-170-173-187-and-187-fix.patch b/python-psycopg2/centos/patches/Manually-patch-170-173-187-and-187-fix.patch new file mode 100644 index 0000000..e4a88c4 --- /dev/null +++ b/python-psycopg2/centos/patches/Manually-patch-170-173-187-and-187-fix.patch @@ -0,0 +1,96 @@ +From 04fe7ce2bed4b20ffa89d12551bd2865d21caec1 Mon Sep 17 00:00:00 2001 +From: Al Bailey +Date: Tue, 29 Nov 2016 14:52:47 -0500 +Subject: [PATCH 1/1] Manually patch 170,173,187 and 187 fix + +--- + psycopg/connection_int.c | 7 ++++++- + psycopg/error_type.c | 12 ++++++++++-- + psycopg/lobject_type.c | 15 +++++++++------ + 3 files changed, 25 insertions(+), 9 deletions(-) + +diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c +index 7851b0a..5069e64 100644 +--- a/psycopg/connection_int.c ++++ b/psycopg/connection_int.c +@@ -642,6 +642,7 @@ static int + _conn_poll_connecting(connectionObject *self) + { + int res = PSYCO_POLL_ERROR; ++ const char *msg; + + Dprintf("conn_poll: poll connecting"); + switch (PQconnectPoll(self->pgconn)) { +@@ -656,7 +657,11 @@ _conn_poll_connecting(connectionObject *self) + break; + case PGRES_POLLING_FAILED: + case PGRES_POLLING_ACTIVE: +- PyErr_SetString(OperationalError, "asynchronous connection failed"); ++ msg = PQerrorMessage(self->pgconn); ++ if (!(msg && *msg)) { ++ msg = "asynchronous connection failed"; ++ } ++ PyErr_SetString(OperationalError, msg); + res = PSYCO_POLL_ERROR; + break; + } +diff --git a/psycopg/error_type.c b/psycopg/error_type.c +index 106b87a..75761e8 100644 +--- a/psycopg/error_type.c ++++ b/psycopg/error_type.c +@@ -163,8 +163,16 @@ psyco_error_reduce(errorObject *self) + if (2 != PyTuple_GET_SIZE(tuple)) { goto exit; } + + if (!(dict = PyDict_New())) { goto error; } +- if (0 != PyDict_SetItemString(dict, "pgerror", self->pgerror)) { goto error; } +- if (0 != PyDict_SetItemString(dict, "pgcode", self->pgcode)) { goto error; } ++ if (self->pgerror) { ++ if (0 != PyDict_SetItemString(dict, "pgerror", self->pgerror)) { ++ goto error; ++ } ++ } ++ if (self->pgcode) { ++ if (0 != PyDict_SetItemString(dict, "pgcode", self->pgcode)) { ++ goto error; ++ } ++ } + + { + PyObject *newtuple; +diff --git a/psycopg/lobject_type.c b/psycopg/lobject_type.c +index fee11c4..823a1b7 100644 +--- a/psycopg/lobject_type.c ++++ b/psycopg/lobject_type.c +@@ -355,9 +355,11 @@ lobject_dealloc(PyObject* obj) + { + lobjectObject *self = (lobjectObject *)obj; + +- if (lobject_close(self) < 0) +- PyErr_Print(); +- Py_XDECREF((PyObject*)self->conn); ++ if (self->conn) { /* if not, init failed */ ++ if (lobject_close(self) < 0) ++ PyErr_Print(); ++ Py_XDECREF((PyObject*)self->conn); ++ } + PyMem_Free(self->smode); + + Dprintf("lobject_dealloc: deleted lobject object at %p, refcnt = " +@@ -372,10 +374,11 @@ lobject_init(PyObject *obj, PyObject *args, PyObject *kwds) + int oid = (int)InvalidOid, new_oid = (int)InvalidOid; + const char *smode = ""; + const char *new_file = NULL; +- PyObject *conn; ++ PyObject *conn = NULL; + +- if (!PyArg_ParseTuple(args, "O|iziz", +- &conn, &oid, &smode, &new_oid, &new_file)) ++ if (!PyArg_ParseTuple(args, "O!|iziz", ++ &connectionType, &conn, ++ &oid, &smode, &new_oid, &new_file)) + return -1; + + return lobject_setup((lobjectObject *)obj, +-- +1.8.3.1 + diff --git a/python-psycopg2/centos/srpm_path b/python-psycopg2/centos/srpm_path new file mode 100644 index 0000000..02f3299 --- /dev/null +++ b/python-psycopg2/centos/srpm_path @@ -0,0 +1,2 @@ +mirror:Source/python-psycopg2-2.5.1-3.el7.src.rpm + diff --git a/rsync/centos/build_srpm.data b/rsync/centos/build_srpm.data new file mode 100644 index 0000000..2c93764 --- /dev/null +++ b/rsync/centos/build_srpm.data @@ -0,0 +1,2 @@ +COPY_LIST="$PKG_BASE/files/rsyncd.conf" +TIS_PATCH_VER=1 diff --git a/rsync/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/rsync/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch new file mode 100644 index 0000000..ca0acc3 --- /dev/null +++ b/rsync/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch @@ -0,0 +1,27 @@ +From 20f4e2f0f19c6d0e9c8ee1314481bc8e85dbd5bb Mon Sep 17 00:00:00 2001 +From: Scott Little +Date: Mon, 2 Oct 2017 16:32:24 -0400 +Subject: [PATCH 1/1] WRS: 0001-Update-package-versioning-for-TIS-format.patch + +Conflicts: + SPECS/rsync.spec +--- + SPECS/rsync.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/rsync.spec b/SPECS/rsync.spec +index 85b01f2..310b284 100644 +--- a/SPECS/rsync.spec ++++ b/SPECS/rsync.spec +@@ -8,7 +8,7 @@ + Summary: A program for synchronizing files over a network + Name: rsync + Version: 3.0.9 +-Release: 18%{?prerelease}%{?dist} ++Release: 18.el7%{?_tis_dist}.%{tis_patch_ver} + Group: Applications/Internet + URL: http://rsync.samba.org/ + +-- +1.9.1 + diff --git a/rsync/centos/meta_patches/PATCH_ORDER b/rsync/centos/meta_patches/PATCH_ORDER new file mode 100644 index 0000000..91f9a80 --- /dev/null +++ b/rsync/centos/meta_patches/PATCH_ORDER @@ -0,0 +1 @@ +0001-Update-package-versioning-for-TIS-format.patch diff --git a/rsync/centos/srpm_path b/rsync/centos/srpm_path new file mode 100644 index 0000000..1780040 --- /dev/null +++ b/rsync/centos/srpm_path @@ -0,0 +1 @@ +mirror:Source/rsync-3.0.9-18.el7.src.rpm diff --git a/rsync/files/rsyncd b/rsync/files/rsyncd new file mode 100755 index 0000000..df550ba --- /dev/null +++ b/rsync/files/rsyncd @@ -0,0 +1,93 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: rsyncd +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: RSYNC daemon +# Description: RSYNC daemon +### END INIT INFO + +DESC="rsyncd" +DAEMON="/usr/bin/rsync" +RUNDIR="/var/run" +PIDFILE="${RUNDIR}/rsyncd.pid" +OPTIONS="--daemon --config=/etc/rsyncd.conf" + + +start() +{ + if [ -e $PIDFILE ]; then + PIDDIR=/proc/$(cat $PIDFILE) + if [ -d ${PIDDIR} ]; then + echo "$DESC already running." + exit 0 + else + echo "Removing stale PID file $PIDFILE" + rm -f $PIDFILE + fi + fi + + echo -n "Starting $DESC..." + mkdir -p $RUNDIR + start-stop-daemon --start --quiet --background \ + --pidfile ${PIDFILE} --exec ${DAEMON} \ + -- $OPTIONS + + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + exit 1 + fi +} + +stop() +{ + echo -n "Stopping $DESC..." + start-stop-daemon --stop --quiet --pidfile $PIDFILE + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed." + fi + rm -f $PIDFILE +} + +status() +{ + pid=`cat $PIDFILE 2>/dev/null` + if [ -n "$pid" ]; then + if ps -p $pid &>/dev/null ; then + echo "$DESC is running" + exit 0 + else + echo "$DESC is not running but has pid file" + exit 1 + fi + fi + echo "$DESC is not running" + exit 3 +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|force-reload|reload) + stop + start + ;; + status) + status + ;; + *) + echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/rsync/files/rsyncd.conf b/rsync/files/rsyncd.conf new file mode 100644 index 0000000..8b56742 --- /dev/null +++ b/rsync/files/rsyncd.conf @@ -0,0 +1,51 @@ +# /etc/rsyncd.conf + +# Configuration file for rsync daemon +# See rsync(1) and rsyncd.conf(5) man pages for help + +# This file is required by rsync --daemon +pid file = /var/run/rsyncd.pid +use chroot = yes +read only = yes + +# Simple example for enabling your own local rsync server +#[everything] +# path = / +# comment = Everything except /etc exposed +# exclude = /etc + +[patching] + path = /opt/patching + comment = Patching filesystem + uid = root + read only = no + +[repo] + path = /www/pages/updates + comment = Patching repo + uid = root + read only = no + +[platform] + path = /etc/platform + comment = Platform configuration + uid = root + read only = no + +[certificate] + path = /etc/ssl/private + comment = SSL certificate + uid = root + read only = no + +[instances] + path = /etc/nova/instances + comment = Nova instances data + uid = root + read only = no + +[cacert] + path = /etc/ssl/certs + comment = SSL ca certificate + uid = root + read only = no diff --git a/seabios/centos/build_srpm.data b/seabios/centos/build_srpm.data new file mode 100644 index 0000000..70b4b5d --- /dev/null +++ b/seabios/centos/build_srpm.data @@ -0,0 +1 @@ +TIS_PATCH_VER=2 diff --git a/seabios/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/seabios/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch new file mode 100644 index 0000000..d83a5bc --- /dev/null +++ b/seabios/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch @@ -0,0 +1,26 @@ +From 2278e76d2a6933e91ee176386f7aa86529c2d3e8 Mon Sep 17 00:00:00 2001 +From: Scott Little +Date: Mon, 2 Oct 2017 17:01:00 -0400 +Subject: [PATCH 1/2] WRS: 0001-Update-package-versioning-for-TIS-format.patch + +Conflicts: + SPECS/seabios.spec +--- + SPECS/seabios.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/seabios.spec b/SPECS/seabios.spec +index 0b255d3..1603f16 100644 +--- a/SPECS/seabios.spec ++++ b/SPECS/seabios.spec +@@ -1,6 +1,6 @@ + Name: seabios + Version: 1.10.2 +-Release: 3%{?dist}.1 ++Release: 3.el7_4.1%{?_tis_dist}.%{tis_patch_ver} + Summary: Open-source legacy BIOS implementation + + Group: Applications/Emulators +-- +1.9.1 + diff --git a/seabios/centos/meta_patches/PATCH_ORDER b/seabios/centos/meta_patches/PATCH_ORDER new file mode 100644 index 0000000..15fc799 --- /dev/null +++ b/seabios/centos/meta_patches/PATCH_ORDER @@ -0,0 +1,2 @@ +0001-Update-package-versioning-for-TIS-format.patch +meta-CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch diff --git a/seabios/centos/meta_patches/meta-CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch b/seabios/centos/meta_patches/meta-CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch new file mode 100644 index 0000000..c7603b8 --- /dev/null +++ b/seabios/centos/meta_patches/meta-CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch @@ -0,0 +1,41 @@ +From 604f198f6eb2d43452e35f51b98087a1bb872021 Mon Sep 17 00:00:00 2001 +From: Scott Little +Date: Mon, 2 Oct 2017 17:01:00 -0400 +Subject: [PATCH 2/2] WRS: + meta-CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch + +Conflicts: + SPECS/seabios.spec +--- + SPECS/seabios.spec | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/SPECS/seabios.spec b/SPECS/seabios.spec +index 1603f16..d8c986f 100644 +--- a/SPECS/seabios.spec ++++ b/SPECS/seabios.spec +@@ -37,6 +37,11 @@ Patch10: seabios-virtio-scsi-enumerate-luns-with-REPORT-LUNS.patch + Patch11: seabios-usb-uas-enumerate-luns-with-REPORT-LUNS.patch + # For bz#1472131 - Guest OS will down when disk enable the IOMMU for Virtio + Patch12: seabios-virtio-IOMMU-support.patch ++ ++# WRS patches ++# CGTS-5175: Instance can not startup due to "No bootable device" ++Patch100: CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch ++ + BuildRequires: python iasl + ExclusiveArch: x86_64 %{power64} + +@@ -99,6 +104,9 @@ SeaVGABIOS is an open-source VGABIOS implementation. + %patch11 -p1 + %patch12 -p1 + ++# WRS patches ++%patch100 -p1 ++ + %build + %ifarch x86_64 + export CFLAGS="$RPM_OPT_FLAGS" +-- +1.9.1 + diff --git a/seabios/centos/patches/CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch b/seabios/centos/patches/CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch new file mode 100644 index 0000000..85201b5 --- /dev/null +++ b/seabios/centos/patches/CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch @@ -0,0 +1,67 @@ +From 7cc3d0e6149ea9276edef25ba85d08879ee40771 Mon Sep 17 00:00:00 2001 +From: Jim Gauld +Date: Thu, 6 Oct 2016 14:18:35 -0400 +Subject: [PATCH 1/1] CGTS-5175: Add instrumentation to debug boot failures + from disk + +This adds print statements with prefix "Debug:" showing +boot register flags before and after interrupt, etc. + +In the case we get instances with "No bootable device", we want +to see more information in the case where retry is not sufficient. +--- + src/boot.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/boot.c b/src/boot.c +index 706b7df..c89086b 100644 +--- a/src/boot.c ++++ b/src/boot.c +@@ -2,6 +2,7 @@ + // + // Copyright (C) 2008-2013 Kevin O'Connor + // Copyright (C) 2002 MandrakeSoft S.A. ++// Copyright (C) 2016 Wind River Systems, Inc. All rights reserved. + // + // This file may be distributed under the terms of the GNU LGPLv3 license. + +@@ -596,7 +597,7 @@ bcv_prepboot(void) + static void + call_boot_entry(struct segoff_s bootsegip, u8 bootdrv) + { +- dprintf(1, "Booting from %04x:%04x\n", bootsegip.seg, bootsegip.offset); ++ printf("Debug: Booting from %04x:%04x\n", bootsegip.seg, bootsegip.offset); + struct bregs br; + memset(&br, 0, sizeof(br)); + br.flags = F_IF; +@@ -622,9 +623,11 @@ boot_disk(u8 bootdrv, int checksig) + br.ah = 2; + br.al = 1; + br.cl = 1; ++ printf("Debug: boot_disk: pre: br.flags=%04x\n", br.flags); + call16_int(0x13, &br); + + if (br.flags & F_CF) { ++ printf("Debug: boot_disk: post: br.flags=%04x, F_CF=%04x\n", br.flags, F_CF); + printf("Boot failed: could not read the boot disk\n\n"); + return; + } +@@ -719,6 +722,7 @@ do_boot(int seq_nr) + if (! CONFIG_BOOT) + panic("Boot support not compiled in.\n"); + ++ printf("Debug: do_boot: seq_nr=%d, BEVCount=%d\n", seq_nr, BEVCount); + if (seq_nr >= BEVCount) + boot_fail(); + +@@ -748,6 +752,7 @@ do_boot(int seq_nr) + } + + // Boot failed: invoke the boot recovery function ++ printf("Debug: do_boot: boot recovery\n"); + struct bregs br; + memset(&br, 0, sizeof(br)); + br.flags = F_IF; +-- +1.9.1 + diff --git a/seabios/centos/srpm_path b/seabios/centos/srpm_path new file mode 100644 index 0000000..b3329b1 --- /dev/null +++ b/seabios/centos/srpm_path @@ -0,0 +1 @@ +mirror:Source/seabios-1.10.2-3.el7_4.1.src.rpm diff --git a/sysvinit/sysvinit/log-start-completion-of-init-steps.patch b/sysvinit/sysvinit/log-start-completion-of-init-steps.patch new file mode 100644 index 0000000..ba1b2e1 --- /dev/null +++ b/sysvinit/sysvinit/log-start-completion-of-init-steps.patch @@ -0,0 +1,27 @@ +--- + rc | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/rc ++++ b/rc +@@ -41,6 +41,7 @@ startup_progress() { + startup() { + # Handle verbosity + [ "$VERBOSE" = very ] && echo "INIT: Running $@..." ++ logger "INIT: Running $@..." + + case "$1" in + *.sh) +@@ -56,6 +57,12 @@ startup() { + "$@" + ;; + esac ++ if [ $? -eq 0 ] ; then ++ logger "INIT: Running $@ PASSED" ++ else ++ logger "INIT: Running $@ FAILED" ++ fi ++ + startup_progress + } + diff --git a/sysvinit/sysvinit/log_timestamp.patch b/sysvinit/sysvinit/log_timestamp.patch new file mode 100644 index 0000000..9e96e73 --- /dev/null +++ b/sysvinit/sysvinit/log_timestamp.patch @@ -0,0 +1,35 @@ +--- + sysvinit-2.88dsf/src/bootlogd.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +--- a/sysvinit-2.88dsf/src/bootlogd.c ++++ b/sysvinit-2.88dsf/src/bootlogd.c +@@ -352,17 +352,26 @@ int consolename(char *res, int rlen) + void writelog(FILE *fp, unsigned char *ptr, int len) + { + time_t t; ++ struct timespec ts; + char *s; + char tmp[8]; ++ char time_buf[64]; + int olen = len; + int dosync = 0; + int tlen; ++ int pos; + + while (len > 0) { + tmp[0] = 0; + if (didnl) { +- time(&t); +- s = ctime(&t); ++ clock_gettime(CLOCK_REALTIME, &ts); ++ pos = strftime(time_buf, sizeof(time_buf), "%FT%T", localtime(&ts.tv_sec)); ++ if (pos > 0) { ++ snprintf(&time_buf[pos], sizeof(time_buf) - pos, ".%03ld", ts.tv_nsec/1000000); ++ s = time_buf; ++ } ++ else ++ s = ctime(&ts.tv_sec); + fprintf(fp, "%.24s: ", s); + didnl = 0; + }