added my Recipes
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
From 713cf821ebe17f9e1771502a85e0905ea04dafae Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Fri, 23 Nov 2018 17:03:58 +0800
|
||||
Subject: [PATCH 02/11] run_program support timeout
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
blivet/util.py | 70 ++++++++++++++++++++++++++++++++++------------------------
|
||||
1 file changed, 41 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/blivet/util.py b/blivet/util.py
|
||||
index 4eac8b9..4f05076 100644
|
||||
--- a/blivet/util.py
|
||||
+++ b/blivet/util.py
|
||||
@@ -158,6 +158,30 @@ class Path(str):
|
||||
def __hash__(self):
|
||||
return self._path.__hash__()
|
||||
|
||||
+def timeout_command(argv, timeout, *args, **kwargs):
|
||||
+ """call shell-command and either return its output or kill it
|
||||
+ if it doesn't normally exit within timeout seconds and return None"""
|
||||
+ import subprocess, datetime, os, time, signal
|
||||
+ start = datetime.datetime.now()
|
||||
+
|
||||
+ try:
|
||||
+ proc = subprocess.Popen(argv, *args, **kwargs)
|
||||
+ while proc.poll() is None:
|
||||
+ time.sleep(0.1)
|
||||
+ now = datetime.datetime.now()
|
||||
+ if (now - start).seconds> timeout:
|
||||
+ os.kill(proc.pid, signal.SIGKILL)
|
||||
+ os.waitpid(-1, os.WNOHANG)
|
||||
+ program_log.debug("%d seconds timeout" % timeout)
|
||||
+ return (-1, None)
|
||||
+
|
||||
+
|
||||
+ except OSError as e:
|
||||
+ program_log.error("Error running %s: %s", argv[0], e.strerror)
|
||||
+ raise
|
||||
+
|
||||
+ program_log.debug("Return code: %d", proc.returncode)
|
||||
+ return (proc.returncode, proc.stdout.read())
|
||||
|
||||
def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False):
|
||||
if env_prune is None:
|
||||
@@ -180,35 +204,23 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa
|
||||
stderr_dir = subprocess.STDOUT
|
||||
else:
|
||||
stderr_dir = subprocess.PIPE
|
||||
- try:
|
||||
- proc = subprocess.Popen(argv, # pylint: disable=subprocess-popen-preexec-fn
|
||||
- stdin=stdin,
|
||||
- stdout=subprocess.PIPE,
|
||||
- stderr=stderr_dir,
|
||||
- close_fds=True,
|
||||
- preexec_fn=chroot, cwd=root, env=env)
|
||||
-
|
||||
- out, err = proc.communicate()
|
||||
- if not binary_output and six.PY3:
|
||||
- out = out.decode("utf-8")
|
||||
- if out:
|
||||
- if not stderr_to_stdout:
|
||||
- program_log.info("stdout:")
|
||||
- for line in out.splitlines():
|
||||
- program_log.info("%s", line)
|
||||
-
|
||||
- if not stderr_to_stdout and err:
|
||||
- program_log.info("stderr:")
|
||||
- for line in err.splitlines():
|
||||
- program_log.info("%s", line)
|
||||
-
|
||||
- except OSError as e:
|
||||
- program_log.error("Error running %s: %s", argv[0], e.strerror)
|
||||
- raise
|
||||
-
|
||||
- program_log.debug("Return code: %d", proc.returncode)
|
||||
-
|
||||
- return (proc.returncode, out)
|
||||
+
|
||||
+ res, out = timeout_command(argv, 10,
|
||||
+ stdin=stdin,
|
||||
+ stdout=subprocess.PIPE,
|
||||
+ stderr=stderr_dir,
|
||||
+ close_fds=True,
|
||||
+ preexec_fn=chroot, cwd=root, env=env)
|
||||
+ if not binary_output and six.PY3:
|
||||
+ out = out.decode("utf-8")
|
||||
+ if out:
|
||||
+ if not stderr_to_stdout:
|
||||
+ program_log.info("stdout:")
|
||||
+ for line in out.splitlines():
|
||||
+ program_log.info("%s", line)
|
||||
+
|
||||
+ return (res, out)
|
||||
+
|
||||
|
||||
|
||||
def run_program(*args, **kwargs):
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
From 5d5436dfa3bdde7b4e87ce5a40cbc724199847d6 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Mon, 8 May 2017 16:18:02 +0800
|
||||
Subject: [PATCH 03/11] support infinit timeout
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
blivet/util.py | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/blivet/util.py b/blivet/util.py
|
||||
index 4f05076..7e89949 100644
|
||||
--- a/blivet/util.py
|
||||
+++ b/blivet/util.py
|
||||
@@ -158,6 +158,7 @@ class Path(str):
|
||||
def __hash__(self):
|
||||
return self._path.__hash__()
|
||||
|
||||
+# timeout = -1 means infinite timeout, always wait.
|
||||
def timeout_command(argv, timeout, *args, **kwargs):
|
||||
"""call shell-command and either return its output or kill it
|
||||
if it doesn't normally exit within timeout seconds and return None"""
|
||||
@@ -169,7 +170,7 @@ def timeout_command(argv, timeout, *args, **kwargs):
|
||||
while proc.poll() is None:
|
||||
time.sleep(0.1)
|
||||
now = datetime.datetime.now()
|
||||
- if (now - start).seconds> timeout:
|
||||
+ if timeout != -1 and (now - start).seconds> timeout:
|
||||
os.kill(proc.pid, signal.SIGKILL)
|
||||
os.waitpid(-1, os.WNOHANG)
|
||||
program_log.debug("%d seconds timeout" % timeout)
|
||||
@@ -183,7 +184,7 @@ def timeout_command(argv, timeout, *args, **kwargs):
|
||||
program_log.debug("Return code: %d", proc.returncode)
|
||||
return (proc.returncode, proc.stdout.read())
|
||||
|
||||
-def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False):
|
||||
+def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=False, binary_output=False, timeout=10):
|
||||
if env_prune is None:
|
||||
env_prune = []
|
||||
|
||||
@@ -192,7 +193,10 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa
|
||||
os.chroot(root)
|
||||
|
||||
with program_log_lock: # pylint: disable=not-context-manager
|
||||
- program_log.info("Running... %s", " ".join(argv))
|
||||
+ if timeout != -1:
|
||||
+ program_log.info("Running... %s", " ".join(argv))
|
||||
+ else:
|
||||
+ program_log.info("Running... %s ...infinite timeout", " ".join(argv))
|
||||
|
||||
env = os.environ.copy()
|
||||
env.update({"LC_ALL": "C",
|
||||
@@ -205,7 +209,7 @@ def _run_program(argv, root='/', stdin=None, env_prune=None, stderr_to_stdout=Fa
|
||||
else:
|
||||
stderr_dir = subprocess.PIPE
|
||||
|
||||
- res, out = timeout_command(argv, 10,
|
||||
+ res, out = timeout_command(argv, timeout,
|
||||
stdin=stdin,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=stderr_dir,
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From 3bb8d08bdec2f79bb13c0a44b81718d26e5bdabc Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Mon, 8 May 2017 16:30:20 +0800
|
||||
Subject: [PATCH 04/11] fix new.roots object is not iterable
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
blivet/blivet.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/blivet/blivet.py b/blivet/blivet.py
|
||||
index ea08837..91c92b2 100644
|
||||
--- a/blivet/blivet.py
|
||||
+++ b/blivet/blivet.py
|
||||
@@ -1206,7 +1206,7 @@ class Blivet(object):
|
||||
p = partition.disk.format.parted_disk.getPartitionByPath(partition.path)
|
||||
partition.parted_partition = p
|
||||
|
||||
- for root in new.roots:
|
||||
+ for root in new.roots or []:
|
||||
root.swaps = [new.devicetree.get_device_by_id(d.id, hidden=True) for d in root.swaps]
|
||||
root.swaps = [s for s in root.swaps if s]
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From f783b9b00da5df176fcd7927b752f574ca6db319 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Fri, 26 Aug 2016 02:02:49 -0400
|
||||
Subject: [PATCH 05/11] fix incorrect timeout while system time changed
|
||||
|
||||
While system time changed by NTP, invoking timeout_command
|
||||
breaks with incorrect timeout.
|
||||
--------
|
||||
|05:40:55,872 INFO program: Running... mount -t ext2 -o
|
||||
defaults,ro /dev/sda2 /mnt/sysimage
|
||||
|01:40:55,086 DEBUG program: 10 seconds timeout
|
||||
--------
|
||||
|
||||
Use numbert count to replace current time count could workaround
|
||||
the issue.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
blivet/util.py | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/blivet/util.py b/blivet/util.py
|
||||
index 7e89949..5571e73 100644
|
||||
--- a/blivet/util.py
|
||||
+++ b/blivet/util.py
|
||||
@@ -163,14 +163,14 @@ def timeout_command(argv, timeout, *args, **kwargs):
|
||||
"""call shell-command and either return its output or kill it
|
||||
if it doesn't normally exit within timeout seconds and return None"""
|
||||
import subprocess, datetime, os, time, signal
|
||||
- start = datetime.datetime.now()
|
||||
+ count = 0
|
||||
|
||||
try:
|
||||
proc = subprocess.Popen(argv, *args, **kwargs)
|
||||
while proc.poll() is None:
|
||||
time.sleep(0.1)
|
||||
- now = datetime.datetime.now()
|
||||
- if timeout != -1 and (now - start).seconds> timeout:
|
||||
+ count += 1
|
||||
+ if timeout != -1 and count > timeout*10:
|
||||
os.kill(proc.pid, signal.SIGKILL)
|
||||
os.waitpid(-1, os.WNOHANG)
|
||||
program_log.debug("%d seconds timeout" % timeout)
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From 8932ae933f2b6acf5e98c9956beff69ae430eed2 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Mon, 8 May 2017 16:33:15 +0800
|
||||
Subject: [PATCH 06/11] tweak btrfs packages
|
||||
|
||||
In oe-cre/yocto, we name btrfs package with btrfs-tools,
|
||||
rather than btrfs-progs.
|
||||
|
||||
Upstream-Status: Inappropriate [oe specific]
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
blivet/devices/btrfs.py | 2 +-
|
||||
blivet/formats/fs.py | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
|
||||
index cada940..7e4d4b8 100644
|
||||
--- a/blivet/devices/btrfs.py
|
||||
+++ b/blivet/devices/btrfs.py
|
||||
@@ -55,7 +55,7 @@ class BTRFSDevice(StorageDevice):
|
||||
|
||||
""" Base class for BTRFS volume and sub-volume devices. """
|
||||
_type = "btrfs"
|
||||
- _packages = ["btrfs-progs"]
|
||||
+ _packages = ["btrfs-tools"]
|
||||
_external_dependencies = [availability.BLOCKDEV_BTRFS_PLUGIN]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
|
||||
index 81e367f..55e5d57 100644
|
||||
--- a/blivet/formats/fs.py
|
||||
+++ b/blivet/formats/fs.py
|
||||
@@ -926,7 +926,7 @@ class BTRFS(FS):
|
||||
_formattable = True
|
||||
_linux_native = True
|
||||
_supported = True
|
||||
- _packages = ["btrfs-progs"]
|
||||
+ _packages = ["btrfs-tools"]
|
||||
_min_size = Size("256 MiB")
|
||||
_max_size = Size("16 EiB")
|
||||
_mkfs_class = fsmkfs.BTRFSMkfs
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From f53481dc4a56b8a996628733553e080bb0aafdd7 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Fri, 23 Nov 2018 17:07:22 +0800
|
||||
Subject: [PATCH 07/11] invoking mount with infinite timeout
|
||||
|
||||
This large timeout is needed when running on machines with
|
||||
lots of disks, or with slow disks.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
blivet/util.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/blivet/util.py b/blivet/util.py
|
||||
index 5571e73..02c8033 100644
|
||||
--- a/blivet/util.py
|
||||
+++ b/blivet/util.py
|
||||
@@ -258,7 +258,7 @@ def mount(device, mountpoint, fstype, options=None):
|
||||
makedirs(mountpoint)
|
||||
|
||||
argv = ["mount", "-t", fstype, "-o", options, device, mountpoint]
|
||||
- return run_program(argv)
|
||||
+ return run_program(argv, timeout=-1)
|
||||
|
||||
|
||||
def umount(mountpoint):
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From 12e2579333258d1a690f8718e91b0f217078e886 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Mon, 8 May 2017 03:54:12 -0400
|
||||
Subject: [PATCH 08/11] use oe variable to replace hardcoded dir
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
|
||||
Rebase for python3-blivet 3.4.0.
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
---
|
||||
setup.py | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index b745a79..b5b4258 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -61,10 +61,10 @@ class blivet_sdist(sdist):
|
||||
|
||||
|
||||
data_files = [
|
||||
- ('/etc/dbus-1/system.d', ['dbus/blivet.conf']),
|
||||
- ('/usr/share/dbus-1/system-services', ['dbus/com.redhat.Blivet0.service']),
|
||||
- ('/usr/libexec', ['dbus/blivetd']),
|
||||
- ('/usr/lib/systemd/system', ['dbus/blivet.service'])
|
||||
+ (os.environ.get('sysconfdir')+'/dbus-1/system.d', ['dbus/blivet.conf']),
|
||||
+ (os.environ.get('datadir')+'/dbus-1/system-services', ['dbus/com.redhat.Blivet0.service']),
|
||||
+ (os.environ.get('libexecdir'), ['dbus/blivetd']),
|
||||
+ (os.environ.get('systemd_system_unitdir'), ['dbus/blivet.service'])
|
||||
]
|
||||
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 9624b6d0dda40aaecbaf9530be819943575a2ec6 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Thu, 1 Jun 2017 16:05:27 +0800
|
||||
Subject: [PATCH 09/11] invoking fsck with infinite timeout
|
||||
|
||||
This large timeout is needed when running on machines with
|
||||
lots of disks, or with slow disks.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
blivet/tasks/fsck.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/blivet/tasks/fsck.py b/blivet/tasks/fsck.py
|
||||
index 5274f13..6e074c4 100644
|
||||
--- a/blivet/tasks/fsck.py
|
||||
+++ b/blivet/tasks/fsck.py
|
||||
@@ -77,7 +77,7 @@ class FSCK(task.BasicApplication, fstask.FSTask):
|
||||
raise FSError("\n".join(error_msgs))
|
||||
|
||||
try:
|
||||
- rc = util.run_program(self._fsck_command)
|
||||
+ rc = util.run_program(self._fsck_command, timeout=-1)
|
||||
except OSError as e:
|
||||
raise FSError("filesystem check failed: %s" % e)
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 33844f6773a676bd57240954e402ae9a843663a4 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Fri, 16 Jun 2017 15:43:00 +0800
|
||||
Subject: [PATCH 10/11] invoking mkfs with infinite timeout
|
||||
|
||||
This large timeout is needed when running on machines with
|
||||
lots of disks, or with slow disks.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
|
||||
Rebase for python3-blivet 3.4.0.
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
---
|
||||
blivet/tasks/fsmkfs.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/blivet/tasks/fsmkfs.py b/blivet/tasks/fsmkfs.py
|
||||
index e4a6aaa8..9730f7e5 100644
|
||||
--- a/blivet/tasks/fsmkfs.py
|
||||
+++ b/blivet/tasks/fsmkfs.py
|
||||
@@ -203,7 +203,7 @@ class FSMkfs(task.BasicApplication, FSMkfsTask):
|
||||
options = options or []
|
||||
cmd = self._mkfs_command(options, label, set_uuid, nodiscard)
|
||||
try:
|
||||
- ret = util.run_program(cmd)
|
||||
+ ret = util.run_program(cmd, timeout=-1)
|
||||
except OSError as e:
|
||||
raise FSError(e)
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 21ca2b859a49e96a230d55a7866dfc7ed5d1366c Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Tue, 6 Mar 2018 17:28:56 +0800
|
||||
Subject: [PATCH 11/11] invoking dd with infinite timeout
|
||||
|
||||
This large timeout is needed when running on machines with
|
||||
lots of disks, or with slow disks.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
blivet/devices/partition.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
|
||||
index 623e1c9..141d8ad 100644
|
||||
--- a/blivet/devices/partition.py
|
||||
+++ b/blivet/devices/partition.py
|
||||
@@ -618,7 +618,7 @@ class PartitionDevice(StorageDevice):
|
||||
cmd = ["dd", "if=/dev/zero", "of=%s" % device, "bs=%d" % bs,
|
||||
"seek=%d" % start, "count=%d" % count]
|
||||
try:
|
||||
- util.run_program(cmd)
|
||||
+ util.run_program(cmd, timeout=-1)
|
||||
except OSError as e:
|
||||
log.error(str(e))
|
||||
finally:
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
DESCRIPTION = "A python module for system storage configuration"
|
||||
HOMEPAGE = "http://fedoraproject.org/wiki/blivet"
|
||||
LICENSE = "LGPL-2.0-or-later"
|
||||
SECTION = "devel/python"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
|
||||
|
||||
SRC_URI += "\
|
||||
file://0002-run_program-support-timeout.patch \
|
||||
file://0003-support-infinit-timeout.patch \
|
||||
file://0004-fix-new.roots-object-is-not-iterable.patch \
|
||||
file://0005-fix-incorrect-timeout-while-system-time-changed.patch \
|
||||
file://0006-tweak-btrfs-packages.patch \
|
||||
file://0007-invoking-mount-with-infinite-timeout.patch \
|
||||
file://0008-use-oe-variable-to-replace-hardcoded-dir.patch \
|
||||
file://0009-invoking-fsck-with-infinite-timeout.patch \
|
||||
file://0010-invoking-mkfs-with-infinite-timeout.patch \
|
||||
file://0011-invoking-dd-with-infinite-timeout.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "1b05b77f3ee35d82c7a577a168c9ba0204d3e9a87eb1975e5f9af47700eeff48"
|
||||
|
||||
inherit pypi features_check systemd setuptools3_legacy
|
||||
|
||||
REQUIRED_DISTRO_FEATURES = "systemd"
|
||||
|
||||
RDEPENDS:${PN} += "python3-pykickstart python3-pyudev \
|
||||
parted python3-pyparted multipath-tools \
|
||||
lsof cryptsetup libblockdev \
|
||||
libbytesize \
|
||||
"
|
||||
|
||||
FILES:${PN} += " \
|
||||
${datadir}/dbus-1/system-services \
|
||||
"
|
||||
|
||||
SYSTEMD_AUTO_ENABLE = "disable"
|
||||
SYSTEMD_SERVICE:${PN} = "blivet.service"
|
||||
@@ -0,0 +1,30 @@
|
||||
From 54014061be2fed20d6c35aba9719ea70a9fea9ea Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 1 Sep 2021 08:59:19 +0200
|
||||
Subject: [PATCH] Use setuptools instead of distutils in setup.py
|
||||
|
||||
The distutils module is deprecated and will be removed in Python
|
||||
3.12.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/kraj/blivet-gui/commit/54014061be2fed20d6c35aba9719ea70a9fea9ea]
|
||||
---
|
||||
setup.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index aa8ef57..77849a1 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import print_function
|
||||
|
||||
-from distutils.core import setup
|
||||
-from distutils.command.sdist import sdist
|
||||
+from setuptools import setup
|
||||
+from setuptools.command.sdist import sdist
|
||||
import glob
|
||||
import sys
|
||||
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
Upstream-Status: Backport [https://github.com/storaged-project/blivet-gui/commit/eb8ec968]
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
From eb8ec968d1ee8b4b710568b1eb8536296f90751e Mon Sep 17 00:00:00 2001
|
||||
From: Adam Williamson <awilliam@redhat.com>
|
||||
Date: Thu, 17 Feb 2022 11:16:22 -0800
|
||||
Subject: [PATCH] Use symbolic list-add and edit- icons (Adwaita dropped old
|
||||
ones)
|
||||
|
||||
adwaita-icon-theme 42 no longer includes the non-symbolic icons
|
||||
for these names. The choices are to switch to symbolic ones or
|
||||
carry the non-symbolic ones downstream.
|
||||
|
||||
Signed-off-by: Adam Williamson <awilliam@redhat.com>
|
||||
---
|
||||
blivetgui/list_actions.py | 8 ++++----
|
||||
blivetgui/processing_window.py | 6 +++---
|
||||
2 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/blivetgui/list_actions.py b/blivetgui/list_actions.py
|
||||
index b7c1f9c..5388feb 100644
|
||||
--- a/blivetgui/list_actions.py
|
||||
+++ b/blivetgui/list_actions.py
|
||||
@@ -48,10 +48,10 @@ def __init__(self, blivet_gui):
|
||||
self.blivet_gui = blivet_gui
|
||||
|
||||
icon_theme = Gtk.IconTheme.get_default() # pylint: disable=no-value-for-parameter
|
||||
- icon_add = Gtk.IconTheme.load_icon(icon_theme, "list-add", 16, 0)
|
||||
- icon_delete = Gtk.IconTheme.load_icon(icon_theme, "edit-delete", 16, 0)
|
||||
- icon_edit = Gtk.IconTheme.load_icon(icon_theme, "edit-select-all", 16, 0)
|
||||
- icon_misc = Gtk.IconTheme.load_icon(icon_theme, "edit-paste", 16, 0)
|
||||
+ icon_add = Gtk.IconTheme.load_icon(icon_theme, "list-add-symbolic", 16, 0)
|
||||
+ icon_delete = Gtk.IconTheme.load_icon(icon_theme, "edit-delete-symbolic", 16, 0)
|
||||
+ icon_edit = Gtk.IconTheme.load_icon(icon_theme, "edit-select-all-symbolic", 16, 0)
|
||||
+ icon_misc = Gtk.IconTheme.load_icon(icon_theme, "edit-paste-symbolic", 16, 0)
|
||||
|
||||
self.action_icons = {"add": icon_add, "delete": icon_delete, "edit": icon_edit,
|
||||
"misc": icon_misc}
|
||||
diff --git a/blivetgui/processing_window.py b/blivetgui/processing_window.py
|
||||
index c400f90..a020ae8 100644
|
||||
--- a/blivetgui/processing_window.py
|
||||
+++ b/blivetgui/processing_window.py
|
||||
@@ -93,9 +93,9 @@ def add_action_view(self):
|
||||
"""
|
||||
|
||||
icon_theme = Gtk.IconTheme.get_default() # pylint: disable=no-value-for-parameter
|
||||
- icon_add = Gtk.IconTheme.load_icon(icon_theme, "list-add", 16, 0)
|
||||
- icon_delete = Gtk.IconTheme.load_icon(icon_theme, "edit-delete", 16, 0)
|
||||
- icon_edit = Gtk.IconTheme.load_icon(icon_theme, "edit-select-all", 16, 0)
|
||||
+ icon_add = Gtk.IconTheme.load_icon(icon_theme, "list-add-symbolic", 16, 0)
|
||||
+ icon_delete = Gtk.IconTheme.load_icon(icon_theme, "edit-delete-symbolic", 16, 0)
|
||||
+ icon_edit = Gtk.IconTheme.load_icon(icon_theme, "edit-select-all-symbolic", 16, 0)
|
||||
|
||||
actions_list = Gtk.ListStore(GdkPixbuf.Pixbuf, str, GdkPixbuf.Pixbuf)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
DESCRIPTION = "GUI tool for storage configuration using blivet library"
|
||||
HOMEPAGE = "https://github.com/rhinstaller/blivet-gui"
|
||||
LICENSE = "GPL-2.0-or-later"
|
||||
SECTION = "devel/python"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
B = "${S}"
|
||||
|
||||
SRCREV = "42512ee48494cee71febf04078d9774f0146a085"
|
||||
SRC_URI = "git://github.com/storaged-project/blivet-gui.git;branch=master;protocol=https \
|
||||
file://0001-Use-setuptools-instead-of-distutils-in-setup.py.patch \
|
||||
file://0002-Use-symbolic-list-add-and-edit-icons.patch \
|
||||
"
|
||||
|
||||
inherit features_check
|
||||
REQUIRED_DISTRO_FEATURES = "x11 systemd"
|
||||
|
||||
inherit setuptools3_legacy python3native
|
||||
|
||||
PIP_INSTALL_PACKAGE = "blivet_gui"
|
||||
|
||||
RDEPENDS:${PN} = "python3-pygobject python3 \
|
||||
python3-blivet gtk+3 \
|
||||
python3-pid libreport \
|
||||
"
|
||||
|
||||
FILES:${PN} += " \
|
||||
${datadir}/* \
|
||||
"
|
||||
@@ -0,0 +1,40 @@
|
||||
From 0d0ffab004306b1379f247016200ade381d1d181 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 8 Feb 2023 23:03:47 -0800
|
||||
Subject: [PATCH] setup.py: Do not poke at git describe to find version
|
||||
|
||||
OE uses git snapshot and git describe --tags will emit a string which is
|
||||
not PEP440 compliant version scheme. setuptools 67+ is strict about it
|
||||
and fails to build. Therefore inject a static version.py from OE
|
||||
environment and use that for version number based on PV
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
setup.py | 10 ++--------
|
||||
1 file changed, 2 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index a77138f..df675cd 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -28,14 +28,8 @@ def main():
|
||||
# Also, when git is not available (PyPi package), use stored version.py.
|
||||
version_py = os.path.join(os.path.dirname(__file__), 'version.py')
|
||||
|
||||
- try:
|
||||
- if sys.version_info < (2, 7) or (3,) <= sys.version_info < (3, 2):
|
||||
- version_git = subprocess.Popen(['ls', '-l'], stdout=subprocess.PIPE).communicate()[0]
|
||||
- else:
|
||||
- version_git = subprocess.check_output(["git", "describe", "--tags"]).rstrip()
|
||||
- except:
|
||||
- with open(version_py, 'r') as fh:
|
||||
- version_git = open(version_py).read().strip().split('=')[-1].replace('"','')
|
||||
+ with open(version_py, 'r') as fh:
|
||||
+ version_git = open(version_py).read().strip().split('=')[-1].replace('"','')
|
||||
|
||||
version_msg = "# Do not edit this file, pipeline versioning is governed by git tags"
|
||||
with open(version_py, 'w') as fh:
|
||||
--
|
||||
2.39.1
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
|
||||
# Released under the MIT license (see COPYING.MIT for the terms)
|
||||
|
||||
DESCRIPTION = "Python library for CSON (schema-compressed JSON)"
|
||||
HOMEPAGE = "https://github.com/gt3389b/python-cson/"
|
||||
LICENSE = "MIT"
|
||||
SECTION = "devel/python"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=7709d2635e63ab96973055a23c2a4cac"
|
||||
|
||||
PV = "1.0.9+1.0.10"
|
||||
SRCREV = "69090778bccc5ed124342ba288597fbb2bfa9f39"
|
||||
SRC_URI = "git://github.com/gt3389b/python-cson.git;branch=master;protocol=https \
|
||||
file://0001-setup.py-Do-not-poke-at-git-describe-to-find-version.patch"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
RDEPENDS:${PN}:class-native = ""
|
||||
DEPENDS:append:class-native = " python-native "
|
||||
|
||||
inherit setuptools3
|
||||
|
||||
PIP_INSTALL_PACKAGE = "python_cson"
|
||||
|
||||
do_configure:prepend() {
|
||||
echo "__version__=${PV}" > ${S}/version.py
|
||||
}
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
SUMMARY = "A python library for handling exceptions"
|
||||
DESCRIPTION = "The python-meh package is a python library for handling, saving, and reporting \
|
||||
exceptions."
|
||||
HOMEPAGE = "https://github.com/rhinstaller/python-meh"
|
||||
LICENSE = "GPL-2.0-or-later"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
|
||||
|
||||
inherit setuptools3_legacy
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
SRC_URI = "git://github.com/rhinstaller/python-meh.git;protocol=https;branch=master"
|
||||
|
||||
SRCREV = "eb5d4adc3b838704b6a68f0f77ada2063a11ab1b"
|
||||
|
||||
FILES:${PN} += "${datadir}/python-meh"
|
||||
@@ -0,0 +1,16 @@
|
||||
SUMMARY = "PyEphem astronomical calculations"
|
||||
HOMEPAGE = "http://rhodesmill.org/pyephem/"
|
||||
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=9c930b395b435b00bb13ec83b0c99f40"
|
||||
|
||||
SRC_URI[sha256sum] = "73a59f0d2162d1624535c3c3b75f956556bdbb2055eaf554a7bef147d3f9c760"
|
||||
|
||||
PYPI_PACKAGE = "ephem"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
RDEPENDS:${PN} += "\
|
||||
${PYTHON_PN}-datetime \
|
||||
${PYTHON_PN}-math \
|
||||
"
|
||||
@@ -0,0 +1,146 @@
|
||||
From 3540ddcc7448dc784b65c74424c8a25132cb8534 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Tue, 31 Jul 2018 17:24:47 +0800
|
||||
Subject: [PATCH] support authentication for kickstart
|
||||
|
||||
While download kickstart file from web server,
|
||||
we support basic/digest authentication.
|
||||
|
||||
Add KickstartAuthError to report authentication failure,
|
||||
which the invoker could parse this specific error.
|
||||
|
||||
Upstream-Status: Inappropriate [oe specific]
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
pykickstart/errors.py | 17 +++++++++++++++++
|
||||
pykickstart/load.py | 32 +++++++++++++++++++++++++++-----
|
||||
pykickstart/parser.py | 4 ++--
|
||||
3 files changed, 46 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/pykickstart/errors.py b/pykickstart/errors.py
|
||||
index 8294f59..3d20bf8 100644
|
||||
--- a/pykickstart/errors.py
|
||||
+++ b/pykickstart/errors.py
|
||||
@@ -32,6 +32,9 @@ This module exports several exception classes:
|
||||
KickstartVersionError - An exception for errors relating to unsupported
|
||||
syntax versions.
|
||||
|
||||
+ KickstartAuthError - An exception for errors relating to authentication
|
||||
+ failed while downloading kickstart from web server
|
||||
+
|
||||
And some warning classes:
|
||||
|
||||
KickstartWarning - A generic warning class.
|
||||
@@ -125,3 +128,17 @@ class KickstartDeprecationWarning(KickstartParseWarning, DeprecationWarning):
|
||||
"""A class for warnings occurring during parsing related to using deprecated
|
||||
commands and options.
|
||||
"""
|
||||
+
|
||||
+class KickstartAuthError(KickstartError):
|
||||
+ """An exception for errors relating to authentication failed while
|
||||
+ downloading kickstart from web server
|
||||
+ """
|
||||
+ def __init__(self, msg):
|
||||
+ """Create a new KickstartAuthError exception instance with the
|
||||
+ descriptive message val. val should be the return value of
|
||||
+ formatErrorMsg.
|
||||
+ """
|
||||
+ KickstartError.__init__(self, msg)
|
||||
+
|
||||
+ def __str__(self):
|
||||
+ return self.value
|
||||
diff --git a/pykickstart/load.py b/pykickstart/load.py
|
||||
index eb76b65..f51cf08 100644
|
||||
--- a/pykickstart/load.py
|
||||
+++ b/pykickstart/load.py
|
||||
@@ -18,9 +18,11 @@
|
||||
# with the express permission of Red Hat, Inc.
|
||||
#
|
||||
import requests
|
||||
+from requests.auth import HTTPDigestAuth
|
||||
+from requests.auth import HTTPBasicAuth
|
||||
import shutil
|
||||
|
||||
-from pykickstart.errors import KickstartError
|
||||
+from pykickstart.errors import KickstartError, KickstartAuthError
|
||||
from pykickstart.i18n import _
|
||||
from requests.exceptions import SSLError, RequestException
|
||||
|
||||
@@ -28,7 +30,7 @@ is_url = lambda location: '://' in location # RFC 3986
|
||||
|
||||
SSL_VERIFY = True
|
||||
|
||||
-def load_to_str(location):
|
||||
+def load_to_str(location, user=None, passwd=None):
|
||||
'''Load a destination URL or file into a string.
|
||||
Type of input is inferred automatically.
|
||||
|
||||
@@ -39,7 +41,7 @@ def load_to_str(location):
|
||||
Raises: KickstartError on error reading'''
|
||||
|
||||
if is_url(location):
|
||||
- return _load_url(location)
|
||||
+ return _load_url(location, user=user, passwd=passwd)
|
||||
else:
|
||||
return _load_file(location)
|
||||
|
||||
@@ -69,11 +71,31 @@ def load_to_file(location, destination):
|
||||
_copy_file(location, destination)
|
||||
return destination
|
||||
|
||||
-def _load_url(location):
|
||||
+def _get_auth(location, user=None, passwd=None):
|
||||
+
|
||||
+ auth = None
|
||||
+ request = requests.get(location, verify=SSL_VERIFY)
|
||||
+ if request.status_code == requests.codes.unauthorized:
|
||||
+ if user is None or passwd is None:
|
||||
+ log.info("Require Authentication")
|
||||
+ raise KickstartAuthError("Require Authentication.\nAppend 'ksuser=<username> kspasswd=<password>' to boot command")
|
||||
+
|
||||
+ reasons = request.headers.get("WWW-Authenticate", "").split()
|
||||
+ if reasons:
|
||||
+ auth_type = reasons[0]
|
||||
+ if auth_type == "Basic":
|
||||
+ auth = HTTPBasicAuth(user, passwd)
|
||||
+ elif auth_type == "Digest":
|
||||
+ auth=HTTPDigestAuth(user, passwd)
|
||||
+
|
||||
+ return auth
|
||||
+
|
||||
+def _load_url(location, user=None, passwd=None):
|
||||
'''Load a location (URL or filename) and return contents as string'''
|
||||
+ auth = _get_auth(location, user=user, passwd=passwd)
|
||||
|
||||
try:
|
||||
- request = requests.get(location, verify=SSL_VERIFY)
|
||||
+ request = requests.get(location, verify=SSL_VERIFY, auth=auth)
|
||||
except SSLError as e:
|
||||
raise KickstartError(_('Error securely accessing URL "%s"') % location + ': {e}'.format(e=str(e)))
|
||||
except RequestException as e:
|
||||
diff --git a/pykickstart/parser.py b/pykickstart/parser.py
|
||||
index 7edf8aa..46c5299 100644
|
||||
--- a/pykickstart/parser.py
|
||||
+++ b/pykickstart/parser.py
|
||||
@@ -790,7 +790,7 @@ class KickstartParser(object):
|
||||
i = PutBackIterator(s.splitlines(True) + [""])
|
||||
self._stateMachine(i)
|
||||
|
||||
- def readKickstart(self, f, reset=True):
|
||||
+ def readKickstart(self, f, reset=True, username=None, password=None):
|
||||
"""Process a kickstart file, given by the filename f."""
|
||||
if reset:
|
||||
self._reset()
|
||||
@@ -811,7 +811,7 @@ class KickstartParser(object):
|
||||
self.currentdir[self._includeDepth] = cd
|
||||
|
||||
try:
|
||||
- s = load_to_str(f)
|
||||
+ s = load_to_str(f, user=username, passwd=password)
|
||||
except KickstartError as e:
|
||||
raise KickstartError(_("Unable to open input kickstart file: %s") % str(e), lineno=0)
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
From 62fdead139edb0f29b2f222efcb8f39be15b057e Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Mon, 30 Jul 2018 15:47:13 +0800
|
||||
Subject: [PATCH 2/4] pykickstart/parser.py: add lock for readKickstart and
|
||||
support https without certification
|
||||
|
||||
- Add lock for readKickstart to fix race issue
|
||||
|
||||
- Support to download kickstart file through https without certification
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
|
||||
---
|
||||
pykickstart/load.py | 2 +-
|
||||
pykickstart/parser.py | 18 ++++++++++++++++++
|
||||
2 files changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/pykickstart/load.py b/pykickstart/load.py
|
||||
index 8da8051..e856c8d 100644
|
||||
--- a/pykickstart/load.py
|
||||
+++ b/pykickstart/load.py
|
||||
@@ -32,7 +32,7 @@ log = logging.getLogger("anaconda.main")
|
||||
|
||||
is_url = lambda location: '://' in location # RFC 3986
|
||||
|
||||
-SSL_VERIFY = True
|
||||
+SSL_VERIFY = False
|
||||
|
||||
def load_to_str(location, user=None, passwd=None):
|
||||
'''Load a destination URL or file into a string.
|
||||
diff --git a/pykickstart/parser.py b/pykickstart/parser.py
|
||||
index b95ba90..a55a9a3 100644
|
||||
--- a/pykickstart/parser.py
|
||||
+++ b/pykickstart/parser.py
|
||||
@@ -51,6 +51,20 @@ from pykickstart.i18n import _
|
||||
STATE_END = "end"
|
||||
STATE_COMMANDS = "commands"
|
||||
|
||||
+import threading
|
||||
+_private_ks_lock = threading.RLock()
|
||||
+
|
||||
+class KsLock(object):
|
||||
+ def __enter__(self):
|
||||
+ _private_ks_lock.acquire()
|
||||
+ return _private_ks_lock
|
||||
+
|
||||
+ def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
+ _private_ks_lock.release()
|
||||
+
|
||||
+
|
||||
+_ks_lock = KsLock()
|
||||
+
|
||||
def _preprocessStateMachine(lineIter):
|
||||
l = None
|
||||
lineno = 0
|
||||
@@ -791,6 +805,10 @@ class KickstartParser(object):
|
||||
self._stateMachine(i)
|
||||
|
||||
def readKickstart(self, f, reset=True, username=None, password=None):
|
||||
+ with _ks_lock:
|
||||
+ self._readKickstart(f, reset=reset, username=username, password=password)
|
||||
+
|
||||
+ def _readKickstart(self, f, reset=True, username=None, password=None):
|
||||
"""Process a kickstart file, given by the filename f."""
|
||||
if reset:
|
||||
self._reset()
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From 44226393812399c61de9ca9281efa002ad4f4c01 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Thu, 1 Jun 2017 15:15:15 +0800
|
||||
Subject: [PATCH 3/4] comment out sections shutdown and environment in
|
||||
generated kickstart file
|
||||
|
||||
Both of them is disabled by default.
|
||||
|
||||
Upstream-Status: Inappropriate [oe specific]
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
|
||||
fixup! add comments of shutdown for user
|
||||
---
|
||||
pykickstart/commands/reboot.py | 3 +++
|
||||
pykickstart/parser.py | 2 +-
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/pykickstart/commands/reboot.py b/pykickstart/commands/reboot.py
|
||||
index 75a6d916..edfe83ff 100644
|
||||
--- a/pykickstart/commands/reboot.py
|
||||
+++ b/pykickstart/commands/reboot.py
|
||||
@@ -43,6 +43,9 @@ class FC3_Reboot(KickstartCommand):
|
||||
elif self.action == KS_SHUTDOWN:
|
||||
retval += "# Shutdown after installation\nshutdown"
|
||||
retval += self._getArgsAsStr() + "\n"
|
||||
+ else:
|
||||
+ retval += "# Shutdown after installation\n#shutdown"
|
||||
+ retval += self._getArgsAsStr() + "\n"
|
||||
|
||||
return retval
|
||||
|
||||
diff --git a/pykickstart/parser.py b/pykickstart/parser.py
|
||||
index bc59131b..b2d09d45 100644
|
||||
--- a/pykickstart/parser.py
|
||||
+++ b/pykickstart/parser.py
|
||||
@@ -428,7 +428,7 @@ class Packages(KickstartObject):
|
||||
|
||||
if not self.default:
|
||||
if self.environment:
|
||||
- pkgs += "@^%s\n" % self.environment
|
||||
+ pkgs += "#@^%s\n" % self.environment
|
||||
|
||||
grps = self.groupList
|
||||
grps.sort()
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
From 737e9a7c11233183f48ce6c83d38b504c8ffed12 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Mon, 30 Jul 2018 15:52:21 +0800
|
||||
Subject: [PATCH] load.py: retry to invoke request with timeout
|
||||
|
||||
While networkless, use request to fetch kickstart file from
|
||||
network, it failed and wait 300s to break, we should retry
|
||||
to invoke request with timeout explicitly. So if it the
|
||||
network is up, the fetch works.
|
||||
|
||||
Upstream-Status: Inappropriate [oe specific]
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
pykickstart/load.py | 31 +++++++++++++++++++++++++++++++
|
||||
1 file changed, 31 insertions(+)
|
||||
|
||||
diff --git a/pykickstart/load.py b/pykickstart/load.py
|
||||
index 58faba6..e856c8d 100644
|
||||
--- a/pykickstart/load.py
|
||||
+++ b/pykickstart/load.py
|
||||
@@ -20,12 +20,16 @@
|
||||
import requests
|
||||
from requests.auth import HTTPDigestAuth
|
||||
from requests.auth import HTTPBasicAuth
|
||||
+import time
|
||||
import shutil
|
||||
|
||||
from pykickstart.errors import KickstartError, KickstartAuthError
|
||||
from pykickstart.i18n import _
|
||||
from requests.exceptions import SSLError, RequestException
|
||||
|
||||
+import logging
|
||||
+log = logging.getLogger("anaconda.main")
|
||||
+
|
||||
is_url = lambda location: '://' in location # RFC 3986
|
||||
|
||||
SSL_VERIFY = False
|
||||
@@ -71,6 +75,29 @@ def load_to_file(location, destination):
|
||||
_copy_file(location, destination)
|
||||
return destination
|
||||
|
||||
+def _access_url(location):
|
||||
+ status = False
|
||||
+
|
||||
+ # Retry 45 times, wait 45s~135s
|
||||
+ i = 0
|
||||
+ while i < 45:
|
||||
+
|
||||
+ try:
|
||||
+ request = requests.get(location, verify=SSL_VERIFY, timeout=2)
|
||||
+ except RequestException as e:
|
||||
+ log.info("Try '%s' %d times, %s" % (location, i, str(e)))
|
||||
+ status = False
|
||||
+ i += 1
|
||||
+ time.sleep(1)
|
||||
+ continue
|
||||
+
|
||||
+ else:
|
||||
+ status = True
|
||||
+ return status
|
||||
+
|
||||
+ return status
|
||||
+
|
||||
+
|
||||
def _get_auth(location, user=None, passwd=None):
|
||||
|
||||
auth = None
|
||||
@@ -92,6 +119,10 @@ def _get_auth(location, user=None, passwd=None):
|
||||
|
||||
def _load_url(location, user=None, passwd=None):
|
||||
'''Load a location (URL or filename) and return contents as string'''
|
||||
+
|
||||
+ if not _access_url(location):
|
||||
+ raise KickstartError(_("Connection %s failed" % location))
|
||||
+
|
||||
auth = _get_auth(location, user=user, passwd=passwd)
|
||||
|
||||
try:
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
DESCRIPTION = "A python library for manipulating kickstart files"
|
||||
HOMEPAGE = "http://fedoraproject.org/wiki/pykickstart"
|
||||
LICENSE = "GPL-2.0-or-later"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
|
||||
|
||||
DEPENDS = "python3"
|
||||
RDEPENDS:${PN} = "python3 \
|
||||
python3-requests \
|
||||
python3-six \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SRC_URI = "git://github.com/rhinstaller/pykickstart.git;protocol=https;branch=master \
|
||||
file://0001-support-authentication-for-kickstart.patch \
|
||||
file://0002-pykickstart-parser.py-add-lock-for-readKickstart-and.patch \
|
||||
file://0003-comment-out-sections-shutdown-and-environment-in-gen.patch \
|
||||
file://0004-load.py-retry-to-invoke-request-with-timeout.patch \
|
||||
"
|
||||
SRCREV = "fa2f233f735a082dccaf03c234238f7d8ce93fa1"
|
||||
|
||||
UPSTREAM_CHECK_GITTAGREGEX = "r(?P<pver>\d+(\.\d+)+(-\d+)*)"
|
||||
|
||||
inherit setuptools3
|
||||
PIP_INSTALL_PACKAGE = "pykickstart"
|
||||
PIP_INSTALL_DIST_PATH = "${S}/dist"
|
||||
@@ -0,0 +1,24 @@
|
||||
DESCRIPTION = "pyparted is a set of Python modules that provide Python programmers \
|
||||
an interface to libparted, the GNU parted library for disk partitioning and \
|
||||
filesystem manipulation."
|
||||
SUMMARY = "Python bindings for libparted"
|
||||
HOMEPAGE = "https://github.com/rhinstaller/pyparted"
|
||||
LICENSE = "GPL-2.0-or-later"
|
||||
LIC_FILES_CHKSUM = "\
|
||||
file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
|
||||
file://src/_pedmodule.c;beginline=10;endline=22;md5=9e53304db812b80d0939e11bb69dcab2 \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "da985e116beb733371feb605b174db9eec8bd0eedffc8f739f8e603f51b521e7"
|
||||
|
||||
inherit pkgconfig pypi setuptools3
|
||||
|
||||
DEPENDS += "parted"
|
||||
|
||||
RDEPENDS:${PN}:class-target += " \
|
||||
parted (>= 2.3) \
|
||||
python3-stringold python3-codecs python3-math \
|
||||
"
|
||||
RDEPENDS:${PN}:class-native = ""
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
@@ -0,0 +1,15 @@
|
||||
SUMMARY = "Rich is a Python library for rich text and beautiful formatting in the terminal"
|
||||
DESCRIPTION = "The Rich API makes it easy to add color and style to terminal output. \
|
||||
Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, \
|
||||
tracebacks, and more."
|
||||
HOMEPAGE="https://github.com/Textualize/rich"
|
||||
SECTION = "devel/python"
|
||||
LICENSE = "MIT"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=b5f0b94fbc94f5ad9ae4efcf8a778303"
|
||||
|
||||
SRC_URI[sha256sum] = "dc84400a9d842b3a9c5ff74addd8eb798d155f36c1c91303888e0a66850d2a15"
|
||||
|
||||
inherit pypi python_poetry_core
|
||||
|
||||
RDEPENDS:${PN} = "${PYTHON_PN}-pygments"
|
||||
@@ -0,0 +1,16 @@
|
||||
SUMMARY = "Cross-platform locking library"
|
||||
DESCRIPTION = "Portalocker is a library to provide an easy API to file locking"
|
||||
LICENSE = "BSD-3-Clause"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=152634da660a374ca18c0734ed07c63c"
|
||||
|
||||
SRC_URI[sha256sum] = "032e81d534a88ec1736d03f780ba073f047a06c478b06e2937486f334e955c51"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
RDEPENDS:${PN} += " \
|
||||
${PYTHON_PN}-fcntl \
|
||||
${PYTHON_PN}-logging \
|
||||
"
|
||||
@@ -0,0 +1,11 @@
|
||||
SUMMARY = "pydot is is an interface to Graphviz."
|
||||
HOMEPAGE = "https://github.com/pydot/pydot"
|
||||
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=3f6fa041dfcc7ff7747cfceaa34a3180"
|
||||
|
||||
SRC_URI[sha256sum] = "248081a39bcb56784deb018977e428605c1c758f10897a339fce1dd728ff007d"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
RDEPENDS:${PN} = "graphviz python3-pyparsing"
|
||||
@@ -0,0 +1,51 @@
|
||||
SUMMARY = "Python WBEM Client and Provider Interface"
|
||||
DESCRIPTION = "\
|
||||
A Python library for making CIM (Common Information Model) operations over \
|
||||
HTTP using the WBEM CIM-XML protocol. It is based on the idea that a good \
|
||||
WBEM client should be easy to use and not necessarily require a large amount \
|
||||
of programming knowledge. It is suitable for a large range of tasks from \
|
||||
simply poking around to writing web and GUI applications. \
|
||||
\
|
||||
WBEM, or Web Based Enterprise Management is a manageability protocol, like \
|
||||
SNMP, standardised by the Distributed Management Task Force (DMTF) available \
|
||||
at http://www.dmtf.org/standards/wbem. \
|
||||
\
|
||||
It also provides a Python provider interface, and is the fastest and easiest \
|
||||
way to write providers on the planet."
|
||||
HOMEPAGE = "http://pywbem.github.io"
|
||||
LICENSE = "LGPL-2.1-only"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=fbc093901857fcd118f065f900982c24"
|
||||
|
||||
SRC_URI[sha256sum] = "abdbd6ce08b6c597cdd6c7730e6b49a842d913f2f6b3cc62b585c58ec3ee7945"
|
||||
|
||||
inherit pypi setuptools3 update-alternatives
|
||||
|
||||
DEPENDS += " \
|
||||
${PYTHON_PN}-ply-native \
|
||||
${PYTHON_PN}-pyyaml-native \
|
||||
${PYTHON_PN}-six-native \
|
||||
${PYTHON_PN}-wheel-native \
|
||||
"
|
||||
|
||||
RDEPENDS:${PN}:class-target += "\
|
||||
${PYTHON_PN}-datetime \
|
||||
${PYTHON_PN}-io \
|
||||
${PYTHON_PN}-netclient \
|
||||
${PYTHON_PN}-ply \
|
||||
${PYTHON_PN}-pyyaml \
|
||||
${PYTHON_PN}-six \
|
||||
${PYTHON_PN}-stringold \
|
||||
${PYTHON_PN}-threading \
|
||||
${PYTHON_PN}-unixadmin \
|
||||
${PYTHON_PN}-xml \
|
||||
${PYTHON_PN}-nocasedict \
|
||||
${PYTHON_PN}-nocaselist \
|
||||
${PYTHON_PN}-yamlloader \
|
||||
"
|
||||
|
||||
ALTERNATIVE:${PN} = "mof_compiler"
|
||||
ALTERNATIVE_TARGET[mof_compiler] = "${bindir}/mof_compiler"
|
||||
|
||||
ALTERNATIVE_PRIORITY = "60"
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
@@ -0,0 +1,39 @@
|
||||
SUMMARY = "A set of tools using pywbem"
|
||||
DESCRIPTION = "A set of tools using pywbem to communicate with WBEM servers"
|
||||
HOMEPAGE = "https://pywbemtools.readthedocs.io/en/stable/"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e23fadd6ceef8c618fc1c65191d846fa"
|
||||
|
||||
SRC_URI[sha256sum] = "921fb57ea2ae3ae2806e18895bb0457697f27221b345c8b05afa4cb304a7f939"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
DEPENDS += " \
|
||||
${PYTHON_PN}-pyyaml-native \
|
||||
${PYTHON_PN}-pywbem-native \
|
||||
${PYTHON_PN}-six-native \
|
||||
${PYTHON_PN}-click-native \
|
||||
"
|
||||
|
||||
RDEPENDS:${PN}:class-target += "\
|
||||
${PYTHON_PN}-ply \
|
||||
${PYTHON_PN}-pyyaml \
|
||||
${PYTHON_PN}-six \
|
||||
${PYTHON_PN}-pywbem \
|
||||
${PYTHON_PN}-click \
|
||||
${PYTHON_PN}-requests \
|
||||
${PYTHON_PN}-prompt-toolkit \
|
||||
${PYTHON_PN}-mock \
|
||||
${PYTHON_PN}-packaging \
|
||||
${PYTHON_PN}-nocasedict \
|
||||
${PYTHON_PN}-yamlloader \
|
||||
${PYTHON_PN}-click-repl \
|
||||
${PYTHON_PN}-click-spinner \
|
||||
${PYTHON_PN}-asciitree \
|
||||
${PYTHON_PN}-tabulate \
|
||||
${PYTHON_PN}-pydicti \
|
||||
${PYTHON_PN}-nocaselist \
|
||||
${PYTHON_PN}-custom-inherit \
|
||||
"
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
@@ -0,0 +1,9 @@
|
||||
SUMMARY = "Send file to trash natively under Mac OS X, Windows and Linux"
|
||||
LICENSE = "BSD-3-Clause"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=a02659c2d5f4cc626e4dcf6504b865eb"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
SRC_URI[sha256sum] = "d2c24762fd3759860a0aff155e45871447ea58d2be6bdd39b5c8f966a0c99c2d"
|
||||
|
||||
PYPI_PACKAGE = "Send2Trash"
|
||||
@@ -0,0 +1,24 @@
|
||||
SUMMARY = "cui/gui tool for tuning of running processes"
|
||||
HOMEPAGE = "https://rt.wiki.kernel.org/index.php/Tuna"
|
||||
LICENSE = "GPL-2.0-only"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
|
||||
|
||||
SRC_URI = "git://git.kernel.org/pub/scm/utils/tuna/tuna.git;branch=main"
|
||||
|
||||
SRCREV = "0681906e75e1c8166126bbfc2f3055e7507bfcb5"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
RDEPENDS:${PN} += " \
|
||||
python3-io \
|
||||
python3-linux-procfs \
|
||||
python3-logging \
|
||||
python3-six \
|
||||
"
|
||||
|
||||
inherit setuptools3
|
||||
|
||||
do_install:append() {
|
||||
install -m 0755 -d ${D}${bindir}
|
||||
install -m 0755 ${S}/tuna-cmd.py ${D}${bindir}/tuna
|
||||
}
|
||||
Reference in New Issue
Block a user