Date   

kirkstone merge request: Oct 13th

Armin Kuster
 

The following changes since commit 05dcac98473402d87e0af73bbc2c5a6a840abe93:

  postgresql: make sure pam conf installed when pam enabled (2022-09-15 08:39:48 -0400)

are available in the Git repository at:

  https://git.openembedded.org/meta-openembedded kirkstone-next

for you to fetch changes up to bd2d8fba766f912bd1bc5cde7d6f0e72152f1547:

  minicoredumper: retry elf parsing as long as needed (2022-09-25 11:03:26 -0400)

----------------------------------------------------------------
Khem Raj (1):
      audit: Revert the tweak done in configure step in do_install

Martin Jansa (1):
      libcec: fix runtime dependencies for ${PN}-examples

Richard Purdie (1):
      lmdb: Don't inherit base

Sakib Sajal (1):
      minicoredumper: retry elf parsing as long as needed

Steffen Olsen (1):
      postgreql: Fix pg_config not working after buildpaths patch

Wang Mingyu (1):
      postgresql: upgrade 14.4 -> 14.5

Yi Zhao (1):
      frr: Security fix CVE-2022-37035

wangmy (1):
      php: upgrade 8.1.9 -> 8.1.10

 meta-networking/recipes-protocols/frr/frr/CVE-2022-37035.patch  | 151 ++++++++++++++++++++++++++++
 meta-networking/recipes-protocols/frr/frr_8.2.2.bb              | 1 +
 meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb                         | 2 +-
 .../files/0001-config_info.c-not-expose-build-info.patch        | 11 +-
 .../0001-configure.ac-bypass-autoconf-2.69-version-check.patch  | 6 +-
 .../postgresql/{postgresql_14.4.bb => postgresql_14.5.bb} |   2 +-
 meta-oe/recipes-devtools/php/{php_8.1.9.bb => php_8.1.10.bb} |   2 +-
 meta-oe/recipes-extended/libcec/libcec_6.0.2.bb                 | 3 +
 ...001-minicoredumper-retry-elf-parsing-as-long-as-needed.patch | 128 +++++++++++++++++++++++
 meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.1.bb   | 1 +
 meta-oe/recipes-security/audit/audit_3.0.8.bb                   | 2 +
 11 files changed, 302 insertions(+), 7 deletions(-)
 create mode 100644 meta-networking/recipes-protocols/frr/frr/CVE-2022-37035.patch
 rename meta-oe/recipes-dbs/postgresql/{postgresql_14.4.bb => postgresql_14.5.bb} (83%)
 rename meta-oe/recipes-devtools/php/{php_8.1.9.bb => php_8.1.10.bb} (99%)
 create mode 100644 meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-retry-elf-parsing-as-long-as-needed.patch


Re: Security Advisory - yasm - CVE-2021-33461

Randy MacLeod
 

On 2022-10-13 02:33, Khem Raj wrote:
On Wed, Oct 12, 2022 at 10:59 PM Polampalli, Archana <Archana.Polampalli@... <mailto:Archana.Polampalli@...>> wrote:
Hi Khem Raj,
I Have seen the link, issue is in Open.
Could you please confirm open embedded is going to provide the fix.
If someone in community signs up for it then yes

and in this case, the community is us (Wind River and other folks using yasm in OE)
so that may be you providing the fix Archana.

I'll explain more offline.

../Randy

Regards,
Archana
------------------------------------------------------------------------
*From:* Khem Raj <raj.khem@... <mailto:raj.khem@...>>
*Sent:* Thursday, October 13, 2022 4:00 AM
*To:* Polampalli, Archana <Archana.Polampalli@...
<mailto:Archana.Polampalli@...>>
*Cc:* openembedded-devel@...
<mailto:openembedded-devel@...>
<openembedded-devel@...
<mailto:openembedded-devel@...>>
*Subject:* Re: [oe] Security Advisory - yasm - CVE-2021-33461
[Please note: This e-mail is from an EXTERNAL e-mail address]
On Wed, Oct 12, 2022 at 10:24 AM Polampalli, Archana
<archana.polampalli@...
<mailto:archana.polampalli@...>> wrote:
>
> HI,
>
> Could you please confirm is there any security fix providing for CVE-2021-33461.
seems to be open https://github.com/yasm/yasm/issues/161
<https://github.com/yasm/yasm/issues/161>

>
>
> Regards,
> Archana
>
>
--
# Randy MacLeod
# Wind River Linux


Re: [meta-oe] Add nativesdk-systemd-systemctl as dependency of dnf-plugin-tui

Ross Burton
 

What’s the difference between this python implementation of systemctl, and the shell implementation that’s already in oe-core in systemd-systemctl-native?

Looks like pointless duplication to me. If the Python implementation here is better, then it should be in core.

Also, why would a nativesdk DNF need to manage systemd units?

Ross

On 12 Oct 2022, at 23:27, Khem Raj via lists.openembedded.org <raj.khem=gmail.com@...> wrote:

On Wed, Oct 12, 2022 at 10:20 AM Jose Quaresma <quaresma.jose@...> wrote:

Hi wangmy,

wangmy <wangmy@...> escreveu no dia quarta, 12/10/2022 à(s) 05:04:

Signed-off-by: Wang Mingyu <wangmy@...>
---
.../systemd/nativesdk-systemd-systemctl.bb | 17 +
.../systemd/systemd-systemctl/systemctl | 340 ++++++++++++++++++
2 files changed, 357 insertions(+)
create mode 100644 meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
create mode 100755 meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl

diff --git a/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb b/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
new file mode 100644
index 0000000000..7ac21aa260
--- /dev/null
+++ b/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Wrapper for enabling systemd services"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r6"

Why is this recipe starting with the package release 6 ?
Right, I have fixed it before accepting.

Jose


+
+inherit nativesdk
+
+SRC_URI = "file://systemctl"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
+}
diff --git a/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl b/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl
new file mode 100755
index 0000000000..6324319a45
--- /dev/null
+++ b/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,340 @@
+#!/usr/bin/env python3
+"""systemctl: subset of systemctl used for image construction
+
+Mask/preset systemd units
+"""
+
+import argparse
+import fnmatch
+import os
+import re
+import sys
+
+from collections import namedtuple
+from pathlib import Path
+
+version = 1.0
+
+ROOT = Path("/")
+SYSCONFDIR = Path("etc")
+BASE_LIBDIR = Path("lib")
+LIBDIR = Path("usr", "lib")
+
+locations = list()
+
+
+class SystemdFile():
+ """Class representing a single systemd configuration file"""
+ def __init__(self, root, path):
+ self.sections = dict()
+ self._parse(root, path)
+ dirname = os.path.basename(path.name) + ".d"
+ for location in locations:
+ for path2 in sorted((root / location / "system" / dirname).glob("*.conf")):
+ self._parse(root, path2)
+
+ def _parse(self, root, path):
+ """Parse a systemd syntax configuration file
+
+ Args:
+ path: A pathlib.Path object pointing to the file
+
+ """
+ skip_re = re.compile(r"^\s*([#;]|$)")
+ section_re = re.compile(r"^\s*\[(?P<section>.*)\]")
+ kv_re = re.compile(r"^\s*(?P<key>[^\s]+)\s*=\s*(?P<value>.*)")
+ section = None
+
+ if path.is_symlink():
+ try:
+ path.resolve()
+ except FileNotFoundError:
+ # broken symlink, try relative to root
+ path = root / Path(os.readlink(str(path))).relative_to(ROOT)
+
+ with path.open() as f:
+ for line in f:
+ if skip_re.match(line):
+ continue
+
+ line = line.strip()
+ m = section_re.match(line)
+ if m:
+ if m.group('section') not in self.sections:
+ section = dict()
+ self.sections[m.group('section')] = section
+ else:
+ section = self.sections[m.group('section')]
+ continue
+
+ while line.endswith("\\"):
+ line += f.readline().rstrip("\n")
+
+ m = kv_re.match(line)
+ k = m.group('key')
+ v = m.group('value')
+ if k not in section:
+ section[k] = list()
+ section[k].extend(v.split())
+
+ def get(self, section, prop):
+ """Get a property from section
+
+ Args:
+ section: Section to retrieve property from
+ prop: Property to retrieve
+
+ Returns:
+ List representing all properties of type prop in section.
+
+ Raises:
+ KeyError: if ``section`` or ``prop`` not found
+ """
+ return self.sections[section][prop]
+
+
+class Presets():
+ """Class representing all systemd presets"""
+ def __init__(self, scope, root):
+ self.directives = list()
+ self._collect_presets(scope, root)
+
+ def _parse_presets(self, presets):
+ """Parse presets out of a set of preset files"""
+ skip_re = re.compile(r"^\s*([#;]|$)")
+ directive_re = re.compile(r"^\s*(?P<action>enable|disable)\s+(?P<unit_name>(.+))")
+
+ Directive = namedtuple("Directive", "action unit_name")
+ for preset in presets:
+ with preset.open() as f:
+ for line in f:
+ m = directive_re.match(line)
+ if m:
+ directive = Directive(action=m.group('action'),
+ unit_name=m.group('unit_name'))
+ self.directives.append(directive)
+ elif skip_re.match(line):
+ pass
+ else:
+ sys.exit("Unparsed preset line in {}".format(preset))
+
+ def _collect_presets(self, scope, root):
+ """Collect list of preset files"""
+ presets = dict()
+ for location in locations:
+ paths = (root / location / scope).glob("*.preset")
+ for path in paths:
+ # earlier names override later ones
+ if path.name not in presets:
+ presets[path.name] = path
+
+ self._parse_presets([v for k, v in sorted(presets.items())])
+
+ def state(self, unit_name):
+ """Return state of preset for unit_name
+
+ Args:
+ presets: set of presets
+ unit_name: name of the unit
+
+ Returns:
+ None: no matching preset
+ `enable`: unit_name is enabled
+ `disable`: unit_name is disabled
+ """
+ for directive in self.directives:
+ if fnmatch.fnmatch(unit_name, directive.unit_name):
+ return directive.action
+
+ return None
+
+
+def add_link(path, target):
+ try:
+ path.parent.mkdir(parents=True)
+ except FileExistsError:
+ pass
+ if not path.is_symlink():
+ print("ln -s {} {}".format(target, path))
+ path.symlink_to(target)
+
+
+class SystemdUnitNotFoundError(Exception):
+ def __init__(self, path, unit):
+ self.path = path
+ self.unit = unit
+
+
+class SystemdUnit():
+ def __init__(self, root, unit):
+ self.root = root
+ self.unit = unit
+ self.config = None
+
+ def _path_for_unit(self, unit):
+ for location in locations:
+ path = self.root / location / "system" / unit
+ if path.exists() or path.is_symlink():
+ return path
+
+ raise SystemdUnitNotFoundError(self.root, unit)
+
+ def _process_deps(self, config, service, location, prop, dirstem):
+ systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+
+ target = ROOT / location.relative_to(self.root)
+ try:
+ for dependent in config.get('Install', prop):
+ wants = systemdir / "{}.{}".format(dependent, dirstem) / service
+ add_link(wants, target)
+
+ except KeyError:
+ pass
+
+ def enable(self, caller_unit=None):
+ # if we're enabling an instance, first extract the actual instance
+ # then figure out what the template unit is
+ template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit)
+ if template:
+ instance = template.group('instance')
+ unit = re.sub(r"@[^\.]*\.", "@.", self.unit, 1)
+ else:
+ instance = None
+ unit = self.unit
+
+ path = self._path_for_unit(unit)
+
+ if path.is_symlink():
+ # ignore aliases
+ return
+
+ config = SystemdFile(self.root, path)
+ if instance == "":
+ try:
+ default_instance = config.get('Install', 'DefaultInstance')[0]
+ except KeyError:
+ # no default instance, so nothing to enable
+ return
+
+ service = self.unit.replace("@.",
+ "@{}.".format(default_instance))
+ else:
+ service = self.unit
+
+ self._process_deps(config, service, path, 'WantedBy', 'wants')
+ self._process_deps(config, service, path, 'RequiredBy', 'requires')
+
+ try:
+ for also in config.get('Install', 'Also'):
+ try:
+ if caller_unit != also:
+ SystemdUnit(self.root, also).enable(unit)
+ except SystemdUnitNotFoundError as e:
+ sys.exit("Error: Systemctl also enable issue with %s (%s)" % (service, e.unit))
+
+ except KeyError:
+ pass
+
+ systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+ target = ROOT / path.relative_to(self.root)
+ try:
+ for dest in config.get('Install', 'Alias'):
+ alias = systemdir / dest
+ add_link(alias, target)
+
+ except KeyError:
+ pass
+
+ def mask(self):
+ systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+ add_link(systemdir / self.unit, "/dev/null")
+
+
+def collect_services(root):
+ """Collect list of service files"""
+ services = set()
+ for location in locations:
+ paths = (root / location / "system").glob("*")
+ for path in paths:
+ if path.is_dir():
+ continue
+ services.add(path.name)
+
+ return services
+
+
+def preset_all(root):
+ presets = Presets('system-preset', root)
+ services = collect_services(root)
+
+ for service in services:
+ state = presets.state(service)
+
+ if state == "enable" or state is None:
+ try:
+ SystemdUnit(root, service).enable()
+ except SystemdUnitNotFoundError:
+ sys.exit("Error: Systemctl preset_all issue in %s" % service)
+
+ # If we populate the systemd links we also create /etc/machine-id, which
+ # allows systemd to boot with the filesystem read-only before generating
+ # a real value and then committing it back.
+ #
+ # For the stateless configuration, where /etc is generated at runtime
+ # (for example on a tmpfs), this script shouldn't run at all and we
+ # allow systemd to completely populate /etc.
+ (root / SYSCONFDIR / "machine-id").touch()
+
+
+def main():
+ if sys.version_info < (3, 4, 0):
+ sys.exit("Python 3.4 or greater is required")
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('command', nargs='?', choices=['enable', 'mask',
+ 'preset-all'])
+ parser.add_argument('service', nargs=argparse.REMAINDER)
+ parser.add_argument('--root')
+ parser.add_argument('--preset-mode',
+ choices=['full', 'enable-only', 'disable-only'],
+ default='full')
+
+ args = parser.parse_args()
+
+ root = Path(args.root) if args.root else ROOT
+
+ locations.append(SYSCONFDIR / "systemd")
+ # Handle the usrmerge case by ignoring /lib when it's a symlink
+ if not (root / BASE_LIBDIR).is_symlink():
+ locations.append(BASE_LIBDIR / "systemd")
+ locations.append(LIBDIR / "systemd")
+
+ command = args.command
+ if not command:
+ parser.print_help()
+ return 0
+
+ if command == "mask":
+ for service in args.service:
+ try:
+ SystemdUnit(root, service).mask()
+ except SystemdUnitNotFoundError as e:
+ sys.exit("Error: Systemctl main mask issue in %s (%s)" % (service, e.unit))
+ elif command == "enable":
+ for service in args.service:
+ try:
+ SystemdUnit(root, service).enable()
+ except SystemdUnitNotFoundError as e:
+ sys.exit("Error: Systemctl main enable issue in %s (%s)" % (service, e.unit))
+ elif command == "preset-all":
+ if len(args.service) != 0:
+ sys.exit("Too many arguments.")
+ if args.preset_mode != "enable-only":
+ sys.exit("Only enable-only is supported as preset-mode.")
+ preset_all(root)
+ else:
+ raise RuntimeError()
+
+
+if __name__ == '__main__':
+ main()
--
2.25.1




