StarlingX open source release updates

Signed-off-by: Dean Troyer <dtroyer@gmail.com>
This commit is contained in:
Dean Troyer 2018-05-30 16:16:40 -07:00
parent 257f9d9865
commit e2689f5f00
96 changed files with 5098 additions and 0 deletions

202
LICENSE Normal file
View File

@ -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.

5
README.rst Normal file
View File

@ -0,0 +1,5 @@
=========
stx-gplv3
=========
StarlingX GPL v3 Licensed Packages

View File

@ -0,0 +1 @@
TIS_PATCH_VER=5

View File

@ -0,0 +1,25 @@
From d52fda6215af4f2d51884a10c04d3c7a44d100dd Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1,38 @@
From 6bec7d96120f7eef019ab2841265bf4b74ebc64d Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1,32 @@
From 9ebc2f9343cc214fb1e590221e4791f10a2f87d1 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1,25 @@
From 709f54c6e799c23a9a374dfca6196ec08102b658 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1,53 @@
From e54422230c27e53436fe94a639a04aaf65f787e1 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -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

View File

@ -0,0 +1,394 @@
From fa37cfcf560506f49bb00b9d216b1e7646a6905b Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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 <clumens@redhat.com>
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

View File

@ -0,0 +1,87 @@
From 76cd2b90fd4e550e162bc8fc7e247ed2f4e6e310 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1,25 @@
From d14b48ec201b4f90042f6292d537d5af5d78c6a6 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1,80 @@
From 0b9c332f7101c890c5bb1c65f9c89d82bd759a04 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1 @@
mirror:Source/anaconda-21.48.22.121-1.el7.centos.src.rpm

View File

@ -0,0 +1 @@
TIS_PATCH_VER=2

View File

@ -0,0 +1,25 @@
From a15d83975ed19367767e18354ea07cd5d281e265 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1,2 @@
spec-add-patch-to-remove-printing-of-motd-script-nam.patch
0001-Update-package-versioning-for-TIS-format.patch

View File

@ -0,0 +1,35 @@
From 9221bd11aec1590df2dc3f19e9a582d76ed7adc0 Mon Sep 17 00:00:00 2001
From: Michel Thebeau <michel.thebeau@windriver.com>
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 <michel.thebeau@windriver.com>
---
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

View File

@ -0,0 +1,65 @@
From f0bd54cb83ba430ef81153c7a6da2a52daca5266 Mon Sep 17 00:00:00 2001
From: Michel Thebeau <michel.thebeau@windriver.com>
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 <michel.thebeau@windriver.com>
---
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] <dir>"
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

View File

@ -0,0 +1 @@
mirror:Source/crontabs-1.11-6.20121102git.el7.src.rpm

7
dnsmasq/.gitignore vendored Normal file
View File

@ -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

13
dnsmasq/PKG-INFO Normal file
View File

@ -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

View File

@ -0,0 +1,2 @@
COPY_LIST="files/*"
TIS_PATCH_VER=6

View File

@ -0,0 +1,25 @@
From 402d56affb9e0767c4406260522fb356ecc420a0 Mon Sep 17 00:00:00 2001
From: jmckenna <jason.mckenna@windriver.com>
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

View File

@ -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

View File

@ -0,0 +1,71 @@
From 13714ffa05d7d8a7ca9f9f61bfa75a3f7e8c2503 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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

View File

@ -0,0 +1,34 @@
From e257b88db5d62a1e44e94373917dd3f97de12522 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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

View File

@ -0,0 +1,49 @@
From ecbe3b4e138cb5076b8cbbedf86fea3044449132 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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

View File

@ -0,0 +1,28 @@
From 858e259bf7125695c068301d0ef56cc4750d6544 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1,84 @@
From c68370ac5678b1052592877ede04886d5f62d2dc Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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

1
dnsmasq/centos/srpm_path Normal file
View File

@ -0,0 +1 @@
mirror:Source/dnsmasq-2.76-2.el7_4.2.src.rpm

59
dnsmasq/files/init Normal file
View File

@ -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

View File

@ -0,0 +1,3 @@
COPY_LIST=""
TIS_PATCH_VER=4
BUILD_IS_SLOW=8

View File

@ -0,0 +1,28 @@
From 7cb38901901be87761aee423b1c2f96b9907d785 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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

View File

@ -0,0 +1,21 @@
From 662913fede85b09f54e5272451e4dc3f295a4e05 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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

View File

@ -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 <johnny@centos.org> - 2.02-0.44
- Roll in CentOS Secureboot keys

View File

@ -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

View File

@ -0,0 +1,44 @@
From 69f56affb4e910470072b79824f3c6ecccefa4c2 Mon Sep 17 00:00:00 2001
From: Bin Qian <bin.qian@windriver.com>
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

View File

@ -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

View File

@ -0,0 +1,42 @@
From 4a1a40ca64be1a2350ec90ceb9089dc0a3950231 Mon Sep 17 00:00:00 2001
From: Bin Qian <bin.qian@windriver.com>
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

View File

@ -0,0 +1,47 @@
From 6934956143557c548cc35dcc272aae1ee3d706c8 Mon Sep 17 00:00:00 2001
From: RHEL Ninjas <example@example.com>
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 <michel.thebeau@windriver.com>
---
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

1
grub2/centos/srpm_path Normal file
View File

@ -0,0 +1 @@
mirror:Source/grub2-2.02-0.44.el7.centos.src.rpm

