Do not use '--loglevel' option when running Anaconda
Improve Imc no-virt error handling Add POSTIN scriptlet error to the log monitor list Remove LD_PRELOAD libgomp.so.1 from Imc --no-virt
This commit is contained in:
parent
741c38d02c
commit
9d0b72a7ce
@ -0,0 +1,31 @@
|
||||
From a33efe7c517737f9849673f1f2d2ce2fedc04014 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Tue, 8 Dec 2020 16:03:07 -0800
|
||||
Subject: [PATCH] Add POSTIN scriptlet error to the log monitor list
|
||||
|
||||
This will cause livemedia-creator to terminate anaconda and exit when an
|
||||
install hits an error that often causes anaconda to get stuck and not
|
||||
exit.
|
||||
|
||||
Resolves: rhbz#1900596
|
||||
---
|
||||
src/pylorax/monitor.py | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/pylorax/monitor.py b/src/pylorax/monitor.py
|
||||
index 9de1ccb..e0d2ed1 100644
|
||||
--- a/src/pylorax/monitor.py
|
||||
+++ b/src/pylorax/monitor.py
|
||||
@@ -46,7 +46,8 @@ class LogRequestHandler(socketserver.BaseRequestHandler):
|
||||
"crashed on signal",
|
||||
"packaging: Missed: NoSuchPackage",
|
||||
"packaging: Installation failed",
|
||||
- "The following error occurred while installing. This is a fatal error"
|
||||
+ "The following error occurred while installing. This is a fatal error",
|
||||
+ "Error in POSTIN scriptlet in rpm package"
|
||||
]
|
||||
|
||||
re_tests = [
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
From 78eec89cda687f9689978eedb5482d041577577a Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 18 Nov 2020 10:27:58 +0100
|
||||
Subject: [PATCH] Do not use '--loglevel' option when running Anaconda
|
||||
|
||||
This option has been removed, see https://github.com/rhinstaller/anaconda/pull/2864
|
||||
---
|
||||
src/pylorax/installer.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/pylorax/installer.py b/src/pylorax/installer.py
|
||||
index b882ecf..9d0a852 100644
|
||||
--- a/src/pylorax/installer.py
|
||||
+++ b/src/pylorax/installer.py
|
||||
@@ -355,7 +355,7 @@ def novirt_install(opts, disk_img, disk_size, cancel_func=None, tar_img=None):
|
||||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
|
||||
- args = ["--kickstart", opts.ks[0], "--cmdline", "--loglevel", "debug"]
|
||||
+ args = ["--kickstart", opts.ks[0], "--cmdline"]
|
||||
if opts.anaconda_args:
|
||||
for arg in opts.anaconda_args:
|
||||
args += arg.split(" ", 1)
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
163
backport-Improve-lmc-no-virt-error-handling.patch
Normal file
163
backport-Improve-lmc-no-virt-error-handling.patch
Normal file
@ -0,0 +1,163 @@
|
||||
From 6400515880e59ab7d0d68a848e2f57052faa0d30 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Tue, 8 Dec 2020 15:57:51 -0800
|
||||
Subject: [PATCH] Improve lmc no-virt error handling
|
||||
|
||||
When monitoring log output in livemedia-creator --no-virt it could get
|
||||
stuck if the output from anaconda stops for some reason.
|
||||
|
||||
This changes execReadlines so that it will only read output when it is
|
||||
available, will monitor the process state, and continue to call the
|
||||
callback function.
|
||||
|
||||
It also adds a final timeout on proc.communicate() so that if Anaconda
|
||||
becomes stuck and won't exit livemedia-creator will eventually exit.
|
||||
|
||||
When the no-virt callback terminates anaconda on an error it now sends a
|
||||
TERM signal to all of the unshare process' children because just sending
|
||||
it to unshare doesn't cause anaconda to exit.
|
||||
---
|
||||
lorax.spec | 1 +
|
||||
src/pylorax/executils.py | 56 ++++++++++++++++++++++++++++++++++--------------
|
||||
src/pylorax/installer.py | 9 ++++++--
|
||||
test-packages | 1 +
|
||||
4 files changed, 49 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/lorax.spec b/lorax.spec
|
||||
index 40506b0..52cda64 100644
|
||||
--- a/lorax.spec
|
||||
+++ b/lorax.spec
|
||||
@@ -118,6 +118,7 @@ Requires: anaconda-core
|
||||
Requires: anaconda-tui
|
||||
Requires: anaconda-install-env-deps
|
||||
Requires: system-logos
|
||||
+Requires: python3-psutil
|
||||
|
||||
%description lmc-novirt
|
||||
Additional dependencies required by livemedia-creator when using it with --no-virt
|
||||
diff --git a/src/pylorax/executils.py b/src/pylorax/executils.py
|
||||
index da5df60..ffb26b6 100644
|
||||
--- a/src/pylorax/executils.py
|
||||
+++ b/src/pylorax/executils.py
|
||||
@@ -19,9 +19,11 @@
|
||||
#
|
||||
|
||||
import os
|
||||
+import select
|
||||
import subprocess
|
||||
from subprocess import TimeoutExpired
|
||||
import signal
|
||||
+import time
|
||||
|
||||
import logging
|
||||
log = logging.getLogger("pylorax")
|
||||
@@ -288,6 +290,7 @@ def execReadlines(command, argv, stdin=None, root='/', env_prune=None, filter_st
|
||||
self._proc = proc
|
||||
self._argv = argv
|
||||
self._callback = callback
|
||||
+ self._data = ""
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
@@ -302,22 +305,43 @@ def execReadlines(command, argv, stdin=None, root='/', env_prune=None, filter_st
|
||||
pass
|
||||
|
||||
def __next__(self):
|
||||
- # Read the next line, blocking if a line is not yet available
|
||||
- line = self._proc.stdout.readline().decode("utf-8")
|
||||
- if line == '' or not self._callback(self._proc):
|
||||
- # Output finished, wait for the process to end
|
||||
- self._proc.communicate()
|
||||
-
|
||||
- # Check for successful exit
|
||||
- if self._proc.returncode < 0:
|
||||
- raise OSError("process '%s' was killed by signal %s" %
|
||||
- (self._argv, -self._proc.returncode))
|
||||
- elif self._proc.returncode > 0:
|
||||
- raise OSError("process '%s' exited with status %s" %
|
||||
- (self._argv, self._proc.returncode))
|
||||
- raise StopIteration
|
||||
-
|
||||
- return line.strip()
|
||||
+ # Return lines from stdout while also calling _callback
|
||||
+ while True:
|
||||
+ # Check for input without blocking
|
||||
+ if select.select([self._proc.stdout], [], [], 0)[0]:
|
||||
+ size = len(self._proc.stdout.peek(1))
|
||||
+ if size > 0:
|
||||
+ self._data += self._proc.stdout.read(size).decode("utf-8")
|
||||
+
|
||||
+ if self._data.find("\n") >= 0:
|
||||
+ line = self._data.split("\n", 1)
|
||||
+ self._data = line[1]
|
||||
+ return line[0]
|
||||
+
|
||||
+ if self._proc.poll() is not None or not self._callback(self._proc):
|
||||
+ # Output finished, wait 60s for the process to end
|
||||
+ try:
|
||||
+ self._proc.communicate(timeout=60)
|
||||
+ except subprocess.TimeoutExpired:
|
||||
+ # Did not exit in 60s, kill it and wait 30s more
|
||||
+ self._proc.kill()
|
||||
+ try:
|
||||
+ self._proc.communicate(timeout=30)
|
||||
+ except subprocess.TimeoutExpired:
|
||||
+ pass
|
||||
+
|
||||
+ if self._proc.returncode is None:
|
||||
+ raise OSError("process '%s' failed to be killed" % self._argv)
|
||||
+ elif self._proc.returncode < 0:
|
||||
+ raise OSError("process '%s' was killed by signal %s" %
|
||||
+ (self._argv, -self._proc.returncode))
|
||||
+ elif self._proc.returncode > 0:
|
||||
+ raise OSError("process '%s' exited with status %s" %
|
||||
+ (self._argv, self._proc.returncode))
|
||||
+ raise StopIteration
|
||||
+
|
||||
+ # Don't loop too fast with no input to read
|
||||
+ time.sleep(0.5)
|
||||
|
||||
argv = [command] + argv
|
||||
|
||||
diff --git a/src/pylorax/installer.py b/src/pylorax/installer.py
|
||||
index 9d0a852..1528474 100644
|
||||
--- a/src/pylorax/installer.py
|
||||
+++ b/src/pylorax/installer.py
|
||||
@@ -291,7 +291,12 @@ def novirt_cancel_check(cancel_funcs, proc):
|
||||
"""
|
||||
for f in cancel_funcs:
|
||||
if f():
|
||||
- proc.terminate()
|
||||
+ # Anaconda runs from unshare, anaconda doesn't exit correctly so try to
|
||||
+ # send TERM to all of them directly
|
||||
+ import psutil
|
||||
+ for p in psutil.Process(proc.pid).children(recursive=True):
|
||||
+ p.terminate()
|
||||
+ psutil.Process(proc.pid).terminate()
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -401,7 +406,7 @@ def novirt_install(opts, disk_img, disk_size, cancel_func=None, tar_img=None):
|
||||
# Preload libgomp.so.1 to workaround rhbz#1722181
|
||||
log.info("Running anaconda.")
|
||||
try:
|
||||
- unshare_args = [ "--pid", "--kill-child", "--mount", "--propagation", "unchanged", "anaconda" ] + args
|
||||
+ unshare_args = ["--pid", "--kill-child", "--mount", "--propagation", "unchanged", "anaconda"] + args
|
||||
for line in execReadlines("unshare", unshare_args, reset_lang=False,
|
||||
env_add={"ANACONDA_PRODUCTNAME": opts.project,
|
||||
"ANACONDA_PRODUCTVERSION": opts.releasever,
|
||||
diff --git a/test-packages b/test-packages
|
||||
index bc5bf20..77583c7 100644
|
||||
--- a/test-packages
|
||||
+++ b/test-packages
|
||||
@@ -12,6 +12,7 @@ python3-librepo
|
||||
python3-magic
|
||||
python3-mako
|
||||
python3-pocketlint
|
||||
+python3-psutil
|
||||
python3-pycdlib
|
||||
python3-pylint
|
||||
python3-pyparted
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
From b0318efeadfe186dbd4958f58ba18ce17d75d3e1 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Tue, 8 Dec 2020 16:19:38 -0800
|
||||
Subject: [PATCH] Remove LD_PRELOAD libgomp.so.1 from lmc --no-virt
|
||||
|
||||
The libgomp bug rhbz#1722181 has been closed since August.
|
||||
---
|
||||
src/pylorax/installer.py | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/pylorax/installer.py b/src/pylorax/installer.py
|
||||
index 1528474..e11c16b 100644
|
||||
--- a/src/pylorax/installer.py
|
||||
+++ b/src/pylorax/installer.py
|
||||
@@ -403,14 +403,12 @@ def novirt_install(opts, disk_img, disk_size, cancel_func=None, tar_img=None):
|
||||
cancel_funcs.append(cancel_func)
|
||||
|
||||
# Make sure anaconda has the right product and release
|
||||
- # Preload libgomp.so.1 to workaround rhbz#1722181
|
||||
log.info("Running anaconda.")
|
||||
try:
|
||||
unshare_args = ["--pid", "--kill-child", "--mount", "--propagation", "unchanged", "anaconda"] + args
|
||||
for line in execReadlines("unshare", unshare_args, reset_lang=False,
|
||||
env_add={"ANACONDA_PRODUCTNAME": opts.project,
|
||||
- "ANACONDA_PRODUCTVERSION": opts.releasever,
|
||||
- "LD_PRELOAD": "libgomp.so.1"},
|
||||
+ "ANACONDA_PRODUCTVERSION": opts.releasever},
|
||||
callback=lambda p: not novirt_cancel_check(cancel_funcs, p)):
|
||||
log.info(line)
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
62
lorax.spec
62
lorax.spec
@ -3,24 +3,27 @@
|
||||
|
||||
Name: lorax
|
||||
Version: 33.6
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: A set of tools used to create bootable images
|
||||
License: GPLv2+
|
||||
URL: https://github.com/weldr/lorax
|
||||
Source0: https://github.com/weldr/lorax/archive/%{name}-%{version}-1.tar.gz
|
||||
|
||||
Patch9000: 0001-ignore-the-dir-that-without-kernel-version.patch
|
||||
Patch9001: 0001-add-text-mode-selection-menu-in-grub-configuration.patch
|
||||
Patch9002: 0001-use-tty0-other-than-ttyAMA0-in-rescue-mode.patch
|
||||
Patch9003: 0001-delete-kernel-modules-pkg.patch
|
||||
Patch9004: 0001-disable-isolabel-character-change.patch
|
||||
Patch9005: disable-graphics-install.patch
|
||||
Patch9006: disable-GeoIP.patch
|
||||
Patch9007: eliminate-difference.patch
|
||||
Patch9008: lorax-enable-GUI-installation.patch
|
||||
Patch9009: lorax-enable-anaconda-KdumpSpoke.patch
|
||||
Patch9010: lorax-delete-udisk2-iscsi.patch
|
||||
|
||||
Patch0: 0001-ignore-the-dir-that-without-kernel-version.patch
|
||||
Patch1: 0001-add-text-mode-selection-menu-in-grub-configuration.patch
|
||||
Patch2: 0001-use-tty0-other-than-ttyAMA0-in-rescue-mode.patch
|
||||
Patch3: 0001-delete-kernel-modules-pkg.patch
|
||||
Patch4: 0001-disable-isolabel-character-change.patch
|
||||
Patch5: disable-graphics-install.patch
|
||||
Patch6: disable-GeoIP.patch
|
||||
Patch7: eliminate-difference.patch
|
||||
Patch8: lorax-enable-GUI-installation.patch
|
||||
Patch9: lorax-enable-anaconda-KdumpSpoke.patch
|
||||
Patch10: lorax-delete-udisk2-iscsi.patch
|
||||
Patch11: backport-Do-not-use-loglevel-option-when-running-Anaconda.patch
|
||||
Patch12: backport-Improve-lmc-no-virt-error-handling.patch
|
||||
Patch13: backport-Add-POSTIN-scriptlet-error-to-the-log-monitor-list.patch
|
||||
Patch14: backport-Remove-LD_PRELOAD-libgomp.so.1-from-lmc-no-virt.patch
|
||||
|
||||
BuildRequires: python3-devel python3-sphinx_rtd_theme python3-magic
|
||||
BuildRequires: python3-nose python3-pytest-mock python3-pocketlint python3-gevent
|
||||
@ -106,23 +109,28 @@ build images, etc. from the command line.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{name}-%{version}-1
|
||||
%patch9000 -p1
|
||||
%patch0 -p1
|
||||
%ifarch aarch64
|
||||
%patch9001 -p1
|
||||
%patch9002 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%endif
|
||||
%patch9003 -p1
|
||||
%patch3 -p1
|
||||
|
||||
%patch9004 -p1
|
||||
%patch4 -p1
|
||||
%ifarch aarch64
|
||||
%patch9005 -p1
|
||||
%patch9006 -p1
|
||||
%patch9007 -p1
|
||||
%patch9008 -p1
|
||||
%patch9009 -p1
|
||||
%patch9010 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%endif
|
||||
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
|
||||
%build
|
||||
%make_build
|
||||
|
||||
@ -203,6 +211,12 @@ getent passwd weldr >/dev/null 2>&1 || useradd -r -g weldr -d / -s /sbin/nologin
|
||||
%{_mandir}/man1/*.1*
|
||||
|
||||
%changelog
|
||||
* Feb Mar 30 2021 yuboyun <yuboyun@huawei.com> - 33.6-3
|
||||
- Do not use '--loglevel' option when running Anaconda
|
||||
Improve Imc no-virt error handling
|
||||
Add POSTIN scriptlet error to the log monitor list
|
||||
Remove LD_PRELOAD libgomp.so.1 from Imc --no-virt
|
||||
|
||||
* Feb Oct 13 2020 yuboyun <yuboyun@huawei.com> - 33.6-2
|
||||
- add yaml file
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user