--
Best regards,

José Quaresma



Re: Security Advisory - yasm - CVE-2021-33461

Khem Raj
 



On Wed, Oct 12, 2022 at 10:59 PM Polampalli, Archana <Archana.Polampalli@...> wrote:
Hi Khem Raj,

I Have seen the link, issue is in Open.

Could you please confirm open embedded is going to provide the fix.

If someone in community signs up for it then yes 


Regards,
Archana



From: Khem Raj <raj.khem@...>
Sent: Thursday, October 13, 2022 4:00 AM
To: Polampalli, Archana <Archana.Polampalli@...>
Cc: openembedded-devel@... <openembedded-devel@...>
Subject: Re: [oe] Security Advisory - yasm - CVE-2021-33461
 
[Please note: This e-mail is from an EXTERNAL e-mail address]


On Wed, Oct 12, 2022 at 10:24 AM Polampalli, Archana
<archana.polampalli@...> wrote:
>
> HI,
>
> Could you please confirm is there any security fix providing for CVE-2021-33461.

seems to be open https://github.com/yasm/yasm/issues/161

>
>
> Regards,
> Archana
>
>
>


Re: Security Advisory - yasm - CVE-2021-33461

Polampalli, Archana
 

Hi Khem Raj,

I Have seen the link, issue is in Open.

Could you please confirm open embedded is going to provide the fix.

Regards,
Archana



From: Khem Raj <raj.khem@...>
Sent: Thursday, October 13, 2022 4:00 AM
To: Polampalli, Archana <Archana.Polampalli@...>
Cc: openembedded-devel@... <openembedded-devel@...>
Subject: Re: [oe] Security Advisory - yasm - CVE-2021-33461
 
[Please note: This e-mail is from an EXTERNAL e-mail address]

On Wed, Oct 12, 2022 at 10:24 AM Polampalli, Archana
<archana.polampalli@...> wrote:
>
> HI,
>
> Could you please confirm is there any security fix providing for CVE-2021-33461.

seems to be open https://github.com/yasm/yasm/issues/161

>
>
> Regards,
> Archana
>
>
>


[meta-networking][kirkstone][PATCH] frr: Security fix CVE-2022-37032

Yi Zhao
 

CVE-2022-37032:
An out-of-bounds read in the BGP daemon of FRRouting FRR before 8.4 may
lead to a segmentation fault and denial of service. This occurs in
bgp_capability_msg_parse in bgpd/bgp_packet.c.

Reference:
https://nvd.nist.gov/vuln/detail/CVE-2022-37032

Patch from:
https://github.com/FRRouting/frr/commit/3c4821679f2362bcd38fcc7803f28a5210441ddb

Signed-off-by: Yi Zhao <yi.zhao@...>
---
.../frr/frr/CVE-2022-37032.patch | 42 +++++++++++++++++++
.../recipes-protocols/frr/frr_8.2.2.bb | 1 +
2 files changed, 43 insertions(+)
create mode 100644 meta-networking/recipes-protocols/frr/frr/CVE-2022-37032.patch