10
mwa-gplv3.map Normal file
View File

@ -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

14
parted/PKG-INFO Normal file
View File

@ -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

View File

@ -0,0 +1,3 @@
COPY_LIST="files/resizepart.sh"
TIS_PATCH_VER=3
BUILD_IS_SLOW=5

View File

@ -0,0 +1,25 @@
From 74ab16d7e0c23b933b3d6f42eac63d70d07ab62d Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
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

View File

@ -0,0 +1,33 @@
From cfa8f478bd19cf706f87c3c5a8baf54df7f2ea16 Mon Sep 17 00:00:00 2001
From: Ovidiu Poncea <ovidiu.poncea@windriver.com>
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

View File

@ -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

View File

@ -0,0 +1,63 @@
From 4859fab94b298a4ca449216c3035b8b024c661a3 Mon Sep 17 00:00:00 2001
From: Kristine Bujold <kristine.bujold@windriver.com>
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

View File

@ -0,0 +1,42 @@
From: "Allain Legacy" <allain.legacy@windriver.com>
---
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);
}

1
parted/centos/srpm_path Normal file
View File

@ -0,0 +1 @@
mirror:Source/parted-3.1-28.el7.src.rpm

285
parted/files/Makefile Normal file
View File

@ -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"

View File

@ -0,0 +1,57 @@
From 060e74354774d36d2c11ef08e3e7ea9b9b6e23fb Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
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 <hongxu.jia@windriver.com>
---
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

View File

@ -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 <obi@opendreambox.org>
--- 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.

View File

@ -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

View File

@ -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 $?

3
parted/files/run-ptest Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
make -C tests check-TESTS

View File

@ -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 <linux/version.h>
+
#include <config.h>
#include <arch/linux.h>
@@ -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);
}

16
python-keyring/PKG-INFO Normal file
View File

@ -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

View File

@ -0,0 +1,2 @@
COPY_LIST="python-keyring/*"
TIS_PATCH_VER=2

View File

@ -0,0 +1,78 @@
From d7f5646de9ec990ed81489cc12d7942654bc017d Mon Sep 17 00:00:00 2001
From: Kam Nasim <kam.nasim@windriver.com>
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

View File

@ -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

View File

@ -0,0 +1,2 @@
0001-move-package-from-tarball-to-srpm.patch
0002-meta-buildrequires-python-setuptools_scm.patch

View File

@ -0,0 +1 @@
mirror:Source/python-keyring-5.7.1-1.el7.src.rpm

View File

@ -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):

View File

@ -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):

View File

@ -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)

View File

@ -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')

View File

@ -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):
"""

View File

@ -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')

View File

@ -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')

View File

@ -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

View File

@ -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'):

View File

@ -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):

View File

@ -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

View File

@ -0,0 +1,2 @@
TIS_PATCH_VER=2

View File

@ -0,0 +1,2 @@
setup-spec-for-tis.patch
meta-patch0.patch

View File

@ -0,0 +1,33 @@
From f964faeb50150b64ed2481f721e544f4c3e2ca55 Mon Sep 17 00:00:00 2001
From: Al Bailey <al.bailey@windriver.com>
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

View File

@ -0,0 +1,25 @@
From 78314a11e44751d23da70c5b935c73579650a2bd Mon Sep 17 00:00:00 2001
From: Al Bailey <al.bailey@windriver.com>
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

View File

@ -0,0 +1,96 @@
From 04fe7ce2bed4b20ffa89d12551bd2865d21caec1 Mon Sep 17 00:00:00 2001
From: Al Bailey <al.bailey@windriver.com>
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

View File

@ -0,0 +1,2 @@
mirror:Source/python-psycopg2-2.5.1-3.el7.src.rpm

View File

@ -0,0 +1,2 @@
COPY_LIST="$PKG_BASE/files/rsyncd.conf"
TIS_PATCH_VER=1

View File

@ -0,0 +1,27 @@
From 20f4e2f0f19c6d0e9c8ee1314481bc8e85dbd5bb Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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

View File

@ -0,0 +1 @@
0001-Update-package-versioning-for-TIS-format.patch

1
rsync/centos/srpm_path Normal file
View File

@ -0,0 +1 @@
mirror:Source/rsync-3.0.9-18.el7.src.rpm

93
rsync/files/rsyncd Executable file
View File

@ -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

51
rsync/files/rsyncd.conf Normal file
View File

@ -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

View File

@ -0,0 +1 @@
TIS_PATCH_VER=2

View File

@ -0,0 +1,26 @@
From 2278e76d2a6933e91ee176386f7aa86529c2d3e8 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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

View File

@ -0,0 +1,2 @@
0001-Update-package-versioning-for-TIS-format.patch
meta-CGTS-5175-Add-instrumentation-to-debug-boot-failures.patch

View File

@ -0,0 +1,41 @@
From 604f198f6eb2d43452e35f51b98087a1bb872021 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
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

View File

@ -0,0 +1,67 @@
From 7cc3d0e6149ea9276edef25ba85d08879ee40771 Mon Sep 17 00:00:00 2001
From: Jim Gauld <james.gauld@windriver.com>
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 <kevin@koconnor.net>
// 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

1
seabios/centos/srpm_path Normal file
View File

@ -0,0 +1 @@
mirror:Source/seabios-1.10.2-3.el7_4.1.src.rpm

View File

@ -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
}

View File

@ -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;
}