[OE-core] [PATCH 2/2] cve-report.bbclass: add class
Implements "report_cve" and "report_patched" tasks. "report_patched" prepares image manifest with patched CVE info. "report_cve" runs cvert-* scripts to generate kernel and package CVE reports. You can configure it to set report filenames, reuse NVD feeds, stop after manifest generation and ignore specific classes, like native, nativesdk, etc. CC: Mariano Lopez Signed-off-by: grygorii tertychnyi --- meta/classes/cve-report.bbclass | 241 1 file changed, 241 insertions(+) create mode 100644 meta/classes/cve-report.bbclass diff --git a/meta/classes/cve-report.bbclass b/meta/classes/cve-report.bbclass new file mode 100644 index 000..00508a9 --- /dev/null +++ b/meta/classes/cve-report.bbclass @@ -0,0 +1,241 @@ +# Class to inherit when you want to generate a CVE reports. +# +# Generates package list file, kernel and package CVE reports. +# +# Example: +# echo 'INHERIT += "cve-report"' >> conf/local.conf +# bitbake -c report_cve core-image-minimal +# +# Variables to be passed to "cvert-*" scripts: +# +# CVE_REPORT_MODE[foss] +# Path to the CVE FOSS report to be generated. +# +# CVE_REPORT_MODE[kernel] +# Path to the CVE kernel report to be generated. +# +# CVE_REPORT_MODE[restore] +# Path to the CVE blob data file. +# +# E.g. for multiple MACHINEs: +# (1) generate CVE blob: +# cvert-update --store /path/to/cvedump $TEMP/nvdfeed +# (2) for mach in $(get_machine_list); do +# (source oe-init-build-env "build-$mach"; +# echo 'CVE_REPORT_MODE[restore] = "/path/to/cvedump"' >> conf/local.conf; +# echo 'CVE_REPORT_MODE[foss] = "/path/to/report-foss-'${mach}'"' >> conf/local.conf; +# echo 'CVE_REPORT_MODE[kernel] = "/path/to/report-kernel-'${mach}'"' >> conf/local.conf; +# MACHINE=$mach bitbake -c report_cve core-image-minimal) +# done +# +# CVE_REPORT_MODE[offline] +# Either "0" or "1". Offline mode ("--offline" parameter for cvert-* scripts). +# +# CVE_REPORT_MODE[feeddir] +# Path to the NVD feed directory. +# +# CVE_REPORT_MODE[packagelist] +# Path to the package list file to be generated. +# +# CVE_REPORT_MODE[packageonly] +# Either "0" or "1". Generate package list file, then stop. +# +# CVE_REPORT_MODE[blacklist] +# Ignore specific class. +# + +CVE_REPORT_MODE[foss] ?= "${LOG_DIR}/cvert/report-foss.txt" +CVE_REPORT_MODE[kernel] ?= "${LOG_DIR}/cvert/report-kernel.txt" +CVE_REPORT_MODE[offline] ?= "0" +CVE_REPORT_MODE[feeddir] ?= "${LOG_DIR}/nvdfeeds" +CVE_REPORT_MODE[packagelist] ?= "${LOG_DIR}/cvert/package.lst" +CVE_REPORT_MODE[packageonly] ?= "0" +CVE_REPORT_MODE[blacklist] ?= "native,nativesdk,cross,crosssdk,cross-canadian,packagegroup,image" + +CVE_PRODUCT ??= "${BPN}" +CVE_VERSION ??= "${PV}" + +addhandler generate_report_handler +generate_report_handler[eventmask] = "bb.event.BuildCompleted" + +def cvert_update(d): +""" +Sync up with NVD +""" + +import tempfile +import subprocess + +bb.utils.export_proxies(d) + +dump = os.path.join(d.getVar("LOG_DIR"), "cvedump") + +bb.note("Storing CVE database %s" % dump) + +cmd = [ +"cvert-update", +"--store", dump, +d.getVarFlag("CVE_REPORT_MODE", "feeddir") +] + +if d.getVarFlag("CVE_REPORT_MODE", "offline") != "0": +cmd.append("--offline") + +try: +output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode() +bb.debug(2, "Call '%s':\n%s" % (" ".join(cmd), output)) +except subprocess.CalledProcessError as e: +bb.error("Failed to run cvert-update: '%s'\n%s: %s" % (" ".join(cmd), e, e.output)) + +return dump + +# copied from cve-check.bbclass +def get_patches_cves(d): +""" +Get patches that solve CVEs using the "CVE: " tag. +""" + +import re + +pn = d.getVar("PN") +cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+") + +# Matches last CVE-1234-211432 in the file name, also if written +# with small letters. Not supporting multiple CVE id's in a single +# file name. +cve_file_name_match = re.compile(".*([Cc][Vv][Ee]\-\d{4}\-\d+)") + +patched_cves = set() +bb.debug(2, "Looking for patches that solves CVEs for %s" % pn) +for url in src_patches(d): +patch_file = bb.fetch.decodeurl(url)[2] + +# Check patch file name for CVE ID +fname_match = cve_file_name_match.search(patch_file) +if fname_match: +cve = fname_match.group(1).upper() +patched_cves.add(cve) +bb.debug(2, "Found CVE %s from patch file name %s" % (cve, patch_file)) + +with open(patch_file, "r", encoding="utf-8") as f: +try: +patch_text = f.read() +except UnicodeDecodeError: +bb.debug(1, "Failed to read patch %s using UTF-8 encoding" +" trying with iso8859-1" % patch_file) +f.close() +
[OE-core] [PATCH 1/2] cve-report: add scripts to generate CVE reports
cvert-kernel - generate CVE report for the Linux kernel. NVD entries for the Linux kernel is almost always outdated. For example, https://nvd.nist.gov/vuln/detail/CVE-2018-1065 is shown as matched for "versions up to (including) 4.15.7", however the patch 57ebd808a97d has been back ported for 4.14. cvert-kernel script checks NVD Resource entries for the patch URLs and looking for the commits in the local git tree. cvert-foss - generate CVE report for the list of packages. It analyzes the whole image manifest to align with the complex CPE configurations. cvert-update - only update NVD feeds and store CVE blob locally. CVE blob is a pickled representation of the cve_struct dictionary. cvert.py - python module used by all cvert-* scripts. Uses NVD JSON Vulnerability Feeds https://nvd.nist.gov/vuln/data-feeds#JSON_FEED Signed-off-by: grygorii tertychnyi --- scripts/cvert-foss | 109 ++ scripts/cvert-kernel | 157 +++ scripts/cvert-update | 64 scripts/cvert.py | 418 +++ 4 files changed, 748 insertions(+) create mode 100755 scripts/cvert-foss create mode 100755 scripts/cvert-kernel create mode 100755 scripts/cvert-update create mode 100644 scripts/cvert.py diff --git a/scripts/cvert-foss b/scripts/cvert-foss new file mode 100755 index 000..a0cc6ad --- /dev/null +++ b/scripts/cvert-foss @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 +# +# Generate CVE report for the list of packages. +# +# Copyright (c) 2018 Cisco Systems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +import sys +import cvert +import textwrap +import argparse + +def report_foss(filename, cve_struct): +packagelist = {} + +with open(filename, 'r') as fil: +for lin in fil: +product, version, patched = lin.split(',', maxsplit=3) + +if product in packagelist: +packagelist[product][version] = patched.split() +else: +packagelist[product] = { +version: patched.split() +} + +return cvert.match_cve(packagelist, cve_struct) + + +if __name__ == '__main__': +parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, + description=textwrap.dedent(''' + Generate CVE report for the list of packages. + '''), + epilog=textwrap.dedent(''' + examples: + + # Download (update) NVD feeds in "nvdfeed" directory + # and prepare the report for the "package.lst" file + %% %(prog)s --feed-dir nvdfeed --output report-foss.txt package.lst + + # Use existed NVD feeds in "nvdfeed" directory + # and prepare the report for the "package.lst" file + %% %(prog)s --offline --feed-dir nvdfeed --output report-foss.txt package.lst + + # (faster) Restore CVE dump from "cvedump" (must exist) + # and prepare the report for the "package.lst" file + %% %(prog)s --restore cvedump --output report-foss.txt package.lst + + # Restore CVE dump from "cvedump" (must exist) + # and prepare the extended report for the "package.lst" file + %% %(prog)s --restore cvedump --show-description --show-reference --output report-foss.txt package.lst + ''')) + +group = parser.add_mutually_exclusive_group(required=True) +group.add_argument('--feed-dir', help='feeds directory') +group.add_argument('--restore', help='load CVE data structures from file', +metavar='FILENAME') + +parser.add_argument('--offline', help='do not update from NVD site', +action='store_true') +parser.add_argument('--output', help='save report to the file') +parser.add_argument('--show-description', help='show "Description" in the report', +
Re: [OE-core] [PATCH] package: skip strip on signed kernel modules
On Fri, 3 Aug 2018, Ocampo Coronado, Omar wrote: Yes, we would like to keep the symbols on a signed kernel module. Andre shared this link: https://www.kernel.org/doc/html/v4.17/admin-guide/module-signing.html#signed-modules-and-stripping , from conversation topic: Re: [OE-core] Strip kernel modules and signatures Thank you for the pointer. I did not expect that KLM signing will be outside of ELF. Too bad that it is so brittle. Ideally, it would be nice if one could disable KLM signing in kernel makefile machinery and have mechanism to sign KLMs in OE itself, just before packaging but after they got stripped. IMO it would be more practical. I could not imagine if one would want to ship KLMs with debug symbols inside. But even if that is implemented, your code would still should stand ok - if module signed already, it cannot be touched. -28 are the last 28 bytes of the file. The same amount of bytes are being read by dracut to check if a module is signed. And you are correct Victor, I'm unsure if this would work outside x86 arch. I've checked that by building mips64 kernel with KLM signing enabled and I looked at scripts/sign-file.c source, you are fine: magic_number = "~Module signature appended~\n" will be always at the end after KLM signing regardless of architecture. Thanks, Victor Two pending fixes: 1) This patch also needs to fix the mode of the file as the original may not be preserved. 2) Seems like 'return' is not accepted by oe.utils.multiprocess, still getting familiar with OE -Original Message- From: Victor Kamensky [mailto:kamen...@cisco.com] Sent: Friday, August 3, 2018 3:28 PM To: Ocampo Coronado, Omar Cc: openembedded-core@lists.openembedded.org Subject: Re: [OE-core] [PATCH] package: skip strip on signed kernel modules On Fri, 3 Aug 2018, omar.ocampo.coron...@intel.com wrote: From: foocampo Executing strip action on kernel modules removes the signature. Is not possible to strip and keep the signature, therefore avoid strip signed kernel modules. Signed-off-by: foocampo --- meta/lib/oe/package.py | 10 ++ 1 file changed, 10 insertions(+) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index fa3428ad61..f7d2d3b7c4 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -24,6 +24,9 @@ def runstrip(arg): # kernel module if elftype & 16: +if is_kernel_module_signed(file): +bb.debug(1, "Skip strip on signed module %s" % file) +return It does not look right to me. Above means that signed KLM will go into image with symbols. Or I don't read code correctly? Where is signature stored? Is it some kind of an ELF NOTE? In this case you would just need to drop only "--remove-section=.note" from strip command. Wondering why .notes were stripped in the first place. stripcmd.extend(["--strip-debug", "--remove-section=.comment", "--remove-section=.note", "--preserve-dates"]) I suggest split above into two invocations and do second stripcmd.extend(["--remove-section=.note"]) only for non signed modules. Assuming that signature is in the .note section. If it is not .comment, do that with "--remove-section=.comment" instead. # .so and shared library @@ -46,6 +49,13 @@ def is_kernel_module(path): with open(path) as f: return mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ).find(b"vermagic=") >= 0 +# Detect if .ko module is signed +def is_kernel_module_signed(path): +with open(path, "rb") as f: +f.seek(-28, 2) Where magic -28 comes from? Is it true for all cases, all CPU arches? I think it could be done more cleanly here. Thanks, Victor +module_tail = f.read() +return "Module signature appended" in "".join(chr(c) for c in + bytearray(module_tail)) + # Return type (bits): # 0 - not elf # 1 - ELF -- 2.18.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCHv3] package: skip strip on signed kernel modules
From: foocampo Executing strip action on kernel modules removes the signature. Is not possible to strip and keep the signature, therefore avoid strip signed kernel modules. Signed-off-by: Omar Ocampo --- meta/lib/oe/package.py | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index fa3428ad61..21c80aaa38 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -21,11 +21,15 @@ def runstrip(arg): os.chmod(file, newmode) stripcmd = [strip] - +skip_strip = False # kernel module if elftype & 16: -stripcmd.extend(["--strip-debug", "--remove-section=.comment", -"--remove-section=.note", "--preserve-dates"]) +if is_kernel_module_signed(file): +bb.debug(1, "Skip strip on signed module %s" % file) +skip_strip = True +else: +stripcmd.extend(["--strip-debug", "--remove-section=.comment", +"--remove-section=.note", "--preserve-dates"]) # .so and shared library elif ".so" in file and elftype & 8: stripcmd.extend(["--remove-section=.comment", "--remove-section=.note", "--strip-unneeded"]) @@ -36,7 +40,8 @@ def runstrip(arg): stripcmd.append(file) bb.debug(1, "runstrip: %s" % stripcmd) -output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT) +if not skip_strip: +output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT) if newmode: os.chmod(file, origmode) @@ -46,6 +51,13 @@ def is_kernel_module(path): with open(path) as f: return mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ).find(b"vermagic=") >= 0 +# Detect if .ko module is signed +def is_kernel_module_signed(path): +with open(path, "rb") as f: +f.seek(-28, 2) +module_tail = f.read() +return "Module signature appended" in "".join(chr(c) for c in bytearray(module_tail)) + # Return type (bits): # 0 - not elf # 1 - ELF -- 2.18.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCHv2] package: skip strip on signed kernel modules
From: foocampo Executing strip action on kernel modules removes the signature. Is not possible to strip and keep the signature, therefore avoid strip signed kernel modules. Signed-off-by: foocampo Signed-off-by: Omar Ocmapo --- meta/lib/oe/package.py | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index fa3428ad61..21c80aaa38 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -21,11 +21,15 @@ def runstrip(arg): os.chmod(file, newmode) stripcmd = [strip] - +skip_strip = False # kernel module if elftype & 16: -stripcmd.extend(["--strip-debug", "--remove-section=.comment", -"--remove-section=.note", "--preserve-dates"]) +if is_kernel_module_signed(file): +bb.debug(1, "Skip strip on signed module %s" % file) +skip_strip = True +else: +stripcmd.extend(["--strip-debug", "--remove-section=.comment", +"--remove-section=.note", "--preserve-dates"]) # .so and shared library elif ".so" in file and elftype & 8: stripcmd.extend(["--remove-section=.comment", "--remove-section=.note", "--strip-unneeded"]) @@ -36,7 +40,8 @@ def runstrip(arg): stripcmd.append(file) bb.debug(1, "runstrip: %s" % stripcmd) -output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT) +if not skip_strip: +output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT) if newmode: os.chmod(file, origmode) @@ -46,6 +51,13 @@ def is_kernel_module(path): with open(path) as f: return mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ).find(b"vermagic=") >= 0 +# Detect if .ko module is signed +def is_kernel_module_signed(path): +with open(path, "rb") as f: +f.seek(-28, 2) +module_tail = f.read() +return "Module signature appended" in "".join(chr(c) for c in bytearray(module_tail)) + # Return type (bits): # 0 - not elf # 1 - ELF -- 2.18.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH 1/2] remove allarch from recipes which rdepends on TUNE_PKGARCH packages
On Fri, 2018-08-03 at 09:49 +0800, kai.k...@windriver.com wrote: > From: Kai Kang > > The following allarch packages rdepends on TUNE_PKGARCH packages. So > remove allarch from these recipes. > > ca-certificates -> openssl Should we reverse this, i.e. have openssl RRECOMMENDS ca-certificates? > docbook-xsl-stylesheets -> perl > font-alias -> font-util > initramfs-module-setup-live -> udev-extraconf > initramfs-framework -> ${VIRTUAL-RUNTIME_base-utils} (busybox by > default) > ppp-dialin -> ppp ppp RRECOMMENDS ppp-dialin? > resolvconf -> bash > weston-init -> weston kbd weston RRECOMMENDS weston-init? Not really sure about some of these but we should at least consider it... Cheers, Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] package: skip strip on signed kernel modules
Yes, we would like to keep the symbols on a signed kernel module. Andre shared this link: https://www.kernel.org/doc/html/v4.17/admin-guide/module-signing.html#signed-modules-and-stripping , from conversation topic: Re: [OE-core] Strip kernel modules and signatures -28 are the last 28 bytes of the file. The same amount of bytes are being read by dracut to check if a module is signed. And you are correct Victor, I'm unsure if this would work outside x86 arch. Two pending fixes: 1) This patch also needs to fix the mode of the file as the original may not be preserved. 2) Seems like 'return' is not accepted by oe.utils.multiprocess, still getting familiar with OE -Original Message- From: Victor Kamensky [mailto:kamen...@cisco.com] Sent: Friday, August 3, 2018 3:28 PM To: Ocampo Coronado, Omar Cc: openembedded-core@lists.openembedded.org Subject: Re: [OE-core] [PATCH] package: skip strip on signed kernel modules On Fri, 3 Aug 2018, omar.ocampo.coron...@intel.com wrote: > From: foocampo > > Executing strip action on kernel modules removes the signature. > Is not possible to strip and keep the signature, therefore avoid strip > signed kernel modules. > > Signed-off-by: foocampo > --- > meta/lib/oe/package.py | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index > fa3428ad61..f7d2d3b7c4 100644 > --- a/meta/lib/oe/package.py > +++ b/meta/lib/oe/package.py > @@ -24,6 +24,9 @@ def runstrip(arg): > > # kernel module > if elftype & 16: > +if is_kernel_module_signed(file): > +bb.debug(1, "Skip strip on signed module %s" % file) > +return It does not look right to me. Above means that signed KLM will go into image with symbols. Or I don't read code correctly? Where is signature stored? Is it some kind of an ELF NOTE? In this case you would just need to drop only "--remove-section=.note" from strip command. Wondering why .notes were stripped in the first place. > stripcmd.extend(["--strip-debug", "--remove-section=.comment", > "--remove-section=.note", "--preserve-dates"]) I suggest split above into two invocations and do second stripcmd.extend(["--remove-section=.note"]) only for non signed modules. Assuming that signature is in the .note section. If it is not .comment, do that with "--remove-section=.comment" instead. > # .so and shared library > @@ -46,6 +49,13 @@ def is_kernel_module(path): > with open(path) as f: > return mmap.mmap(f.fileno(), 0, > prot=mmap.PROT_READ).find(b"vermagic=") >= 0 > > +# Detect if .ko module is signed > +def is_kernel_module_signed(path): > +with open(path, "rb") as f: > +f.seek(-28, 2) Where magic -28 comes from? Is it true for all cases, all CPU arches? I think it could be done more cleanly here. Thanks, Victor > +module_tail = f.read() > +return "Module signature appended" in "".join(chr(c) for c in > + bytearray(module_tail)) > + > # Return type (bits): > # 0 - not elf > # 1 - ELF > -- > 2.18.0 > > -- > ___ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] package: skip strip on signed kernel modules
On Fri, 3 Aug 2018, omar.ocampo.coron...@intel.com wrote: From: foocampo Executing strip action on kernel modules removes the signature. Is not possible to strip and keep the signature, therefore avoid strip signed kernel modules. Signed-off-by: foocampo --- meta/lib/oe/package.py | 10 ++ 1 file changed, 10 insertions(+) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index fa3428ad61..f7d2d3b7c4 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -24,6 +24,9 @@ def runstrip(arg): # kernel module if elftype & 16: +if is_kernel_module_signed(file): +bb.debug(1, "Skip strip on signed module %s" % file) +return It does not look right to me. Above means that signed KLM will go into image with symbols. Or I don't read code correctly? Where is signature stored? Is it some kind of an ELF NOTE? In this case you would just need to drop only "--remove-section=.note" from strip command. Wondering why .notes were stripped in the first place. stripcmd.extend(["--strip-debug", "--remove-section=.comment", "--remove-section=.note", "--preserve-dates"]) I suggest split above into two invocations and do second stripcmd.extend(["--remove-section=.note"]) only for non signed modules. Assuming that signature is in the .note section. If it is not .comment, do that with "--remove-section=.comment" instead. # .so and shared library @@ -46,6 +49,13 @@ def is_kernel_module(path): with open(path) as f: return mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ).find(b"vermagic=") >= 0 +# Detect if .ko module is signed +def is_kernel_module_signed(path): +with open(path, "rb") as f: +f.seek(-28, 2) Where magic -28 comes from? Is it true for all cases, all CPU arches? I think it could be done more cleanly here. Thanks, Victor +module_tail = f.read() +return "Module signature appended" in "".join(chr(c) for c in bytearray(module_tail)) + # Return type (bits): # 0 - not elf # 1 - ELF -- 2.18.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] package: skip strip on signed kernel modules
From: foocampo Executing strip action on kernel modules removes the signature. Is not possible to strip and keep the signature, therefore avoid strip signed kernel modules. Signed-off-by: foocampo --- meta/lib/oe/package.py | 10 ++ 1 file changed, 10 insertions(+) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index fa3428ad61..f7d2d3b7c4 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -24,6 +24,9 @@ def runstrip(arg): # kernel module if elftype & 16: +if is_kernel_module_signed(file): +bb.debug(1, "Skip strip on signed module %s" % file) +return stripcmd.extend(["--strip-debug", "--remove-section=.comment", "--remove-section=.note", "--preserve-dates"]) # .so and shared library @@ -46,6 +49,13 @@ def is_kernel_module(path): with open(path) as f: return mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ).find(b"vermagic=") >= 0 +# Detect if .ko module is signed +def is_kernel_module_signed(path): +with open(path, "rb") as f: +f.seek(-28, 2) +module_tail = f.read() +return "Module signature appended" in "".join(chr(c) for c in bytearray(module_tail)) + # Return type (bits): # 0 - not elf # 1 - ELF -- 2.18.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] ✗ patchtest: failure for glibc: Upgrade to 2.28 (rev2)
it seems patch scanner is confused here On Fri, Aug 3, 2018 at 11:34 AM Patchwork wrote: > > == Series Details == > > Series: glibc: Upgrade to 2.28 (rev2) > Revision: 2 > URL : https://patchwork.openembedded.org/series/13377/ > State : failure > > == Summary == > > > Thank you for submitting this patch series to OpenEmbedded Core. This is > an automated response. Several tests have been executed on the proposed > series by patchtest resulting in the following failures: > > > > * Issue Patches not removed from tree [test_src_uri_left_files] > Suggested fixAmend the patch containing the software patch file removal > Patch > 0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch > Patch0014-yes-within-the-path-sets-wrong-config-variables.patch > Patch0019-eglibc-Clear-cache-lines-on-ppc8xx.patch > Patch0018-eglibc-Help-bootstrap-cross-toolchain.patch > Patch > 0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch > Patch0015-timezone-re-written-tzselect-as-posix-sh.patch > Patch > 0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch > Patch > 0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch > Patch0030-plural_c_no_preprocessor_lines.patch > Patch0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch > Patch > 0012-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch > Patch0017-eglibc-Cross-building-and-testing-instructions.patch > Patch0016-Remove-bash-dependency-for-nscd-init-script.patch > Patch > 0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch > Patch0020-eglibc-Resolve-__fpscr_values-on-SH4.patch > Patch0013-Add-unused-attribute.patch > Patch > 0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch > > > > If you believe any of these test results are incorrect, please reply to the > mailing list (openembedded-core@lists.openembedded.org) raising your concerns. > Otherwise we would appreciate you correcting the issues and submitting a new > version of the patchset if applicable. Please ensure you add/increment the > version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> > [PATCH v3] -> ...). > > --- > Guidelines: > https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines > Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest > Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe > -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] libidn2: Fix charset.alias issue with musl
On Fri, Aug 3, 2018 at 11:17 AM Burton, Ross wrote: > > Has that actually been fixed in gnulib yet? > haven't check lately but few months back it is not fixed yet. > Ross > > On 3 August 2018 at 18:30, Khem Raj wrote: > > Fixes > > ERROR: libidn2-2.0.5-r0 do_package: QA Issue: libidn2: Files/directories > > were installed but not shipped in any packag > > e: > > /usr/lib/charset.alias > > Please set FILES such that these items are packaged. Alternatively if they > > are unneeded, avoid installing them or del > > ete them within do_install. > > > > Signed-off-by: Khem Raj > > --- > > ...charset_alias-when-building-for-musl.patch | 23 +++ > > meta/recipes-extended/libidn/libidn2_2.0.5.bb | 4 +++- > > 2 files changed, 26 insertions(+), 1 deletion(-) > > create mode 100644 > > meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch > > > > diff --git > > a/meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch > > > > b/meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch > > new file mode 100644 > > index 00..ace50bbfde > > --- /dev/null > > +++ > > b/meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch > > @@ -0,0 +1,23 @@ > > +Unset need_charset_alias when building for musl > > + > > +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 > > +which actually shoudl be fixed in gnulib and then all downstream > > +projects will get it eventually. For now we apply the fix to > > +coreutils > > + > > +Upstream-Status: Pending > > + > > +Signed-off-by: Khem Raj > > +Index: libidn2-2.0.5/unistring/Makefile.am > > +=== > > +--- libidn2-2.0.5.orig/unistring/Makefile.am > > libidn2-2.0.5/unistring/Makefile.am > > +@@ -293,7 +293,7 @@ install-exec-localcharset: all-local > > + case '$(host_os)' in \ > > + darwin[56]*) \ > > + need_charset_alias=true ;; \ > > +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ > > ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ > > + need_charset_alias=false ;; \ > > + *) \ > > + need_charset_alias=true ;; \ > > diff --git a/meta/recipes-extended/libidn/libidn2_2.0.5.bb > > b/meta/recipes-extended/libidn/libidn2_2.0.5.bb > > index aaf9ecd7e7..0d7bddbc7f 100644 > > --- a/meta/recipes-extended/libidn/libidn2_2.0.5.bb > > +++ b/meta/recipes-extended/libidn/libidn2_2.0.5.bb > > @@ -9,7 +9,9 @@ LIC_FILES_CHKSUM = > > "file://COPYING;md5=ab90e75ef97cc6318ce4f2fbda62fe4d \ > > > > file://src/idn2.c;endline=16;md5=0283aec28e049f5bcaaeee52aa865874 \ > > > > file://lib/idn2.h.in;endline=27;md5=c2cd28d3f87260f157f022eabb83714f" > > > > -SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz" > > +SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \ > > + file://Unset-need_charset_alias-when-building-for-musl.patch \ > > + " > > SRC_URI[md5sum] = "eaf9a5b9d03b0cce3760f34b3124eb36" > > SRC_URI[sha256sum] = > > "53f69170886f1fa6fa5b332439c7a77a7d22626a82ef17e2c1224858bb4ca2b8" > > > > -- > > 2.18.0 > > > > -- > > ___ > > Openembedded-core mailing list > > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] ✗ patchtest: failure for glibc: Upgrade to 2.28 (rev2)
== Series Details == Series: glibc: Upgrade to 2.28 (rev2) Revision: 2 URL : https://patchwork.openembedded.org/series/13377/ State : failure == Summary == Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures: * Issue Patches not removed from tree [test_src_uri_left_files] Suggested fixAmend the patch containing the software patch file removal Patch 0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch Patch0014-yes-within-the-path-sets-wrong-config-variables.patch Patch0019-eglibc-Clear-cache-lines-on-ppc8xx.patch Patch0018-eglibc-Help-bootstrap-cross-toolchain.patch Patch 0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch Patch0015-timezone-re-written-tzselect-as-posix-sh.patch Patch 0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch Patch0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch Patch0030-plural_c_no_preprocessor_lines.patch Patch0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch Patch 0012-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch Patch0017-eglibc-Cross-building-and-testing-instructions.patch Patch0016-Remove-bash-dependency-for-nscd-init-script.patch Patch 0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch Patch0020-eglibc-Resolve-__fpscr_values-on-SH4.patch Patch0013-Add-unused-attribute.patch Patch0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch If you believe any of these test results are incorrect, please reply to the mailing list (openembedded-core@lists.openembedded.org) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...). --- Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [RFT][PATCH v2] glibc: Upgrade to 2.28
License-Update: libidn is dropped from glibc and a testcase that was a particular contributor copyrighted see https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=LICENSES;h=0e3a9fe39b26e97038d92f904508a4c3aa1bb43b;hp=b29efe01084af28cc40953d7317f22927c0ee3b7;hb=5a357506659f9a00fcf5bc9c5d8fc676175c89a7;hpb=7279af007c420a9d5f88a6909d11e7cb712c16a4 https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=LICENSES;h=b29efe01084af28cc40953d7317f22927c0ee3b7;hp=80f7f1487947f57815b9fe076fadc8c7f94eeb8e;hb=7f9f1ecb710eac4d65bb02785ddf288cac098323;hpb=5f7b841d3aebdccc2baed27cb4b22ddb08cd7c0c Drop upstreamed and backported patches Signed-off-by: Khem Raj --- meta/conf/distro/include/tcmode-default.inc | 2 +- ...2.27.bb => cross-localedef-native_2.28.bb} | 18 +- ...-initial_2.27.bb => glibc-initial_2.28.bb} | 0 ...bc-locale_2.27.bb => glibc-locale_2.28.bb} | 0 ...bc-mtrace_2.27.bb => glibc-mtrace_2.28.bb} | 0 ...-scripts_2.27.bb => glibc-scripts_2.28.bb} | 0 ...Look-for-host-system-ld.so.cache-as-.patch | 12 +- ...Fix-buffer-overrun-with-a-relocated-.patch | 10 +- ...Raise-the-size-of-arrays-containing-.patch | 18 +- ...k-glibc-Allow-64-bit-atomics-for-x86.patch | 6 +- ...ake-relocatable-install-for-locales.patch} | 45 +- ...500-e6500-603e-fsqrt-implementation.patch} | 44 +- ...E_KNOWN_INTERPRETER_NAMES-to-known-.patch} | 6 +- ...ndefined-reference-to-__sqrt_finite.patch} | 6 +- ...are-now-inline-functions-and-call-o.patch} | 6 +- ...43-which-explains-what-the-patch-do.patch} | 8 +- ...-err-tab.pl-with-specific-dirs-in-S.patch} | 6 +- ...are-now-inline-functions-and-call-o.patch} | 6 +- ...gure.ac-handle-correctly-libc_cv_ro.patch} | 6 +- patch => 0014-Add-unused-attribute.patch} | 6 +- ...he-path-sets-wrong-config-variables.patch} | 6 +- ...one-re-written-tzselect-as-posix-sh.patch} | 6 +- ...ash-dependency-for-nscd-init-script.patch} | 6 +- ...s-building-and-testing-instructions.patch} | 10 +- ...libc-Help-bootstrap-cross-toolchain.patch} | 12 +- ...-eglibc-Clear-cache-lines-on-ppc8xx.patch} | 6 +- ...glibc-Resolve-__fpscr_values-on-SH4.patch} | 6 +- ...port-cross-locale-generation-support.patch | 28 +- ...Define-DUMMY_LOCALE_T-if-not-defined.patch | 6 +- ...ke-_dl_build_local_scope-breadth-fir.patch | 10 +- ...le-fix-hard-coded-reference-to-gcc-E.patch | 6 +- ...set-dl_load_write_lock-after-forking.patch | 14 +- ...ck-before-switching-to-malloc_atfork.patch | 30 +- ...sts.h-enum-definition-for-TRAP_HWBKP.patch | 14 +- ...with-memccpy-to-fix-Wstringop-trunca.patch | 40 -- ...archive-uses-a-hard-coded-locale-pa.patch} | 23 +- ...t-no-lines-in-bison-generated-files.patch} | 17 +- .../0031-nativesdk-deprecate-libcrypt.patch | 419 -- .../glibc/glibc/CVE-2017-18269.patch | 178 .../glibc/glibc/CVE-2018-11236.patch | 164 --- .../glibc/glibc/CVE-2018-11237.patch | 82 .../glibc/{glibc_2.27.bb => glibc_2.28.bb}| 46 +- 42 files changed, 244 insertions(+), 1090 deletions(-) rename meta/recipes-core/glibc/{cross-localedef-native_2.27.bb => cross-localedef-native_2.28.bb} (70%) rename meta/recipes-core/glibc/{glibc-initial_2.27.bb => glibc-initial_2.28.bb} (100%) rename meta/recipes-core/glibc/{glibc-locale_2.27.bb => glibc-locale_2.28.bb} (100%) rename meta/recipes-core/glibc/{glibc-mtrace_2.27.bb => glibc-mtrace_2.28.bb} (100%) rename meta/recipes-core/glibc/{glibc-scripts_2.27.bb => glibc-scripts_2.28.bb} (100%) rename meta/recipes-core/glibc/glibc/{relocate-locales.patch => 0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch} (80%) rename meta/recipes-core/glibc/glibc/{0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch => 0006-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch} (97%) rename meta/recipes-core/glibc/glibc/{0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch => 0007-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch} (85%) rename meta/recipes-core/glibc/glibc/{0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch => 0008-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch} (98%) rename meta/recipes-core/glibc/glibc/{0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch => 0009-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch} (98%) rename meta/recipes-core/glibc/glibc/{0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch => 0010-Quote-from-bug-1443-which-explains-what-the-patch-do.patch} (93%) rename meta/recipes-core/glibc/glibc/{0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch => 0011-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch} (89%) rename meta/recipes-core/glibc/glibc/{0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch => 0012-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch} (93%) rename
Re: [OE-core] [PATCH] libidn2: Fix charset.alias issue with musl
Has that actually been fixed in gnulib yet? Ross On 3 August 2018 at 18:30, Khem Raj wrote: > Fixes > ERROR: libidn2-2.0.5-r0 do_package: QA Issue: libidn2: Files/directories were > installed but not shipped in any packag > e: > /usr/lib/charset.alias > Please set FILES such that these items are packaged. Alternatively if they > are unneeded, avoid installing them or del > ete them within do_install. > > Signed-off-by: Khem Raj > --- > ...charset_alias-when-building-for-musl.patch | 23 +++ > meta/recipes-extended/libidn/libidn2_2.0.5.bb | 4 +++- > 2 files changed, 26 insertions(+), 1 deletion(-) > create mode 100644 > meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch > > diff --git > a/meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch > > b/meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch > new file mode 100644 > index 00..ace50bbfde > --- /dev/null > +++ > b/meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch > @@ -0,0 +1,23 @@ > +Unset need_charset_alias when building for musl > + > +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 > +which actually shoudl be fixed in gnulib and then all downstream > +projects will get it eventually. For now we apply the fix to > +coreutils > + > +Upstream-Status: Pending > + > +Signed-off-by: Khem Raj > +Index: libidn2-2.0.5/unistring/Makefile.am > +=== > +--- libidn2-2.0.5.orig/unistring/Makefile.am > libidn2-2.0.5/unistring/Makefile.am > +@@ -293,7 +293,7 @@ install-exec-localcharset: all-local > + case '$(host_os)' in \ > + darwin[56]*) \ > + need_charset_alias=true ;; \ > +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ > ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ > + need_charset_alias=false ;; \ > + *) \ > + need_charset_alias=true ;; \ > diff --git a/meta/recipes-extended/libidn/libidn2_2.0.5.bb > b/meta/recipes-extended/libidn/libidn2_2.0.5.bb > index aaf9ecd7e7..0d7bddbc7f 100644 > --- a/meta/recipes-extended/libidn/libidn2_2.0.5.bb > +++ b/meta/recipes-extended/libidn/libidn2_2.0.5.bb > @@ -9,7 +9,9 @@ LIC_FILES_CHKSUM = > "file://COPYING;md5=ab90e75ef97cc6318ce4f2fbda62fe4d \ > > file://src/idn2.c;endline=16;md5=0283aec28e049f5bcaaeee52aa865874 \ > > file://lib/idn2.h.in;endline=27;md5=c2cd28d3f87260f157f022eabb83714f" > > -SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz" > +SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \ > + file://Unset-need_charset_alias-when-building-for-musl.patch \ > + " > SRC_URI[md5sum] = "eaf9a5b9d03b0cce3760f34b3124eb36" > SRC_URI[sha256sum] = > "53f69170886f1fa6fa5b332439c7a77a7d22626a82ef17e2c1224858bb4ca2b8" > > -- > 2.18.0 > > -- > ___ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] ✗ patchtest: failure for glibc: Upgrade to 2.28
== Series Details == Series: glibc: Upgrade to 2.28 Revision: 1 URL : https://patchwork.openembedded.org/series/13377/ State : failure == Summary == Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures: * Issue Patches not removed from tree [test_src_uri_left_files] Suggested fixAmend the patch containing the software patch file removal Patch0016-Remove-bash-dependency-for-nscd-init-script.patch Patch0019-eglibc-Clear-cache-lines-on-ppc8xx.patch Patch 0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch Patch0014-yes-within-the-path-sets-wrong-config-variables.patch Patch0015-timezone-re-written-tzselect-as-posix-sh.patch Patch0018-eglibc-Help-bootstrap-cross-toolchain.patch Patch0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch Patch0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch Patch 0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch Patch 0012-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch Patch 0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch Patch0013-Add-unused-attribute.patch Patch 0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch Patch0020-eglibc-Resolve-__fpscr_values-on-SH4.patch Patch0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch Patch0030-plural_c_no_preprocessor_lines.patch Patch0017-eglibc-Cross-building-and-testing-instructions.patch If you believe any of these test results are incorrect, please reply to the mailing list (openembedded-core@lists.openembedded.org) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...). --- Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] libidn2: Fix charset.alias issue with musl
Fixes ERROR: libidn2-2.0.5-r0 do_package: QA Issue: libidn2: Files/directories were installed but not shipped in any packag e: /usr/lib/charset.alias Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or del ete them within do_install. Signed-off-by: Khem Raj --- ...charset_alias-when-building-for-musl.patch | 23 +++ meta/recipes-extended/libidn/libidn2_2.0.5.bb | 4 +++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch diff --git a/meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch new file mode 100644 index 00..ace50bbfde --- /dev/null +++ b/meta/recipes-extended/libidn/libidn2/Unset-need_charset_alias-when-building-for-musl.patch @@ -0,0 +1,23 @@ +Unset need_charset_alias when building for musl + +localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 +which actually shoudl be fixed in gnulib and then all downstream +projects will get it eventually. For now we apply the fix to +coreutils + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +Index: libidn2-2.0.5/unistring/Makefile.am +=== +--- libidn2-2.0.5.orig/unistring/Makefile.am libidn2-2.0.5/unistring/Makefile.am +@@ -293,7 +293,7 @@ install-exec-localcharset: all-local + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ +- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ ++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ diff --git a/meta/recipes-extended/libidn/libidn2_2.0.5.bb b/meta/recipes-extended/libidn/libidn2_2.0.5.bb index aaf9ecd7e7..0d7bddbc7f 100644 --- a/meta/recipes-extended/libidn/libidn2_2.0.5.bb +++ b/meta/recipes-extended/libidn/libidn2_2.0.5.bb @@ -9,7 +9,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ab90e75ef97cc6318ce4f2fbda62fe4d \ file://src/idn2.c;endline=16;md5=0283aec28e049f5bcaaeee52aa865874 \ file://lib/idn2.h.in;endline=27;md5=c2cd28d3f87260f157f022eabb83714f" -SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz" +SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \ + file://Unset-need_charset_alias-when-building-for-musl.patch \ + " SRC_URI[md5sum] = "eaf9a5b9d03b0cce3760f34b3124eb36" SRC_URI[sha256sum] = "53f69170886f1fa6fa5b332439c7a77a7d22626a82ef17e2c1224858bb4ca2b8" -- 2.18.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [RFT][PATCH] glibc: Upgrade to 2.28
Drop upstreamed and backported patches Signed-off-by: Khem Raj --- meta/conf/distro/include/tcmode-default.inc | 2 +- ...2.27.bb => cross-localedef-native_2.28.bb} | 2 +- ...-initial_2.27.bb => glibc-initial_2.28.bb} | 0 ...bc-locale_2.27.bb => glibc-locale_2.28.bb} | 0 ...bc-mtrace_2.27.bb => glibc-mtrace_2.28.bb} | 0 ...-scripts_2.27.bb => glibc-scripts_2.28.bb} | 0 ...Look-for-host-system-ld.so.cache-as-.patch | 12 +- ...Fix-buffer-overrun-with-a-relocated-.patch | 10 +- ...Raise-the-size-of-arrays-containing-.patch | 18 +- ...k-glibc-Allow-64-bit-atomics-for-x86.patch | 6 +- ...ake-relocatable-install-for-locales.patch} | 45 +- ...500-e6500-603e-fsqrt-implementation.patch} | 44 +- ...E_KNOWN_INTERPRETER_NAMES-to-known-.patch} | 6 +- ...ndefined-reference-to-__sqrt_finite.patch} | 6 +- ...are-now-inline-functions-and-call-o.patch} | 6 +- ...43-which-explains-what-the-patch-do.patch} | 8 +- ...-err-tab.pl-with-specific-dirs-in-S.patch} | 6 +- ...are-now-inline-functions-and-call-o.patch} | 6 +- ...gure.ac-handle-correctly-libc_cv_ro.patch} | 6 +- patch => 0014-Add-unused-attribute.patch} | 6 +- ...he-path-sets-wrong-config-variables.patch} | 6 +- ...one-re-written-tzselect-as-posix-sh.patch} | 6 +- ...ash-dependency-for-nscd-init-script.patch} | 6 +- ...s-building-and-testing-instructions.patch} | 10 +- ...libc-Help-bootstrap-cross-toolchain.patch} | 12 +- ...-eglibc-Clear-cache-lines-on-ppc8xx.patch} | 6 +- ...glibc-Resolve-__fpscr_values-on-SH4.patch} | 6 +- ...port-cross-locale-generation-support.patch | 28 +- ...Define-DUMMY_LOCALE_T-if-not-defined.patch | 6 +- ...ke-_dl_build_local_scope-breadth-fir.patch | 10 +- ...le-fix-hard-coded-reference-to-gcc-E.patch | 6 +- ...set-dl_load_write_lock-after-forking.patch | 14 +- ...ck-before-switching-to-malloc_atfork.patch | 30 +- ...sts.h-enum-definition-for-TRAP_HWBKP.patch | 14 +- ...with-memccpy-to-fix-Wstringop-trunca.patch | 40 -- ...archive-uses-a-hard-coded-locale-pa.patch} | 23 +- ...t-no-lines-in-bison-generated-files.patch} | 17 +- .../0031-nativesdk-deprecate-libcrypt.patch | 419 -- .../glibc/glibc/CVE-2017-18269.patch | 178 .../glibc/glibc/CVE-2018-11236.patch | 164 --- .../glibc/glibc/CVE-2018-11237.patch | 82 .../glibc/{glibc_2.27.bb => glibc_2.28.bb}| 44 +- 42 files changed, 235 insertions(+), 1081 deletions(-) rename meta/recipes-core/glibc/{cross-localedef-native_2.27.bb => cross-localedef-native_2.28.bb} (97%) rename meta/recipes-core/glibc/{glibc-initial_2.27.bb => glibc-initial_2.28.bb} (100%) rename meta/recipes-core/glibc/{glibc-locale_2.27.bb => glibc-locale_2.28.bb} (100%) rename meta/recipes-core/glibc/{glibc-mtrace_2.27.bb => glibc-mtrace_2.28.bb} (100%) rename meta/recipes-core/glibc/{glibc-scripts_2.27.bb => glibc-scripts_2.28.bb} (100%) rename meta/recipes-core/glibc/glibc/{relocate-locales.patch => 0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch} (80%) rename meta/recipes-core/glibc/glibc/{0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch => 0006-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch} (97%) rename meta/recipes-core/glibc/glibc/{0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch => 0007-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch} (85%) rename meta/recipes-core/glibc/glibc/{0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch => 0008-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch} (98%) rename meta/recipes-core/glibc/glibc/{0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch => 0009-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch} (98%) rename meta/recipes-core/glibc/glibc/{0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch => 0010-Quote-from-bug-1443-which-explains-what-the-patch-do.patch} (93%) rename meta/recipes-core/glibc/glibc/{0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch => 0011-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch} (89%) rename meta/recipes-core/glibc/glibc/{0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch => 0012-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch} (93%) rename meta/recipes-core/glibc/glibc/{0012-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch => 0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch} (88%) rename meta/recipes-core/glibc/glibc/{0013-Add-unused-attribute.patch => 0014-Add-unused-attribute.patch} (86%) rename meta/recipes-core/glibc/glibc/{0014-yes-within-the-path-sets-wrong-config-variables.patch => 0015-yes-within-the-path-sets-wrong-config-variables.patch} (98%) rename meta/recipes-core/glibc/glibc/{0015-timezone-re-written-tzselect-as-posix-sh.patch => 0016-timezone-re-written-tzselect-as-posix-sh.patch} (90%) rename
Re: [OE-core] [PATCH 1/1] oe_syslog.py: fix for syslog-ng
On Fri, 2018-08-03 at 16:27 +0800, Chen Qi wrote: > When using syslog-ng as the syslog provider, oe_syslog test case > fails > because it cannot find the syslog daemon. This is because it greps > for > 'syslogd' but syslog-ng's daemon is 'syslog-ng'. So fix the grep > command > to also consider syslog-ng. > > Also, when the test case fails, what I get is: > > AssertionError: 1 != 0 : No syslogd process; ps output: > > > > This does not help user. The output is actually from the 'PS | GREP' > command. > And when the 'PS | GREP' command fails, the output is always empty. > So also > fix it to actually output the ps information. After the change, it > looks like: > > AssertionError: 1 != 0 : No syslogd process; ps -ef output: > > UIDPID PPID C STIME TTY TIME CMD > > root 1 0 28 07:35 ?00:00:19 /sbin/init > > root 2 0 0 07:35 ?00:00:00 [kthreadd] > > root 3 2 0 07:35 ?00:00:00 [kworker/0:0] > > ... > > Signed-off-by: Chen Qi > --- > meta/lib/oeqa/runtime/cases/oe_syslog.py | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/meta/lib/oeqa/runtime/cases/oe_syslog.py > b/meta/lib/oeqa/runtime/cases/oe_syslog.py > index 935f10f..23abae3 100644 > --- a/meta/lib/oeqa/runtime/cases/oe_syslog.py > +++ b/meta/lib/oeqa/runtime/cases/oe_syslog.py > @@ -10,9 +10,10 @@ class SyslogTest(OERuntimeTestCase): > @OETestDepends(['ssh.SSHTest.test_ssh']) > @OEHasPackage(["busybox-syslog", "sysklogd", "rsyslog", "syslog- > ng"]) > def test_syslog_running(self): > -cmd = '%s | grep -i [s]yslogd' % self.tc.target_cmds['ps'] > -status, output = self.target.run(cmd) > -msg = "No syslogd process; ps output: %s" % output > +cmd = '%s | grep -iE "[s]yslogd|[s]yslog-ng"' % > self.tc.target_cmds['ps'] > +status, _ = self.target.run(cmd) > +_, output = self.target.run(self.tc.target_cmds['ps']) > +msg = "No syslogd process; %s output:\n%s" % > (self.tc.target_cmds['ps'], output) > self.assertEqual(status, 0, msg=msg) Rather than getting the output of "ps" again if the test failed (which may then be different), could we just get the output of ps and then test for the presence of syslog using python, sharing the output of ps if the match isn't found? Cheers, Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] Revert "gnutls: rationalise libunistring arguments"
On Fri, 2018-08-03 at 08:49 -0700, Khem Raj wrote: > Yes, will do. I explained it in original thread as well I know, but we need it in the commit message so we record why we did it... Cheers, Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH] packagegroup-core-lsb: use new name for libasound
Signed-off-by: Ross Burton --- meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb index ef6347c7120..933864aee8f 100644 --- a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb +++ b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb @@ -219,7 +219,7 @@ RDEPENDS_packagegroup-core-lsb-desktop = "\ liberation-fonts \ gtk+ \ atk \ -libasound \ +alsa-lib \ " RDEPENDS_packagegroup-core-lsb-runtime-add = "\ -- 2.11.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH V2] Revert "gnutls: rationalise libunistring arguments"
This causes regression on build machines where libunistring is installed on host. It is also because gnuts is using non standard AC macro called AC_LIB_HAVE_LINKFLAGS to detect this library and it confusing cross builds. This reverts commit 60fef4940de7f0440f1216eb2ea0ea683b3e8fdd. Signed-off-by: Khem Raj --- V2: Describe the rationale to revert it meta/recipes-support/gnutls/gnutls.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-support/gnutls/gnutls.inc b/meta/recipes-support/gnutls/gnutls.inc index 876a3847b0..04c0fd2af8 100644 --- a/meta/recipes-support/gnutls/gnutls.inc +++ b/meta/recipes-support/gnutls/gnutls.inc @@ -39,6 +39,7 @@ EXTRA_OECONF = " \ --enable-local-libopts \ --enable-openssl-compatibility \ --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \ +--without-libunistring-prefix \ " LDFLAGS_append_libc-musl = " -largp" -- 2.18.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] Revert "gnutls: rationalise libunistring arguments"
Yes, will do. I explained it in original thread as well On Fri, Aug 3, 2018 at 8:47 AM Richard Purdie wrote: > > On Fri, 2018-08-03 at 08:40 -0700, Khem Raj wrote: > > ping^1 > > Could you put something about why in the commit message please? > > Cheers, > > Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] Revert "gnutls: rationalise libunistring arguments"
On Fri, 2018-08-03 at 08:40 -0700, Khem Raj wrote: > ping^1 Could you put something about why in the commit message please? Cheers, Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] Revert "gnutls: rationalise libunistring arguments"
ping^1 On Fri, Jul 27, 2018 at 2:04 PM Khem Raj wrote: > > This reverts commit 60fef4940de7f0440f1216eb2ea0ea683b3e8fdd. > --- > meta/recipes-support/gnutls/gnutls.inc | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/meta/recipes-support/gnutls/gnutls.inc > b/meta/recipes-support/gnutls/gnutls.inc > index b62a137e59..98ec8d9667 100644 > --- a/meta/recipes-support/gnutls/gnutls.inc > +++ b/meta/recipes-support/gnutls/gnutls.inc > @@ -41,6 +41,7 @@ EXTRA_OECONF = " \ > --enable-local-libopts \ > --enable-openssl-compatibility \ > --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \ > +--without-libunistring-prefix \ > " > > LDFLAGS_append_libc-musl = " -largp" > -- > 2.18.0 > -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH v3] alsa-lib: Cleanup packaging
Cleans up the packaging by moving libasound.so.2 back into the alsa-lib package which was previously empty. Previously, it was difficult to create an image that had libasound.so.2, then create an SDK from that image that had the proper development files, because the only way to get libasound.so.2 was to do: IMAGE_INSTALL += "libasound" This however caused a problem because all of the development files that would be desired in the SDK were located in alsa-lib-dev, which wouldn't be included because alsa-lib wasn't included, and it was impossible to include alsa-lib because it was an empty package that was culled. Signed-off-by: Joshua Watt --- meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb index 6364e9eafaa..25e7a3c6b72 100644 --- a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb +++ b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb @@ -18,19 +18,18 @@ EXTRA_OECONF += " \ --disable-python \ " -PACKAGES =+ "alsa-server libasound alsa-conf alsa-doc" +PACKAGES =+ "alsa-server alsa-conf alsa-doc" -FILES_libasound = "${libdir}/libasound.so.*" FILES_alsa-server = "${bindir}/*" FILES_alsa-conf = "${datadir}/alsa/" -RDEPENDS_libasound = "alsa-conf" - -# alsa-lib gets automatically added to alsa-lib-dev dependencies, but the -# alsa-lib package doesn't exist. libasound is the real library package. -RDEPENDS_${PN}-dev = "libasound" +RDEPENDS_${PN}_class-target = "alsa-conf" # upgrade path +RPROVIDES_${PN} = "libasound" +RREPLACES_${PN} = "libasound" +RCONFLICTS_${PN} = "libasound" + RPROVIDES_${PN}-dev = "alsa-dev" RREPLACES_${PN}-dev = "alsa-dev" RCONFLICTS_${PN}-dev = "alsa-dev" -- 2.17.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH v2] alsa-lib: Cleanup packaging
On Fri, 2018-08-03 at 15:02 +0100, Burton, Ross wrote: > On 3 August 2018 at 14:48, Joshua Watt wrote: > > # upgrade path > > +RPROVIDES_${PN}-dev = "libasound" > > +RREPLACES_${PN}-dev = "libasound" > > +RCONFLICTS_${PN}-dev = "libasound" > > Shouldn't this just be PN? Indeed! Good catch. I'll try to remember the in-reply-to this time ;) > > Ross -- Joshua Watt -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH v2] alsa-lib: Cleanup packaging
On 3 August 2018 at 14:48, Joshua Watt wrote: > # upgrade path > +RPROVIDES_${PN}-dev = "libasound" > +RREPLACES_${PN}-dev = "libasound" > +RCONFLICTS_${PN}-dev = "libasound" Shouldn't this just be PN? Ross -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH 4/4] desktop-file-utils: allow target/nativesdk build, not just native
Also fix the license, as this is GPLv2+ not just v2. Signed-off-by: Ross Burton --- ...le-utils-native_0.23.bb => desktop-file-utils_0.23.bb} | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) rename meta/recipes-devtools/desktop-file-utils/{desktop-file-utils-native_0.23.bb => desktop-file-utils_0.23.bb} (58%) diff --git a/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.23.bb b/meta/recipes-devtools/desktop-file-utils/desktop-file-utils_0.23.bb similarity index 58% rename from meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.23.bb rename to meta/recipes-devtools/desktop-file-utils/desktop-file-utils_0.23.bb index 54daabef56c..6446f47189d 100644 --- a/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.23.bb +++ b/meta/recipes-devtools/desktop-file-utils/desktop-file-utils_0.23.bb @@ -1,18 +1,19 @@ SECTION = "console/utils" SUMMARY = "Command line utilities for working with *.desktop files" HOMEPAGE = "http://www.freedesktop.org/wiki/Software/desktop-file-utils; -LICENSE = "GPLv2" +LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" -DEPENDS = "glib-2.0-native" - -SRC_URI = "http://freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-${PV}.tar.xz; +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://src/validator.c;beginline=4;endline=27;md5=281e1114ee6c486a1a0a4295986b9416" +SRC_URI = "http://freedesktop.org/software/${BPN}/releases/${BP}.tar.xz; SRC_URI[md5sum] = "599133d51cc9a41bfec186414906b6f1" SRC_URI[sha256sum] = "6c094031bdec46c9f621708f919084e1cb5294e2c5b1e4c883b3e70cb8903385" -inherit autotools native +DEPENDS = "glib-2.0" -S = "${WORKDIR}/desktop-file-utils-${PV}" +inherit autotools pkgconfig EXTRA_OECONF += "ac_cv_prog_EMACS=no" + +BBCLASSEXTEND = "native nativesdk" -- 2.11.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH 3/4] oeqa/sdk: add test that CMake works
Add a new SDK testcase that builds assimp, a project that uses cmake. Using TARGET_ARCH and TARGET_OS which is now exported into the environment, check that the generated binaries match the ELF headers we expect. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/assimp.py | 68 +++ 1 file changed, 68 insertions(+) create mode 100644 meta/lib/oeqa/sdk/cases/assimp.py diff --git a/meta/lib/oeqa/sdk/cases/assimp.py b/meta/lib/oeqa/sdk/cases/assimp.py new file mode 100644 index 000..7251bdf34e7 --- /dev/null +++ b/meta/lib/oeqa/sdk/cases/assimp.py @@ -0,0 +1,68 @@ +import os, subprocess, unittest +import bb +from oeqa.sdk.case import OESDKTestCase +from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject + +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() + +class BuildAssimp(OESDKTestCase): +""" +Test case to build a project using cmake. +""" + +td_vars = ['DATETIME', 'TARGET_OS', 'TARGET_ARCH'] + +@classmethod +def setUpClass(self): +if not (self.tc.hasHostPackage("nativesdk-cmake") or +self.tc.hasHostPackage("cmake-native")): +raise unittest.SkipTest("Needs cmake") + +def fetch(self, workdir, dl_dir, url, archive=None): +if not archive: +from urllib.parse import urlparse +archive = os.path.basename(urlparse(url).path) + +if dl_dir: +tarball = os.path.join(dl_dir, archive) +if os.path.exists(tarball): +return tarball + +tarball = os.path.join(workdir, archive) +subprocess.check_output(["wget", "-O", tarball, url]) +return tarball + +def test_assimp(self): +import tempfile +import oe.qa, oe.elf + +with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir: +dl_dir = self.td.get('DL_DIR', None) +tarball = self.fetch(testdir, dl_dir, "https://github.com/assimp/assimp/archive/v4.1.0.tar.gz;) +subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) + +sourcedir = os.path.join(testdir, "assimp-4.1.0") +builddir = os.path.join(testdir, "build") +installdir = os.path.join(testdir, "install") +bb.utils.mkdirhier(builddir) + +self._run("cd %s && cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON %s " % (builddir, sourcedir)) +self._run("cmake --build %s -- -j" % builddir) +self._run("cmake --build %s --target install -- DESTDIR=%s" % (builddir, installdir)) + +elf = oe.qa.ELFFile(os.path.join(installdir, "usr", "local", "lib", "libassimp.so.4.1.0")) +elf.open() + +output = self._run("echo $OECORE_TARGET_OS:$OECORE_TARGET_ARCH") +target_os, target_arch = output.strip().split(":") +machine_data = oe.elf.machine_dict(None)[target_os][target_arch] +(machine, osabi, abiversion, endian, bits) = machine_data + +self.assertEqual(machine, elf.machine()) +self.assertEqual(bits, elf.abiSize()) +self.assertEqual(endian, elf.isLittleEndian()) + +@classmethod +def tearDownClass(self): +self.project.clean() -- 2.11.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH 2/4] toolchain-scripts: put TARGET_ARCH and TARGET_OS into environment
It's useful for the SDK to know exactly what TARGET_ARCH and TARGET_OS are, specifically for SDK QA. Signed-off-by: Ross Burton --- meta/classes/toolchain-scripts.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass index 63b07c802f4..6d1ba69473a 100644 --- a/meta/classes/toolchain-scripts.bbclass +++ b/meta/classes/toolchain-scripts.bbclass @@ -52,6 +52,9 @@ toolchain_create_sdk_env_script () { echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script echo 'export OECORE_BASELIB="${baselib}"' >> $script + echo 'export OECORE_TARGET_ARCH="${TARGET_ARCH}"' >>$script + echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script + echo 'unset command_not_found_handle' >> $script toolchain_shared_env_script -- 2.11.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH 1/4] cmake: fix linking in multilib SDKs
CMake, in it's infinite wisdom, when searching for libraries (using find_library) will look inside the libraries PREFIX/lib, PREFIX/lib32, and PREFIX/lib64. In a multilib SDK more than one of these will exist (potentially all three) and obviously for a given build configuration only one of those is valid. This search path is hard-coded deep inside CMake but by setting CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX we can bypass it and set an explicit lib to use. Do this by writing ${baselib} into the environment file, and then stripping "lib" from this to obtain the suffix in the cmake-specific environment script, which is then read in the CMake toolchain. Signed-off-by: Ross Burton --- meta/classes/toolchain-scripts.bbclass| 1 + meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 2 ++ meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh | 1 + 3 files changed, 4 insertions(+) diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass index 0ff5301530b..63b07c802f4 100644 --- a/meta/classes/toolchain-scripts.bbclass +++ b/meta/classes/toolchain-scripts.bbclass @@ -51,6 +51,7 @@ toolchain_create_sdk_env_script () { echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script + echo 'export OECORE_BASELIB="${baselib}"' >> $script echo 'unset command_not_found_handle' >> $script toolchain_shared_env_script diff --git a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake index dc8477ea345..d52c29e5a1c 100644 --- a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake +++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake @@ -10,6 +10,8 @@ set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY ) +set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX "$ENV{OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX}") + # Set CMAKE_SYSTEM_PROCESSOR from the sysroot name (assuming processor-distro-os). if ($ENV{SDKTARGETSYSROOT} MATCHES "/sysroots/([a-zA-Z0-9_-]+)-.+-.+") set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_MATCH_1}) diff --git a/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh b/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh index 64b6cf3c6a3..7bdb19fb6ce 100644 --- a/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh +++ b/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh @@ -1 +1,2 @@ export OE_CMAKE_TOOLCHAIN_FILE="$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake" +export OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX="`echo $OECORE_BASELIB | sed -e s/lib//`" -- 2.11.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] alsa-lib: Allow empty alsa-lib package for SDK
On Fri, 2018-08-03 at 14:21 +0100, Burton, Ross wrote: > I agree with Tanu, the packaging in this recipe is non-standard and > instead of making it more non-standard, let's just fix it. > > Remove the libasound recipe, the contents of that can go into $PN. > Either way with Debian renaming it gets renamed to libasound2, and > without renaming it's still a sensible name. The dependency hacks > can > then all be removed. Done. Sorry I, forgot the "in-reply-to" when I sent the update. See: http://lists.openembedded.org/pipermail/openembedded-core/2018-August/1 53684.html > > Ross > > On 3 August 2018 at 11:39, Tanu Kaskinen wrote: > > On Thu, 2018-08-02 at 16:22 -0500, Joshua Watt wrote: > > > Without ALLOW_EMPTY, the empty alsa-lib package (which gets > > > culled) > > > makes it fairly difficult to create an image that has libasound, > > > then > > > create an SDK from that image that has the proper development > > > files. > > > > > > If there is no alsa-lib package, the only way to get libasound on > > > a > > > target image is to do: > > > > > > IMAGE_INSTALL += "libasound" > > > > > > This however causes a problem because all of the development > > > files that > > > would be desired in the SDK are located in alsa-lib-dev, which > > > won't be > > > included (because alsa-lib wasn't included). Without > > > ALLOW_EMPTY_${PN}, > > > it is not possible to do: > > > > > > IMAGE_INSTALL += "alsa-lib" > > > > > > because the package is empty and gets culled. Adding the > > > ALLOW_EMPTY and > > > then making alsa-lib RDEPEND on libasound solves this problem and > > > allows > > > alsa-lib to be installed on the target and have the correct > > > development > > > files in the SDK > > > > > > Signed-off-by: Joshua Watt > > > --- > > > meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb | 7 +++ > > > 1 file changed, 7 insertions(+) > > > > > > diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb > > > b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb > > > index 6364e9eafaa..581655c5349 100644 > > > --- a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb > > > +++ b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb > > > @@ -24,6 +24,13 @@ FILES_libasound = "${libdir}/libasound.so.*" > > > FILES_alsa-server = "${bindir}/*" > > > FILES_alsa-conf = "${datadir}/alsa/" > > > > > > +# Create an alsa-lib package even though it is empty and make it > > > RDEPEND on > > > +# libasound for target builds. This makes it possible to sanely > > > create a image > > > +# that has libasound and then generate an SDK from that image > > > that has > > > +# alsa-lib-dev > > > +ALLOW_EMPTY_${PN} = "1" > > > +RDEPENDS_${PN}_class-target = "libasound" > > > + > > > RDEPENDS_libasound = "alsa-conf" > > > > > > # alsa-lib gets automatically added to alsa-lib-dev > > > dependencies, but the > > > > Looks fine to me, although renaming alsa-lib-dev to libasound-dev > > would > > seem like a sensible option too. > > > > -- > > Tanu > > > > https://www.patreon.com/tanuk > > https://liberapay.com/tanuk > > -- > > ___ > > Openembedded-core mailing list > > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- Joshua Watt -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH v2] alsa-lib: Cleanup packaging
Cleans up the packaging by moving libasound.so.2 back into the alsa-lib package which was previously empty. Previously, it was difficult to create an image that had libasound.so.2, then create an SDK from that image that had the proper development files, because the only way to get libasound.so.2 was to do: IMAGE_INSTALL += "libasound" This however caused a problem because all of the development files that would be desired in the SDK were located in alsa-lib-dev, which wouldn't be included because alsa-lib wasn't included, and it was impossible to include alsa-lib because it was an empty package that was culled. Signed-off-by: Joshua Watt --- meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb index 6364e9eafaa..569f9f61e3a 100644 --- a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb +++ b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb @@ -18,19 +18,18 @@ EXTRA_OECONF += " \ --disable-python \ " -PACKAGES =+ "alsa-server libasound alsa-conf alsa-doc" +PACKAGES =+ "alsa-server alsa-conf alsa-doc" -FILES_libasound = "${libdir}/libasound.so.*" FILES_alsa-server = "${bindir}/*" FILES_alsa-conf = "${datadir}/alsa/" -RDEPENDS_libasound = "alsa-conf" - -# alsa-lib gets automatically added to alsa-lib-dev dependencies, but the -# alsa-lib package doesn't exist. libasound is the real library package. -RDEPENDS_${PN}-dev = "libasound" +RDEPENDS_${PN}_class-target = "alsa-conf" # upgrade path +RPROVIDES_${PN}-dev = "libasound" +RREPLACES_${PN}-dev = "libasound" +RCONFLICTS_${PN}-dev = "libasound" + RPROVIDES_${PN}-dev = "alsa-dev" RREPLACES_${PN}-dev = "alsa-dev" RCONFLICTS_${PN}-dev = "alsa-dev" -- 2.17.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] alsa-lib: Allow empty alsa-lib package for SDK
I agree with Tanu, the packaging in this recipe is non-standard and instead of making it more non-standard, let's just fix it. Remove the libasound recipe, the contents of that can go into $PN. Either way with Debian renaming it gets renamed to libasound2, and without renaming it's still a sensible name. The dependency hacks can then all be removed. Ross On 3 August 2018 at 11:39, Tanu Kaskinen wrote: > On Thu, 2018-08-02 at 16:22 -0500, Joshua Watt wrote: >> Without ALLOW_EMPTY, the empty alsa-lib package (which gets culled) >> makes it fairly difficult to create an image that has libasound, then >> create an SDK from that image that has the proper development files. >> >> If there is no alsa-lib package, the only way to get libasound on a >> target image is to do: >> >> IMAGE_INSTALL += "libasound" >> >> This however causes a problem because all of the development files that >> would be desired in the SDK are located in alsa-lib-dev, which won't be >> included (because alsa-lib wasn't included). Without ALLOW_EMPTY_${PN}, >> it is not possible to do: >> >> IMAGE_INSTALL += "alsa-lib" >> >> because the package is empty and gets culled. Adding the ALLOW_EMPTY and >> then making alsa-lib RDEPEND on libasound solves this problem and allows >> alsa-lib to be installed on the target and have the correct development >> files in the SDK >> >> Signed-off-by: Joshua Watt >> --- >> meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb | 7 +++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb >> b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb >> index 6364e9eafaa..581655c5349 100644 >> --- a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb >> +++ b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb >> @@ -24,6 +24,13 @@ FILES_libasound = "${libdir}/libasound.so.*" >> FILES_alsa-server = "${bindir}/*" >> FILES_alsa-conf = "${datadir}/alsa/" >> >> +# Create an alsa-lib package even though it is empty and make it RDEPEND on >> +# libasound for target builds. This makes it possible to sanely create a >> image >> +# that has libasound and then generate an SDK from that image that has >> +# alsa-lib-dev >> +ALLOW_EMPTY_${PN} = "1" >> +RDEPENDS_${PN}_class-target = "libasound" >> + >> RDEPENDS_libasound = "alsa-conf" >> >> # alsa-lib gets automatically added to alsa-lib-dev dependencies, but the > > Looks fine to me, although renaming alsa-lib-dev to libasound-dev would > seem like a sensible option too. > > -- > Tanu > > https://www.patreon.com/tanuk > https://liberapay.com/tanuk > -- > ___ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] alsa-lib: Allow empty alsa-lib package for SDK
On Thu, 2018-08-02 at 16:22 -0500, Joshua Watt wrote: > Without ALLOW_EMPTY, the empty alsa-lib package (which gets culled) > makes it fairly difficult to create an image that has libasound, then > create an SDK from that image that has the proper development files. > > If there is no alsa-lib package, the only way to get libasound on a > target image is to do: > > IMAGE_INSTALL += "libasound" > > This however causes a problem because all of the development files that > would be desired in the SDK are located in alsa-lib-dev, which won't be > included (because alsa-lib wasn't included). Without ALLOW_EMPTY_${PN}, > it is not possible to do: > > IMAGE_INSTALL += "alsa-lib" > > because the package is empty and gets culled. Adding the ALLOW_EMPTY and > then making alsa-lib RDEPEND on libasound solves this problem and allows > alsa-lib to be installed on the target and have the correct development > files in the SDK > > Signed-off-by: Joshua Watt > --- > meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb > b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb > index 6364e9eafaa..581655c5349 100644 > --- a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb > +++ b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb > @@ -24,6 +24,13 @@ FILES_libasound = "${libdir}/libasound.so.*" > FILES_alsa-server = "${bindir}/*" > FILES_alsa-conf = "${datadir}/alsa/" > > +# Create an alsa-lib package even though it is empty and make it RDEPEND on > +# libasound for target builds. This makes it possible to sanely create a > image > +# that has libasound and then generate an SDK from that image that has > +# alsa-lib-dev > +ALLOW_EMPTY_${PN} = "1" > +RDEPENDS_${PN}_class-target = "libasound" > + > RDEPENDS_libasound = "alsa-conf" > > # alsa-lib gets automatically added to alsa-lib-dev dependencies, but the Looks fine to me, although renaming alsa-lib-dev to libasound-dev would seem like a sensible option too. -- Tanu https://www.patreon.com/tanuk https://liberapay.com/tanuk -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [oe-core][PATCH v3 2/2] runtime selftest: remove the case of hw breakpoint
Hw breakpoint is based on hardware. Signed-off-by: Hongzhi.Song --- meta/lib/oeqa/runtime/cases/ksample.py | 16 1 file changed, 16 deletions(-) diff --git a/meta/lib/oeqa/runtime/cases/ksample.py b/meta/lib/oeqa/runtime/cases/ksample.py index 26fbe9d8cb..5e8699a2e2 100644 --- a/meta/lib/oeqa/runtime/cases/ksample.py +++ b/meta/lib/oeqa/runtime/cases/ksample.py @@ -161,22 +161,6 @@ class KSampleTest(KSample): # rmmod self.cmd_and_check("rmmod trace-printk") -# hw breakpoint -@OETestDepends(['ssh.SSHTest.test_ssh']) -def test_hw_breakpoint_example(self): -# check config -self.check_config("CONFIG_KALLSYMS_ALL") -# make sure if module exists -self.check_module_exist("hw_breakpoint/", "data_breakpoint.ko") -# modprobe -self.cmd_and_check("modprobe data_breakpoint") -# lsmod -self.cmd_and_check("lsmod | grep data_breakpoint | cut -d\' \' -f1", "data_breakpoint") -# check result -self.cmd_and_check("cat /var/log/messages | grep sample_hbp_handler", "sample_hbp_handler") -# rmmod -self.cmd_and_check("rmmod data_breakpoint") - @OETestDepends(['ssh.SSHTest.test_ssh']) def test_configfs_sample(self): # check config -- 2.11.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [oe-core][PATCH v3 0/2] remove the case of hw breakpoint
v3: remove the case of hw breakpoint v2: test_trace_events_sample of ksample.py Hongzhi.Song (2): runtime selftest: test_trace_events_sample of ksample.py runtime selftest: remove the case of hw breakpoint meta/lib/oeqa/runtime/cases/ksample.py | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) -- 2.11.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [oe-core][PATCH v2 1/2] runtime selftest: test_trace_events_sample of ksample.py
The debug info can not be written to trace buffer immediately by thread. So we should sleep some seconds. Signed-off-by: Hongzhi.Song --- meta/lib/oeqa/runtime/cases/ksample.py | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/runtime/cases/ksample.py b/meta/lib/oeqa/runtime/cases/ksample.py index 260bc3cfbd..26fbe9d8cb 100644 --- a/meta/lib/oeqa/runtime/cases/ksample.py +++ b/meta/lib/oeqa/runtime/cases/ksample.py @@ -18,7 +18,8 @@ class KSample(OERuntimeTestCase): else: # check result result = ("%s" % match_string) in output -self.assertTrue(result) +msg = output +self.assertTrue(result, msg) self.assertEqual(status, 0, cmd) def check_config(self, config_opt=''): @@ -126,7 +127,16 @@ class KSampleTest(KSample): self.cmd_and_check("echo 1 > /sys/kernel/debug/tracing/events/sample-trace/enable") self.cmd_and_check("cat /sys/kernel/debug/tracing/events/sample-trace/enable") # check result -self.cmd_and_check("cat /sys/kernel/debug/tracing/trace | grep hello | head -n1 | cut -d\':\' -f2", " foo_bar") +status = 1 +count = 0 +while status != 0: +time.sleep(1) +status, output = self.target.run('cat /sys/kernel/debug/tracing/trace | grep hello | head -n1 | cut -d\':\' -f2') +if " foo_bar" in output: +break +count = count + 1 +if count > 5: +self.assertTrue(False, "Time out when check result") # disable trace self.cmd_and_check("echo 0 > /sys/kernel/debug/tracing/events/sample-trace/enable") # clean up trace -- 2.11.0 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH 0/1] oe_syslog.py: fix for syslog-ng
*** BLURB HERE *** The following changes since commit da24071e92071ecbefe51314d82bf40f85172485: bitbake: toaster/orm/management/commands/lsupdates.py: Use new layerindexlib module (2018-08-02 10:18:27 +0100) are available in the git repository at: git://git.pokylinux.org/poky-contrib ChenQi/oe_syslog http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/oe_syslog Chen Qi (1): oe_syslog.py: fix for syslog-ng meta/lib/oeqa/runtime/cases/oe_syslog.py | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) -- 1.9.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
[OE-core] [PATCH 1/1] oe_syslog.py: fix for syslog-ng
When using syslog-ng as the syslog provider, oe_syslog test case fails because it cannot find the syslog daemon. This is because it greps for 'syslogd' but syslog-ng's daemon is 'syslog-ng'. So fix the grep command to also consider syslog-ng. Also, when the test case fails, what I get is: | AssertionError: 1 != 0 : No syslogd process; ps output: This does not help user. The output is actually from the 'PS | GREP' command. And when the 'PS | GREP' command fails, the output is always empty. So also fix it to actually output the ps information. After the change, it looks like: | AssertionError: 1 != 0 : No syslogd process; ps -ef output: | UIDPID PPID C STIME TTY TIME CMD | root 1 0 28 07:35 ?00:00:19 /sbin/init | root 2 0 0 07:35 ?00:00:00 [kthreadd] | root 3 2 0 07:35 ?00:00:00 [kworker/0:0] ... Signed-off-by: Chen Qi --- meta/lib/oeqa/runtime/cases/oe_syslog.py | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/meta/lib/oeqa/runtime/cases/oe_syslog.py b/meta/lib/oeqa/runtime/cases/oe_syslog.py index 935f10f..23abae3 100644 --- a/meta/lib/oeqa/runtime/cases/oe_syslog.py +++ b/meta/lib/oeqa/runtime/cases/oe_syslog.py @@ -10,9 +10,10 @@ class SyslogTest(OERuntimeTestCase): @OETestDepends(['ssh.SSHTest.test_ssh']) @OEHasPackage(["busybox-syslog", "sysklogd", "rsyslog", "syslog-ng"]) def test_syslog_running(self): -cmd = '%s | grep -i [s]yslogd' % self.tc.target_cmds['ps'] -status, output = self.target.run(cmd) -msg = "No syslogd process; ps output: %s" % output +cmd = '%s | grep -iE "[s]yslogd|[s]yslog-ng"' % self.tc.target_cmds['ps'] +status, _ = self.target.run(cmd) +_, output = self.target.run(self.tc.target_cmds['ps']) +msg = "No syslogd process; %s output:\n%s" % (self.tc.target_cmds['ps'], output) self.assertEqual(status, 0, msg=msg) class SyslogTestConfig(OERuntimeTestCase): -- 1.9.1 -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] Strip kernel modules and signatures
On Thu, Aug 2, 2018 at 9:54 AM, Ocampo Coronado, Omar wrote: > Neither 'nm' or 'readelf' provide a symbol that we can use to strip. > I'm having a hard time reading kernel-source/scripts/sign-file.c and how > exactly how the sign works and what bytes are being added, so we can avoid > stripping them. > > Looking into dracut, they simple avoid strip signed modules: > From dracut.sh:1671 # strip kernel modules, but do not touch signed > modules > > Perhaps we can do the same as dracut within meta/lib/oe/package.py. Some more information here: https://www.kernel.org/doc/html/v4.17/admin-guide/module-signing.html#signed-modules-and-stripping It looks like signed kernel modules can't be stripped at all. The packaging code should probably be updated to detect signed modules and then leave them alone. > -Original Message- > From: richard.pur...@linuxfoundation.org > [mailto:richard.pur...@linuxfoundation.org] > Sent: Thursday, August 2, 2018 4:19 AM > To: Ocampo Coronado, Omar ; > openembedded-core@lists.openembedded.org > Subject: Re: [OE-core] Strip kernel modules and signatures > > On Wed, 2018-08-01 at 22:46 +, Ocampo Coronado, Omar wrote: >> Hello OE, >> >> While attempting to sign our kernel modules (using the kernel >> configuration CONFIG_MODULE_SIG) the drivers in our image did not >> have the signature, even the certificate was being loaded by the >> kernel or the driver being signed during do_install(). >> >> Turns out package.bbclass, while it ignores to create debug info files >> it does strips the kernel modules files: >> >> python split_and_strip_files () { >> ... >> ... >> for f in kernmods: >> sfiles.append((f, 16, strip)) >> >> oe.utils.multiprocess_exec(sfiles, oe.package.runstrip) >> # >> # End of strip >> # >> os.chdir(oldcwd) >> } >> >> The strip is required for many reasons yet it removes the signature >> which we want to preserve in this scenario. >> To work around this issue add >> INHIBIT_PACKAGE_STRIP = "1" >> either on your virtual/kernel bb file or driver bb file. >> >> Hope this helps someone in the future when adding signature to files, >> perhaps including this into the Yocto kernel development manual. > > The code which handles kernel module stripping is in > meta/lib/oe/package.py: > > stripcmd.extend(["--strip-debug", "--remove-section=.comment", > "--remove-section=.note", "--preserve-dates"]) > > It would be good to see what we'd have to do to tweak that to work for signed > modules. > > Cheers, > > Richard > -- > ___ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [oe-core][PATCH v4 1/3] udev-extraconf/mount.sh: add support to systemd
On 2018年08月03日 00:15, Martin Hundebøll wrote: Hi Hongzhi, I think duplicating all of 'automount' when the only difference is the call to 'mount' is unnecessary. Hi, The patch is compatible with both systemd and sysvinit. And generally speaking, there will be no systemd-mount command when using sysvinit. // Hongzhi It should be possible to check for system inside the existing 'automount' (see diff below). When reading the script I couldn't help cleaning up the special treatment of mount from util-linux (busybox accepts '-o silent' too), and remove the 'rm_dir' function, which can be replaced by 'rmdir'. // Martin diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh index d760328a09..6f013c5afb 100644 --- a/meta/recipes-core/udev/udev-extraconf/mount.sh +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh @@ -20,11 +20,12 @@ done automount() { name="`basename "$DEVNAME"`" - ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" - # Silent util-linux's version of mounting auto - if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; + mkdir -p "/run/media/$name" + + # Use systemd-mount to avoid being trapped in udev's mount-namespace + if [ "$(readlink /sbin/init)" = "/lib/systemd/systemd" ]; then - MOUNT="$MOUNT -o silent" + MOUNT="/usr/bin/systemd-mount --no-block" fi # If filesystem type is vfat, change the ownership group to 'disk', and @@ -41,22 +42,12 @@ automount() { if ! $MOUNT -t auto $DEVNAME "/run/media/$name" then #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/run/media/$name\" failed!" - rm_dir "/run/media/$name" + rmdir "/run/media/$name" else logger "mount.sh/automount" "Auto-mount of [/run/media/$name] successful" touch "/tmp/.automount-$name" fi } - -rm_dir() { - # We do not want to rm -r populated directories - if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1" - then - ! test -z "$1" && rm -r "$1" - else - logger "mount.sh/automount" "Not removing non-empty directory [$1]" - fi -} # No ID_FS_TYPE for cdrom device, yet it should be mounted name="`basename "$DEVNAME"`" On 2018-08-02 04:50, Hongzhi.Song wrote: Udev-extraconf works correctly with sysvinit in the aspect of automounting block devices. But it has a serious problem in case of systemd. Block devices automounted by udev is unaccessible to host space(out of udevd's private namespace). For example, we cannot format those block devices. e.g. root@qemux86:~# mkfs.ext4 /dev/sda1 mke2fs 1.43.8 /dev/sda1 contains a ext4 file system last mounted on Tue Apr Proceed anyway? (y,N) y /dev/sda1 is apparently in use by the system; will not make a filesystem here! Other distributions has no such problem, because they use a series of rules to manager block devices. Different types of block devices match different rules. But udev-extraconf just use one rule, automount.rules, which results in this problem. The 'systemd-mount' command is recommended by the systemd community to solve such problems. This patch makes use of 'systemd-mount' to solve the above problem. [YOCTO #12644] Signed-off-by: Hongzhi.Song --- meta/recipes-core/udev/udev-extraconf/mount.sh | 55 +++--- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh index d760328a09..3a72c455e0 100644 --- a/meta/recipes-core/udev/udev-extraconf/mount.sh +++ b/meta/recipes-core/udev/udev-extraconf/mount.sh @@ -4,10 +4,26 @@ # # Attempt to mount any added block devices and umount any removed devices +BASE_INIT="`readlink "/sbin/init"`" +INIT_SYSTEMD="/lib/systemd/systemd" + +if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then + MOUNT="/usr/bin/systemd-mount" + UMOUNT="/usr/bin/systemd-umount" + + if [ -x $MOUNT ] && [ -x $UMOUNT ]; + then + logger "Using systemd-mount to finish mount" + else + logger "Linux init is using systemd, so please install systemd-mount to finish mount" + fi +else + MOUNT="/bin/mount" + UMOUNT="/bin/umount" +fi -MOUNT="/bin/mount" PMOUNT="/usr/bin/pmount" -UMOUNT="/bin/umount" + for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*` do if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; @@ -17,6 +33,33 @@ do fi done +automount_systemd() { + name="`basename "$DEVNAME"`" + + ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" + # Silent util-linux's version of mounting auto + MOUNT="$MOUNT -o silent" + + # If filesystem type is vfat, change the ownership group to 'disk', and + # grant it with w/r/x permissions. + case $ID_FS_TYPE in +