diff --git a/meta-networking/recipes-protocols/frr/frr/CVE-2022-37032.patch b/meta-networking/recipes-protocols/frr/frr/CVE-2022-37032.patch
new file mode 100644
index 000000000..672bc9514
--- /dev/null
+++ b/meta-networking/recipes-protocols/frr/frr/CVE-2022-37032.patch
@@ -0,0 +1,42 @@
+From 3c4821679f2362bcd38fcc7803f28a5210441ddb Mon Sep 17 00:00:00 2001
+From: Donald Sharp <sharpd@...>
+Date: Thu, 21 Jul 2022 08:11:58 -0400
+Subject: [PATCH] bgpd: Make sure hdr length is at a minimum of what is
+ expected
+
+Ensure that if the capability length specified is enough data.
+
+Signed-off-by: Donald Sharp <sharpd@...>
+
+CVE: CVE-2022-37032
+
+Upstream-Status: Backport
+[https://github.com/FRRouting/frr/commit/3c4821679f2362bcd38fcc7803f28a5210441ddb]
+
+Signed-off-by: Yi Zhao <yi.zhao@...>
+---
+ bgpd/bgp_packet.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
+index 7c92a8d9e..bcd47e32d 100644
+--- a/bgpd/bgp_packet.c
++++ b/bgpd/bgp_packet.c
+@@ -2440,6 +2440,14 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
+ "%s CAPABILITY has action: %d, code: %u, length %u",
+ peer->host, action, hdr->code, hdr->length);
+
++ if (hdr->length < sizeof(struct capability_mp_data)) {
++ zlog_info(
++ "%s Capability structure is not properly filled out, expected at least %zu bytes but header length specified is %d",
++ peer->host, sizeof(struct capability_mp_data),
++ hdr->length);
++ return BGP_Stop;
++ }
++
+ /* Capability length check. */
+ if ((pnt + hdr->length + 3) > end) {
+ zlog_info("%s Capability length error", peer->host);
+--
+2.25.1
+
diff --git a/meta-networking/recipes-protocols/frr/frr_8.2.2.bb b/meta-networking/recipes-protocols/frr/frr_8.2.2.bb
index 62f548f84..658731567 100644
--- a/meta-networking/recipes-protocols/frr/frr_8.2.2.bb
+++ b/meta-networking/recipes-protocols/frr/frr_8.2.2.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \

SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/8.2 \
file://CVE-2022-37035.patch \
+ file://CVE-2022-37032.patch \
file://frr.pam \
"

--
2.25.1


[meta-networking][PATCH] frr: Security fix CVE-2022-37032

Yi Zhao
 

CVE-2022-37032:
An out-of-bounds read in the BGP daemon of FRRouting FRR before 8.4 may
lead to a segmentation fault and denial of service. This occurs in
bgp_capability_msg_parse in bgpd/bgp_packet.c.

Reference:
https://nvd.nist.gov/vuln/detail/CVE-2022-37032

Patch from:
https://github.com/FRRouting/frr/commit/066770ac1c69ee5b484bb82581b22ad0423b004d

Signed-off-by: Yi Zhao <yi.zhao@...>
---
...dr-length-is-at-a-minimum-of-what-is.patch | 43 +++++++++++++++++++
.../recipes-protocols/frr/frr_8.3.1.bb | 1 +
2 files changed, 44 insertions(+)
create mode 100644 meta-networking/recipes-protocols/frr/frr/0001-bgpd-Make-sure-hdr-length-is-at-a-minimum-of-what-is.patch

diff --git a/meta-networking/recipes-protocols/frr/frr/0001-bgpd-Make-sure-hdr-length-is-at-a-minimum-of-what-is.patch b/meta-networking/recipes-protocols/frr/frr/0001-bgpd-Make-sure-hdr-length-is-at-a-minimum-of-what-is.patch
new file mode 100644
index 000000000..52b39c1e8
--- /dev/null
+++ b/meta-networking/recipes-protocols/frr/frr/0001-bgpd-Make-sure-hdr-length-is-at-a-minimum-of-what-is.patch
@@ -0,0 +1,43 @@
+From 066770ac1c69ee5b484bb82581b22ad0423b004d Mon Sep 17 00:00:00 2001
+From: Donald Sharp <sharpd@...>
+Date: Thu, 21 Jul 2022 08:11:58 -0400
+Subject: [PATCH] bgpd: Make sure hdr length is at a minimum of what is
+ expected
+
+Ensure that if the capability length specified is enough data.
+
+Signed-off-by: Donald Sharp <sharpd@...>
+(cherry picked from commit ff6db1027f8f36df657ff2e5ea167773752537ed)
+
+CVE: CVE-2022-37032
+
+Upstream-Status: Backport
+[https://github.com/FRRouting/frr/commit/066770ac1c69ee5b484bb82581b22ad0423b004d]
+
+Signed-off-by: Yi Zhao <yi.zhao@...>
+---
+ bgpd/bgp_packet.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
+index 7613ccc7d..a5f065a15 100644
+--- a/bgpd/bgp_packet.c
++++ b/bgpd/bgp_packet.c
+@@ -2621,6 +2621,14 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
+ "%s CAPABILITY has action: %d, code: %u, length %u",
+ peer->host, action, hdr->code, hdr->length);
+
++ if (hdr->length < sizeof(struct capability_mp_data)) {
++ zlog_info(
++ "%pBP Capability structure is not properly filled out, expected at least %zu bytes but header length specified is %d",
++ peer, sizeof(struct capability_mp_data),
++ hdr->length);
++ return BGP_Stop;
++ }
++
+ /* Capability length check. */
+ if ((pnt + hdr->length + 3) > end) {
+ zlog_info("%s Capability length error", peer->host);
+--
+2.25.1
+
diff --git a/meta-networking/recipes-protocols/frr/frr_8.3.1.bb b/meta-networking/recipes-protocols/frr/frr_8.3.1.bb
index c69720e6f..1abea6345 100644
--- a/meta-networking/recipes-protocols/frr/frr_8.3.1.bb
+++ b/meta-networking/recipes-protocols/frr/frr_8.3.1.bb
@@ -13,6 +13,7 @@ SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/8.3 \
file://0001-configure-Check-for-readline-function-instead-of-mai.patch \
file://0001-ospfd-Adding-SUPPORT_OSPF_API-define-in-ospf_spf.c.patch \
file://0001-bgpd-avoid-notify-race-between-io-and-main-pthreads.patch \
+ file://0001-bgpd-Make-sure-hdr-length-is-at-a-minimum-of-what-is.patch \
file://frr.pam \
"

--
2.25.1


Re: Security Advisory - yasm - CVE-2021-33461

Khem Raj
 

On Wed, Oct 12, 2022 at 10:24 AM Polampalli, Archana
<archana.polampalli@...> wrote:

HI,

Could you please confirm is there any security fix providing for CVE-2021-33461.
seems to be open https://github.com/yasm/yasm/issues/161



Regards,
Archana



Re: [meta-oe] Add nativesdk-systemd-systemctl as dependency of dnf-plugin-tui

Khem Raj
 

On Wed, Oct 12, 2022 at 10:20 AM Jose Quaresma <quaresma.jose@...> wrote:

Hi wangmy,

wangmy <wangmy@...> escreveu no dia quarta, 12/10/2022 à(s) 05:04:

Signed-off-by: Wang Mingyu <wangmy@...>
---
.../systemd/nativesdk-systemd-systemctl.bb | 17 +
.../systemd/systemd-systemctl/systemctl | 340 ++++++++++++++++++
2 files changed, 357 insertions(+)
create mode 100644 meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
create mode 100755 meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl

diff --git a/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb b/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
new file mode 100644
index 0000000000..7ac21aa260
--- /dev/null
+++ b/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Wrapper for enabling systemd services"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r6"

Why is this recipe starting with the package release 6 ?
Right, I have fixed it before accepting.

Jose


+
+inherit nativesdk
+
+SRC_URI = "file://systemctl"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
+}
diff --git a/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl b/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl
new file mode 100755
index 0000000000..6324319a45
--- /dev/null
+++ b/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,340 @@
+#!/usr/bin/env python3
+"""systemctl: subset of systemctl used for image construction
+
+Mask/preset systemd units
+"""
+
+import argparse
+import fnmatch
+import os
+import re
+import sys
+
+from collections import namedtuple
+from pathlib import Path
+
+version = 1.0
+
+ROOT = Path("/")
+SYSCONFDIR = Path("etc")
+BASE_LIBDIR = Path("lib")
+LIBDIR = Path("usr", "lib")
+
+locations = list()
+
+
+class SystemdFile():
+ """Class representing a single systemd configuration file"""
+ def __init__(self, root, path):
+ self.sections = dict()
+ self._parse(root, path)
+ dirname = os.path.basename(path.name) + ".d"
+ for location in locations:
+ for path2 in sorted((root / location / "system" / dirname).glob("*.conf")):
+ self._parse(root, path2)
+
+ def _parse(self, root, path):
+ """Parse a systemd syntax configuration file
+
+ Args:
+ path: A pathlib.Path object pointing to the file
+
+ """
+ skip_re = re.compile(r"^\s*([#;]|$)")
+ section_re = re.compile(r"^\s*\[(?P<section>.*)\]")
+ kv_re = re.compile(r"^\s*(?P<key>[^\s]+)\s*=\s*(?P<value>.*)")
+ section = None
+
+ if path.is_symlink():
+ try:
+ path.resolve()
+ except FileNotFoundError:
+ # broken symlink, try relative to root
+ path = root / Path(os.readlink(str(path))).relative_to(ROOT)
+
+ with path.open() as f:
+ for line in f:
+ if skip_re.match(line):
+ continue
+
+ line = line.strip()
+ m = section_re.match(line)
+ if m:
+ if m.group('section') not in self.sections:
+ section = dict()
+ self.sections[m.group('section')] = section
+ else:
+ section = self.sections[m.group('section')]
+ continue
+
+ while line.endswith("\\"):
+ line += f.readline().rstrip("\n")
+
+ m = kv_re.match(line)
+ k = m.group('key')
+ v = m.group('value')
+ if k not in section:
+ section[k] = list()
+ section[k].extend(v.split())
+
+ def get(self, section, prop):
+ """Get a property from section
+
+ Args:
+ section: Section to retrieve property from
+ prop: Property to retrieve
+
+ Returns:
+ List representing all properties of type prop in section.
+
+ Raises:
+ KeyError: if ``section`` or ``prop`` not found
+ """
+ return self.sections[section][prop]
+
+
+class Presets():
+ """Class representing all systemd presets"""
+ def __init__(self, scope, root):
+ self.directives = list()
+ self._collect_presets(scope, root)
+
+ def _parse_presets(self, presets):
+ """Parse presets out of a set of preset files"""
+ skip_re = re.compile(r"^\s*([#;]|$)")
+ directive_re = re.compile(r"^\s*(?P<action>enable|disable)\s+(?P<unit_name>(.+))")
+
+ Directive = namedtuple("Directive", "action unit_name")
+ for preset in presets:
+ with preset.open() as f:
+ for line in f:
+ m = directive_re.match(line)
+ if m:
+ directive = Directive(action=m.group('action'),
+ unit_name=m.group('unit_name'))
+ self.directives.append(directive)
+ elif skip_re.match(line):
+ pass
+ else:
+ sys.exit("Unparsed preset line in {}".format(preset))
+
+ def _collect_presets(self, scope, root):
+ """Collect list of preset files"""
+ presets = dict()
+ for location in locations:
+ paths = (root / location / scope).glob("*.preset")
+ for path in paths:
+ # earlier names override later ones
+ if path.name not in presets:
+ presets[path.name] = path
+
+ self._parse_presets([v for k, v in sorted(presets.items())])
+
+ def state(self, unit_name):
+ """Return state of preset for unit_name
+
+ Args:
+ presets: set of presets
+ unit_name: name of the unit
+
+ Returns:
+ None: no matching preset
+ `enable`: unit_name is enabled
+ `disable`: unit_name is disabled
+ """
+ for directive in self.directives:
+ if fnmatch.fnmatch(unit_name, directive.unit_name):
+ return directive.action
+
+ return None
+
+
+def add_link(path, target):
+ try:
+ path.parent.mkdir(parents=True)
+ except FileExistsError:
+ pass
+ if not path.is_symlink():
+ print("ln -s {} {}".format(target, path))
+ path.symlink_to(target)
+
+
+class SystemdUnitNotFoundError(Exception):
+ def __init__(self, path, unit):
+ self.path = path
+ self.unit = unit
+
+
+class SystemdUnit():
+ def __init__(self, root, unit):
+ self.root = root
+ self.unit = unit
+ self.config = None
+
+ def _path_for_unit(self, unit):
+ for location in locations:
+ path = self.root / location / "system" / unit
+ if path.exists() or path.is_symlink():
+ return path
+
+ raise SystemdUnitNotFoundError(self.root, unit)
+
+ def _process_deps(self, config, service, location, prop, dirstem):
+ systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+
+ target = ROOT / location.relative_to(self.root)
+ try:
+ for dependent in config.get('Install', prop):
+ wants = systemdir / "{}.{}".format(dependent, dirstem) / service
+ add_link(wants, target)
+
+ except KeyError:
+ pass
+
+ def enable(self, caller_unit=None):
+ # if we're enabling an instance, first extract the actual instance
+ # then figure out what the template unit is
+ template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit)
+ if template:
+ instance = template.group('instance')
+ unit = re.sub(r"@[^\.]*\.", "@.", self.unit, 1)
+ else:
+ instance = None
+ unit = self.unit
+
+ path = self._path_for_unit(unit)
+
+ if path.is_symlink():
+ # ignore aliases
+ return
+
+ config = SystemdFile(self.root, path)
+ if instance == "":
+ try:
+ default_instance = config.get('Install', 'DefaultInstance')[0]
+ except KeyError:
+ # no default instance, so nothing to enable
+ return
+
+ service = self.unit.replace("@.",
+ "@{}.".format(default_instance))
+ else:
+ service = self.unit
+
+ self._process_deps(config, service, path, 'WantedBy', 'wants')
+ self._process_deps(config, service, path, 'RequiredBy', 'requires')
+
+ try:
+ for also in config.get('Install', 'Also'):
+ try:
+ if caller_unit != also:
+ SystemdUnit(self.root, also).enable(unit)
+ except SystemdUnitNotFoundError as e:
+ sys.exit("Error: Systemctl also enable issue with %s (%s)" % (service, e.unit))
+
+ except KeyError:
+ pass
+
+ systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+ target = ROOT / path.relative_to(self.root)
+ try:
+ for dest in config.get('Install', 'Alias'):
+ alias = systemdir / dest
+ add_link(alias, target)
+
+ except KeyError:
+ pass
+
+ def mask(self):
+ systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+ add_link(systemdir / self.unit, "/dev/null")
+
+
+def collect_services(root):
+ """Collect list of service files"""
+ services = set()
+ for location in locations:
+ paths = (root / location / "system").glob("*")
+ for path in paths:
+ if path.is_dir():
+ continue
+ services.add(path.name)
+
+ return services
+
+
+def preset_all(root):
+ presets = Presets('system-preset', root)
+ services = collect_services(root)
+
+ for service in services:
+ state = presets.state(service)
+
+ if state == "enable" or state is None:
+ try:
+ SystemdUnit(root, service).enable()
+ except SystemdUnitNotFoundError:
+ sys.exit("Error: Systemctl preset_all issue in %s" % service)
+
+ # If we populate the systemd links we also create /etc/machine-id, which
+ # allows systemd to boot with the filesystem read-only before generating
+ # a real value and then committing it back.
+ #
+ # For the stateless configuration, where /etc is generated at runtime
+ # (for example on a tmpfs), this script shouldn't run at all and we
+ # allow systemd to completely populate /etc.
+ (root / SYSCONFDIR / "machine-id").touch()
+
+
+def main():
+ if sys.version_info < (3, 4, 0):
+ sys.exit("Python 3.4 or greater is required")
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('command', nargs='?', choices=['enable', 'mask',
+ 'preset-all'])
+ parser.add_argument('service', nargs=argparse.REMAINDER)
+ parser.add_argument('--root')
+ parser.add_argument('--preset-mode',
+ choices=['full', 'enable-only', 'disable-only'],
+ default='full')
+
+ args = parser.parse_args()
+
+ root = Path(args.root) if args.root else ROOT
+
+ locations.append(SYSCONFDIR / "systemd")
+ # Handle the usrmerge case by ignoring /lib when it's a symlink
+ if not (root / BASE_LIBDIR).is_symlink():
+ locations.append(BASE_LIBDIR / "systemd")
+ locations.append(LIBDIR / "systemd")
+
+ command = args.command
+ if not command:
+ parser.print_help()
+ return 0
+
+ if command == "mask":
+ for service in args.service:
+ try:
+ SystemdUnit(root, service).mask()
+ except SystemdUnitNotFoundError as e:
+ sys.exit("Error: Systemctl main mask issue in %s (%s)" % (service, e.unit))
+ elif command == "enable":
+ for service in args.service:
+ try:
+ SystemdUnit(root, service).enable()
+ except SystemdUnitNotFoundError as e:
+ sys.exit("Error: Systemctl main enable issue in %s (%s)" % (service, e.unit))
+ elif command == "preset-all":
+ if len(args.service) != 0:
+ sys.exit("Too many arguments.")
+ if args.preset_mode != "enable-only":
+ sys.exit("Only enable-only is supported as preset-mode.")
+ preset_all(root)
+ else:
+ raise RuntimeError()
+
+
+if __name__ == '__main__':
+ main()
--
2.25.1




--
Best regards,

José Quaresma



[meta-networking][PATCH] mctp: install the .target files

Khem Raj
 

From: Hao Jiang <jianghao@...>

Need the targets file to enable the mctpd.service on systemd.

Signed-off-by: Hao Jiang <jianghao@...>
Change-Id: I8d48d3767760dc1f34ae7e1266600d350ac93281
---
meta-networking/recipes-support/mctp/mctp_git.bb | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta-networking/recipes-support/mctp/mctp_git.bb b/meta-networking/recipes-support/mctp/mctp_git.bb
index 516f3e2d9e..9e97a6a60a 100644
--- a/meta-networking/recipes-support/mctp/mctp_git.bb
+++ b/meta-networking/recipes-support/mctp/mctp_git.bb
@@ -22,13 +22,16 @@ PACKAGECONFIG ??= " \
# mctpd will only be built if pkg-config detects libsystemd; in which case
# we'll want to declare the dep and install the service.
PACKAGECONFIG[systemd] = ",,systemd,libsystemd"
-SYSTEMD_SERVICE:${PN} = "mctpd.service"
+SYSTEMD_SERVICE:${PN} = "mctpd.service mctp.target mctp-local.target"
+SYSTEMD_AUTO_ENABLE_${PN} = "enable"

do_install:append () {
if ${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'true', 'false', d)}; then
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${S}/conf/mctpd.service \
${D}${systemd_system_unitdir}/mctpd.service
+ install -m 0644 ${S}/conf/*.target \
+ ${D}${systemd_system_unitdir}/
install -d ${D}${datadir}/dbus-1/system.d
install -m 0644 ${S}/conf/mctpd-dbus.conf \
${D}${datadir}/dbus-1/system.d/mctpd.conf
--
2.38.0


Re: [meta-oe][kirkstone][PATCH] minicoredumper: retry elf parsing as long as needed

Sakib Sajal
 

Has this patch accidentally been skipped?

On 2022-09-22 16:38, Sakib Sajal wrote:
Maximum number of tries, in rare cases, is insufficient for
elf parse. Backport patch that fixes the issue.

Signed-off-by: Sakib Sajal <sakib.sajal@...>
Signed-off-by: Khem Raj <raj.khem@...>
(cherry picked from commit e231c86e282eefff0e8164551f75f8e01682abe6)
Signed-off-by: Sakib Sajal <sakib.sajal@...>
---
...-retry-elf-parsing-as-long-as-needed.patch | 128 ++++++++++++++++++
.../minicoredumper/minicoredumper_2.0.1.bb | 1 +
2 files changed, 129 insertions(+)
create mode 100644 meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-retry-elf-parsing-as-long-as-needed.patch

diff --git a/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-retry-elf-parsing-as-long-as-needed.patch b/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-retry-elf-parsing-as-long-as-needed.patch
new file mode 100644
index 000000000..8d5b8b6cb
--- /dev/null
+++ b/meta-oe/recipes-kernel/minicoredumper/files/0001-minicoredumper-retry-elf-parsing-as-long-as-needed.patch
@@ -0,0 +1,128 @@
+From 7a8c6a06c86e133e4346b1dc66483bd8d0d3c716 Mon Sep 17 00:00:00 2001
+From: John Ogness <john.ogness@...>
+Date: Tue, 24 Aug 2021 21:10:43 +0200
+Subject: [PATCH] minicoredumper: retry elf parsing as long as needed
+
+As was reported in github issue #2 ("maximum number of tries
+insufficient, in rare cases, for elf parse"), the number of retries
+for parsing a process may be insufficient. Rather than setting an
+upper limit on the maximum number of retries, track the number of
+headers seen. As long as the number of seen headers is greater than
+the previous try, try again.
+
+In order to avoid introducing any new issues, preserve the behavior
+of retrying at least 10 times, even if no new headers are seen.
+
+Reported-by: github.com/ssajal-wr
+Signed-off-by: John Ogness <john.ogness@...>
+
+Upstream-Status: Backport [7a8c6a06c86e133e4346b1dc66483bd8d0d3c716]
+
+Signed-off-by: Sakib Sajal <sakib.sajal@...>
+---
+ src/minicoredumper/corestripper.c | 30 +++++++++++++++++++++++-------
+ 1 file changed, 23 insertions(+), 7 deletions(-)
+
+diff --git a/src/minicoredumper/corestripper.c b/src/minicoredumper/corestripper.c
+index d96d1df..c96b350 100644
+--- a/src/minicoredumper/corestripper.c
++++ b/src/minicoredumper/corestripper.c
+@@ -761,7 +761,7 @@ static int init_log(struct dump_info *di)
+ typedef int elf_parse_cb(struct dump_info *di, Elf *elf, GElf_Phdr *phdr);
+
+ static int do_elf_ph_parse(struct dump_info *di, GElf_Phdr *type,
+- elf_parse_cb *callback)
++ elf_parse_cb *callback, size_t *phnum_found)
+ {
+ GElf_Ehdr ehdr_mem;
+ GElf_Ehdr *ehdr;
+@@ -770,6 +770,9 @@ static int do_elf_ph_parse(struct dump_info *di, GElf_Phdr *type,
+ size_t phnum;
+ size_t cnt;
+
++ if (phnum_found)
++ *phnum_found = 0;
++
+ /* start from beginning of core */
+ if (lseek64(di->elf_fd, 0, SEEK_SET) == -1) {
+ info("lseek failed: %s", strerror(errno));
+@@ -809,6 +812,9 @@ static int do_elf_ph_parse(struct dump_info *di, GElf_Phdr *type,
+ goto out;
+ }
+
++ if (phnum_found)
++ *phnum_found = phnum;
++
+ for (cnt = 0; cnt < phnum; cnt++) {
+ GElf_Phdr phdr_mem;
+ GElf_Phdr *phdr;
+@@ -891,7 +897,7 @@ static int vma_cb(struct dump_info *di, Elf *elf, GElf_Phdr *phdr)
+ /*
+ * Tries to parse the found ELF headers and reads all vmas from it.
+ */
+-static int parse_vma_info(struct dump_info *di)
++static int parse_vma_info(struct dump_info *di, size_t *phnum_found)
+ {
+ unsigned long min_off = ULONG_MAX;
+ unsigned long max_len = 0;
+@@ -911,7 +917,7 @@ static int parse_vma_info(struct dump_info *di)
+ memset(&type, 0, sizeof(type));
+ type.p_type = PT_LOAD;
+ type.p_flags = PF_R;
+- if (do_elf_ph_parse(di, &type, vma_cb) != 0)
++ if (do_elf_ph_parse(di, &type, vma_cb, phnum_found) != 0)
+ return -1;
+
+ for (v = di->vma; v; v = v->next) {
+@@ -1614,8 +1620,10 @@ int add_core_data(struct dump_info *di, off64_t dest_offset, size_t len,
+ */
+ static int init_src_core(struct dump_info *di, int src)
+ {
++ size_t last_phnum = 0;
+ int tries = 0;
+ int ret = -1;
++ size_t phnum;
+ size_t len;
+ char *buf;
+ long pos;
+@@ -1642,7 +1650,7 @@ again:
+ goto out;
+
+ /* try to elf-parse the core to read vma info */
+- ret = parse_vma_info(di);
++ ret = parse_vma_info(di, &phnum);
+
+ /* restore our position */
+ if (lseek64(di->elf_fd, pos, SEEK_SET) == -1)
+@@ -1653,9 +1661,17 @@ again:
+
+ tries++;
+
+- /* maybe try again */
+- if (tries < 10)
++ if (phnum > last_phnum) {
++ /* new headers found, keep trying */
++ last_phnum = phnum;
+ goto again;
++ } else if (tries < 10) {
++ /*
++ * even if no new headers are found,
++ * retry at least 10 times
++ */
++ goto again;
++ }
+
+ goto out;
+ }
+@@ -2106,7 +2122,7 @@ static int dump_stacks(struct dump_info *di)
+ /* find and set the first task */
+ memset(&type, 0, sizeof(type));
+ type.p_type = PT_NOTE;
+- do_elf_ph_parse(di, &type, note_cb);
++ do_elf_ph_parse(di, &type, note_cb, NULL);
+ }
+
+ if (di->first_pid)
+--
+2.25.1
+
diff --git a/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.1.bb b/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.1.bb
index bf9915294..0b934ee2d 100644
--- a/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.1.bb
+++ b/meta-oe/recipes-kernel/minicoredumper/minicoredumper_2.0.1.bb
@@ -17,6 +17,7 @@ SRC_URI = "git://github.com/diamon/minicoredumper;protocol=https;branch=master \
file://0001-replace-pthread_mutexattr_setrobust_np-with-pthread_.patch \
file://minicoredumper.service \
file://minicoredumper.init \
+ file://0001-minicoredumper-retry-elf-parsing-as-long-as-needed.patch \
"
S = "${WORKDIR}/git"


Re: [meta-oe][kirkstone][PATCH] audit: Install audit.h from audit package.

Denys Dmytriyenko
 

On Sun, Sep 25, 2022 at 10:59:57AM -0400, Armin Kuster wrote:


On 9/22/22 23:38, Jeremy Puhlman wrote:
Yup.
thanks for the feedback.

commit has been backported.
I see this in kirkstone-next - any ETA when it will merge to kirkstone branch?
Thanks!


-armin
On 9/22/2022 8:25 PM, Khem Raj wrote:
does this backport fix it for you

https://patchwork.yoctoproject.org/project/oe/patch/20220921081916.17313-1-mikko.rapeli@linaro.org/


On Thu, Sep 22, 2022 at 10:13 PM Jeremy Puhlman
<jpuhlman@...> wrote:
Source: MontaVista Software, LLC
MR: 121884
Type: Defect Fix
Disposition: Submitted to meta-oe
ChangeID: 2708329947da5ec2f96a8478771f56cfce95f616
Description:

The last upgrade to audit, changed libaudit.h to use "audit.h", which
makes the build work for this package, but breaks any other package
trying to use libaudit.h, like libsemanage.

build/tmp/work/aarch64-montavista-linux/libsemanage/3.3-r0/recipe-sysroot/usr/include/libaudit.h:30:10:
fatal error: audit.h: No such file or directory
    30 | #include "audit.h"
       |          ^~~~~~~~~
compilation terminated.

Install audit.h so other applications can use it.

Signed-off-by: Jeremy A. Puhlman <jpuhlman@...>
---
  meta-oe/recipes-security/audit/audit_3.0.8.bb | 1 +
  1 file changed, 1 insertion(+)

diff --git a/meta-oe/recipes-security/audit/audit_3.0.8.bb
b/meta-oe/recipes-security/audit/audit_3.0.8.bb
index 3dbfc9e60..6195b6749 100644
--- a/meta-oe/recipes-security/audit/audit_3.0.8.bb
+++ b/meta-oe/recipes-security/audit/audit_3.0.8.bb
@@ -110,4 +110,5 @@ do_install:append() {

         # Create /var/spool/audit directory for audisp-remote
         install -m 0700 -d ${D}${localstatedir}/spool/audit
+       install -m 644 ${S}/lib/audit.h ${D}${includedir}/audit.h
  }
--
2.35.4


Security Advisory - yasm - CVE-2021-33461

Polampalli, Archana
 

HI,

Could you please confirm is there any security fix providing for CVE-2021-33461.


Regards,
Archana


Re: [meta-oe] Add nativesdk-systemd-systemctl as dependency of dnf-plugin-tui

Jose Quaresma
 

Hi wangmy,

wangmy <wangmy@...> escreveu no dia quarta, 12/10/2022 à(s) 05:04:
Signed-off-by: Wang Mingyu <wangmy@...>
---
 .../systemd/nativesdk-systemd-systemctl.bb    |  17 +
 .../systemd/systemd-systemctl/systemctl       | 340 ++++++++++++++++++
 2 files changed, 357 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
 create mode 100755 meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl

diff --git a/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb b/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
new file mode 100644
index 0000000000..7ac21aa260
--- /dev/null
+++ b/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Wrapper for enabling systemd services"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r6"

Why is this recipe starting with the package release 6 ?

Jose
 
+
+inherit nativesdk
+
+SRC_URI = "file://systemctl"
+
+S = "${WORKDIR}"
+
+do_install() {
+       install -d ${D}${bindir}
+       install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
+}
diff --git a/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl b/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl
new file mode 100755
index 0000000000..6324319a45
--- /dev/null
+++ b/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,340 @@
+#!/usr/bin/env python3
+"""systemctl: subset of systemctl used for image construction
+
+Mask/preset systemd units
+"""
+
+import argparse
+import fnmatch
+import os
+import re
+import sys
+
+from collections import namedtuple
+from pathlib import Path
+
+version = 1.0
+
+ROOT = Path("/")
+SYSCONFDIR = Path("etc")
+BASE_LIBDIR = Path("lib")
+LIBDIR = Path("usr", "lib")
+
+locations = list()
+
+
+class SystemdFile():
+    """Class representing a single systemd configuration file"""
+    def __init__(self, root, path):
+        self.sections = dict()
+        self._parse(root, path)
+        dirname = os.path.basename(path.name) + ".d"
+        for location in locations:
+            for path2 in sorted((root / location / "system" / dirname).glob("*.conf")):               
+                self._parse(root, path2)
+
+    def _parse(self, root, path):
+        """Parse a systemd syntax configuration file
+
+        Args:
+            path: A pathlib.Path object pointing to the file
+
+        """
+        skip_re = re.compile(r"^\s*([#;]|$)")
+        section_re = re.compile(r"^\s*\[(?P<section>.*)\]")
+        kv_re = re.compile(r"^\s*(?P<key>[^\s]+)\s*=\s*(?P<value>.*)")
+        section = None
+
+        if path.is_symlink():
+            try:
+                path.resolve()
+            except FileNotFoundError:
+                # broken symlink, try relative to root
+                path = root / Path(os.readlink(str(path))).relative_to(ROOT)
+
+        with path.open() as f:
+            for line in f:
+                if skip_re.match(line):
+                    continue
+
+                line = line.strip()
+                m = section_re.match(line)
+                if m:
+                    if m.group('section') not in self.sections:
+                        section = dict()
+                        self.sections[m.group('section')] = section
+                    else:
+                        section = self.sections[m.group('section')]
+                    continue
+
+                while line.endswith("\\"):
+                    line += f.readline().rstrip("\n")
+
+                m = kv_re.match(line)
+                k = m.group('key')
+                v = m.group('value')
+                if k not in section:
+                    section[k] = list()
+                section[k].extend(v.split())
+
+    def get(self, section, prop):
+        """Get a property from section
+
+        Args:
+            section: Section to retrieve property from
+            prop: Property to retrieve
+
+        Returns:
+            List representing all properties of type prop in section.
+
+        Raises:
+            KeyError: if ``section`` or ``prop`` not found
+        """
+        return self.sections[section][prop]
+
+
+class Presets():
+    """Class representing all systemd presets"""
+    def __init__(self, scope, root):
+        self.directives = list()
+        self._collect_presets(scope, root)
+
+    def _parse_presets(self, presets):
+        """Parse presets out of a set of preset files"""
+        skip_re = re.compile(r"^\s*([#;]|$)")
+        directive_re = re.compile(r"^\s*(?P<action>enable|disable)\s+(?P<unit_name>(.+))")
+
+        Directive = namedtuple("Directive", "action unit_name")
+        for preset in presets:
+            with preset.open() as f:
+                for line in f:
+                    m = directive_re.match(line)
+                    if m:
+                        directive = Directive(action=m.group('action'),
+                                              unit_name=m.group('unit_name'))
+                        self.directives.append(directive)
+                    elif skip_re.match(line):
+                        pass
+                    else:
+                        sys.exit("Unparsed preset line in {}".format(preset))
+
+    def _collect_presets(self, scope, root):
+        """Collect list of preset files"""
+        presets = dict()
+        for location in locations:
+            paths = (root / location / scope).glob("*.preset")
+            for path in paths:
+                # earlier names override later ones
+                if path.name not in presets:
+                    presets[path.name] = path
+
+        self._parse_presets([v for k, v in sorted(presets.items())])
+
+    def state(self, unit_name):
+        """Return state of preset for unit_name
+
+        Args:
+            presets: set of presets
+            unit_name: name of the unit
+
+        Returns:
+            None: no matching preset
+            `enable`: unit_name is enabled
+            `disable`: unit_name is disabled
+        """
+        for directive in self.directives:
+            if fnmatch.fnmatch(unit_name, directive.unit_name):
+                return directive.action
+
+        return None
+
+
+def add_link(path, target):
+    try:
+        path.parent.mkdir(parents=True)
+    except FileExistsError:
+        pass
+    if not path.is_symlink():
+        print("ln -s {} {}".format(target, path))
+        path.symlink_to(target)
+
+
+class SystemdUnitNotFoundError(Exception):
+    def __init__(self, path, unit):
+        self.path = path
+        self.unit = unit
+
+
+class SystemdUnit():
+    def __init__(self, root, unit):
+        self.root = root
+        self.unit = unit
+        self.config = None
+
+    def _path_for_unit(self, unit):
+        for location in locations:
+            path = self.root / location / "system" / unit
+            if path.exists() or path.is_symlink():
+                return path
+
+        raise SystemdUnitNotFoundError(self.root, unit)
+
+    def _process_deps(self, config, service, location, prop, dirstem):
+        systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+
+        target = ROOT / location.relative_to(self.root)
+        try:
+            for dependent in config.get('Install', prop):
+                wants = systemdir / "{}.{}".format(dependent, dirstem) / service
+                add_link(wants, target)
+
+        except KeyError:
+            pass
+
+    def enable(self, caller_unit=None):
+        # if we're enabling an instance, first extract the actual instance
+        # then figure out what the template unit is
+        template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit)
+        if template:
+            instance = template.group('instance')
+            unit = re.sub(r"@[^\.]*\.", "@.", self.unit, 1)
+        else:
+            instance = None
+            unit = self.unit
+
+        path = self._path_for_unit(unit)
+
+        if path.is_symlink():
+            # ignore aliases
+            return
+
+        config = SystemdFile(self.root, path)
+        if instance == "":
+            try:
+                default_instance = config.get('Install', 'DefaultInstance')[0]
+            except KeyError:
+                # no default instance, so nothing to enable
+                return
+
+            service = self.unit.replace("@.",
+                                        "@{}.".format(default_instance))
+        else:
+            service = self.unit
+
+        self._process_deps(config, service, path, 'WantedBy', 'wants')
+        self._process_deps(config, service, path, 'RequiredBy', 'requires')
+
+        try:
+            for also in config.get('Install', 'Also'):
+                try:
+                    if caller_unit != also:
+                        SystemdUnit(self.root, also).enable(unit)
+                except SystemdUnitNotFoundError as e:
+                    sys.exit("Error: Systemctl also enable issue with  %s (%s)" % (service, e.unit))
+
+        except KeyError:
+            pass
+
+        systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+        target = ROOT / path.relative_to(self.root)
+        try:
+            for dest in config.get('Install', 'Alias'):
+                alias = systemdir / dest
+                add_link(alias, target)
+
+        except KeyError:
+            pass
+
+    def mask(self):
+        systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+        add_link(systemdir / self.unit, "/dev/null")
+
+
+def collect_services(root):
+    """Collect list of service files"""
+    services = set()
+    for location in locations:
+        paths = (root / location / "system").glob("*")
+        for path in paths:
+            if path.is_dir():
+                continue
+            services.add(path.name)
+
+    return services
+
+
+def preset_all(root):
+    presets = Presets('system-preset', root)
+    services = collect_services(root)
+
+    for service in services:
+        state = presets.state(service)
+
+        if state == "enable" or state is None:
+            try:
+                SystemdUnit(root, service).enable()
+            except SystemdUnitNotFoundError:
+                sys.exit("Error: Systemctl preset_all issue in %s" % service)
+
+    # If we populate the systemd links we also create /etc/machine-id, which
+    # allows systemd to boot with the filesystem read-only before generating
+    # a real value and then committing it back.
+    #
+    # For the stateless configuration, where /etc is generated at runtime
+    # (for example on a tmpfs), this script shouldn't run at all and we
+    # allow systemd to completely populate /etc.
+    (root / SYSCONFDIR / "machine-id").touch()
+
+
+def main():
+    if sys.version_info < (3, 4, 0):
+        sys.exit("Python 3.4 or greater is required")
+
+    parser = argparse.ArgumentParser()
+    parser.add_argument('command', nargs='?', choices=['enable', 'mask',
+                                                     'preset-all'])
+    parser.add_argument('service', nargs=argparse.REMAINDER)
+    parser.add_argument('--root')
+    parser.add_argument('--preset-mode',
+                        choices=['full', 'enable-only', 'disable-only'],
+                        default='full')
+
+    args = parser.parse_args()
+
+    root = Path(args.root) if args.root else ROOT
+
+    locations.append(SYSCONFDIR / "systemd")
+    # Handle the usrmerge case by ignoring /lib when it's a symlink
+    if not (root / BASE_LIBDIR).is_symlink():
+        locations.append(BASE_LIBDIR / "systemd")
+    locations.append(LIBDIR / "systemd")
+
+    command = args.command
+    if not command:
+        parser.print_help()
+        return 0
+
+    if command == "mask":
+        for service in args.service:
+            try:
+                SystemdUnit(root, service).mask()
+            except SystemdUnitNotFoundError as e:
+                sys.exit("Error: Systemctl main mask issue in %s (%s)" % (service, e.unit))
+    elif command == "enable":
+        for service in args.service:
+            try:
+                SystemdUnit(root, service).enable()
+            except SystemdUnitNotFoundError as e:
+                sys.exit("Error: Systemctl main enable issue in %s (%s)" % (service, e.unit))
+    elif command == "preset-all":
+        if len(args.service) != 0:
+            sys.exit("Too many arguments.")
+        if args.preset_mode != "enable-only":
+            sys.exit("Only enable-only is supported as preset-mode.")
+        preset_all(root)
+    else:
+        raise RuntimeError()
+
+
+if __name__ == '__main__':
+    main()
--
2.25.1






--
Best regards,

José Quaresma


[meta-python][PATCH 2/2] python3-xmltodict: Upgrade 0.12.0 -> 0.13.0

Leon Anavi
 

Upgrade to release 0.13.0:

- Add install info to readme for openSUSE
- Support defaultdict for namespace mapping
- parse(generator) is now possible
- Processing comments on parsing from xml to dict
- Add expand_iter kw to unparse to expand iterables
- Add support for python3.8
- Drop Jython/Python 2 and add Python 3.9/3.10
- Do not use len() to determine if a sequence is empty
- Add more namespace attribute tests
- Fix encoding issue in setup.py

Signed-off-by: Leon Anavi <leon.anavi@...>
---
...3-xmltodict_0.12.0.bb => python3-xmltodict_0.13.0.bb} | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
rename meta-python/recipes-devtools/python/{python3-xmltodict_0.12.0.bb => python3-xmltodict_0.13.0.bb} (74%)

diff --git a/meta-python/recipes-devtools/python/python3-xmltodict_0.12.0.bb b/meta-python/recipes-devtools/python/python3-xmltodict_0.13.0.bb
similarity index 74%
rename from meta-python/recipes-devtools/python/python3-xmltodict_0.12.0.bb
rename to meta-python/recipes-devtools/python/python3-xmltodict_0.13.0.bb
index 1d871b2d3..aadf8b7f4 100644
--- a/meta-python/recipes-devtools/python/python3-xmltodict_0.12.0.bb
+++ b/meta-python/recipes-devtools/python/python3-xmltodict_0.13.0.bb
@@ -4,8 +4,7 @@ HOMEPAGE = "https://github.com/martinblech/xmltodict"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=01441d50dc74476db58a41ac10cb9fa2"

-SRC_URI[md5sum] = "ddb2bd078cef4f7e3021a578034ad941"
-SRC_URI[sha256sum] = "50d8c638ed7ecb88d90561beedbf720c9b4e851a9fa6c47ebd64e99d166d8a21"
+SRC_URI[sha256sum] = "341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56"

PYPI_PACKAGE = "xmltodict"

@@ -15,6 +14,12 @@ SRC_URI += " \
file://run-ptest \
"

+RDEPENDS:${PN} += " \
+ ${PYTHON_PN}-core \
+ ${PYTHON_PN}-xml \
+ ${PYTHON_PN}-io \
+"
+
RDEPENDS:${PN}-ptest += " \
${PYTHON_PN}-pytest \
"
--
2.30.2


[meta-python][PATCH 1/2] python3-greenlet: Upgrade 1.1.3 -> 1.1.3.post0

Leon Anavi
 

Upgrade to release 1.1.3.post0:

- Add musllinux (Alpine) binary wheels.

Signed-off-by: Leon Anavi <leon.anavi@...>
---
...ython3-greenlet_1.1.3.bb => python3-greenlet_1.1.3.post0.bb} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
rename meta-python/recipes-devtools/python/{python3-greenlet_1.1.3.bb => python3-greenlet_1.1.3.post0.bb} (78%)

diff --git a/meta-python/recipes-devtools/python/python3-greenlet_1.1.3.bb b/meta-python/recipes-devtools/python/python3-greenlet_1.1.3.post0.bb
similarity index 78%
rename from meta-python/recipes-devtools/python/python3-greenlet_1.1.3.bb
rename to meta-python/recipes-devtools/python/python3-greenlet_1.1.3.post0.bb
index 5175212a7..342227c3f 100644
--- a/meta-python/recipes-devtools/python/python3-greenlet_1.1.3.bb
+++ b/meta-python/recipes-devtools/python/python3-greenlet_1.1.3.post0.bb
@@ -4,6 +4,6 @@ LICENSE = "MIT & PSF-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e95668d68e4329085c7ab3535e6a7aee \
file://LICENSE.PSF;md5=c106931d9429eda0492617f037b8f69a"

-SRC_URI[sha256sum] = "bcb6c6dd1d6be6d38d6db283747d07fda089ff8c559a835236560a4410340455"
+SRC_URI[sha256sum] = "f5e09dc5c6e1796969fd4b775ea1417d70e49a5df29aaa8e5d10675d9e11872c"

inherit pypi setuptools3
--
2.30.2


[meta-oe] [PATCH] dnf-plugin-tui: Add nativesdk

wangmy
 

Signed-off-by: Wang Mingyu <wangmy@...>
---
meta-oe/recipes-devtools/dnf-plugin-tui/dnf-plugin-tui_git.bb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta-oe/recipes-devtools/dnf-plugin-tui/dnf-plugin-tui_git.bb b/meta-oe/recipes-devtools/dnf-plugin-tui/dnf-plugin-tui_git.bb
index f170b9f824..9f961882af 100644
--- a/meta-oe/recipes-devtools/dnf-plugin-tui/dnf-plugin-tui_git.bb
+++ b/meta-oe/recipes-devtools/dnf-plugin-tui/dnf-plugin-tui_git.bb
@@ -4,7 +4,7 @@ LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

SRC_URI = "git://github.com/ubinux/dnf-plugin-tui.git;branch=master;protocol=https"
-SRCREV = "bac88927b253cdcfe0d06ac7dc5afb876cd2d996"
+SRCREV = "b0d80b7129f1d84cc563a4098d869e7420bcf4bc"
PV = "1.3"

SRC_URI:append:class-target = " file://oe-remote.repo.sample"
@@ -42,6 +42,6 @@ RDEPENDS:${PN} += " \
dnf \
libnewt-python \
"
-
+DEPENDS:append:class-nativesdk = " file-replacement-nativesdk"
BBCLASSEXTEND = "nativesdk"
SKIP_RECIPE[dnf-plugin-tui] ?= "${@bb.utils.contains('PACKAGE_CLASSES', 'package_rpm', '', 'does not build correctly without package_rpm in PACKAGE_CLASSES', d)}"
--
2.25.1


[meta-oe] Add nativesdk-systemd-systemctl as dependency of dnf-plugin-tui

wangmy
 

Signed-off-by: Wang Mingyu <wangmy@...>
---
.../systemd/nativesdk-systemd-systemctl.bb | 17 +
.../systemd/systemd-systemctl/systemctl | 340 ++++++++++++++++++
2 files changed, 357 insertions(+)
create mode 100644 meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
create mode 100755 meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl

diff --git a/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb b/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
new file mode 100644
index 0000000000..7ac21aa260
--- /dev/null
+++ b/meta-oe/recipes-devtools/systemd/nativesdk-systemd-systemctl.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Wrapper for enabling systemd services"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r6"
+
+inherit nativesdk
+
+SRC_URI = "file://systemctl"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
+}
diff --git a/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl b/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl
new file mode 100755
index 0000000000..6324319a45
--- /dev/null
+++ b/meta-oe/recipes-devtools/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,340 @@
+#!/usr/bin/env python3
+"""systemctl: subset of systemctl used for image construction
+
+Mask/preset systemd units
+"""
+
+import argparse
+import fnmatch
+import os
+import re
+import sys
+
+from collections import namedtuple
+from pathlib import Path
+
+version = 1.0
+
+ROOT = Path("/")
+SYSCONFDIR = Path("etc")
+BASE_LIBDIR = Path("lib")
+LIBDIR = Path("usr", "lib")
+
+locations = list()
+
+
+class SystemdFile():
+ """Class representing a single systemd configuration file"""
+ def __init__(self, root, path):
+ self.sections = dict()
+ self._parse(root, path)
+ dirname = os.path.basename(path.name) + ".d"
+ for location in locations:
+ for path2 in sorted((root / location / "system" / dirname).glob("*.conf")):
+ self._parse(root, path2)
+
+ def _parse(self, root, path):
+ """Parse a systemd syntax configuration file
+
+ Args:
+ path: A pathlib.Path object pointing to the file
+
+ """
+ skip_re = re.compile(r"^\s*([#;]|$)")
+ section_re = re.compile(r"^\s*\[(?P<section>.*)\]")
+ kv_re = re.compile(r"^\s*(?P<key>[^\s]+)\s*=\s*(?P<value>.*)")
+ section = None
+
+ if path.is_symlink():
+ try:
+ path.resolve()
+ except FileNotFoundError:
+ # broken symlink, try relative to root
+ path = root / Path(os.readlink(str(path))).relative_to(ROOT)
+
+ with path.open() as f:
+ for line in f:
+ if skip_re.match(line):
+ continue
+
+ line = line.strip()
+ m = section_re.match(line)
+ if m:
+ if m.group('section') not in self.sections:
+ section = dict()
+ self.sections[m.group('section')] = section
+ else:
+ section = self.sections[m.group('section')]
+ continue
+
+ while line.endswith("\\"):
+ line += f.readline().rstrip("\n")
+
+ m = kv_re.match(line)
+ k = m.group('key')
+ v = m.group('value')
+ if k not in section:
+ section[k] = list()
+ section[k].extend(v.split())
+
+ def get(self, section, prop):
+ """Get a property from section
+
+ Args:
+ section: Section to retrieve property from
+ prop: Property to retrieve
+
+ Returns:
+ List representing all properties of type prop in section.
+
+ Raises:
+ KeyError: if ``section`` or ``prop`` not found
+ """
+ return self.sections[section][prop]
+
+
+class Presets():
+ """Class representing all systemd presets"""
+ def __init__(self, scope, root):
+ self.directives = list()
+ self._collect_presets(scope, root)
+
+ def _parse_presets(self, presets):
+ """Parse presets out of a set of preset files"""
+ skip_re = re.compile(r"^\s*([#;]|$)")
+ directive_re = re.compile(r"^\s*(?P<action>enable|disable)\s+(?P<unit_name>(.+))")
+
+ Directive = namedtuple("Directive", "action unit_name")
+ for preset in presets:
+ with preset.open() as f:
+ for line in f:
+ m = directive_re.match(line)
+ if m:
+ directive = Directive(action=m.group('action'),
+ unit_name=m.group('unit_name'))
+ self.directives.append(directive)
+ elif skip_re.match(line):
+ pass
+ else:
+ sys.exit("Unparsed preset line in {}".format(preset))
+
+ def _collect_presets(self, scope, root):
+ """Collect list of preset files"""
+ presets = dict()
+ for location in locations:
+ paths = (root / location / scope).glob("*.preset")
+ for path in paths:
+ # earlier names override later ones
+ if path.name not in presets:
+ presets[path.name] = path
+
+ self._parse_presets([v for k, v in sorted(presets.items())])
+
+ def state(self, unit_name):
+ """Return state of preset for unit_name
+
+ Args:
+ presets: set of presets
+ unit_name: name of the unit
+
+ Returns:
+ None: no matching preset
+ `enable`: unit_name is enabled
+ `disable`: unit_name is disabled
+ """
+ for directive in self.directives:
+ if fnmatch.fnmatch(unit_name, directive.unit_name):
+ return directive.action
+
+ return None
+
+
+def add_link(path, target):
+ try:
+ path.parent.mkdir(parents=True)
+ except FileExistsError:
+ pass
+ if not path.is_symlink():
+ print("ln -s {} {}".format(target, path))
+ path.symlink_to(target)
+
+
+class SystemdUnitNotFoundError(Exception):
+ def __init__(self, path, unit):
+ self.path = path
+ self.unit = unit
+
+
+class SystemdUnit():
+ def __init__(self, root, unit):
+ self.root = root
+ self.unit = unit
+ self.config = None
+
+ def _path_for_unit(self, unit):
+ for location in locations:
+ path = self.root / location / "system" / unit
+ if path.exists() or path.is_symlink():
+ return path
+
+ raise SystemdUnitNotFoundError(self.root, unit)
+
+ def _process_deps(self, config, service, location, prop, dirstem):
+ systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+
+ target = ROOT / location.relative_to(self.root)
+ try:
+ for dependent in config.get('Install', prop):
+ wants = systemdir / "{}.{}".format(dependent, dirstem) / service
+ add_link(wants, target)
+
+ except KeyError:
+ pass
+
+ def enable(self, caller_unit=None):
+ # if we're enabling an instance, first extract the actual instance
+ # then figure out what the template unit is
+ template = re.match(r"[^@]+@(?P<instance>[^\.]*)\.", self.unit)
+ if template:
+ instance = template.group('instance')
+ unit = re.sub(r"@[^\.]*\.", "@.", self.unit, 1)
+ else:
+ instance = None
+ unit = self.unit
+
+ path = self._path_for_unit(unit)
+
+ if path.is_symlink():
+ # ignore aliases
+ return
+
+ config = SystemdFile(self.root, path)
+ if instance == "":
+ try:
+ default_instance = config.get('Install', 'DefaultInstance')[0]
+ except KeyError:
+ # no default instance, so nothing to enable
+ return
+
+ service = self.unit.replace("@.",
+ "@{}.".format(default_instance))
+ else:
+ service = self.unit
+
+ self._process_deps(config, service, path, 'WantedBy', 'wants')
+ self._process_deps(config, service, path, 'RequiredBy', 'requires')
+
+ try:
+ for also in config.get('Install', 'Also'):
+ try:
+ if caller_unit != also:
+ SystemdUnit(self.root, also).enable(unit)
+ except SystemdUnitNotFoundError as e:
+ sys.exit("Error: Systemctl also enable issue with %s (%s)" % (service, e.unit))
+
+ except KeyError:
+ pass
+
+ systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+ target = ROOT / path.relative_to(self.root)
+ try:
+ for dest in config.get('Install', 'Alias'):
+ alias = systemdir / dest
+ add_link(alias, target)
+
+ except KeyError:
+ pass
+
+ def mask(self):
+ systemdir = self.root / SYSCONFDIR / "systemd" / "system"
+ add_link(systemdir / self.unit, "/dev/null")
+
+
+def collect_services(root):
+ """Collect list of service files"""
+ services = set()
+ for location in locations:
+ paths = (root / location / "system").glob("*")
+ for path in paths:
+ if path.is_dir():
+ continue
+ services.add(path.name)
+
+ return services
+
+
+def preset_all(root):
+ presets = Presets('system-preset', root)
+ services = collect_services(root)
+
+ for service in services:
+ state = presets.state(service)
+
+ if state == "enable" or state is None:
+ try:
+ SystemdUnit(root, service).enable()
+ except SystemdUnitNotFoundError:
+ sys.exit("Error: Systemctl preset_all issue in %s" % service)
+
+ # If we populate the systemd links we also create /etc/machine-id, which
+ # allows systemd to boot with the filesystem read-only before generating
+ # a real value and then committing it back.
+ #
+ # For the stateless configuration, where /etc is generated at runtime
+ # (for example on a tmpfs), this script shouldn't run at all and we
+ # allow systemd to completely populate /etc.
+ (root / SYSCONFDIR / "machine-id").touch()
+
+
+def main():
+ if sys.version_info < (3, 4, 0):
+ sys.exit("Python 3.4 or greater is required")
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('command', nargs='?', choices=['enable', 'mask',
+ 'preset-all'])
+ parser.add_argument('service', nargs=argparse.REMAINDER)
+ parser.add_argument('--root')
+ parser.add_argument('--preset-mode',
+ choices=['full', 'enable-only', 'disable-only'],
+ default='full')
+
+ args = parser.parse_args()
+
+ root = Path(args.root) if args.root else ROOT
+
+ locations.append(SYSCONFDIR / "systemd")
+ # Handle the usrmerge case by ignoring /lib when it's a symlink
+ if not (root / BASE_LIBDIR).is_symlink():
+ locations.append(BASE_LIBDIR / "systemd")
+ locations.append(LIBDIR / "systemd")
+
+ command = args.command
+ if not command:
+ parser.print_help()
+ return 0
+
+ if command == "mask":
+ for service in args.service:
+ try:
+ SystemdUnit(root, service).mask()
+ except SystemdUnitNotFoundError as e:
+ sys.exit("Error: Systemctl main mask issue in %s (%s)" % (service, e.unit))
+ elif command == "enable":
+ for service in args.service:
+ try:
+ SystemdUnit(root, service).enable()
+ except SystemdUnitNotFoundError as e:
+ sys.exit("Error: Systemctl main enable issue in %s (%s)" % (service, e.unit))
+ elif command == "preset-all":
+ if len(args.service) != 0:
+ sys.exit("Too many arguments.")
+ if args.preset_mode != "enable-only":
+ sys.exit("Only enable-only is supported as preset-mode.")
+ preset_all(root)
+ else:
+ raise RuntimeError()
+
+
+if __name__ == '__main__':
+ main()
--
2.25.1


[meta-python][PATCH v2] python3-gevent: Upgrade to 22.8.0

Khem Raj
 

This has the python 3.11 fix in it so drop the patch
Add a patch to avoid adding native include paths to compiler cmdline

Signed-off-by: Khem Raj <raj.khem@...>
Cc: Alexander Kanavin <alex@...>
---
v2: Fix native path inclusion issue

...setuputils.py-Do-not-add-sys_inc_dir.patch | 40 +++++
.../python/python3-gevent/py-3.11.patch | 170 ------------------
...nt_21.12.0.bb => python3-gevent_22.8.0.bb} | 6 +-
3 files changed, 43 insertions(+), 173 deletions(-)
create mode 100644 meta-python/recipes-devtools/python/python3-gevent/0001-_setuputils.py-Do-not-add-sys_inc_dir.patch
delete mode 100644 meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch
rename meta-python/recipes-devtools/python/{python3-gevent_21.12.0.bb => python3-gevent_22.8.0.bb} (87%)

diff --git a/meta-python/recipes-devtools/python/python3-gevent/0001-_setuputils.py-Do-not-add-sys_inc_dir.patch b/meta-python/recipes-devtools/python/python3-gevent/0001-_setuputils.py-Do-not-add-sys_inc_dir.patch
new file mode 100644
index 0000000000..ac8b031cf5
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-gevent/0001-_setuputils.py-Do-not-add-sys_inc_dir.patch
@@ -0,0 +1,40 @@
+From f3267ad7994a4b66e6bcf72cb0e418105f77bd52 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@...>
+Date: Tue, 11 Oct 2022 17:37:01 -0700
+Subject: [PATCH] _setuputils.py: Do not add sys_inc_dir
+
+sys_inc_dir computes to ignore sysroot and ends with paths into host
+system include area, which is then flagged by OE gcc since it finds
+the host include path poisoning. Since we are adding the syroot anyway
+we really do not need setuptools to deduce it for us.
+
+Upstream-Status: Inappropriate [ Cross-compile specific ]
+Signed-off-by: Khem Raj <raj.khem@...>
+---
+ _setuputils.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/_setuputils.py b/_setuputils.py
+index d98f716..31134a4 100644
+--- a/_setuputils.py
++++ b/_setuputils.py
+@@ -161,7 +161,6 @@ def get_include_dirs(*extra_paths):
+ # Neither sysconfig dir is not enough if we're in a virtualenv; the greenlet.h
+ # header goes into a site/ subdir. See https://github.com/pypa/pip/issues/4610
+ dist_inc_dir = os.path.abspath(dist_sysconfig.get_python_inc()) # 1
+- sys_inc_dir = os.path.abspath(sysconfig.get_path("include")) # 2
+ venv_include_dir = os.path.join(
+ sys.prefix, 'include', 'site',
+ 'python' + sysconfig.get_python_version()
+@@ -175,7 +174,7 @@ def get_include_dirs(*extra_paths):
+
+ return [
+ p
+- for p in (dist_inc_dir, sys_inc_dir, dep_inc_dir) + extra_paths
++ for p in (dist_inc_dir, dep_inc_dir) + extra_paths
+ if os.path.exists(p)
+ ]
+
+--
+2.38.0
+
diff --git a/meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch b/meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch
deleted file mode 100644
index 6750c1a3cf..0000000000
--- a/meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch
+++ /dev/null
@@ -1,170 +0,0 @@
-From 90e9169c915a640739880b55ed95f88ce21fa7b0 Mon Sep 17 00:00:00 2001
-From: Victor Stinner <vstinner@...>
-Date: Tue, 1 Mar 2022 22:28:40 +0100
-Subject: [PATCH] Add Python 3.11 alpha 6 support
-
-* On Python 3.11a6 and newer, get the PyFrameObject structure from
- the internal C API ("internal/pycore_frame.h").
-* On Python 3.9 and newer, use PyFrame_GetBack() and
- PyFrame_GetCode().
-* Add frame getter and setter functions to greenlet:
-
- * get_f_code(frame)
- * set_f_lineno(frame, lineno)
- * set_f_code(frame, code)
-
-* greenlet.h: the CFrame type has been renamed to _PyCFrame.
-
-Upstream-Status: Submitted [https://github.com/gevent/gevent/pull/1872]
-Signed-off-by: Alexander Kanavin <alex@...>
----
- _setuputils.py | 4 +++
- deps/greenlet/greenlet.h | 6 +++-
- src/gevent/_gevent_cgreenlet.pxd | 59 ++++++++++++++++++++++++--------
- src/gevent/greenlet.py | 7 ++--
- 4 files changed, 59 insertions(+), 17 deletions(-)
-
-diff --git a/_setuputils.py b/_setuputils.py
-index 7257b3eea..0b14ab1f0 100644
---- a/_setuputils.py
-+++ b/_setuputils.py
-@@ -244,6 +244,10 @@ def cythonize1(ext):
- 'infer_types': True,
- 'nonecheck': False,
- },
-+ compile_time_env={
-+ 'PY39B1': sys.hexversion >= 0x030900B1,
-+ 'PY311A6': sys.hexversion >= 0x030B00A6,
-+ },
- # The common_utility_include_dir (not well documented)
- # causes Cython to emit separate files for much of the
- # static support code. Each of the modules then includes
-diff --git a/deps/greenlet/greenlet.h b/deps/greenlet/greenlet.h
-index 830bef8dd..f07ce1833 100644
---- a/deps/greenlet/greenlet.h
-+++ b/deps/greenlet/greenlet.h
-@@ -14,6 +14,10 @@ extern "C" {
- /* This is deprecated and undocumented. It does not change. */
- #define GREENLET_VERSION "1.0.0"
-
-+#if PY_VERSION_HEX < 0x30B00A6
-+# define _PyCFrame CFrame
-+#endif
-+
- typedef struct _greenlet {
- PyObject_HEAD
- char* stack_start;
-@@ -39,7 +43,7 @@ typedef struct _greenlet {
- PyObject* context;
- #endif
- #if PY_VERSION_HEX >= 0x30A00B1
-- CFrame* cframe;
-+ _PyCFrame* cframe;
- #endif
- } PyGreenlet;
-
-diff --git a/src/gevent/_gevent_cgreenlet.pxd b/src/gevent/_gevent_cgreenlet.pxd
-index cbb81a638..246773e24 100644
---- a/src/gevent/_gevent_cgreenlet.pxd
-+++ b/src/gevent/_gevent_cgreenlet.pxd
-@@ -57,30 +57,61 @@ cdef extern from "Python.h":
- ctypedef class types.CodeType [object PyCodeObject]:
- pass
-
--cdef extern from "frameobject.h":
--
-- ctypedef class types.FrameType [object PyFrameObject]:
-- cdef CodeType f_code
-- # Accessing the f_lineno directly doesn't work. There is an accessor
-- # function, PyFrame_GetLineNumber that is needed to turn the raw line number
-- # into the executing line number.
-- # cdef int f_lineno
-- # We can't declare this in the object as an object, because it's
-- # allowed to be NULL, and Cython can't handle that.
-- # We have to go through the python machinery to get a
-- # proper None instead, or use an inline function.
-- cdef void* f_back
-+IF PY311A6:
-+ cdef extern from "internal/pycore_frame.h":
-+ ctypedef class types._PyInterpreterFrame [object _PyInterpreterFrame]:
-+ cdef CodeType f_code
-+
-+ ctypedef class types.FrameType [object PyFrameObject]:
-+ cdef _PyInterpreterFrame f_frame
-+ # Accessing the f_lineno directly doesn't work. There is an accessor
-+ # function, PyFrame_GetLineNumber that is needed to turn the raw line number
-+ # into the executing line number.
-+ # cdef int f_lineno
-+ # We can't declare this in the object as an object, because it's
-+ # allowed to be NULL, and Cython can't handle that.
-+ # We have to go through the python machinery to get a
-+ # proper None instead, or use an inline function.
-+ cdef void* f_back
-+ELSE:
-+ cdef extern from "frameobject.h":
-+ ctypedef class types.FrameType [object PyFrameObject]:
-+ cdef CodeType f_code
-+ cdef void* f_back
-
-+cdef extern from "frameobject.h":
- int PyFrame_GetLineNumber(FrameType frame)
-+ IF PY39B1:
-+ CodeType PyFrame_GetCode(FrameType frame)
-+ void* PyFrame_GetBack(FrameType frame)
-
- @cython.nonecheck(False)
- cdef inline FrameType get_f_back(FrameType frame):
-+ IF PY39B1:
-+ f_back = PyFrame_GetBack(frame)
-+ ELSE:
-+ f_back = frame.f_back
- if frame.f_back != NULL:
-- return <FrameType>frame.f_back
-+ return <FrameType>f_back
-
- cdef inline int get_f_lineno(FrameType frame):
- return PyFrame_GetLineNumber(frame)
-
-+cdef inline void set_f_lineno(FrameType frame, int lineno):
-+ frame.f_lineno = lineno
-+
-+cdef inline CodeType get_f_code(FrameType frame):
-+ IF PY39B1:
-+ return PyFrame_GetCode(frame)
-+ ELSE:
-+ return frame.f_code
-+
-+cdef inline void set_f_code(FrameType frame, CodeType code):
-+ IF PY311A6:
-+ frame.f_frame.f_code = code
-+ ELSE:
-+ frame.f_code = code
-+
- cdef void _init()
-
- cdef class SpawnedLink:
-diff --git a/src/gevent/greenlet.py b/src/gevent/greenlet.py
-index bed12ed44..f925770bb 100644
---- a/src/gevent/greenlet.py
-+++ b/src/gevent/greenlet.py
-@@ -58,6 +58,9 @@
- # Frame access
- locals()['get_f_back'] = lambda frame: frame.f_back
- locals()['get_f_lineno'] = lambda frame: frame.f_lineno
-+locals()['set_f_lineno'] = lambda frame, lineno: setattr(frame, 'f_lineno', lineno)
-+locals()['get_f_code'] = lambda frame: frame.f_code
-+locals()['set_f_code'] = lambda frame, code: setattr(frame, 'f_code', code)
-
- if _PYPY:
- import _continuation # pylint:disable=import-error
-@@ -157,8 +160,8 @@ def _extract_stack(limit):
- # Arguments are always passed to the constructor as Python objects,
- # meaning we wind up boxing the f_lineno just to unbox it if we pass it.
- # It's faster to simply assign once the object is created.
-- older_Frame.f_code = frame.f_code
-- older_Frame.f_lineno = get_f_lineno(frame) # pylint:disable=undefined-variable
-+ set_f_code(older_Frame.f_code, get_f_code(frame))
-+ set_f_lineno(older_Frame.f_lineno, get_f_lineno(frame)) # pylint:disable=undefined-variable
- if newer_Frame is not None:
- newer_Frame.f_back = older_Frame
- newer_Frame = older_Frame
diff --git a/meta-python/recipes-devtools/python/python3-gevent_21.12.0.bb b/meta-python/recipes-devtools/python/python3-gevent_22.8.0.bb
similarity index 87%
rename from meta-python/recipes-devtools/python/python3-gevent_21.12.0.bb
rename to meta-python/recipes-devtools/python/python3-gevent_22.8.0.bb
index f891c2eeab..96a0cb78e2 100644
--- a/meta-python/recipes-devtools/python/python3-gevent_21.12.0.bb
+++ b/meta-python/recipes-devtools/python/python3-gevent_22.8.0.bb
@@ -11,7 +11,9 @@ RDEPENDS:${PN} = "${PYTHON_PN}-greenlet \
${PYTHON_PN}-pprint \
"

-SRC_URI[sha256sum] = "f48b64578c367b91fa793bf8eaaaf4995cb93c8bc45860e473bf868070ad094e"
+SRC_URI += "file://0001-_setuputils.py-Do-not-add-sys_inc_dir.patch"
+
+SRC_URI[sha256sum] = "868d500fe2b7f9750eadc07ada8ab32360c0e71976be2bf5919482f14a6477c7"

inherit pypi setuptools3

@@ -31,5 +33,3 @@ do_configure:append() {
do_compile:append() {
sed -i -e 's#${WORKDIR}##g' ${S}/src/gevent/*.c ${S}/src/gevent/libev/*.c ${S}/src/gevent/resolver/*.c
}
-
-SRC_URI += "file://py-3.11.patch"
--
2.38.0


[meta-python][PATCH] python3-gevent: Upgrade to 22.8.0

Khem Raj
 

This has the python 3.11 fix in it so drop the patch

Signed-off-by: Khem Raj <raj.khem@...>
Cc: Alexander Kanavin <alex@...>
---
.../python/python3-gevent/py-3.11.patch | 170 ------------------
...nt_21.12.0.bb => python3-gevent_22.8.0.bb} | 5 +-
2 files changed, 1 insertion(+), 174 deletions(-)
delete mode 100644 meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch
rename meta-python/recipes-devtools/python/{python3-gevent_21.12.0.bb => python3-gevent_22.8.0.bb} (89%)

diff --git a/meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch b/meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch
deleted file mode 100644
index 6750c1a3cf..0000000000
--- a/meta-python/recipes-devtools/python/python3-gevent/py-3.11.patch
+++ /dev/null
@@ -1,170 +0,0 @@
-From 90e9169c915a640739880b55ed95f88ce21fa7b0 Mon Sep 17 00:00:00 2001
-From: Victor Stinner <vstinner@...>
-Date: Tue, 1 Mar 2022 22:28:40 +0100
-Subject: [PATCH] Add Python 3.11 alpha 6 support
-
-* On Python 3.11a6 and newer, get the PyFrameObject structure from
- the internal C API ("internal/pycore_frame.h").
-* On Python 3.9 and newer, use PyFrame_GetBack() and
- PyFrame_GetCode().
-* Add frame getter and setter functions to greenlet:
-
- * get_f_code(frame)
- * set_f_lineno(frame, lineno)
- * set_f_code(frame, code)
-
-* greenlet.h: the CFrame type has been renamed to _PyCFrame.
-
-Upstream-Status: Submitted [https://github.com/gevent/gevent/pull/1872]
-Signed-off-by: Alexander Kanavin <alex@...>
----
- _setuputils.py | 4 +++
- deps/greenlet/greenlet.h | 6 +++-
- src/gevent/_gevent_cgreenlet.pxd | 59 ++++++++++++++++++++++++--------
- src/gevent/greenlet.py | 7 ++--
- 4 files changed, 59 insertions(+), 17 deletions(-)
-
-diff --git a/_setuputils.py b/_setuputils.py
-index 7257b3eea..0b14ab1f0 100644
---- a/_setuputils.py
-+++ b/_setuputils.py
-@@ -244,6 +244,10 @@ def cythonize1(ext):
- 'infer_types': True,
- 'nonecheck': False,
- },
-+ compile_time_env={
-+ 'PY39B1': sys.hexversion >= 0x030900B1,
-+ 'PY311A6': sys.hexversion >= 0x030B00A6,
-+ },
- # The common_utility_include_dir (not well documented)
- # causes Cython to emit separate files for much of the
- # static support code. Each of the modules then includes
-diff --git a/deps/greenlet/greenlet.h b/deps/greenlet/greenlet.h
-index 830bef8dd..f07ce1833 100644
---- a/deps/greenlet/greenlet.h
-+++ b/deps/greenlet/greenlet.h
-@@ -14,6 +14,10 @@ extern "C" {
- /* This is deprecated and undocumented. It does not change. */
- #define GREENLET_VERSION "1.0.0"
-
-+#if PY_VERSION_HEX < 0x30B00A6
-+# define _PyCFrame CFrame
-+#endif
-+
- typedef struct _greenlet {
- PyObject_HEAD
- char* stack_start;
-@@ -39,7 +43,7 @@ typedef struct _greenlet {
- PyObject* context;
- #endif
- #if PY_VERSION_HEX >= 0x30A00B1
-- CFrame* cframe;
-+ _PyCFrame* cframe;
- #endif
- } PyGreenlet;
-
-diff --git a/src/gevent/_gevent_cgreenlet.pxd b/src/gevent/_gevent_cgreenlet.pxd
-index cbb81a638..246773e24 100644
---- a/src/gevent/_gevent_cgreenlet.pxd
-+++ b/src/gevent/_gevent_cgreenlet.pxd
-@@ -57,30 +57,61 @@ cdef extern from "Python.h":
- ctypedef class types.CodeType [object PyCodeObject]:
- pass
-
--cdef extern from "frameobject.h":
--
-- ctypedef class types.FrameType [object PyFrameObject]:
-- cdef CodeType f_code
-- # Accessing the f_lineno directly doesn't work. There is an accessor
-- # function, PyFrame_GetLineNumber that is needed to turn the raw line number
-- # into the executing line number.
-- # cdef int f_lineno
-- # We can't declare this in the object as an object, because it's
-- # allowed to be NULL, and Cython can't handle that.
-- # We have to go through the python machinery to get a
-- # proper None instead, or use an inline function.
-- cdef void* f_back
-+IF PY311A6:
-+ cdef extern from "internal/pycore_frame.h":
-+ ctypedef class types._PyInterpreterFrame [object _PyInterpreterFrame]:
-+ cdef CodeType f_code
-+
-+ ctypedef class types.FrameType [object PyFrameObject]:
-+ cdef _PyInterpreterFrame f_frame
-+ # Accessing the f_lineno directly doesn't work. There is an accessor
-+ # function, PyFrame_GetLineNumber that is needed to turn the raw line number
-+ # into the executing line number.
-+ # cdef int f_lineno
-+ # We can't declare this in the object as an object, because it's
-+ # allowed to be NULL, and Cython can't handle that.
-+ # We have to go through the python machinery to get a
-+ # proper None instead, or use an inline function.
-+ cdef void* f_back
-+ELSE:
-+ cdef extern from "frameobject.h":
-+ ctypedef class types.FrameType [object PyFrameObject]:
-+ cdef CodeType f_code
-+ cdef void* f_back
-
-+cdef extern from "frameobject.h":
- int PyFrame_GetLineNumber(FrameType frame)
-+ IF PY39B1:
-+ CodeType PyFrame_GetCode(FrameType frame)
-+ void* PyFrame_GetBack(FrameType frame)
-
- @cython.nonecheck(False)
- cdef inline FrameType get_f_back(FrameType frame):
-+ IF PY39B1:
-+ f_back = PyFrame_GetBack(frame)
-+ ELSE:
-+ f_back = frame.f_back
- if frame.f_back != NULL:
-- return <FrameType>frame.f_back
-+ return <FrameType>f_back
-
- cdef inline int get_f_lineno(FrameType frame):
- return PyFrame_GetLineNumber(frame)
-
-+cdef inline void set_f_lineno(FrameType frame, int lineno):
-+ frame.f_lineno = lineno
-+
-+cdef inline CodeType get_f_code(FrameType frame):
-+ IF PY39B1:
-+ return PyFrame_GetCode(frame)
-+ ELSE:
-+ return frame.f_code
-+
-+cdef inline void set_f_code(FrameType frame, CodeType code):
-+ IF PY311A6:
-+ frame.f_frame.f_code = code
-+ ELSE:
-+ frame.f_code = code
-+
- cdef void _init()
-
- cdef class SpawnedLink:
-diff --git a/src/gevent/greenlet.py b/src/gevent/greenlet.py
-index bed12ed44..f925770bb 100644
---- a/src/gevent/greenlet.py
-+++ b/src/gevent/greenlet.py
-@@ -58,6 +58,9 @@
- # Frame access
- locals()['get_f_back'] = lambda frame: frame.f_back
- locals()['get_f_lineno'] = lambda frame: frame.f_lineno
-+locals()['set_f_lineno'] = lambda frame, lineno: setattr(frame, 'f_lineno', lineno)
-+locals()['get_f_code'] = lambda frame: frame.f_code
-+locals()['set_f_code'] = lambda frame, code: setattr(frame, 'f_code', code)
-
- if _PYPY:
- import _continuation # pylint:disable=import-error
-@@ -157,8 +160,8 @@ def _extract_stack(limit):
- # Arguments are always passed to the constructor as Python objects,
- # meaning we wind up boxing the f_lineno just to unbox it if we pass it.
- # It's faster to simply assign once the object is created.
-- older_Frame.f_code = frame.f_code
-- older_Frame.f_lineno = get_f_lineno(frame) # pylint:disable=undefined-variable
-+ set_f_code(older_Frame.f_code, get_f_code(frame))
-+ set_f_lineno(older_Frame.f_lineno, get_f_lineno(frame)) # pylint:disable=undefined-variable
- if newer_Frame is not None:
- newer_Frame.f_back = older_Frame
- newer_Frame = older_Frame
diff --git a/meta-python/recipes-devtools/python/python3-gevent_21.12.0.bb b/meta-python/recipes-devtools/python/python3-gevent_22.8.0.bb
similarity index 89%
rename from meta-python/recipes-devtools/python/python3-gevent_21.12.0.bb
rename to meta-python/recipes-devtools/python/python3-gevent_22.8.0.bb
index f891c2eeab..c51c4c4971 100644
--- a/meta-python/recipes-devtools/python/python3-gevent_21.12.0.bb
+++ b/meta-python/recipes-devtools/python/python3-gevent_22.8.0.bb
@@ -10,8 +10,7 @@ RDEPENDS:${PN} = "${PYTHON_PN}-greenlet \
${PYTHON_PN}-mime \
${PYTHON_PN}-pprint \
"
-
-SRC_URI[sha256sum] = "f48b64578c367b91fa793bf8eaaaf4995cb93c8bc45860e473bf868070ad094e"
+SRC_URI[sha256sum] = "868d500fe2b7f9750eadc07ada8ab32360c0e71976be2bf5919482f14a6477c7"

inherit pypi setuptools3

@@ -31,5 +30,3 @@ do_configure:append() {
do_compile:append() {
sed -i -e 's#${WORKDIR}##g' ${S}/src/gevent/*.c ${S}/src/gevent/libev/*.c ${S}/src/gevent/resolver/*.c
}
-
-SRC_URI += "file://py-3.11.patch"
--
2.38.0