added my Recipes
This commit is contained in:
17
meta-openembedded/meta-oe/COPYING.MIT
Normal file
17
meta-openembedded/meta-oe/COPYING.MIT
Normal file
@@ -0,0 +1,17 @@
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
31
meta-openembedded/meta-oe/README
Normal file
31
meta-openembedded/meta-oe/README
Normal file
@@ -0,0 +1,31 @@
|
||||
meta-oe
|
||||
=======
|
||||
|
||||
This layer depends on:
|
||||
|
||||
URI: git://github.com/openembedded/openembedded-core.git
|
||||
branch: mickledore
|
||||
|
||||
luajit recipe requires host compiler to be able to generate 32bit code when target is 32bit
|
||||
e.g. arm, so ensure that $CC -m32 is functional on build host, if building this recipe, needed
|
||||
packages to fullfit this might have different names on different host distributions
|
||||
e.g. on archlinux based distributions install prerequisites like below
|
||||
|
||||
pacman -S lib32-gcc-libs lib32-glibc
|
||||
|
||||
Ubuntu
|
||||
sudo apt-get install gcc-multilib linux-libc-dev:i386
|
||||
|
||||
Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-oe][mickledore]' in the subject'
|
||||
|
||||
When sending single patches, please use something like:
|
||||
'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix="meta-oe][mickledore][PATCH"'
|
||||
|
||||
You are encouraged to fork the mirror on GitHub https://github.com/openembedded/meta-openembedded
|
||||
to share your patches, this is preferred for patch sets consisting of more than one patch.
|
||||
|
||||
Other services like GitLab, repo.or.cz or self-hosted setups are of course accepted as well,
|
||||
'git fetch <remote>' works the same on all of them. We recommend GitHub because it is free, easy
|
||||
to use, has been proven to be reliable and has a really good web GUI.
|
||||
|
||||
layer maintainer: Armin Kuster <akuster808@gmail.com>
|
||||
36
meta-openembedded/meta-oe/classes/breakpad.bbclass
Normal file
36
meta-openembedded/meta-oe/classes/breakpad.bbclass
Normal file
@@ -0,0 +1,36 @@
|
||||
# Class to inherit when you want to build against Breakpad.
|
||||
# Apart from inheriting this class, you need to set BREAKPAD_BIN in
|
||||
# your recipe, and make sure that you link against libbreakpad_client.a.
|
||||
|
||||
DEPENDS += "breakpad breakpad-native"
|
||||
|
||||
CFLAGS += "-I${STAGING_DIR_TARGET}${includedir}/breakpad "
|
||||
CXXFLAGS += "-I${STAGING_DIR_TARGET}${includedir}/breakpad "
|
||||
|
||||
BREAKPAD_BIN ?= ""
|
||||
|
||||
python () {
|
||||
breakpad_bin = d.getVar("BREAKPAD_BIN")
|
||||
|
||||
if not breakpad_bin:
|
||||
PN = d.getVar("PN")
|
||||
FILE = os.path.basename(d.getVar("FILE"))
|
||||
bb.error("To build %s, see breakpad.bbclass for instructions on \
|
||||
setting up your Breakpad configuration" % PN)
|
||||
raise ValueError('BREAKPAD_BIN not defined in %s' % PN)
|
||||
}
|
||||
|
||||
# Add creation of symbols here
|
||||
PACKAGE_PREPROCESS_FUNCS += "breakpad_package_preprocess"
|
||||
breakpad_package_preprocess () {
|
||||
mkdir -p ${PKGD}/usr/share/breakpad-syms
|
||||
find ${D} -name ${BREAKPAD_BIN} -exec sh -c "dump_syms {} > ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym" \;
|
||||
HASH=$(head -n1 ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym | rev | cut -d ' ' -f2 | rev)
|
||||
mkdir -p ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH}
|
||||
mv ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH}
|
||||
}
|
||||
|
||||
PACKAGES =+ "${PN}-breakpad"
|
||||
|
||||
FILES:${PN}-breakpad = "/usr/share/breakpad-syms"
|
||||
|
||||
125
meta-openembedded/meta-oe/classes/gitpkgv.bbclass
Normal file
125
meta-openembedded/meta-oe/classes/gitpkgv.bbclass
Normal file
@@ -0,0 +1,125 @@
|
||||
# gitpkgv.bbclass provides a GITPKGV and GITPKGVTAG variables to be
|
||||
# used in PKGV, as described bellow:
|
||||
#
|
||||
# - GITPKGV which is a sortable version with the format NN+GITHASH, to
|
||||
# be used in PKGV, where
|
||||
#
|
||||
# NN equals the total number of revs up to SRCREV
|
||||
# GITHASH is SRCREV's (full) hash
|
||||
#
|
||||
# - GITPKGVTAG which is the output of 'git describe --tags --exact-match'
|
||||
# allowing for automatic versioning
|
||||
#
|
||||
# gitpkgv.bbclass assumes the git repository has been cloned, and
|
||||
# contains SRCREV. So ${GITPKGV} and ${GITPKGVTAG} should never be
|
||||
# used in PV, only in PKGV. It can handle SRCREV = ${AUTOREV}, as
|
||||
# well as SRCREV = "<some fixed git hash>".
|
||||
#
|
||||
# WARNING: if upstream repository is always using consistent and
|
||||
# sortable tag name scheme you can get sortable version including tag
|
||||
# name with ${GITPKGVTAG}, but be aware that ie tag sequence "v1.0,
|
||||
# v1.2, xtest, v2.0" will force you to increment PE to get upgradeable
|
||||
# path to v2.0 revisions
|
||||
#
|
||||
# use example:
|
||||
#
|
||||
# inherit gitpkgv
|
||||
#
|
||||
# PV = "1.0+gitr${SRCPV}" # expands to something like 1.0+gitr3+4c1c21d7dbbf93b0df336994524313dfe0d4963b
|
||||
# PKGV = "1.0+gitr${GITPKGV}" # expands also to something like 1.0+gitr31337+4c1c21d7d
|
||||
#
|
||||
# or
|
||||
#
|
||||
# inherit gitpkgv
|
||||
#
|
||||
# PV = "1.0+gitr${SRCPV}" # expands to something like 1.0+gitr3+4c1c21d7dbbf93b0df336994524313dfe0d4963b
|
||||
# PKGV = "${GITPKGVTAG}" # expands to something like 1.0-31337+g4c1c21d
|
||||
# if there is tag v1.0 before this revision or
|
||||
# ver1.0-31337+g4c1c21d if there is tag ver1.0
|
||||
|
||||
GITPKGV = "${@get_git_pkgv(d, False)}"
|
||||
GITPKGVTAG = "${@get_git_pkgv(d, True)}"
|
||||
|
||||
# This regexp is used to drop unwanted parts of the found tags. Any matching
|
||||
# groups will be concatenated to yield the final version.
|
||||
GITPKGV_TAG_REGEXP ??= "v(\d.*)"
|
||||
|
||||
def gitpkgv_drop_tag_prefix(d, version):
|
||||
import re
|
||||
|
||||
m = re.match(d.getVar('GITPKGV_TAG_REGEXP'), version)
|
||||
if m:
|
||||
return ''.join(group for group in m.groups() if group)
|
||||
else:
|
||||
return version
|
||||
|
||||
def get_git_pkgv(d, use_tags):
|
||||
import os
|
||||
import bb
|
||||
from pipes import quote
|
||||
|
||||
src_uri = d.getVar('SRC_URI').split()
|
||||
fetcher = bb.fetch2.Fetch(src_uri, d)
|
||||
ud = fetcher.ud
|
||||
|
||||
#
|
||||
# If SRCREV_FORMAT is set respect it for tags
|
||||
#
|
||||
format = d.getVar('SRCREV_FORMAT')
|
||||
if not format:
|
||||
names = []
|
||||
for url in ud.values():
|
||||
if url.type == 'git' or url.type == 'gitsm':
|
||||
names.extend(url.revisions.keys())
|
||||
if len(names) > 0:
|
||||
format = '_'.join(names)
|
||||
else:
|
||||
format = 'default'
|
||||
|
||||
found = False
|
||||
for url in ud.values():
|
||||
if url.type == 'git' or url.type == 'gitsm':
|
||||
for name, rev in url.revisions.items():
|
||||
if not os.path.exists(url.localpath):
|
||||
return None
|
||||
|
||||
found = True
|
||||
|
||||
vars = { 'repodir' : quote(url.localpath),
|
||||
'rev' : quote(rev) }
|
||||
|
||||
rev = bb.fetch2.get_srcrev(d).split('+')[1]
|
||||
rev_file = os.path.join(url.localpath, "oe-gitpkgv_" + rev)
|
||||
|
||||
if not os.path.exists(rev_file) or os.path.getsize(rev_file)==0:
|
||||
commits = bb.fetch2.runfetchcmd(
|
||||
"git --git-dir=%(repodir)s rev-list %(rev)s -- 2>/dev/null | wc -l"
|
||||
% vars, d, quiet=True).strip().lstrip('0')
|
||||
|
||||
if commits != "":
|
||||
oe.path.remove(rev_file, recurse=False)
|
||||
with open(rev_file, "w") as f:
|
||||
f.write("%d\n" % int(commits))
|
||||
else:
|
||||
commits = "0"
|
||||
else:
|
||||
with open(rev_file, "r") as f:
|
||||
commits = f.readline(128).strip()
|
||||
|
||||
if use_tags:
|
||||
try:
|
||||
output = bb.fetch2.runfetchcmd(
|
||||
"git --git-dir=%(repodir)s describe %(rev)s --tags --exact-match 2>/dev/null"
|
||||
% vars, d, quiet=True).strip()
|
||||
ver = gitpkgv_drop_tag_prefix(d, output)
|
||||
except Exception:
|
||||
ver = "0.0-%s-g%s" % (commits, vars['rev'][:7])
|
||||
else:
|
||||
ver = "%s+%s" % (commits, vars['rev'][:7])
|
||||
|
||||
format = format.replace(name, ver)
|
||||
|
||||
if found:
|
||||
return format
|
||||
|
||||
return '0+0'
|
||||
84
meta-openembedded/meta-oe/classes/gitver.bbclass
Normal file
84
meta-openembedded/meta-oe/classes/gitver.bbclass
Normal file
@@ -0,0 +1,84 @@
|
||||
# Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
|
||||
# Released under the MIT license (see COPYING.MIT for the terms)
|
||||
#
|
||||
# gitver.bbclass provides a GITVER variable which is a (fairly) sane version,
|
||||
# for use in ${PV}, extracted from the ${S} git checkout, assuming it is one.
|
||||
# This is most useful in concert with srctree.bbclass.
|
||||
|
||||
def git_drop_tag_prefix(version):
|
||||
import re
|
||||
if re.match("v\d", version):
|
||||
return version[1:]
|
||||
else:
|
||||
return version
|
||||
|
||||
GIT_TAGADJUST = "git_drop_tag_prefix(version)"
|
||||
GITVER = "${@get_git_pv(d, tagadjust=lambda version:${GIT_TAGADJUST})}"
|
||||
GITSHA = "${@get_git_hash(d)}"
|
||||
|
||||
def gitrev_run(cmd, path):
|
||||
(output, error) = bb.process.run(cmd, cwd=path)
|
||||
return output.rstrip()
|
||||
|
||||
def get_git_pv(d, tagadjust=None):
|
||||
import os
|
||||
|
||||
srcdir = d.getVar("EXTERNALSRC") or d.getVar("S")
|
||||
gitdir = os.path.abspath(os.path.join(srcdir, ".git"))
|
||||
try:
|
||||
ver = gitrev_run("git describe --tags", gitdir)
|
||||
except:
|
||||
try:
|
||||
ver = gitrev_run("git rev-parse --short HEAD", gitdir)
|
||||
if ver:
|
||||
return "0.0+%s" % ver
|
||||
else:
|
||||
return "0.0"
|
||||
|
||||
except Exception as exc:
|
||||
raise bb.parse.SkipRecipe(str(exc))
|
||||
|
||||
if ver and tagadjust:
|
||||
ver = tagadjust(ver)
|
||||
return ver
|
||||
|
||||
def get_git_hash(d):
|
||||
import os
|
||||
|
||||
srcdir = d.getVar("EXTERNALSRC") or d.getVar("S")
|
||||
gitdir = os.path.abspath(os.path.join(srcdir, ".git"))
|
||||
try:
|
||||
rev = gitrev_run("git rev-list HEAD -1", gitdir)
|
||||
return rev[:7]
|
||||
except Exception as exc:
|
||||
bb.fatal(str(exc))
|
||||
|
||||
def mark_recipe_dependencies(path, d):
|
||||
from bb.parse import mark_dependency
|
||||
|
||||
gitdir = os.path.join(path, ".git")
|
||||
|
||||
# Force the recipe to be reparsed so the version gets bumped
|
||||
# if the active branch is switched, or if the branch changes.
|
||||
mark_dependency(d, os.path.join(gitdir, "HEAD"))
|
||||
|
||||
# Force a reparse if anything in the index changes.
|
||||
mark_dependency(d, os.path.join(gitdir, "index"))
|
||||
|
||||
try:
|
||||
ref = gitrev_run("git symbolic-ref -q HEAD", gitdir)
|
||||
except bb.process.CmdError:
|
||||
pass
|
||||
else:
|
||||
if ref:
|
||||
mark_dependency(d, os.path.join(gitdir, ref))
|
||||
|
||||
# Catch new tags.
|
||||
tagdir = os.path.join(gitdir, "refs", "tags")
|
||||
if os.path.exists(tagdir):
|
||||
mark_dependency(d, tagdir)
|
||||
|
||||
python () {
|
||||
srcdir = d.getVar("EXTERNALSRC") or d.getVar("S")
|
||||
mark_recipe_dependencies(srcdir, d)
|
||||
}
|
||||
17
meta-openembedded/meta-oe/classes/gpe.bbclass
Normal file
17
meta-openembedded/meta-oe/classes/gpe.bbclass
Normal file
@@ -0,0 +1,17 @@
|
||||
DEPENDS:prepend = "virtual/libintl intltool-native "
|
||||
GPE_TARBALL_SUFFIX ?= "gz"
|
||||
SRC_URI = "${GPE_MIRROR}/${BP}.tar.${GPE_TARBALL_SUFFIX}"
|
||||
FILES:${PN} += "${datadir}/gpe ${datadir}/application-registry"
|
||||
SECTION ?= "gpe"
|
||||
|
||||
inherit gettext
|
||||
|
||||
gpe_do_compile() {
|
||||
oe_runmake PREFIX=${prefix}
|
||||
}
|
||||
|
||||
gpe_do_install() {
|
||||
oe_runmake PREFIX=${prefix} DESTDIR=${D} install
|
||||
}
|
||||
|
||||
EXPORT_FUNCTIONS do_compile do_install
|
||||
16
meta-openembedded/meta-oe/classes/image_types_sparse.bbclass
Normal file
16
meta-openembedded/meta-oe/classes/image_types_sparse.bbclass
Normal file
@@ -0,0 +1,16 @@
|
||||
inherit image_types
|
||||
|
||||
# This sets the granularity of the sparse image conversion. Chunk sizes will be
|
||||
# specified in units of this value. Setting this value smaller than the
|
||||
# underlying image's block size will not result in any further space saving.
|
||||
# However, there is no loss in correctness if this value is larger or smaller
|
||||
# than optimal. This value should be a power of two.
|
||||
SPARSE_BLOCK_SIZE ??= "4096"
|
||||
|
||||
CONVERSIONTYPES += "sparse"
|
||||
CONVERSION_CMD:sparse() {
|
||||
INPUT="${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
|
||||
truncate --no-create --size=%${SPARSE_BLOCK_SIZE} "$INPUT"
|
||||
img2simg -s "$INPUT" "$INPUT.sparse" ${SPARSE_BLOCK_SIZE}
|
||||
}
|
||||
CONVERSION_DEPENDS_sparse = "android-tools-native"
|
||||
5
meta-openembedded/meta-oe/classes/itstool.bbclass
Normal file
5
meta-openembedded/meta-oe/classes/itstool.bbclass
Normal file
@@ -0,0 +1,5 @@
|
||||
# helper class to prepare correct environment for native itstool
|
||||
|
||||
inherit python3native
|
||||
|
||||
DEPENDS:append = " itstool-native"
|
||||
@@ -0,0 +1,8 @@
|
||||
python __anonymous () {
|
||||
|
||||
machine_kernel_pr = d.getVar('MACHINE_KERNEL_PR')
|
||||
|
||||
if machine_kernel_pr:
|
||||
d.setVar('PR', machine_kernel_pr)
|
||||
}
|
||||
|
||||
35
meta-openembedded/meta-oe/classes/scancode.bbclass
Normal file
35
meta-openembedded/meta-oe/classes/scancode.bbclass
Normal file
@@ -0,0 +1,35 @@
|
||||
# We use scancode utlity for extacting licence information.
|
||||
# scancode itself is an OSS Utlitity.
|
||||
# For more informaiton https://github.com/nexB/scancode-toolkit
|
||||
|
||||
SCANCODE_FORMAT ?= "html-app"
|
||||
EXT = "${@'html' if d.getVar('SCANCODE_FORMAT') == 'html-app' else 'json'}"
|
||||
SCANCODE_TOOLKIT = "${@get_scancode_toolkit(d)}"
|
||||
SCANCODE_TAG = "v2.2.1"
|
||||
SCANCODE_GIT_LOCATION ?= "https://github.com/nexB/scancode-toolkit.git"
|
||||
SCANCODE_SRC_LOCATION ?= "${DL_DIR}/scancode"
|
||||
|
||||
def get_scancode_toolkit(d):
|
||||
lf = bb.utils.lockfile(d.getVar('SCANCODE_SRC_LOCATION') + ".lock")
|
||||
if (not os.path.exists(d.getVar('SCANCODE_SRC_LOCATION'))):
|
||||
os.system("git clone %s %s -b %s" % (d.getVar('SCANCODE_GIT_LOCATION'), d.getVar('SCANCODE_SRC_LOCATION'), d.getVar('SCANCODE_TAG')))
|
||||
bb.utils.unlockfile(lf)
|
||||
return (d.getVar('SCANCODE_SRC_LOCATION'))
|
||||
|
||||
do_scancode() {
|
||||
mkdir -p ${DEPLOY_DIR_IMAGE}/scancode
|
||||
cd ${SCANCODE_TOOLKIT}
|
||||
if [ -d "${S}" ]; then
|
||||
./scancode ${S} --format ${SCANCODE_FORMAT} ${DEPLOY_DIR_IMAGE}/scancode/${PN}.${EXT}
|
||||
fi
|
||||
}
|
||||
|
||||
addtask scancode after do_patch
|
||||
|
||||
do_scancode_oss() {
|
||||
echo "We are done running scancode"
|
||||
}
|
||||
|
||||
do_scancode_oss[recrdeptask] = "do_scancode_oss do_scancode"
|
||||
do_scancode_oss[nostamp] = "1"
|
||||
addtask do_scancode_oss after do_scancode
|
||||
316
meta-openembedded/meta-oe/classes/signing.bbclass
Normal file
316
meta-openembedded/meta-oe/classes/signing.bbclass
Normal file
@@ -0,0 +1,316 @@
|
||||
#
|
||||
# Copyright Jan Luebbe <jlu@pengutronix.de>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
# This class provides a common workflow to use asymmetric (i.e. RSA) keys to
|
||||
# sign artifacts. Usually, the keys are either stored as simple files in the
|
||||
# file system or on a HSM (Hardware Security Module). While files are easy to
|
||||
# use, it's hard to verify that no copies of the private have been made and
|
||||
# only authorized persons are able to use the key. Use of an HSM addresses
|
||||
# these risks by only allowing use of the key via an API (often PKCS #11). The
|
||||
# standard way of referring to a specific key in an HSM are PKCS #11 URIs (RFC
|
||||
# 7512).
|
||||
#
|
||||
# Many software projects support signing using PKCS #11 keys, but configuring
|
||||
# this is very project specific. Furthermore, as physical HSMs are not very
|
||||
# widespread, testing code signing in CI is not simple. To solve this at the
|
||||
# build system level, this class takes the approach of always using PKCS #11 at
|
||||
# the recipe level. For cases where the keys are available as files (i.e. test
|
||||
# keys in CI), they are imported into SoftHSM (a HSM emulation library).
|
||||
#
|
||||
# Recipes access the available keys via a specific role. So, depending on
|
||||
# whether we're building during development or for release, a given role can
|
||||
# refer to different keys.
|
||||
# Each key recipe PROVIDES a virtual package corresponding to the role, allowing
|
||||
# the user to select one of multiple keys for a role when needed.
|
||||
#
|
||||
# For use with a real HSM, a PKCS #11 URI can be set (i.e. in local.conf) to
|
||||
# override the SoftHSM key with the real one:
|
||||
#
|
||||
# SIGNING_PKCS11_URI[fit] = "pkcs11:serial=DENK0200554;object=ptx-dev-rauc&pin-value=123456"
|
||||
# SIGNING_PKCS11_MODULE[fit] = "/usr/lib/x86_64-linux-gnu/opensc-pkcs11.so"
|
||||
#
|
||||
# Examples for defining roles and importing keys:
|
||||
#
|
||||
# meta-code-signing/recipes-security/signing-keys/dummy-rsa-key-native.bb
|
||||
# meta-code-signing-demo/recipes-security/ptx-dev-keys/ptx-dev-keys-native_git.bb
|
||||
#
|
||||
# Examples for using keys for signing:
|
||||
#
|
||||
# meta-code-signing-demo/recipes-security/fit-image/linux-fit-image.bb
|
||||
# meta-code-signing-demo/recipes-core/bundles/update-bundle.bb
|
||||
#
|
||||
# Examples for using keys for authentication:
|
||||
#
|
||||
# meta-code-signing-demo/recipes-security/fit-image/barebox_%.bbappend
|
||||
# meta-code-signing-demo/recipes-core/rauc/rauc_%.bbappend
|
||||
#
|
||||
# Examples for using keys for both signing and authentication:
|
||||
#
|
||||
# meta-code-signing-demo/recipes-kernel/linux/linux-yocto_6.1.bbappend
|
||||
|
||||
SIGNING_PKCS11_URI ?= ""
|
||||
SIGNING_PKCS11_MODULE ?= ""
|
||||
|
||||
DEPENDS += "softhsm-native libp11-native opensc-native openssl-native"
|
||||
|
||||
def signing_class_prepare(d):
|
||||
import os.path
|
||||
|
||||
def export(role, k, v):
|
||||
k = k % (role, )
|
||||
d.setVar(k, v)
|
||||
d.setVarFlag(k, "export", "1")
|
||||
|
||||
roles = set()
|
||||
roles |= (d.getVarFlags("SIGNING_PKCS11_URI") or {}).keys()
|
||||
roles |= (d.getVarFlags("SIGNING_PKCS11_MODULE") or {}).keys()
|
||||
for role in roles:
|
||||
if not set(role).issubset("abcdefghijklmnopqrstuvwxyz0123456789_"):
|
||||
bb.fatal("key role name '%s' must consist of only [a-z0-9_]" % (role,))
|
||||
|
||||
pkcs11_uri = d.getVarFlag("SIGNING_PKCS11_URI", role) or d.getVar("SIGNING_PKCS11_URI")
|
||||
if not pkcs11_uri.startswith("pkcs11:"):
|
||||
bb.fatal("URI for key role '%s' must start with 'pkcs11:'" % (role,))
|
||||
|
||||
pkcs11_module = d.getVarFlag("SIGNING_PKCS11_MODULE", role) or d.getVar("SIGNING_PKCS11_MODULE")
|
||||
if not os.path.isfile(pkcs11_module):
|
||||
bb.fatal("module path for key role '%s' must be an existing file" % (role,))
|
||||
|
||||
if pkcs11_uri and not pkcs11_module:
|
||||
bb.warn("SIGNING_PKCS11_URI[%s] is set without SIGNING_PKCS11_MODULE[%s]" % (role, role))
|
||||
if pkcs11_module and not pkcs11_uri:
|
||||
bb.warn("SIGNING_PKCS11_MODULE[%s] is set without SIGNING_PKCS11_URI[%s]" % (role, role))
|
||||
|
||||
export(role, "SIGNING_PKCS11_URI_%s_", pkcs11_uri)
|
||||
export(role, "SIGNING_PKCS11_MODULE_%s_", pkcs11_module)
|
||||
|
||||
signing_pkcs11_tool() {
|
||||
pkcs11-tool --module "${STAGING_LIBDIR_NATIVE}/softhsm/libsofthsm2.so" --login --pin 1111 $*
|
||||
}
|
||||
|
||||
signing_import_prepare() {
|
||||
export _SIGNING_ENV_FILE_="${B}/meta-signing.env"
|
||||
rm -f "$_SIGNING_ENV_FILE_"
|
||||
|
||||
export SOFTHSM2_CONF="${B}/softhsm2.conf"
|
||||
export SOFTHSM2_DIR="${B}/softhsm2.tokens"
|
||||
export SOFTHSM2_MOD="${STAGING_LIBDIR_NATIVE}/softhsm/libsofthsm2.so"
|
||||
|
||||
echo "directories.tokendir = $SOFTHSM2_DIR" > "$SOFTHSM2_CONF"
|
||||
echo "objectstore.backend = db" >> "$SOFTHSM2_CONF"
|
||||
rm -rf "$SOFTHSM2_DIR"
|
||||
mkdir -p "$SOFTHSM2_DIR"
|
||||
|
||||
softhsm2-util --module $SOFTHSM2_MOD --init-token --free --label ${PN} --pin 1111 --so-pin 222222
|
||||
}
|
||||
|
||||
signing_import_define_role() {
|
||||
local role="${1}"
|
||||
case "${1}" in
|
||||
(*[!a-z0-9_]*) false;;
|
||||
(*) true;;
|
||||
esac || bbfatal "invalid role name '${1}', must consist of [a-z0-9_]"
|
||||
|
||||
echo "_SIGNING_PKCS11_URI_${role}_=\"pkcs11:token=${PN};object=$role;pin-value=1111\"" >> $_SIGNING_ENV_FILE_
|
||||
echo "_SIGNING_PKCS11_MODULE_${role}_=\"softhsm\"" >> $_SIGNING_ENV_FILE_
|
||||
}
|
||||
|
||||
# signing_import_cert_from_der <role> <der>
|
||||
#
|
||||
# Import a certificate from DER file to a role. To be used
|
||||
# with SoftHSM.
|
||||
signing_import_cert_from_der() {
|
||||
local role="${1}"
|
||||
local der="${2}"
|
||||
|
||||
signing_pkcs11_tool --type cert --write-object "${der}" --label "${role}"
|
||||
}
|
||||
|
||||
# signing_import_cert_from_pem <role> <pem>
|
||||
#
|
||||
# Import a certificate from PEM file to a role. To be used
|
||||
# with SoftHSM.
|
||||
signing_import_cert_from_pem() {
|
||||
local role="${1}"
|
||||
local pem="${2}"
|
||||
|
||||
openssl x509 \
|
||||
-in "${pem}" -inform pem -outform der |
|
||||
signing_pkcs11_tool --type cert --write-object /proc/self/fd/0 --label "${role}"
|
||||
}
|
||||
|
||||
# signing_import_pubkey_from_der <role> <pem>
|
||||
#
|
||||
# Import a public key from DER file to a role. To be used with SoftHSM.
|
||||
signing_import_pubkey_from_pem() {
|
||||
local role="${1}"
|
||||
local der="${2}"
|
||||
|
||||
signing_pkcs11_tool --type pubkey --write-object "${der}" --label "${role}"
|
||||
}
|
||||
|
||||
# signing_import_pubkey_from_pem <role> <pem>
|
||||
#
|
||||
# Import a public key from PEM file to a role. To be used with SoftHSM.
|
||||
signing_import_pubkey_from_pem() {
|
||||
local openssl_keyopt
|
||||
local role="${1}"
|
||||
local pem="${2}"
|
||||
|
||||
if [ -n "${IMPORT_PASS_FILE}" ]; then
|
||||
openssl rsa \
|
||||
-passin "file:${IMPORT_PASS_FILE}" \
|
||||
-in "${pem}" -inform pem -pubout -outform der
|
||||
else
|
||||
openssl rsa \
|
||||
-in "${pem}" -inform pem -pubout -outform der
|
||||
fi |
|
||||
signing_pkcs11_tool --type pubkey --write-object /proc/self/fd/0 --label "${role}"
|
||||
}
|
||||
|
||||
# signing_import_privkey_from_der <role> <pem>
|
||||
#
|
||||
# Import a private key from DER file to a role. To be used with SoftHSM.
|
||||
signing_import_privkey_from_der() {
|
||||
local role="${1}"
|
||||
local der="${2}"
|
||||
signing_pkcs11_tool --type privkey --write-object "${der}" --label "${role}"
|
||||
}
|
||||
|
||||
# signing_import_privkey_from_pem <role> <pem>
|
||||
#
|
||||
# Import a private key from PEM file to a role. To be used with SoftHSM.
|
||||
signing_import_privkey_from_pem() {
|
||||
local openssl_keyopt
|
||||
local role="${1}"
|
||||
local pem="${2}"
|
||||
|
||||
if [ -n "${IMPORT_PASS_FILE}" ]; then
|
||||
openssl rsa \
|
||||
-passin "file:${IMPORT_PASS_FILE}" \
|
||||
-in "${pem}" -inform pem -outform der
|
||||
else
|
||||
openssl rsa \
|
||||
-in "${pem}" -inform pem -outform der
|
||||
fi |
|
||||
signing_pkcs11_tool --type privkey --write-object /proc/self/fd/0 --label "${role}"
|
||||
}
|
||||
|
||||
# signing_import_key_from_pem <role> <pem>
|
||||
#
|
||||
# Import a private and public key from PEM file to a role. To be used
|
||||
# with SoftHSM.
|
||||
signing_import_key_from_pem() {
|
||||
local role="${1}"
|
||||
local pem="${2}"
|
||||
|
||||
signing_import_pubkey_from_pem "${role}" "${pem}"
|
||||
signing_import_privkey_from_pem "${role}" "${pem}"
|
||||
}
|
||||
|
||||
signing_import_finish() {
|
||||
echo "loaded objects:"
|
||||
signing_pkcs11_tool --list-objects
|
||||
}
|
||||
|
||||
signing_import_install() {
|
||||
install -d ${D}${localstatedir}/lib/softhsm/tokens/${PN}
|
||||
install -m 600 -t ${D}${localstatedir}/lib/softhsm/tokens/${PN} ${B}/softhsm2.tokens/*/*
|
||||
install -d ${D}${localstatedir}/lib/meta-signing.env.d
|
||||
install -m 644 "${B}/meta-signing.env" ${D}${localstatedir}/lib/meta-signing.env.d/${PN}
|
||||
}
|
||||
|
||||
signing_prepare() {
|
||||
if [ -f ${OPENSSL_CONF} ]; then
|
||||
echo "Using '${OPENSSL_CONF}' for OpenSSL configuration"
|
||||
else
|
||||
echo "Missing 'openssl.cnf' at '${STAGING_ETCDIR_NATIVE}/ssl'"
|
||||
return 1
|
||||
fi
|
||||
if [ -d ${OPENSSL_MODULES} ]; then
|
||||
echo "Using '${OPENSSL_MODULES}' for OpenSSL run-time modules"
|
||||
else
|
||||
echo "Missing OpenSSL module directory at '${OPENSSL_MODULES}'"
|
||||
return 1
|
||||
fi
|
||||
if [ -d ${OPENSSL_ENGINES} ]; then
|
||||
echo "Using '${OPENSSL_ENGINES}' for OpenSSL run-time PKCS#11 modules"
|
||||
else
|
||||
echo "Missing OpenSSL PKCS11 engine directory at '${OPENSSL_ENGINES}'"
|
||||
return 1
|
||||
fi
|
||||
|
||||
export SOFTHSM2_CONF="${WORKDIR}/softhsm2.conf"
|
||||
export SOFTHSM2_DIR="${STAGING_DIR_NATIVE}/var/lib/softhsm/tokens"
|
||||
|
||||
echo "directories.tokendir = $SOFTHSM2_DIR" > "$SOFTHSM2_CONF"
|
||||
echo "objectstore.backend = db" >> "$SOFTHSM2_CONF"
|
||||
|
||||
for env in $(ls "${STAGING_DIR_NATIVE}/var/lib/meta-signing.env.d"); do
|
||||
. "${STAGING_DIR_NATIVE}/var/lib/meta-signing.env.d/$env"
|
||||
done
|
||||
}
|
||||
# make sure these functions are exported
|
||||
signing_prepare[vardeps] += "signing_get_uri signing_get_module"
|
||||
|
||||
signing_use_role() {
|
||||
local role="${1}"
|
||||
|
||||
export PKCS11_MODULE_PATH="$(signing_get_module $role)"
|
||||
export PKCS11_URI="$(signing_get_uri $role)"
|
||||
|
||||
if [ -z "$PKCS11_MODULE_PATH" ]; then
|
||||
echo "No PKCS11_MODULE_PATH found for role '${role}'"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$PKCS11_URI" ]; then
|
||||
echo "No PKCS11_URI found for role '${role}'"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
signing_get_uri() {
|
||||
local role="${1}"
|
||||
|
||||
# prefer local configuration
|
||||
eval local uri="\$SIGNING_PKCS11_URI_${role}_"
|
||||
if [ -n "$uri" ]; then
|
||||
echo "$uri"
|
||||
return
|
||||
fi
|
||||
|
||||
# fall back to softhsm
|
||||
eval echo "\$_SIGNING_PKCS11_URI_${role}_"
|
||||
}
|
||||
|
||||
signing_get_module() {
|
||||
local role="${1}"
|
||||
|
||||
# prefer local configuration
|
||||
eval local module="\$SIGNING_PKCS11_MODULE_${role}_"
|
||||
if [ -n "$module" ]; then
|
||||
echo "$module"
|
||||
return
|
||||
fi
|
||||
|
||||
# fall back to softhsm
|
||||
eval local module="\$_SIGNING_PKCS11_MODULE_${role}_"
|
||||
if [ "$module" = "softhsm" ]; then
|
||||
echo "${STAGING_LIBDIR_NATIVE}/softhsm/libsofthsm2.so"
|
||||
else
|
||||
echo "$module"
|
||||
fi
|
||||
}
|
||||
|
||||
python () {
|
||||
signing_class_prepare(d)
|
||||
}
|
||||
|
||||
export OPENSSL_MODULES="${STAGING_LIBDIR_NATIVE}/ossl-modules"
|
||||
export OPENSSL_ENGINES="${STAGING_LIBDIR_NATIVE}/engines-3"
|
||||
export OPENSSL_CONF="${STAGING_LIBDIR_NATIVE}/ssl-3/openssl.cnf"
|
||||
export SSL_CERT_DIR="${STAGING_LIBDIR_NATIVE}/ssl-3/certs"
|
||||
export SSL_CERT_FILE="${STAGING_LIBDIR_NATIVE}/ssl-3/cert.pem"
|
||||
231
meta-openembedded/meta-oe/classes/socorro-syms.bbclass
Normal file
231
meta-openembedded/meta-oe/classes/socorro-syms.bbclass
Normal file
@@ -0,0 +1,231 @@
|
||||
# Inherit this class when you want to allow Mozilla Socorro to link Breakpad's
|
||||
# stack trace information to the correct source code revision.
|
||||
# This class creates a new version of the symbol file (.sym) created by
|
||||
# Breakpad. The absolute file paths in the symbol file will be replaced by VCS,
|
||||
# branch, file and revision of the source file. That information facilitates the
|
||||
# lookup of a particular source code line in the stack trace.
|
||||
#
|
||||
# Use example:
|
||||
#
|
||||
# BREAKPAD_BIN = "YourBinary"
|
||||
# inherit socorro-syms
|
||||
#
|
||||
|
||||
# We depend on Breakpad creating the original symbol file.
|
||||
inherit breakpad
|
||||
|
||||
PACKAGE_PREPROCESS_FUNCS += "symbol_file_preprocess"
|
||||
PACKAGES =+ "${PN}-socorro-syms"
|
||||
FILES:${PN}-socorro-syms = "/usr/share/socorro-syms"
|
||||
|
||||
|
||||
python symbol_file_preprocess() {
|
||||
|
||||
package_dir = d.getVar("PKGD")
|
||||
breakpad_bin = d.getVar("BREAKPAD_BIN")
|
||||
if not breakpad_bin:
|
||||
package_name = d.getVar("PN")
|
||||
bb.error("Package %s depends on Breakpad via socorro-syms. See "
|
||||
"breakpad.bbclass for instructions on setting up the Breakpad "
|
||||
"configuration." % package_name)
|
||||
raise ValueError("BREAKPAD_BIN not defined in %s." % package_name)
|
||||
|
||||
sym_file_name = breakpad_bin + ".sym"
|
||||
|
||||
breakpad_syms_dir = os.path.join(
|
||||
package_dir, "usr", "share", "breakpad-syms")
|
||||
socorro_syms_dir = os.path.join(
|
||||
package_dir, "usr", "share", "socorro-syms")
|
||||
if not os.path.exists(socorro_syms_dir):
|
||||
os.makedirs(socorro_syms_dir)
|
||||
|
||||
breakpad_sym_file_path = os.path.join(breakpad_syms_dir, sym_file_name)
|
||||
socorro_sym_file_path = os.path.join(socorro_syms_dir, sym_file_name)
|
||||
|
||||
create_socorro_sym_file(d, breakpad_sym_file_path, socorro_sym_file_path)
|
||||
|
||||
arrange_socorro_sym_file(socorro_sym_file_path, socorro_syms_dir)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
def run_command(command, directory):
|
||||
|
||||
(output, error) = bb.process.run(command, cwd=directory)
|
||||
if error:
|
||||
raise bb.process.ExecutionError(command, error)
|
||||
|
||||
return output.rstrip()
|
||||
|
||||
|
||||
def create_socorro_sym_file(d, breakpad_sym_file_path, socorro_sym_file_path):
|
||||
|
||||
# In the symbol file, all source files are referenced like the following.
|
||||
# FILE 123 /path/to/some/File.cpp
|
||||
# Go through all references and replace the file paths with repository
|
||||
# paths.
|
||||
with open(breakpad_sym_file_path, 'r') as breakpad_sym_file, \
|
||||
open(socorro_sym_file_path, 'w') as socorro_sym_file:
|
||||
|
||||
for line in breakpad_sym_file:
|
||||
if line.startswith("FILE "):
|
||||
socorro_sym_file.write(socorro_file_reference(d, line))
|
||||
else:
|
||||
socorro_sym_file.write(line)
|
||||
|
||||
return
|
||||
|
||||
|
||||
def socorro_file_reference(d, line):
|
||||
|
||||
# The 3rd position is the file path. See example above.
|
||||
source_file_path = line.split()[2]
|
||||
source_file_repo_path = repository_path(
|
||||
d, os.path.normpath(source_file_path))
|
||||
|
||||
# If the file could be found in any repository then replace it with the
|
||||
# repository's path.
|
||||
if source_file_repo_path:
|
||||
return line.replace(source_file_path, source_file_repo_path)
|
||||
|
||||
return line
|
||||
|
||||
|
||||
def repository_path(d, source_file_path):
|
||||
|
||||
if not os.path.isfile(source_file_path):
|
||||
return None
|
||||
|
||||
# Check which VCS is used and use that to extract repository information.
|
||||
(output, error) = bb.process.run("git status",
|
||||
cwd=os.path.dirname(source_file_path))
|
||||
if not error:
|
||||
# Make sure the git repository we just found wasn't the yocto repository
|
||||
# itself, i.e. the root of the repository we're looking for must be a
|
||||
# child of the build directory TOPDIR.
|
||||
git_root_dir = run_command(
|
||||
"git rev-parse --show-toplevel", os.path.dirname(source_file_path))
|
||||
if not git_root_dir.startswith(d.getVar("TOPDIR")):
|
||||
return None
|
||||
|
||||
return git_repository_path(source_file_path)
|
||||
|
||||
# Here we can add support for other VCSs like hg, svn, cvs, etc.
|
||||
|
||||
# The source file isn't under any VCS so we leave it be.
|
||||
return None
|
||||
|
||||
|
||||
def is_local_url(url):
|
||||
|
||||
return \
|
||||
url.startswith("file:") or url.startswith("/") or url.startswith("./")
|
||||
|
||||
|
||||
def git_repository_path(source_file_path):
|
||||
|
||||
import re
|
||||
|
||||
# We need to extract the following.
|
||||
# (1): VCS URL, (2): branch, (3): repo root directory name, (4): repo file,
|
||||
# (5): revision.
|
||||
|
||||
source_file_dir = os.path.dirname(source_file_path)
|
||||
|
||||
# (1) Get the VCS URL and extract the server part, i.e. change the URL from
|
||||
# gitolite@git.someserver.com:SomeRepo.git to just git.someserver.com.
|
||||
source_long_url = run_command(
|
||||
"git config --get remote.origin.url", source_file_dir)
|
||||
|
||||
# The URL could be a local download directory. If so, get the URL again
|
||||
# using the local directory's config file.
|
||||
if is_local_url(source_long_url):
|
||||
git_config_file = os.path.join(source_long_url, "config")
|
||||
source_long_url = run_command(
|
||||
"git config --file %s --get remote.origin.url" % git_config_file,
|
||||
source_file_dir)
|
||||
|
||||
# If also the download directory redirects to a local git directory,
|
||||
# then we're probably using source code from a local debug branch which
|
||||
# won't be accessible by Socorro.
|
||||
if is_local_url(source_long_url):
|
||||
return None
|
||||
|
||||
# The URL can have several formats. A full list can be found using
|
||||
# git help clone. Extract the server part with a regex.
|
||||
url_match = re.search(".*(://|@)([^:/]*).*", source_long_url)
|
||||
source_server = url_match.group(2)
|
||||
|
||||
# (2) Get the branch for this file.
|
||||
source_branch_list = run_command("git show-branch --list", source_file_dir)
|
||||
source_branch_match = re.search(".*?\[(.*?)\].*", source_branch_list)
|
||||
source_branch = source_branch_match.group(1)
|
||||
|
||||
# (3) Since the repo root directory name can be changed without affecting
|
||||
# git, we need to extract the name from something more reliable.
|
||||
# The git URL has a repo name that we could use. We just need to strip off
|
||||
# everything around it - from gitolite@git.someserver.com:SomeRepo.git/ to
|
||||
# SomeRepo.
|
||||
source_repo_dir = re.sub("/$", "", source_long_url)
|
||||
source_repo_dir = re.sub("\.git$", "", source_repo_dir)
|
||||
source_repo_dir = re.sub(".*[:/]", "", source_repo_dir)
|
||||
|
||||
# (4) We know the file but want to remove all of the build system dependent
|
||||
# path up to and including the repository's root directory, e.g. remove
|
||||
# /home/someuser/dev/repo/projectx/
|
||||
source_toplevel = run_command(
|
||||
"git rev-parse --show-toplevel", source_file_dir)
|
||||
source_toplevel = source_toplevel + os.path.sep
|
||||
source_file = source_file_path.replace(source_toplevel, "")
|
||||
|
||||
# (5) Get the source revision this file is part of.
|
||||
source_revision = run_command("git rev-parse HEAD", source_file_dir)
|
||||
|
||||
# Assemble the repository path according to the Socorro format.
|
||||
socorro_reference = "git:%s/%s:%s/%s:%s" % \
|
||||
(source_server, source_branch,
|
||||
source_repo_dir, source_file,
|
||||
source_revision)
|
||||
|
||||
return socorro_reference
|
||||
|
||||
|
||||
def arrange_socorro_sym_file(socorro_sym_file_path, socorro_syms_dir):
|
||||
|
||||
import re
|
||||
|
||||
# Breakpad's minidump_stackwalk needs a certain directory structure in order
|
||||
# to find correct symbols when extracting a stack trace out of a minidump.
|
||||
# The directory structure must look like the following.
|
||||
# YourBinary/<hash>/YourBinary.sym
|
||||
# YourLibrary.so/<hash>/YourLibrary.so.sym
|
||||
# To be able to create such structure we need to extract the hash value that
|
||||
# is found in each symbol file. The header of the symbol file looks
|
||||
# something like this:
|
||||
# MODULE Linux x86 A079E473106CE51C74C1C25AF536CCD30 YourBinary
|
||||
# See
|
||||
# http://code.google.com/p/google-breakpad/wiki/LinuxStarterGuide
|
||||
|
||||
# Create the directory with the same name as the binary.
|
||||
binary_dir = re.sub("\.sym$", "", socorro_sym_file_path)
|
||||
if not os.path.exists(binary_dir):
|
||||
os.makedirs(binary_dir)
|
||||
|
||||
# Get the hash from the header of the symbol file.
|
||||
with open(socorro_sym_file_path, 'r') as socorro_sym_file:
|
||||
|
||||
# The hash is the 4th argument of the first line.
|
||||
sym_file_hash = socorro_sym_file.readline().split()[3]
|
||||
|
||||
# Create the hash directory.
|
||||
hash_dir = os.path.join(binary_dir, sym_file_hash)
|
||||
if not os.path.exists(hash_dir):
|
||||
os.makedirs(hash_dir)
|
||||
|
||||
# Move the symbol file to the hash directory.
|
||||
sym_file_name = os.path.basename(socorro_sym_file_path)
|
||||
os.rename(socorro_sym_file_path, os.path.join(hash_dir, sym_file_name))
|
||||
|
||||
return
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# Lists of the ptest in meta-oe, sorted into two sets by the time they take
|
||||
# Please keep these sorted in alphabetical order
|
||||
#
|
||||
# A first pass at getting all meta-oe recipes which inherit ptest
|
||||
# meta_oe_ptest_recipes=$(bitbake-layers show-recipes --recipes-only --layer meta-oe --inherits ptest --bare | tr '\n' ' ' | pcregrep -o1 '^NOTE:.+===(.+)$')
|
||||
#
|
||||
# ptests which take less than ~30s each
|
||||
PTESTS_FAST_META_OE = "\
|
||||
cmocka \
|
||||
cunit \
|
||||
duktape \
|
||||
fmt \
|
||||
function2 \
|
||||
fwupd \
|
||||
gcab \
|
||||
jq \
|
||||
leveldb \
|
||||
libcereal \
|
||||
libee \
|
||||
libio-pty-perl \
|
||||
libmanette \
|
||||
libssh \
|
||||
libtinyxml2 \
|
||||
libxml++-5.0 \
|
||||
libxmlb \
|
||||
libyang \
|
||||
lmdb \
|
||||
minicoredumper \
|
||||
neon \
|
||||
nodejs \
|
||||
onig \
|
||||
poco \
|
||||
protobuf \
|
||||
sdbus-c++ \
|
||||
uthash \
|
||||
xmlsec1 \
|
||||
zeromq \
|
||||
"
|
||||
PTESTS_FAST_META_OE:remove:libc-musl = "minicoredumper"
|
||||
|
||||
PTESTS_SLOW_META_OE = "\
|
||||
fftw \
|
||||
libusb-compat \
|
||||
rsyslog \
|
||||
"
|
||||
|
||||
PTESTS_PROBLEMS_META_OE ="\
|
||||
jemalloc \
|
||||
kernel-selftest \
|
||||
keyutils \
|
||||
libdbi-perl \
|
||||
libgpiod \
|
||||
libjcat \
|
||||
libteam \
|
||||
libxml++ \
|
||||
mcelog \
|
||||
oprofile \
|
||||
ostree \
|
||||
psqlodbc \
|
||||
pv \
|
||||
"
|
||||
114
meta-openembedded/meta-oe/conf/layer.conf
Normal file
114
meta-openembedded/meta-oe/conf/layer.conf
Normal file
@@ -0,0 +1,114 @@
|
||||
# It really depends on order of the layers appearing in BBLAYERS
|
||||
# variable in toplevel bblayers.conf file, where bitbake will search
|
||||
# for .inc files and others where bitbake uses BBPATH since it will
|
||||
# search the directories from first to last as specified in BBPATH
|
||||
# Therefore if you want a given layer to be considered high priority
|
||||
# for the .inc and .conf etc. then consider it adding at the beginning
|
||||
# of BBPATH. For bblayers bitbake will use BBFILES_PRIORITY to resolve
|
||||
# the recipe contention so the order of directories in BBFILES does
|
||||
# not matter.
|
||||
|
||||
# We have a conf and classes directory, append to BBPATH
|
||||
BBPATH .= ":${LAYERDIR}"
|
||||
|
||||
# We have a recipes directory, add to BBFILES
|
||||
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
|
||||
|
||||
BBFILE_COLLECTIONS += "openembedded-layer"
|
||||
BBFILE_PATTERN_openembedded-layer := "^${LAYERDIR}/"
|
||||
|
||||
# Define the priority for recipes (.bb files) from this layer,
|
||||
# choosing carefully how this layer interacts with all of the
|
||||
# other layers.
|
||||
|
||||
BBFILE_PRIORITY_openembedded-layer = "5"
|
||||
|
||||
# only activates content when identified layers are present,
|
||||
# to ensure yocto compatibility check pass
|
||||
BBFILES_DYNAMIC += " \
|
||||
meta-python:${LAYERDIR}/dynamic-layers/meta-python/recipes-*/*/*.bb \
|
||||
meta-python:${LAYERDIR}/dynamic-layers/meta-python/recipes-*/*/*.bbappend \
|
||||
networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/recipes-*/*/*.bb \
|
||||
networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/recipes-*/*/*.bbappend \
|
||||
gnome-layer:${LAYERDIR}/dynamic-layers/gnome-layer/recipes-*/*/*.bb \
|
||||
gnome-layer:${LAYERDIR}/dynamic-layers/gnome-layer/recipes-*/*/*.bbappend \
|
||||
perl-layer:${LAYERDIR}/dynamic-layers/perl-layer/recipes-*/*/*.bb \
|
||||
perl-layer:${LAYERDIR}/dynamic-layers/perl-layer/recipes-*/*/*.bbappend \
|
||||
selinux:${LAYERDIR}/dynamic-layers/selinux/recipes-*/*/*.bb \
|
||||
selinux:${LAYERDIR}/dynamic-layers/selinux/recipes-*/*/*.bbappend \
|
||||
"
|
||||
|
||||
# This should only be incremented on significant changes that will
|
||||
# cause compatibility issues with other layers
|
||||
LAYERVERSION_openembedded-layer = "1"
|
||||
|
||||
LAYERDEPENDS_openembedded-layer = "core"
|
||||
|
||||
LAYERSERIES_COMPAT_openembedded-layer = "mickledore"
|
||||
|
||||
LICENSE_PATH += "${LAYERDIR}/licenses"
|
||||
|
||||
PREFERRED_RPROVIDER_libdevmapper = "lvm2"
|
||||
PREFERRED_PROVIDER_android-tools-conf ?= "android-tools-conf"
|
||||
# Configures whether coreutils or uutils-coreutils is used.
|
||||
PREFERRED_PROVIDER_coreutils = "coreutils"
|
||||
PREFERRED_PROVIDER_virtual/opencl-icd ?= "opencl-icd-loader"
|
||||
PREFERRED_RPROVIDER_virtual/opencl-icd ?= "opencl-icd-loader"
|
||||
|
||||
SIGGEN_EXCLUDERECIPES_ABISAFE += " \
|
||||
fbset-modes \
|
||||
gpsd-machine-conf \
|
||||
distro-feed-configs \
|
||||
ca-certificates \
|
||||
pointercal \
|
||||
"
|
||||
|
||||
SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
|
||||
android-tools->android-tools-conf \
|
||||
usb-modeswitch-data->usb-modeswitch \
|
||||
lmsensors->lmsensors-config \
|
||||
phoronix-test-suite->bash \
|
||||
phoronix-test-suite->python3 \
|
||||
phoronix-test-suite->php \
|
||||
phoronix-test-suite->lsb-release \
|
||||
phoronix-test-suite->util-linux \
|
||||
phoronix-test-suite->busybox \
|
||||
phoronix-test-suite->shared-mime-info \
|
||||
phoronix-test-suite->desktop-file-utils \
|
||||
"
|
||||
|
||||
# ttf.inc inherits fontcache which adds fontconfig-utils to RDEPENDS
|
||||
SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
|
||||
terminus-font->fontconfig \
|
||||
ttf-abyssinica->fontconfig \
|
||||
ttf-arphic-uming->fontconfig \
|
||||
ttf-dejavu->fontconfig \
|
||||
ttf-droid->fontconfig \
|
||||
ttf-gentium->fontconfig \
|
||||
ttf-hunkyfonts->fontconfig \
|
||||
ttf-inconsolata->fontconfig \
|
||||
ttf-ipa->fontconfig \
|
||||
ttf-liberation->fontconfig \
|
||||
ttf-liberation-sans-narrow->fontconfig \
|
||||
ttf-lklug->fontconfig \
|
||||
ttf-lohit->fontconfig \
|
||||
ttf-noto-emoji->fontconfig \
|
||||
ttf-pt-sans->fontconfig \
|
||||
ttf-roboto->fontconfig \
|
||||
ttf-mplus->fontconfig \
|
||||
ttf-sazanami->fontconfig \
|
||||
ttf-takao->fontconfig \
|
||||
ttf-tlwg->fontconfig \
|
||||
ttf-ubuntu-font-family->fontconfig \
|
||||
ttf-vlgothic->fontconfig \
|
||||
ttf-wqy-zenhei->fontconfig \
|
||||
source-han-sans-cn-fonts->fontconfig \
|
||||
source-han-sans-jp-fonts->fontconfig \
|
||||
source-han-sans-kr-fonts->fontconfig \
|
||||
source-han-sans-tw-fonts->fontconfig \
|
||||
source-code-pro-fonts->fontconfig \
|
||||
"
|
||||
|
||||
DEFAULT_TEST_SUITES:pn-meta-oe-ptest-image = " ${PTESTTESTSUITE}"
|
||||
|
||||
NON_MULTILIB_RECIPES:append = " crash pahole"
|
||||
@@ -0,0 +1,3 @@
|
||||
RDEPENDS:packagegroup-meta-oe-graphics +="\
|
||||
openbox-xdgmenu \
|
||||
"
|
||||
@@ -0,0 +1,13 @@
|
||||
=== modified file 'openbox-xdgmenu.c'
|
||||
--- openbox-xdgmenu.c 2011-09-03 20:13:39 +0000
|
||||
+++ openbox-xdgmenu.c 2013-12-28 17:41:04 +0000
|
||||
@@ -235,7 +235,7 @@
|
||||
}
|
||||
|
||||
g_printf("<item label=\"%s\">\n", g_strjoinv("&", g_strsplit(name,"&",0))),
|
||||
- g_printf("<action name=\"Execute\"><execute>%s</execute></action>\n", exec),
|
||||
+ g_printf("<action name=\"Execute\"><command>%s</command></action>\n", exec),
|
||||
g_printf("</item>\n");
|
||||
|
||||
g_free(name);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Index: openbox-xdgmenu-0.3/openbox-xdgmenu.c
|
||||
===================================================================
|
||||
--- openbox-xdgmenu-0.3.orig/openbox-xdgmenu.c
|
||||
+++ openbox-xdgmenu-0.3/openbox-xdgmenu.c
|
||||
@@ -197,7 +197,7 @@ void process_entry(GMenuTreeEntry *entry
|
||||
{
|
||||
GDesktopAppInfo *appinfo = gmenu_tree_entry_get_app_info (entry);
|
||||
char *name = g_strdup (g_app_info_get_name(G_APP_INFO(appinfo)));
|
||||
- char *exec = g_strdup (g_app_info_get_executable(G_APP_INFO(appinfo)));
|
||||
+ char *exec = g_strdup (g_app_info_get_commandline(G_APP_INFO(appinfo)));
|
||||
int i;
|
||||
|
||||
for (i = 0; i < strlen(exec) - 1; i++) {
|
||||
@@ -217,8 +217,11 @@ void process_entry(GMenuTreeEntry *entry
|
||||
}
|
||||
}
|
||||
|
||||
- g_printf("<item label=\"%s\">\n", g_strjoinv("&", g_strsplit(name,"&",0))),
|
||||
- g_printf("<action name=\"Execute\"><command>%s</command></action>\n", exec),
|
||||
+ g_printf("<item label=\"%s\">\n", g_strjoinv("&", g_strsplit(name,"&",0)));
|
||||
+ g_printf("<action name=\"Execute\"><command>%s%s</command></action>\n",
|
||||
+ g_desktop_app_info_get_boolean(appinfo, G_KEY_FILE_DESKTOP_KEY_TERMINAL) ?
|
||||
+ "x-terminal-emulator -e " : "",
|
||||
+ exec);
|
||||
g_printf("</item>\n");
|
||||
|
||||
g_free(name);
|
||||
@@ -0,0 +1,184 @@
|
||||
Index: openbox-xdgmenu-0.3/openbox-xdgmenu.c
|
||||
===================================================================
|
||||
--- openbox-xdgmenu-0.3.orig/openbox-xdgmenu.c
|
||||
+++ openbox-xdgmenu-0.3/openbox-xdgmenu.c
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
-#include <gnome-menus/gmenu-tree.h>
|
||||
+#include <gnome-menus-3.0/gmenu-tree.h>
|
||||
|
||||
/*=============================================================================
|
||||
* Declarations
|
||||
@@ -42,7 +42,6 @@ static void process_directory(GMenuTreeD
|
||||
static void process_entry(GMenuTreeEntry *entry);
|
||||
static void process_separator(GMenuTreeSeparator *entry);
|
||||
|
||||
-gboolean option_show_amount_of_entries = 0;
|
||||
gboolean option_do_not_use_categories = 0;
|
||||
|
||||
/*=============================================================================
|
||||
@@ -61,11 +60,6 @@ int main (int argc, char **argv)
|
||||
g_free (xdgfile);
|
||||
return 0;
|
||||
}
|
||||
- else if ((strcmp (argv[i], "--show-amount") == 0) ||
|
||||
- (strcmp (argv[i], "-a") == 0))
|
||||
- {
|
||||
- option_show_amount_of_entries = 1;
|
||||
- }
|
||||
else if ((strcmp (argv[i], "--plain") == 0) ||
|
||||
(strcmp (argv[i], "-p") == 0))
|
||||
{
|
||||
@@ -93,16 +87,15 @@ int main (int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
- FILE * file;
|
||||
- if (!(file = fopen(xdgfile, "r")))
|
||||
+ GMenuTree *menuTree = gmenu_tree_new (xdgfile, GMENU_TREE_FLAGS_NONE );
|
||||
+
|
||||
+ GError *error = NULL;
|
||||
+ if (!gmenu_tree_load_sync(menuTree, &error))
|
||||
{
|
||||
- g_printf ("Could not read file \"%s\".\n", xdgfile);
|
||||
- g_free (xdgfile);
|
||||
- return 2;
|
||||
+ g_printerr ("Failed to load tree: %s\n", error->message);
|
||||
+ g_clear_error (&error);
|
||||
+ return 3;
|
||||
}
|
||||
- fclose(file);
|
||||
-
|
||||
- GMenuTree *menuTree = gmenu_tree_lookup (xdgfile, GMENU_TREE_FLAGS_NONE );
|
||||
|
||||
GMenuTreeDirectory *rootDirectory = gmenu_tree_get_root_directory(menuTree);
|
||||
|
||||
@@ -129,11 +122,10 @@ void show_help()
|
||||
g_printf (" openbox-xdgmenu [options] <Xdg menu file>\n");
|
||||
g_printf ("\n");
|
||||
g_printf ("Options:\n");
|
||||
- g_printf (" -a: Show the amount of items in each category next to its name.\n");
|
||||
g_printf (" -p: Do not use categories.\n");
|
||||
g_printf ("\n");
|
||||
g_printf ("For example:\n");
|
||||
- g_printf (" openbox-xdgmenu \"/etc/xdg/menus/applications.menu\"\n\n");
|
||||
+ g_printf (" openbox-xdgmenu \"gnome-applications.menu\"\n\n");
|
||||
}
|
||||
|
||||
/*=============================================================================
|
||||
@@ -141,72 +133,61 @@ void show_help()
|
||||
*/
|
||||
void process_directory(GMenuTreeDirectory *directory, gboolean isRoot)
|
||||
{
|
||||
- int hasSeparator = 0;
|
||||
+ GMenuTreeSeparator *separator = NULL;
|
||||
int hasMenu = 0;
|
||||
GMenuTreeItemType entryType;
|
||||
- GSList *entryList = gmenu_tree_directory_get_contents (directory);
|
||||
- GSList *l;
|
||||
-
|
||||
- if (option_do_not_use_categories == 00 && isRoot == 0 &&
|
||||
- g_slist_length(entryList) > 0)
|
||||
+ GMenuTreeIter *iter = gmenu_tree_directory_iter (directory);
|
||||
+ GMenuTreeItemType next_type;
|
||||
+
|
||||
+ while ((next_type = gmenu_tree_iter_next (iter)) != GMENU_TREE_ITEM_INVALID)
|
||||
{
|
||||
- hasMenu = 1;
|
||||
-
|
||||
- if (option_show_amount_of_entries == 1)
|
||||
+ if (option_do_not_use_categories == 00 && isRoot == 0 && hasMenu == 0)
|
||||
{
|
||||
+ hasMenu = 1;
|
||||
+
|
||||
g_printf(
|
||||
- "<menu id=\"xdg-menu-%s\" label=\"%s (%d)\">\n",
|
||||
- g_strjoinv("&", g_strsplit(gmenu_tree_directory_get_name(directory),"&",0)),
|
||||
- g_strjoinv("&", g_strsplit(gmenu_tree_directory_get_name(directory),"&",0)),
|
||||
- g_slist_length(entryList));
|
||||
+ "<menu id=\"xdg-menu-%s\" label=\"%s\">\n",
|
||||
+ g_strjoinv("&", g_strsplit(gmenu_tree_directory_get_name(directory),"&",0)),
|
||||
+ g_strjoinv("&", g_strsplit(gmenu_tree_directory_get_name(directory),"&",0)));
|
||||
}
|
||||
- else
|
||||
- {
|
||||
- g_printf(
|
||||
- "<menu id=\"xdg-menu-%s\" label=\"%s\">\n",
|
||||
- g_strjoinv("&", g_strsplit(gmenu_tree_directory_get_name(directory),"&",0)),
|
||||
- g_strjoinv("&", g_strsplit(gmenu_tree_directory_get_name(directory),"&",0)));
|
||||
- }
|
||||
- }
|
||||
|
||||
- for (l = entryList; l; l = l->next)
|
||||
- {
|
||||
- GMenuTreeItem *item = l->data;
|
||||
-
|
||||
- entryType = gmenu_tree_item_get_type (GMENU_TREE_ITEM(item));
|
||||
-
|
||||
- switch (entryType)
|
||||
+ switch (next_type)
|
||||
{
|
||||
+ case GMENU_TREE_ITEM_INVALID:
|
||||
+ break;
|
||||
case GMENU_TREE_ITEM_DIRECTORY:
|
||||
- if (hasSeparator)
|
||||
+ if (separator != NULL)
|
||||
{
|
||||
- process_separator(GMENU_TREE_SEPARATOR(item));
|
||||
- hasSeparator = 0;
|
||||
+ process_separator(separator);
|
||||
+ gmenu_tree_item_unref (separator);
|
||||
+ separator = NULL;
|
||||
}
|
||||
- process_directory(GMENU_TREE_DIRECTORY(item), 0);
|
||||
+ process_directory(gmenu_tree_iter_get_directory(iter), 0);
|
||||
break;
|
||||
case GMENU_TREE_ITEM_ENTRY:
|
||||
- if (hasSeparator)
|
||||
+ if (separator != NULL)
|
||||
{
|
||||
- process_separator(GMENU_TREE_SEPARATOR(item));
|
||||
- hasSeparator = 0;
|
||||
+ process_separator(separator);
|
||||
+ gmenu_tree_item_unref (separator);
|
||||
+ separator = NULL;
|
||||
}
|
||||
- process_entry(GMENU_TREE_ENTRY(item));
|
||||
+ process_entry(gmenu_tree_iter_get_entry(iter));
|
||||
break;
|
||||
case GMENU_TREE_ITEM_SEPARATOR:
|
||||
- hasSeparator = 1;
|
||||
+ separator = gmenu_tree_iter_get_separator(iter);
|
||||
break;
|
||||
}
|
||||
-
|
||||
- gmenu_tree_item_unref (item);
|
||||
}
|
||||
|
||||
if (hasMenu == 1)
|
||||
{
|
||||
g_printf("</menu>\n");
|
||||
}
|
||||
+
|
||||
+ if (separator != NULL)
|
||||
+ gmenu_tree_item_unref (separator);
|
||||
|
||||
- g_slist_free (entryList);
|
||||
+ gmenu_tree_iter_unref (iter);
|
||||
}
|
||||
|
||||
/*=============================================================================
|
||||
@@ -214,8 +195,9 @@ void process_directory(GMenuTreeDirector
|
||||
*/
|
||||
void process_entry(GMenuTreeEntry *entry)
|
||||
{
|
||||
- char *name = g_strdup (gmenu_tree_entry_get_name(entry));
|
||||
- char *exec = g_strdup (gmenu_tree_entry_get_exec(entry));
|
||||
+ GDesktopAppInfo *appinfo = gmenu_tree_entry_get_app_info (entry);
|
||||
+ char *name = g_strdup (g_app_info_get_name(G_APP_INFO(appinfo)));
|
||||
+ char *exec = g_strdup (g_app_info_get_executable(G_APP_INFO(appinfo)));
|
||||
int i;
|
||||
|
||||
for (i = 0; i < strlen(exec) - 1; i++) {
|
||||
@@ -0,0 +1,36 @@
|
||||
SUMMARY = "Openbox configuration tool"
|
||||
AUTHOR = "Siegfried Gevatter"
|
||||
HOMEPAGE = "https://launchpad.net/openbox-xdgmenu/"
|
||||
SECTION = "x11/wm"
|
||||
LICENSE = "GPL-3.0-or-later"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
|
||||
DEPENDS = " \
|
||||
gnome-menus \
|
||||
glib-2.0 \
|
||||
"
|
||||
PV = "0.3"
|
||||
|
||||
SRC_URI = " \
|
||||
http://launchpad.net/openbox-xdgmenu/trunk/0.3/+download/openbox-xdgmenu-0.3.tar.gz \
|
||||
file://7_6.diff;striplevel=0 \
|
||||
file://port-gnome-menus3.patch \
|
||||
file://fix-menu-generation.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "824e099928aab2fb628f0fa4870ef7bba10b95581e47c2d8fa216709a0f399b3"
|
||||
|
||||
inherit pkgconfig features_check
|
||||
# depends on openbox, which is X11-only
|
||||
REQUIRED_DISTRO_FEATURES = "x11"
|
||||
|
||||
EXTRA_OEMAKE = " \
|
||||
CC='${CC}' \
|
||||
CFLAGS='${CPPFLAGS} ${CFLAGS} `pkg-config --cflags glib-2.0 libgnome-menu-3.0` -DGMENU_I_KNOW_THIS_IS_UNSTABLE' \
|
||||
LDFLAGS='${LDFLAGS} `pkg-config --libs glib-2.0 libgnome-menu-3.0`' \
|
||||
"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${bindir}
|
||||
install -m 0755 openbox-xdgmenu ${D}${bindir}
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} += "virtual-x-terminal-emulator"
|
||||
@@ -0,0 +1,32 @@
|
||||
From 84e884f99e581515b49d8973538bb17e1e6c0dc0 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 26 Jan 2023 20:45:57 -0800
|
||||
Subject: [PATCH] include missing <cstdint>
|
||||
|
||||
gcc 13 moved some includes around and as a result <cstdint> is no
|
||||
longer transitively included [1]. Explicitly include it for
|
||||
uint{32,64}_t.
|
||||
|
||||
[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/tomba/rwmem/pull/7]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
librwmem/helpers.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/librwmem/helpers.h b/librwmem/helpers.h
|
||||
index a0a738b..8d02c9c 100644
|
||||
--- a/librwmem/helpers.h
|
||||
+++ b/librwmem/helpers.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cerrno>
|
||||
+#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <string.h>
|
||||
--
|
||||
2.39.1
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
SUMMARY = "A small tool to read/write memory"
|
||||
DESCRIPTION = "rwmem is a small tool for reading and writing device registers. \
|
||||
rwmem supports two modes: mmap mode and i2c mode. \
|
||||
\
|
||||
In mmap mode rwmem accesses a file by memory mapping it. \
|
||||
Using /dev/mem as the memory mapped file makes rwmem access memory and \
|
||||
can thus be used to access devices which have memory mapped registers. \
|
||||
\
|
||||
In i2c mode rwmem accesses an i2c peripheral by sending i2c messages to it."
|
||||
|
||||
LICENSE = "GPL-2.0-or-later"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
|
||||
|
||||
DEPENDS += "fmt libinih"
|
||||
|
||||
PV .= "+git${SRCPV}"
|
||||
|
||||
SRCREV = "8416326777b2aada0706539b8f9f6acefa476b16"
|
||||
|
||||
SRC_URI = "git://github.com/tomba/rwmem.git;protocol=https;name=rwmem;branch=master \
|
||||
file://0001-include-missing-cstdint.patch"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit meson pkgconfig python3native
|
||||
|
||||
PACKAGECONFIG ?= "python static"
|
||||
PACKAGECONFIG[python] = "-Dpyrwmem=enabled,-Dpyrwmem=disabled,cmake-native python3 python3-pybind11"
|
||||
PACKAGECONFIG[static] = "-Dstatic-libc=true,-Dstatic-libc=false,"
|
||||
|
||||
do_install:append() {
|
||||
install -D -m 0644 ${B}/librwmem/librwmem.a ${D}${libdir}/librwmem.a
|
||||
}
|
||||
|
||||
FILES:${PN} += "${libdir}/python3.11/site-packages/pyrwmem"
|
||||
@@ -0,0 +1,40 @@
|
||||
From 50a48a7bd8d65a165ce2aac4ba0c1e02bded04aa Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 30 Nov 2019 12:21:31 -0800
|
||||
Subject: [PATCH] Fix build on 32bit arches with 64bit time_t
|
||||
|
||||
time element is deprecated on new input_event structure in kernel's
|
||||
input.h [1]
|
||||
|
||||
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
plugins/devinput.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugins/devinput.c b/plugins/devinput.c
|
||||
index d4d733a..feb4a61 100644
|
||||
--- a/plugins/devinput.c
|
||||
+++ b/plugins/devinput.c
|
||||
@@ -34,6 +34,11 @@
|
||||
#include <linux/uinput.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
+#ifndef input_event_sec
|
||||
+#define input_event_sec time.tv_sec
|
||||
+#define input_event_usec time.tv_usec
|
||||
+#endif
|
||||
+
|
||||
#ifndef EV_SYN
|
||||
/* previous name */
|
||||
#define EV_SYN EV_RST
|
||||
@@ -459,7 +464,7 @@ char* devinput_rec(struct ir_remote* remotes)
|
||||
return 0;
|
||||
}
|
||||
|
||||
- log_trace("time %ld.%06ld type %d code %d value %d", event.time.tv_sec, event.time.tv_usec, event.type,
|
||||
+ log_trace("time %ld.%06ld type %d code %d value %d", event.input_event_sec, event.input_event_usec, event.type,
|
||||
event.code, event.value);
|
||||
|
||||
value = (unsigned)event.value;
|
||||
@@ -0,0 +1,55 @@
|
||||
From 5e3b74927b4fef03d91518d235e9e3ba8cd7ab2e Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex@linutronix.de>
|
||||
Date: Wed, 9 Nov 2022 20:49:41 +0100
|
||||
Subject: [PATCH] Makefile.am: do not clobber PYTHONPATH from build environment
|
||||
|
||||
This environment variable has special significance for python,
|
||||
and so lirc's variable has to be named something else.
|
||||
|
||||
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
|
||||
---
|
||||
Makefile.am | 2 +-
|
||||
pylint.mak | 2 +-
|
||||
tools/Makefile.am | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 6718af1..fae423e 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -128,7 +128,7 @@ endif
|
||||
|
||||
pylint: .phony
|
||||
$(MAKE) -C tools pylint
|
||||
- -PYTHONPATH=$(PYTHONPATH) $(PYLINT) --rcfile=pylint.conf \
|
||||
+ -PYTHONPATH=$(LIRCPYTHONPATH) $(PYLINT) --rcfile=pylint.conf \
|
||||
--msg-template='$(pylint_template)' $(py_PYTHON)
|
||||
|
||||
pep8: $(py_PYTHON)
|
||||
diff --git a/pylint.mak b/pylint.mak
|
||||
index bf427ab..2692951 100644
|
||||
--- a/pylint.mak
|
||||
+++ b/pylint.mak
|
||||
@@ -1,5 +1,5 @@
|
||||
PYTHONPATH1 = $(abs_top_srcdir)/python-pkg/lirc:
|
||||
PYTHONPATH2 = $(abs_top_srcdir)/python-pkg/lirc/lib/.libs
|
||||
-PYTHONPATH = $(PYTHONPATH1):$(PYTHONPATH2)
|
||||
+LIRCPYTHONPATH = $(PYTHONPATH1):$(PYTHONPATH2)
|
||||
PYLINT = python3-pylint
|
||||
pylint_template = {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
|
||||
diff --git a/tools/Makefile.am b/tools/Makefile.am
|
||||
index 85d1fd0..96b17f8 100644
|
||||
--- a/tools/Makefile.am
|
||||
+++ b/tools/Makefile.am
|
||||
@@ -142,7 +142,7 @@ force-pylint: .phony
|
||||
|
||||
pylint: .pylint-stamp
|
||||
.pylint-stamp: $(py_sources)
|
||||
- -PYTHONPATH=$(PYTHONPATH) $(PYLINT) --rcfile=../pylint.conf \
|
||||
+ -PYTHONPATH=$(LIRCPYTHONPATH) $(PYLINT) --rcfile=../pylint.conf \
|
||||
--msg-template='$(pylint_template)' $? && touch $@
|
||||
|
||||
.phony:
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From ca126a2832aaff0deef3ba7eaf411dd0dc43b068 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 16 Mar 2023 11:31:14 -0700
|
||||
Subject: [PATCH] Unbolt ubuntu hack
|
||||
|
||||
This bites during cross compiling where the target is different than
|
||||
build host and build host might be ubuntu but that does not matter in
|
||||
cross compilation case. This fails builds when usrmerge feature is used
|
||||
|
||||
Upstream-Status: Inappropriates [ Cross-compile specific ]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -429,7 +429,7 @@ AC_CHECK_LIB([udev], [udev_device_new_fr
|
||||
])
|
||||
|
||||
dnl Ubuntu's systemd pkg-config seems broken beyond repair. So:
|
||||
-kernelversion=`cat /proc/version || echo "non-linux"`
|
||||
+kernelversion="cross-compiled"
|
||||
AS_CASE([$kernelversion],
|
||||
[*Ubuntu*],[
|
||||
AC_MSG_NOTICE([Hardwiring Ubuntu systemd setup])
|
||||
@@ -0,0 +1,44 @@
|
||||
From e9e9027d7a324e1ce5e0cb06d4eb51847262a09d Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sun, 28 Aug 2022 12:26:52 -0700
|
||||
Subject: [PATCH] mplay: Fix build with musl
|
||||
|
||||
pthread_t is an opaque type, therefore typecast it to avoid warnings on
|
||||
musl
|
||||
|
||||
Fixes
|
||||
mplay.c:200:12: error: incompatible integer to pointer conversion initializing 'pthread_t' (aka 'struct __pthread *') with an expression of type 'int' [-Wint-conversion]
|
||||
| .tid = -1
|
||||
| ^~
|
||||
|
||||
Upstream-Status: Submitted [https://sourceforge.net/p/lirc/git/merge-requests/47/]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
plugins/mplay.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/plugins/mplay.c b/plugins/mplay.c
|
||||
index d6d9619..5b9eb4b 100644
|
||||
--- a/plugins/mplay.c
|
||||
+++ b/plugins/mplay.c
|
||||
@@ -197,7 +197,7 @@ static struct {
|
||||
.latest_button = MPLAY_CODE_ERROR,
|
||||
.fd = -1,
|
||||
.pipefd = { -1, -1 },
|
||||
- .tid = -1
|
||||
+ .tid = (pthread_t)-1
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -788,7 +788,7 @@ int mplayfamily_deinit(void)
|
||||
return 0;
|
||||
}
|
||||
pthread_join(mplayfamily_local_data.tid, NULL);
|
||||
- mplayfamily_local_data.tid = -1;
|
||||
+ mplayfamily_local_data.tid = (pthread_t)-1;
|
||||
}
|
||||
if (mplayfamily_local_data.pipefd[0] != -1) {
|
||||
close(mplayfamily_local_data.pipefd[0]);
|
||||
--
|
||||
2.37.2
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 58347d8..8c7fca2 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -77,15 +77,10 @@ AC_TYPE_UINT64_T
|
||||
|
||||
dnl AC_TYPE_GETGROUPS seems broken on recent MacOS, so:
|
||||
AC_MSG_CHECKING([Figure out if getgrouplist() needs gid_t or int])
|
||||
-oldcflags="$CFLAGS"
|
||||
-export CFLAGS=-Werror
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <unistd.h>
|
||||
-#include <grp.h>
|
||||
- ]], [[
|
||||
-gid_t groups[32]; int ngroups; const char* user = "root";
|
||||
-getgrouplist(user, 1, groups, &ngroups);
|
||||
- ]])],[
|
||||
+int getgroups(int gidsetsize, gid_t grouplist[]);
|
||||
+ ]], [[ ]])],[
|
||||
AC_MSG_RESULT(gid_t)
|
||||
AC_DEFINE(GETGROUPS_T,[gid_t])
|
||||
],[
|
||||
@@ -93,7 +88,6 @@ getgrouplist(user, 1, groups, &ngroups);
|
||||
AC_DEFINE(GETGROUPS_T,[int])
|
||||
]
|
||||
)
|
||||
-export CFLAGS="$oldcflags"
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_CHECK_FUNCS(gethostname gettimeofday mkfifo select socket strdup \
|
||||
@@ -0,0 +1 @@
|
||||
d /run/lirc 0755 root root -
|
||||
@@ -0,0 +1,24 @@
|
||||
# These are the default options to lircd, if installed as
|
||||
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
|
||||
# manpages for info on the different options.
|
||||
|
||||
[lircd]
|
||||
nodaemon = False
|
||||
permission = 666
|
||||
driver = default
|
||||
device = /dev/lirc0
|
||||
output = /var/run/lirc/lircd
|
||||
pidfile = /var/run/lirc/lircd.pid
|
||||
plugindir = /usr/lib/lirc/plugins
|
||||
allow-simulate = No
|
||||
repeat-max = 600
|
||||
#listen = [address:]port
|
||||
#connect = host[:port]
|
||||
#debug = 5
|
||||
#uinput = ...
|
||||
#release = ...
|
||||
#logfile = ...
|
||||
|
||||
[lircmd]
|
||||
uinput = False
|
||||
nodeamon = False
|
||||
@@ -0,0 +1,315 @@
|
||||
# contributed by angelo castello
|
||||
#
|
||||
# note: this config file has been deduced starting from the
|
||||
# raw codes provided to run mode2 utility.
|
||||
#
|
||||
# brand: futarque
|
||||
|
||||
begin remote
|
||||
name futarque
|
||||
bits 8
|
||||
flags SPACE_ENC|CONST_LENGTH
|
||||
eps 30
|
||||
aeps 100
|
||||
|
||||
header 8048 3898
|
||||
one 555 1436
|
||||
zero 555 439
|
||||
gap 113123
|
||||
ptrail 555
|
||||
pre_data_bits 8
|
||||
pre_data 0x54
|
||||
pre 570 3890
|
||||
|
||||
begin codes
|
||||
MUTE 0x70
|
||||
EXIT 0xA8
|
||||
POWER 0xF0
|
||||
CHANNEL_UP 0x50
|
||||
CHANNEL_DOWN 0xD0
|
||||
VOLUME_UP 0x30
|
||||
VOLUME_DOWN 0xB0
|
||||
OK 0x98
|
||||
FAVORITES 0x04
|
||||
TEXT 0x68
|
||||
EPG 0xC8
|
||||
BACK 0x48
|
||||
MENU 0x88
|
||||
1 0x00
|
||||
2 0x80
|
||||
3 0x40
|
||||
4 0xC0
|
||||
5 0x20
|
||||
6 0xA0
|
||||
7 0x60
|
||||
8 0xE0
|
||||
9 0x10
|
||||
0 0x90
|
||||
PAUSE 0x84
|
||||
INFO 0x38
|
||||
RED 0xE8
|
||||
GREEN 0x08
|
||||
YELLOW 0x28
|
||||
BLUE 0x78
|
||||
UP 0xD8
|
||||
DOWN 0xB8
|
||||
REWIND 0x44
|
||||
FASTFORWARD 0x24
|
||||
PLAYPAUSE 0xC4
|
||||
STOP 0x64
|
||||
RECORD 0xA4
|
||||
AUDIO 0xE4
|
||||
TAPE 0x14
|
||||
DVD 0x94
|
||||
CAPITAL_A 0xF8
|
||||
CAPITAL_B 0x54
|
||||
end codes
|
||||
|
||||
end remote
|
||||
|
||||
# brand: STM PVR-1
|
||||
|
||||
begin remote
|
||||
name stm_pvr_1
|
||||
bits 16
|
||||
flags SPACE_ENC|CONST_LENGTH
|
||||
eps 30
|
||||
aeps 150
|
||||
|
||||
header 9000 4500
|
||||
one 572 1700
|
||||
zero 572 572
|
||||
ptrail 572
|
||||
repeat 9000 2200
|
||||
pre_data_bits 16
|
||||
pre_data 0xFE
|
||||
gap 100000
|
||||
|
||||
begin codes
|
||||
POWER 0x00ff
|
||||
FAVORITES 0x7887
|
||||
MUTE 0x28d7
|
||||
0 0x708F
|
||||
1 0xc03f
|
||||
2 0x40bf
|
||||
3 0x807f
|
||||
4 0xe01f
|
||||
5 0x609f
|
||||
6 0xa05f
|
||||
7 0xd02f
|
||||
8 0x50af
|
||||
9 0x906f
|
||||
INFO 0x38c7
|
||||
SUBTITLE 0xe817
|
||||
MENU 0x9867
|
||||
EXIT 0x20df
|
||||
EPG 0xa857
|
||||
BACK 0x48b7
|
||||
CURSOR_UP 0x58a7
|
||||
CURSOR_DOWN 0xd827
|
||||
CURSOR_LEFT 0x8877
|
||||
CURSOR_RIGHT 0xb04f
|
||||
OK 0x10ef
|
||||
VOLUME_UP 0x22dd
|
||||
VOLUME_DOWN 0x8a75
|
||||
CHANNEL_UP 0x12ed
|
||||
CHANNEL_DOWN 0x4ab5
|
||||
TEXT 0xf00f
|
||||
RADIO 0x926d
|
||||
ZOOM 0x6897
|
||||
AUDIO 0x08f7
|
||||
RED 0x42bd
|
||||
GREEN 0xa25d
|
||||
YELLOW 0x827d
|
||||
BLUE 0x02fd
|
||||
CUSTOM0 0x52ad
|
||||
CUSTOM1 0x30cf
|
||||
PLAY 0x629d
|
||||
PAUSE 0xb24d
|
||||
PREVIOUS 0xc837
|
||||
NEXT 0xf807
|
||||
REWIND 0x32cd
|
||||
FASTFORWARD 0x0af5
|
||||
AUX 0x7a85
|
||||
CUSTOM3 0xb847
|
||||
PIP 0x3ac5
|
||||
SWAP 0xba45
|
||||
end codes
|
||||
|
||||
end remote
|
||||
|
||||
# brand: STM DTV-2
|
||||
|
||||
begin remote
|
||||
|
||||
name stm_dtv_2
|
||||
flags SHIFT_ENC|CONST_LENGTH
|
||||
bits 13
|
||||
aeps 150
|
||||
|
||||
one 850 850
|
||||
zero 850 850
|
||||
plead 850
|
||||
gap 67800
|
||||
toggle_bit 2
|
||||
|
||||
begin codes
|
||||
POWER 0x100C
|
||||
FAVORITES 0x1015
|
||||
AUX 0x1038
|
||||
1 0x1001
|
||||
2 0x1002
|
||||
3 0x1003
|
||||
4 0x1004
|
||||
5 0x1005
|
||||
6 0x1006
|
||||
7 0x1007
|
||||
8 0x1008
|
||||
9 0x1009
|
||||
PERIOD 0x1024
|
||||
0 0x103E
|
||||
BACK 0x1023
|
||||
MENU 0x1016
|
||||
INFO 0x100F
|
||||
EPG 0x101E
|
||||
EXIT 0x1018
|
||||
CURSOR_UP 0x1017
|
||||
CURSOR_DOWN 0x101D
|
||||
CURSOR_LEFT 0x1019
|
||||
CURSOR_RIGHT 0x101B
|
||||
OK 0x101A
|
||||
VOLUME_UP 0x1010
|
||||
VOLUME_DOWN 0x1011
|
||||
CHANNEL_UP 0x1020
|
||||
CHANNEL_DOWN 0x1021
|
||||
TEXT 0x102E
|
||||
SUBTITLE 0x103C
|
||||
FREEZE 0x1014
|
||||
ZOOM 0x102B
|
||||
RED 0x1028
|
||||
GREEN 0x102A
|
||||
YELLOW 0x102F
|
||||
BLUE 0x1030
|
||||
CUSTOM10 0x1022
|
||||
INTERNET 0x1027
|
||||
CUSTOM11 0x102C
|
||||
AUDIO 0x1025
|
||||
RECORD 0x102D
|
||||
PLAYPAUSE 0x1029
|
||||
STOP 0x1026
|
||||
CUSTOM1 0x101C
|
||||
MUTE 0x100d
|
||||
CUSTOM12 0x101F
|
||||
PIP 0x100B
|
||||
SWAP 0x100E
|
||||
end codes
|
||||
|
||||
end remote
|
||||
|
||||
# brand: Comcast
|
||||
# model no. of remote control: XR2
|
||||
# 32 bits for the pre-date (should be value 0x170F443E)
|
||||
# width between pre_bits and data: 12900 microseconds
|
||||
#
|
||||
# 24 bits for the data (key code)
|
||||
# To get key REPEAT, XOR 0x088 with KEY value
|
||||
# There are 8 post bits (both should be zero)
|
||||
#
|
||||
# Gap between keys: 8100 microseconds
|
||||
begin remote
|
||||
|
||||
name Xfinity-XR2
|
||||
bits 24
|
||||
flags XMP
|
||||
eps 20
|
||||
aeps 300
|
||||
|
||||
one 0 137
|
||||
zero 250 710
|
||||
ptrail 250
|
||||
pre_data_bits 32
|
||||
pre_data 0x170F443E
|
||||
post_data_bits 8
|
||||
post_data 0x0
|
||||
pre 250 12921
|
||||
gap 81698
|
||||
toggle_bit_mask 0x0
|
||||
|
||||
begin codes
|
||||
1 0x1E0001
|
||||
1_repeat 0x168001
|
||||
2 0x1D0002
|
||||
2_repeat 0x158002
|
||||
3 0x1C0003
|
||||
3_repeat 0x148003
|
||||
4 0x1B0004
|
||||
4_repeat 0x138004
|
||||
5 0x1A0005
|
||||
5_repeat 0x128005
|
||||
6 0x190006
|
||||
6_repeat 0x118006
|
||||
7 0x180007
|
||||
7_repeat 0x108007
|
||||
8 0x170008
|
||||
8_repeat 0x1F8008
|
||||
9 0x160009
|
||||
9_repeat 0x1E8009
|
||||
0 0x1F0000
|
||||
0_repeat 0x178000
|
||||
OK 0x180025
|
||||
OK_repeat 0x108025
|
||||
POWER 0x10000F
|
||||
POWER_repeat 0x18800F
|
||||
UP 0x1C0021
|
||||
UP_repeat 0x148021
|
||||
DOWN 0x1B0022
|
||||
DOWN_repeat 0x138022
|
||||
LEFT 0x1A0023
|
||||
LEFT_repeat 0x128023
|
||||
RIGHT 0x190024
|
||||
RIGHT_repeat 0x118024
|
||||
REWIND 0x190033
|
||||
REWIND_repeat 0x118033
|
||||
PLAY 0x1C0030
|
||||
PLAY_repeat 0x148030
|
||||
FASTFORWARD 0x180034
|
||||
FASTFORWARD_repeat 0x108034
|
||||
RECORD 0x170035
|
||||
RECORD_repeat 0x1F8035
|
||||
REPLAY 0x170053
|
||||
REPLAY_repeat 0x1F8053
|
||||
A 0x190060
|
||||
A_repeat 0x118060
|
||||
B 0x180061
|
||||
B_repeat 0x108061
|
||||
C 0x170062
|
||||
C_repeat 0x1F8062
|
||||
D 0x160063
|
||||
D_repeat 0x1E8063
|
||||
PAGE_UP 0x150028
|
||||
PAGE_UP_repeat 0x1D8028
|
||||
PAGE_DOWN 0x140029
|
||||
PAGE_DOWN_repeat 0x1C8029
|
||||
GUIDE 0x160027
|
||||
GUIDE_repeat 0x1E8027
|
||||
MENU 0x1D0020
|
||||
MENU_repeat 0x158020
|
||||
EXIT 0x13002A
|
||||
EXIT_repeat 0x1B802A
|
||||
INFO 0x170026
|
||||
INFO_repeat 0x1F8026
|
||||
LAST 0x190051
|
||||
LAST_repeat 0x118051
|
||||
VOLUME_UP 0x15000A
|
||||
VOLUME_UP_repeat 0x1D800A
|
||||
CHANNEL_UP 0x12000D
|
||||
CHANNEL_UP_repeat 0x1A800D
|
||||
VOLUME_DOWN 0x14000B
|
||||
VOLUME_DOWN_repeat 0x1C800B
|
||||
CHANNEL_DOWN 0x11000E
|
||||
CHANNEL_DOWN_repeat 0x19800E
|
||||
MUTE 0x13000C
|
||||
MUTE_repeat 0x1B800D
|
||||
end codes
|
||||
|
||||
end remote
|
||||
@@ -0,0 +1,40 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# This is an init script for Familiar
|
||||
# Copy it to /etc/init.d/lircd and type
|
||||
# > update-rc.d lircd defaults 20
|
||||
#
|
||||
|
||||
|
||||
test -f /usr/sbin/lircd || exit 0
|
||||
test -f /etc/lircd.conf || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting lirc daemon: lircd"
|
||||
start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- --device=/dev/lirc0
|
||||
echo "."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping lirc daemon: lircd"
|
||||
start-stop-daemon --stop --quiet --exec /usr/sbin/lircd
|
||||
echo "."
|
||||
;;
|
||||
reload|force-reload)
|
||||
start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/lircd
|
||||
;;
|
||||
restart)
|
||||
echo -n "Stopping lirc daemon: lircd"
|
||||
start-stop-daemon --stop --quiet --exec /usr/sbin/lircd
|
||||
sleep 1
|
||||
echo -n "Starting lirc daemon: lircd"
|
||||
start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- --device=/dev/lirc0
|
||||
echo "."
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/lircd {start|stop|reload|restart|force-reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
[Unit]
|
||||
Description=LIRC Infrared Signal Decoder
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=/etc/lirc/lircd.conf
|
||||
PIDFile=/run/lirc/lircd.pid
|
||||
ExecStartPre=/bin/mkdir -p /run/lirc
|
||||
ExecStartPre=/bin/rm -f /dev/lircd
|
||||
ExecStartPre=/bin/rm -f /run/lirc/lircd
|
||||
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd
|
||||
|
||||
ExecStart=/usr/sbin/lircd --pidfile=/run/lirc/lircd.pid --device=/dev/lirc0
|
||||
|
||||
ExecStopPost=/bin/rm -f /dev/lircd
|
||||
ExecStopPost=/bin/rm -fR /run/lirc
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,37 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# This is an init script for Familiar
|
||||
# Copy it to /etc/init.d/lircexecd and type
|
||||
# > update-rc.d lircexecd defaults 20
|
||||
# It must be started after lircd (and it does alphabetically :-)
|
||||
# irexec reads /etc/lircrc by default
|
||||
|
||||
|
||||
test -f /usr/bin/irexec || exit 0
|
||||
test -f /etc/lircrc || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting lircexec daemon: irexec"
|
||||
start-stop-daemon --start --quiet --exec /usr/bin/irexec -- --daemon
|
||||
echo "."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping lircexec daemon: irexec"
|
||||
start-stop-daemon --stop --quiet --exec /usr/bin/irexec
|
||||
echo "."
|
||||
;;
|
||||
restart|force-restart)
|
||||
echo -n "Stopping lircexec daemon: irexec"
|
||||
start-stop-daemon --stop --quiet --exec /usr/bin/irexec
|
||||
sleep 1
|
||||
echo -n "Starting lircexec daemon: irexec"
|
||||
start-stop-daemon --start --quiet --exec /usr/bin/irexec -- --daemon
|
||||
echo "."
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/lircexec {start|stop|reload|restart|force-restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,115 @@
|
||||
DESCRIPTION = "LIRC is a package that allows you to decode and send infra-red signals of many commonly used remote controls."
|
||||
DESCRIPTION:append:lirc = " This package contains the lirc daemon, libraries and tools."
|
||||
DESCRIPTION:append:lirc-exec = " This package contains a daemon that runs programs on IR signals."
|
||||
DESCRIPTION:append:lirc-remotes = " This package contains some config files for remotes."
|
||||
DESCRIPTION:append:lirc-nslu2example = " This package contains a working config for RC5 remotes and a modified NSLU2."
|
||||
HOMEPAGE = "http://www.lirc.org"
|
||||
SECTION = "console/network"
|
||||
LICENSE = "GPL-2.0-only"
|
||||
DEPENDS = "libxslt-native alsa-lib libftdi libusb1 libusb-compat jack portaudio-v19 python3-pyyaml python3-setuptools-native"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
|
||||
|
||||
SRC_URI = "http://prdownloads.sourceforge.net/lirc/lirc-${PV}.tar.bz2 \
|
||||
file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch \
|
||||
file://fix_build_errors.patch \
|
||||
file://0001-mplay-Fix-build-with-musl.patch \
|
||||
file://lircd.service \
|
||||
file://lircd.init \
|
||||
file://lircexec.init \
|
||||
file://lircd.conf \
|
||||
file://lirc_options.conf \
|
||||
file://lirc.tmpfiles \
|
||||
file://0001-Makefile.am-do-not-clobber-PYTHONPATH-from-build-env.patch \
|
||||
file://0001-Unbolt-ubuntu-hack.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "3d44ec8274881cf262f160805641f0827ffcc20ade0d85e7e6f3b90e0d3d222a"
|
||||
|
||||
SYSTEMD_PACKAGES = "lirc lirc-exec"
|
||||
SYSTEMD_SERVICE:${PN} = "lircd.service lircmd.service lircd-setup.service lircd-uinput.service"
|
||||
SYSTEMD_SERVICE:${PN}-exec = "irexec.service"
|
||||
SYSTEMD_AUTO_ENABLE:lirc = "enable"
|
||||
SYSTEMD_AUTO_ENABLE:lirc-exec = "enable"
|
||||
|
||||
inherit autotools pkgconfig systemd python3native setuptools3-base
|
||||
|
||||
PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd"
|
||||
PACKAGECONFIG[x11] = "--with-x,--with-x=no,libx11,"
|
||||
|
||||
PACKAGECONFIG ?= " \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' x11', '', d)} \
|
||||
"
|
||||
CACHED_CONFIGUREVARS = "HAVE_WORKING_POLL=yes SH_PATH=/bin/sh"
|
||||
|
||||
#EXTRA_OEMAKE = 'SUBDIRS="lib daemons tools"'
|
||||
|
||||
# Ensure python-pkg/VERSION exists
|
||||
do_configure:append() {
|
||||
cp ${S}/VERSION ${S}/python-pkg/
|
||||
}
|
||||
|
||||
# Create PYTHON_TARBALL which LIRC needs for install-nodist_pkgdataDATA
|
||||
do_install:prepend() {
|
||||
rm -rf ${S}/python-pkg/dist/
|
||||
mkdir ${S}/python-pkg/dist/
|
||||
tar --exclude='${S}/python-pkg/*' -czf ${S}/python-pkg/dist/${BP}.tar.gz ${S}
|
||||
}
|
||||
|
||||
# In code, path to python is a variable that is replaced with path to native version of it
|
||||
# during the configure stage, e.g ../recipe-sysroot-native/usr/bin/python3-native/python3.
|
||||
# Replace it with #!/usr/bin/env python3
|
||||
do_install:append() {
|
||||
sed -i '1c#!/usr/bin/env python3' ${D}${bindir}/lirc-setup \
|
||||
${D}${PYTHON_SITEPACKAGES_DIR}/lirc-setup/lirc-setup \
|
||||
${D}${bindir}/irtext2udp \
|
||||
${D}${bindir}/lirc-init-db \
|
||||
${D}${bindir}/irdb-get \
|
||||
${D}${bindir}/pronto2lirc \
|
||||
${D}${sbindir}/lircd-setup
|
||||
|
||||
install -m 0755 -d ${D}${sysconfdir}
|
||||
install -m 0755 -d ${D}${sysconfdir}/lirc
|
||||
install -m 0644 ${WORKDIR}/lircd.conf ${D}${sysconfdir}/lirc/
|
||||
install -m 0644 ${WORKDIR}/lirc_options.conf ${D}${sysconfdir}/lirc/
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||
install -m 0755 -d ${D}${systemd_unitdir}/system ${D}${libdir}/tmpfiles.d
|
||||
install -m 0644 ${WORKDIR}/lircd.service ${D}${systemd_unitdir}/system/
|
||||
install -m 0755 ${WORKDIR}/lircexec.init ${D}${systemd_unitdir}/system/
|
||||
install -m 0644 ${WORKDIR}/lirc.tmpfiles ${D}${libdir}/tmpfiles.d/lirc.conf
|
||||
else
|
||||
rm -rf ${D}/lib
|
||||
fi
|
||||
rm -rf ${D}${libdir}/lirc/plugins/*.la
|
||||
rmdir ${D}/var/run/lirc ${D}/var/run
|
||||
chown -R root:root ${D}${datadir}/lirc/contrib
|
||||
}
|
||||
|
||||
PACKAGES =+ "${PN}-contrib ${PN}-exec ${PN}-plugins ${PN}-python"
|
||||
|
||||
RDEPENDS:${PN} = "bash python3"
|
||||
RDEPENDS:${PN}-exec = "${PN}"
|
||||
RDEPENDS:${PN}-python = "python3-shell python3-pyyaml python3-datetime python3-netclient python3-stringold"
|
||||
|
||||
RRECOMMENDS:${PN} = "${PN}-exec ${PN}-plugins"
|
||||
|
||||
FILES:${PN}-plugins = "${libdir}/lirc/plugins/*.so ${datadir}/lirc/configs"
|
||||
FILES:${PN}-contrib = "${datadir}/lirc/contrib"
|
||||
FILES:${PN}-exec = "${bindir}/irexec ${sysconfdir}/lircexec ${systemd_unitdir}/system/irexec.service"
|
||||
FILES:${PN} += "${systemd_unitdir}/system/lircexec.init"
|
||||
FILES:${PN} += "${systemd_unitdir}/system/lircd.service"
|
||||
FILES:${PN} += "${systemd_unitdir}/system/lircd.socket"
|
||||
FILES:${PN} += "${libdir}/tmpfiles.d/lirc.conf"
|
||||
FILES:${PN}-dbg += "${libdir}/lirc/plugins/.debug"
|
||||
FILES:${PN}-python += "${bindir}/irdb-get ${bindir}/irtext2udp ${bindir}/lircd-setup ${bindir}/pronto2lirc ${libdir}/python*/site-packages"
|
||||
|
||||
INITSCRIPT_PACKAGES = "lirc lirc-exec"
|
||||
INITSCRIPT_NAME:lirc-exec = "lircexec"
|
||||
INITSCRIPT_PARAMS:lirc-exec = "defaults 21"
|
||||
|
||||
# this is for distributions that don't use udev
|
||||
pkg_postinst:${PN}:append() {
|
||||
if [ ! -c $D/dev/lirc -a ! -f /sbin/udevd ]; then mknod $D/dev/lirc c 61 0; fi
|
||||
}
|
||||
|
||||
SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
|
||||
@@ -0,0 +1,26 @@
|
||||
From a06c77557ed951249d5b344441ad6ec57410e63f Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex@linutronix.de>
|
||||
Date: Sun, 3 Oct 2021 21:52:16 +0200
|
||||
Subject: [PATCH] Makefile: do not use -Werror
|
||||
|
||||
Upstream-Status: Inappropriate [oe-core specific]
|
||||
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
|
||||
---
|
||||
Makefile | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 97973ce..78273ff 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -8,7 +8,6 @@ BUILDFLAGS = \
|
||||
-DSBINDIR=\"$(SBINDIR)\" \
|
||||
-I${CURDIR}/include \
|
||||
-Wall \
|
||||
- -Werror \
|
||||
$(NULL)
|
||||
|
||||
TESTFLAGS = \
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From e0df1f07d1707d5daf0358cc60b30f06121f7e60 Mon Sep 17 00:00:00 2001
|
||||
From: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
|
||||
Date: Fri, 25 Dec 2020 11:41:43 +0900
|
||||
Subject: [PATCH] don't fail if GLOB_BRACE is not defined
|
||||
|
||||
Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
|
||||
---
|
||||
src/util.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/util.c b/src/util.c
|
||||
index 841ec12..59595da 100644
|
||||
--- a/src/util.c
|
||||
+++ b/src/util.c
|
||||
@@ -32,6 +32,12 @@
|
||||
#include "names.h"
|
||||
#include "yaml-helpers.h"
|
||||
|
||||
+/* Don't fail if the standard library
|
||||
+ * doesn't provide brace expansion */
|
||||
+#ifndef GLOB_BRACE
|
||||
+#define GLOB_BRACE 0
|
||||
+#endif
|
||||
+
|
||||
NETPLAN_ABI GHashTable*
|
||||
wifi_frequency_24;
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
SUMMARY = "The network configuration abstraction renderer"
|
||||
DESCRIPTION = "Netplan is a utility for easily configuring networking on a \
|
||||
linux system. You simply create a YAML description of the required network \
|
||||
interfaces and what each should be configured to do. From this description \
|
||||
Netplan will generate all the necessary configuration for your chosen renderer \
|
||||
tool."
|
||||
HOMEPAGE = "https://netplan.io"
|
||||
SECTION = "net/misc"
|
||||
|
||||
LICENSE = "GPL-3.0-only"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
SRCREV = "15ce044d1df27b5057556d84d0d14beef8dd4e4d"
|
||||
PV = "0.106"
|
||||
|
||||
SRC_URI = "git://github.com/CanonicalLtd/netplan.git;branch=main;protocol=https \
|
||||
file://0001-Makefile-do-not-use-Werror.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:libc-musl = " file://0001-don-t-fail-if-GLOB_BRACE-is-not-defined.patch"
|
||||
|
||||
DEPENDS = "glib-2.0 libyaml ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
|
||||
|
||||
PACKAGECONFIG ?= ""
|
||||
|
||||
PACKAGECONFIG[tests] = ",,,python3-nose python3-coverage python3-netifaces python3-pycodestyle python3-pyflakes python3-pyyaml"
|
||||
|
||||
RDEPENDS:${PN} = "python3 python3-core python3-netifaces python3-pyyaml util-linux-libuuid libnetplan python3-dbus python3-rich"
|
||||
|
||||
inherit pkgconfig systemd
|
||||
|
||||
TARGET_CC_ARCH += "${LDFLAGS}"
|
||||
|
||||
EXTRA_OEMAKE = "generate netplan/_features.py"
|
||||
EXTRA_OEMAKE =+ "${@bb.utils.contains('DISTRO_FEATURES','systemd','netplan-dbus dbus/io.netplan.Netplan.service','',d)}"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sbindir} ${D}${libdir} ${D}${base_libdir}/netplan ${D}${datadir}/netplan/netplan/cli/commands ${D}${sysconfdir}/netplan
|
||||
install -m 755 ${S}/generate ${D}${base_libdir}/netplan/
|
||||
install -m 644 ${S}/netplan/*.py ${D}${datadir}/netplan/netplan
|
||||
install -m 644 ${S}/netplan/cli/*.py ${D}${datadir}/netplan/netplan/cli
|
||||
install -m 644 ${S}/netplan/cli/commands/*.py ${D}${datadir}/netplan/netplan/cli/commands
|
||||
install -m 755 ${S}/src/netplan.script ${D}${datadir}/netplan/
|
||||
ln -srf ${D}${datadir}/netplan/netplan.script ${D}${sbindir}/netplan
|
||||
sed -i -e "s#/lib/netplan/generate#${base_libdir}/netplan/generate#" ${D}${datadir}/netplan/netplan/cli/utils.py
|
||||
|
||||
install -d ${D}/${systemd_unitdir}/system ${D}${systemd_unitdir}/system-generators
|
||||
ln -srf ${D}/${base_libdir}/netplan/generate ${D}${systemd_unitdir}/system-generators
|
||||
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
||||
install -d ${D}${datadir}/dbus-1/system.d ${D}${datadir}/dbus-1/system-services
|
||||
install -m 755 ${S}/netplan-dbus ${D}${base_libdir}/netplan
|
||||
install -m 644 ${S}/dbus/io.netplan.Netplan.conf ${D}${datadir}/dbus-1/system.d
|
||||
install -m 644 ${S}/dbus/io.netplan.Netplan.service ${D}${datadir}/dbus-1/system-services
|
||||
sed -i -e "s#^Exec=/lib/#Exec=${base_libdir}/#" ${D}${datadir}/dbus-1/system-services/io.netplan.Netplan.service
|
||||
fi
|
||||
|
||||
install -m 755 ${S}/libnetplan.so.0.0 ${D}${libdir}
|
||||
ln -rfs ${D}${libdir}/libnetplan.so.0.0 ${D}${libdir}/libnetplan.so
|
||||
}
|
||||
|
||||
PACKAGES += "${PN}-dbus libnetplan"
|
||||
|
||||
FILES:libnetplan = "${libdir}/libnetplan.so.0.0"
|
||||
FILES:${PN} = "${sbindir} ${base_libdir}/netplan/generate ${datadir}/netplan ${sysconfdir}/netplan ${systemd_unitdir}"
|
||||
FILES:${PN}-dbus = "${base_libdir}/netplan/netplan-dbus ${datadir}/dbus-1"
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"general": {
|
||||
"objectName": "TB_gateway",
|
||||
"address": "192.168.188.181:1052",
|
||||
"objectIdentifier": 599,
|
||||
"maxApduLengthAccepted": 1024,
|
||||
"segmentationSupported": "segmentedBoth",
|
||||
"vendorIdentifier": 15
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"deviceName": "BACnet Device ${objectName}",
|
||||
"deviceType": "default",
|
||||
"address": "192.168.188.181:10520",
|
||||
"pollPeriod": 10000,
|
||||
"attributes": [
|
||||
{
|
||||
"key": "temperature",
|
||||
"type": "string",
|
||||
"objectId": "analogOutput:1",
|
||||
"propertyId": "presentValue"
|
||||
}
|
||||
],
|
||||
"timeseries": [
|
||||
{
|
||||
"key": "state",
|
||||
"type": "bool",
|
||||
"objectId": "binaryValue:1",
|
||||
"propertyId": "presentValue"
|
||||
}
|
||||
],
|
||||
"attributeUpdates": [
|
||||
{
|
||||
"key": "brightness",
|
||||
"requestType": "writeProperty",
|
||||
"objectId": "analogOutput:1",
|
||||
"propertyId": "presentValue"
|
||||
}
|
||||
],
|
||||
"serverSideRpc": [
|
||||
{
|
||||
"method": "set_state",
|
||||
"requestType": "writeProperty",
|
||||
"requestTimeout": 10000,
|
||||
"objectId": "binaryOutput:1",
|
||||
"propertyId": "presentValue"
|
||||
},
|
||||
{
|
||||
"method": "get_state",
|
||||
"requestType": "readProperty",
|
||||
"requestTimeout": 10000,
|
||||
"objectId": "binaryOutput:1",
|
||||
"propertyId": "presentValue"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "BLE Connector",
|
||||
"rescanIntervalSeconds": 100,
|
||||
"checkIntervalSeconds": 100,
|
||||
"scanTimeSeconds": 5,
|
||||
"passiveScanMode": true,
|
||||
"devices": [
|
||||
{
|
||||
"name": "Temperature and humidity sensor",
|
||||
"MACAddress": "4C:65:A8:DF:85:C0",
|
||||
"addrType": "public",
|
||||
"telemetry": [
|
||||
{
|
||||
"key": "temperature",
|
||||
"method": "notify",
|
||||
"characteristicUUID": "226CAA55-6476-4566-7562-66734470666D",
|
||||
"byteFrom": 2,
|
||||
"byteTo": 6
|
||||
},
|
||||
{
|
||||
"key": "humidity",
|
||||
"method": "notify",
|
||||
"characteristicUUID": "226CAA55-6476-4566-7562-66734470666D",
|
||||
"byteFrom": 9,
|
||||
"byteTo": 13
|
||||
}
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"key": "name",
|
||||
"characteristicUUID": "00002A00-0000-1000-8000-00805F9B34FB",
|
||||
"method": "read",
|
||||
"byteFrom": 0,
|
||||
"byteTo": -1
|
||||
}
|
||||
],
|
||||
"attributeUpdates": [
|
||||
{
|
||||
"attributeOnThingsBoard": "sharedName",
|
||||
"characteristicUUID": "00002A00-0000-1000-8000-00805F9B34FB"
|
||||
}
|
||||
],
|
||||
"serverSideRpc": [
|
||||
{
|
||||
"methodRPC": "rpcMethod1",
|
||||
"withResponse": true,
|
||||
"characteristicUUID": "00002A00-0000-1000-8000-00805F9B34FB",
|
||||
"methodProcessing": "read"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"interface": "socketcan",
|
||||
"channel": "vcan0",
|
||||
"backend": {
|
||||
"fd": true
|
||||
},
|
||||
"reconnectPeriod": 5,
|
||||
"devices": [
|
||||
{
|
||||
"name": "Car",
|
||||
"sendDataOnlyOnChange": false,
|
||||
"enableUnknownRpc": true,
|
||||
"strictEval": false,
|
||||
"attributes": [
|
||||
{
|
||||
"key": "isDriverDoorOpened",
|
||||
"nodeId": 41,
|
||||
"command": "2:2:big:8717",
|
||||
"value": "4:1:int",
|
||||
"expression": "bool(value & 0b00000100)",
|
||||
"polling": {
|
||||
"type": "once",
|
||||
"dataInHex": "AB CD AB CD"
|
||||
}
|
||||
}
|
||||
],
|
||||
"timeseries": [
|
||||
{
|
||||
"key": "rpm",
|
||||
"nodeId": 1918,
|
||||
"isExtendedId": true,
|
||||
"command": "2:2:big:48059",
|
||||
"value": "4:2:big:int",
|
||||
"expression": "value / 4",
|
||||
"polling": {
|
||||
"type": "always",
|
||||
"period": 5,
|
||||
"dataInHex": "aaaa bbbb aaaa bbbb"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "milliage",
|
||||
"nodeId": 1918,
|
||||
"isExtendedId": true,
|
||||
"value": "4:2:little:int",
|
||||
"expression": "value * 10",
|
||||
"polling": {
|
||||
"type": "always",
|
||||
"period": 30,
|
||||
"dataInHex": "aa bb cc dd ee ff aa bb"
|
||||
}
|
||||
}
|
||||
],
|
||||
"attributeUpdates": [
|
||||
{
|
||||
"attributeOnThingsBoard": "softwareVersion",
|
||||
"nodeId": 64,
|
||||
"isExtendedId": true,
|
||||
"dataLength": 4,
|
||||
"dataExpression": "value + 5",
|
||||
"dataByteorder": "little"
|
||||
}
|
||||
],
|
||||
"serverSideRpc": [
|
||||
{
|
||||
"method": "sendSameData",
|
||||
"nodeId": 4,
|
||||
"isExtendedId": true,
|
||||
"isFd": true,
|
||||
"bitrateSwitch": true,
|
||||
"dataInHex": "aa bb cc dd ee ff aa bb aa bb cc d ee ff"
|
||||
},
|
||||
{
|
||||
"method": "setLightLevel",
|
||||
"nodeId": 5,
|
||||
"dataLength": 2,
|
||||
"dataByteorder": "little",
|
||||
"dataBefore": "00AA"
|
||||
},
|
||||
{
|
||||
"method": "setSpeed",
|
||||
"nodeId": 16,
|
||||
"dataAfter": "0102",
|
||||
"dataExpression": "userSpeed if maxAllowedSpeed > userSpeed else maxAllowedSpeed"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "Custom serial connector",
|
||||
"devices": [
|
||||
{
|
||||
"name": "CustomSerialDevice1",
|
||||
"type": "default",
|
||||
"port": "/dev/ttyUSB0",
|
||||
"baudrate": 9600,
|
||||
"converter": "CustomSerialUplinkConverter",
|
||||
"telemetry": [
|
||||
{
|
||||
"type": "byte",
|
||||
"key": "humidity",
|
||||
"untilDelimiter": "\r"
|
||||
}
|
||||
],
|
||||
"attributes":[
|
||||
{
|
||||
"key": "SerialNumber",
|
||||
"type": "string",
|
||||
"fromByte": 4,
|
||||
"toByte": -1
|
||||
}
|
||||
],
|
||||
"attributeUpdates": [
|
||||
{
|
||||
"attributeOnThingsBoard": "attr1",
|
||||
"stringToDevice": "value = ${attr1}\n"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
[loggers]
|
||||
keys=root, service, connector, converter, tb_connection, storage, extension
|
||||
[handlers]
|
||||
keys=consoleHandler, serviceHandler, connectorHandler, converterHandler, tb_connectionHandler, storageHandler, extensionHandler
|
||||
[formatters]
|
||||
keys=LogFormatter
|
||||
[logger_root]
|
||||
level=ERROR
|
||||
handlers=consoleHandler
|
||||
[logger_connector]
|
||||
level=INFO
|
||||
handlers=connectorHandler
|
||||
formatter=LogFormatter
|
||||
qualname=connector
|
||||
[logger_storage]
|
||||
level=INFO
|
||||
handlers=storageHandler
|
||||
formatter=LogFormatter
|
||||
qualname=storage
|
||||
[logger_tb_connection]
|
||||
level=INFO
|
||||
handlers=tb_connectionHandler
|
||||
formatter=LogFormatter
|
||||
qualname=tb_connection
|
||||
[logger_service]
|
||||
level=INFO
|
||||
handlers=serviceHandler
|
||||
formatter=LogFormatter
|
||||
qualname=service
|
||||
[logger_converter]
|
||||
level=INFO
|
||||
handlers=converterHandler
|
||||
formatter=LogFormatter
|
||||
qualname=converter
|
||||
[logger_extension]
|
||||
level=INFO
|
||||
handlers=connectorHandler
|
||||
formatter=LogFormatter
|
||||
qualname=extension
|
||||
[handler_consoleHandler]
|
||||
class=StreamHandler
|
||||
level=INFO
|
||||
formatter=LogFormatter
|
||||
args=(sys.stdout,)
|
||||
[handler_connectorHandler]
|
||||
level=INFO
|
||||
class=logging.handlers.TimedRotatingFileHandler
|
||||
formatter=LogFormatter
|
||||
args=("./logs/connector.log", "d", 1, 7,)
|
||||
[handler_storageHandler]
|
||||
level=INFO
|
||||
class=logging.handlers.TimedRotatingFileHandler
|
||||
formatter=LogFormatter
|
||||
args=("./logs/storage.log", "d", 1, 7,)
|
||||
[handler_serviceHandler]
|
||||
level=INFO
|
||||
class=logging.handlers.TimedRotatingFileHandler
|
||||
formatter=LogFormatter
|
||||
args=("./logs/service.log", "d", 1, 7,)
|
||||
[handler_converterHandler]
|
||||
level=INFO
|
||||
class=logging.handlers.TimedRotatingFileHandler
|
||||
formatter=LogFormatter
|
||||
args=("./logs/converter.log", "d", 1, 3,)
|
||||
[handler_extensionHandler]
|
||||
level=INFO
|
||||
class=logging.handlers.TimedRotatingFileHandler
|
||||
formatter=LogFormatter
|
||||
args=("./logs/extension.log", "d", 1, 3,)
|
||||
[handler_tb_connectionHandler]
|
||||
level=INFO
|
||||
class=logging.handlers.TimedRotatingFileHandler
|
||||
formatter=LogFormatter
|
||||
args=("./logs/tb_connection.log", "d", 1, 3,)
|
||||
[formatter_LogFormatter]
|
||||
format="%(asctime)s - %(levelname)s - [%(filename)s] - %(module)s - %(lineno)d - %(message)s"
|
||||
datefmt="%Y-%m-%d %H:%M:%S"
|
||||
@@ -0,0 +1,169 @@
|
||||
{
|
||||
"server": {
|
||||
"type": "tcp",
|
||||
"host": "127.0.0.1",
|
||||
"port": 5020,
|
||||
"timeout": 35,
|
||||
"method": "socket",
|
||||
"byteOrder": "BIG",
|
||||
"devices": [
|
||||
{
|
||||
"unitId": 1,
|
||||
"deviceName": "Temp Sensor",
|
||||
"attributesPollPeriod": 5000,
|
||||
"timeseriesPollPeriod": 5000,
|
||||
"sendDataOnlyOnChange": true,
|
||||
"attributes": [
|
||||
{
|
||||
"tag": "string_read",
|
||||
"type": "string",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 4,
|
||||
"address": 1
|
||||
},
|
||||
{
|
||||
"tag": "bits_read",
|
||||
"type": "bits",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 1,
|
||||
"address": 5
|
||||
},
|
||||
{
|
||||
"tag": "8int_read",
|
||||
"type": "8int",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 1,
|
||||
"address": 6
|
||||
},
|
||||
{
|
||||
"tag": "16int_read",
|
||||
"type": "16int",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 1,
|
||||
"address": 7
|
||||
},
|
||||
{
|
||||
"tag": "32int_read_divider",
|
||||
"type": "32int",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 2,
|
||||
"address": 8,
|
||||
"divider": 10
|
||||
},
|
||||
{
|
||||
"tag": "8int_read_multiplier",
|
||||
"type": "8int",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 1,
|
||||
"address": 10,
|
||||
"multiplier": 10
|
||||
},
|
||||
{
|
||||
"tag": "32int_read",
|
||||
"type": "32int",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 2,
|
||||
"address": 11
|
||||
},
|
||||
{
|
||||
"tag": "64int_read",
|
||||
"type": "64int",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 4,
|
||||
"address": 13
|
||||
}
|
||||
],
|
||||
"timeseries": [
|
||||
{
|
||||
"tag": "8uint_read",
|
||||
"type": "8uint",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 1,
|
||||
"address": 17
|
||||
},
|
||||
{
|
||||
"tag": "16uint_read",
|
||||
"type": "16uint",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 2,
|
||||
"address": 18
|
||||
},
|
||||
{
|
||||
"tag": "32uint_read",
|
||||
"type": "32uint",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 4,
|
||||
"address": 20
|
||||
},
|
||||
{
|
||||
"tag": "64uint_read",
|
||||
"type": "64uint",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 1,
|
||||
"address": 24
|
||||
},
|
||||
{
|
||||
"tag": "16float_read",
|
||||
"type": "16float",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 1,
|
||||
"address": 25
|
||||
},
|
||||
{
|
||||
"tag": "32float_read",
|
||||
"type": "32float",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 2,
|
||||
"address": 26
|
||||
},
|
||||
{
|
||||
"tag": "64float_read",
|
||||
"type": "64float",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 4,
|
||||
"address": 28
|
||||
}
|
||||
],
|
||||
"attributeUpdates": [
|
||||
{
|
||||
"tag": "shared_attribute_write",
|
||||
"type": "32int",
|
||||
"functionCode": 6,
|
||||
"objectsCount": 2,
|
||||
"address": 29
|
||||
}
|
||||
],
|
||||
"rpc": [
|
||||
{
|
||||
"tag": "setValue",
|
||||
"type": "bits",
|
||||
"functionCode": 5,
|
||||
"objectsCount": 1,
|
||||
"address": 31
|
||||
},
|
||||
{
|
||||
"tag": "getValue",
|
||||
"type": "bits",
|
||||
"functionCode": 1,
|
||||
"objectsCount": 1,
|
||||
"address": 31
|
||||
},
|
||||
{
|
||||
"tag": "setCPUFanSpeed",
|
||||
"type": "32int",
|
||||
"functionCode": 16,
|
||||
"objectsCount": 2,
|
||||
"address": 33
|
||||
},
|
||||
{
|
||||
"tag":"getCPULoad",
|
||||
"type": "32int",
|
||||
"functionCode": 4,
|
||||
"objectsCount": 2,
|
||||
"address": 35
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"server": {
|
||||
"name": "Modbus Default Server",
|
||||
"type": "serial",
|
||||
"method": "rtu",
|
||||
"port": "/dev/ttyUSB0",
|
||||
"baudrate": 19200,
|
||||
"timeout": 35,
|
||||
"devices": [
|
||||
{
|
||||
"unitId": 1,
|
||||
"deviceName": "Temp Sensor",
|
||||
"attributesPollPeriod": 5000,
|
||||
"timeseriesPollPeriod": 5000,
|
||||
"sendDataOnlyOnChange": true,
|
||||
"attributes": [
|
||||
{
|
||||
"byteOrder": "BIG",
|
||||
"tag": "test",
|
||||
"type": "long",
|
||||
"functionCode": 4,
|
||||
"registerCount": 1,
|
||||
"address": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
{
|
||||
"broker": {
|
||||
"name":"Default Local Broker",
|
||||
"host":"127.0.0.1",
|
||||
"port":1883,
|
||||
"clientId": "ThingsBoard_gateway",
|
||||
"security": {
|
||||
"type": "basic",
|
||||
"username": "user",
|
||||
"password": "password"
|
||||
}
|
||||
},
|
||||
"mapping": [
|
||||
{
|
||||
"topicFilter": "/sensor/data",
|
||||
"converter": {
|
||||
"type": "json",
|
||||
"deviceNameJsonExpression": "${serialNumber}",
|
||||
"deviceTypeJsonExpression": "${sensorType}",
|
||||
"timeout": 60000,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "string",
|
||||
"key": "model",
|
||||
"value": "${sensorModel}"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"key": "${sensorModel}",
|
||||
"value": "on"
|
||||
}
|
||||
],
|
||||
"timeseries": [
|
||||
{
|
||||
"type": "double",
|
||||
"key": "temperature",
|
||||
"value": "${temp}"
|
||||
},
|
||||
{
|
||||
"type": "double",
|
||||
"key": "humidity",
|
||||
"value": "${hum}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"topicFilter": "/sensor/+/data",
|
||||
"converter": {
|
||||
"type": "json",
|
||||
"deviceNameTopicExpression": "(?<=sensor\/)(.*?)(?=\/data)",
|
||||
"deviceTypeTopicExpression": "Thermometer",
|
||||
"timeout": 60000,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "string",
|
||||
"key": "model",
|
||||
"value": "${sensorModel}"
|
||||
}
|
||||
],
|
||||
"timeseries": [
|
||||
{
|
||||
"type": "double",
|
||||
"key": "temperature",
|
||||
"value": "${temp}"
|
||||
},
|
||||
{
|
||||
"type": "double",
|
||||
"key": "humidity",
|
||||
"value": "${hum}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"topicFilter": "/custom/sensors/+",
|
||||
"converter": {
|
||||
"type": "custom",
|
||||
"extension": "CustomMqttUplinkConverter",
|
||||
"extension-config": {
|
||||
"temperatureBytes" : 2,
|
||||
"humidityBytes" : 2,
|
||||
"batteryLevelBytes" : 1
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connectRequests": [
|
||||
{
|
||||
"topicFilter": "sensor/connect",
|
||||
"deviceNameJsonExpression": "${SerialNumber}"
|
||||
},
|
||||
{
|
||||
"topicFilter": "sensor/+/connect",
|
||||
"deviceNameTopicExpression": "(?<=sensor\/)(.*?)(?=\/connect)"
|
||||
}
|
||||
],
|
||||
"disconnectRequests": [
|
||||
{
|
||||
"topicFilter": "sensor/disconnect",
|
||||
"deviceNameJsonExpression": "${SerialNumber}"
|
||||
},
|
||||
{
|
||||
"topicFilter": "sensor/+/disconnect",
|
||||
"deviceNameTopicExpression": "(?<=sensor\/)(.*?)(?=\/disconnect)"
|
||||
}
|
||||
],
|
||||
"attributeUpdates": [
|
||||
{
|
||||
"deviceNameFilter": "SmartMeter.*",
|
||||
"attributeFilter": "uploadFrequency",
|
||||
"topicExpression": "sensor/${deviceName}/${attributeKey}",
|
||||
"valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}"
|
||||
}
|
||||
],
|
||||
"serverSideRpc": [
|
||||
{
|
||||
"deviceNameFilter": ".*",
|
||||
"methodFilter": "echo",
|
||||
"requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}",
|
||||
"responseTopicExpression": "sensor/${deviceName}/response/${methodName}/${requestId}",
|
||||
"responseTimeout": 10000,
|
||||
"valueExpression": "${params}"
|
||||
},
|
||||
{
|
||||
"deviceNameFilter": ".*",
|
||||
"methodFilter": "no-reply",
|
||||
"requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}",
|
||||
"valueExpression": "${params}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"connection": {
|
||||
"str": "Driver={PostgreSQL};Server=localhost;Port=5432;Database=thingsboard;Uid=postgres;Pwd=postgres;",
|
||||
"attributes": {
|
||||
"autocommit": true,
|
||||
"timeout": 0
|
||||
},
|
||||
"encoding": "utf-8",
|
||||
"decoding": {
|
||||
"char": "utf-8",
|
||||
"wchar": "utf-8",
|
||||
"metadata": "utf-16le"
|
||||
},
|
||||
"reconnect": true,
|
||||
"reconnectPeriod": 60
|
||||
},
|
||||
"pyodbc": {
|
||||
"pooling": false
|
||||
},
|
||||
"polling": {
|
||||
"query": "SELECT bool_v, str_v, dbl_v, long_v, entity_id, ts FROM ts_kv WHERE ts > ? ORDER BY ts ASC LIMIT 10",
|
||||
"period": 10,
|
||||
"iterator": {
|
||||
"column": "ts",
|
||||
"query": "SELECT MIN(ts) - 1 FROM ts_kv",
|
||||
"persistent": false
|
||||
}
|
||||
},
|
||||
"mapping": {
|
||||
"device": {
|
||||
"type": "postgres",
|
||||
"name": "'ODBC ' + entity_id"
|
||||
},
|
||||
"sendDataOnlyOnChange": false,
|
||||
"attributes": "*",
|
||||
"timeseries": [
|
||||
{
|
||||
"name": "value",
|
||||
"value": "[i for i in [str_v, long_v, dbl_v,bool_v] if i is not None][0]"
|
||||
}
|
||||
]
|
||||
},
|
||||
"serverSideRpc": {
|
||||
"enableUnknownRpc": false,
|
||||
"overrideRpcConfig": true,
|
||||
"methods": [
|
||||
"procedureOne",
|
||||
{
|
||||
"name": "procedureTwo",
|
||||
"args": [ "One", 2, 3.0 ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"server": {
|
||||
"name": "OPC-UA Default Server",
|
||||
"url": "localhost:4840/freeopcua/server/",
|
||||
"timeoutInMillis": 5000,
|
||||
"scanPeriodInMillis": 5000,
|
||||
"disableSubscriptions":false,
|
||||
"subCheckPeriodInMillis": 100,
|
||||
"showMap": false,
|
||||
"security": "Basic128Rsa15",
|
||||
"identity": {
|
||||
"type": "anonymous"
|
||||
},
|
||||
"mapping": [
|
||||
{
|
||||
"deviceNodePattern": "Root\\.Objects\\.Device1",
|
||||
"deviceNamePattern": "Device ${Root\\.Objects\\.Device1\\.serialNumber}",
|
||||
"attributes": [
|
||||
{
|
||||
"key": "temperature °C",
|
||||
"path": "${ns=2;i=5}"
|
||||
}
|
||||
],
|
||||
"timeseries": [
|
||||
{
|
||||
"key": "humidity",
|
||||
"path": "${Root\\.Objects\\.Device1\\.TemperatureAndHumiditySensor\\.Humidity}"
|
||||
},
|
||||
{
|
||||
"key": "batteryLevel",
|
||||
"path": "${Battery\\.batteryLevel}"
|
||||
}
|
||||
],
|
||||
"rpc_methods": [
|
||||
{
|
||||
"method": "multiply",
|
||||
"arguments": [2, 4]
|
||||
}
|
||||
],
|
||||
"attributes_updates": [
|
||||
{
|
||||
"attributeOnThingsBoard": "deviceName",
|
||||
"attributeOnDevice": "Root\\.Objects\\.Device1\\.serialNumber"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
"job": "leader"
|
||||
},
|
||||
"allowRedirects": true,
|
||||
"timeout": 0.5,
|
||||
"scanPeriod": 5,
|
||||
"converter": {
|
||||
"type": "json",
|
||||
"deviceNameJsonExpression": "SD8500",
|
||||
"deviceTypeJsonExpression": "SD",
|
||||
"attributes": [
|
||||
{
|
||||
"key": "serialNumber",
|
||||
"type": "string",
|
||||
"value": "${serial}"
|
||||
}
|
||||
],
|
||||
"telemetry": [
|
||||
{
|
||||
"key": "Maintainer",
|
||||
"type": "string",
|
||||
"value": "${Developer}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "get_info",
|
||||
"httpMethod": "GET",
|
||||
"httpHeaders": {
|
||||
"ACCEPT": "application/json"
|
||||
},
|
||||
"allowRedirects": true,
|
||||
"timeout": 0.5,
|
||||
"scanPeriod": 100,
|
||||
"converter": {
|
||||
"type": "custom",
|
||||
"deviceNameJsonExpression": "SD8500",
|
||||
"deviceTypeJsonExpression": "SD",
|
||||
"extension": "CustomRequestUplinkConverter",
|
||||
"extension-config": [
|
||||
{
|
||||
"key": "Totaliser",
|
||||
"type": "float",
|
||||
"fromByte": 0,
|
||||
"toByte": 4,
|
||||
"byteorder": "big",
|
||||
"signed": true,
|
||||
"multiplier": 1
|
||||
},
|
||||
{
|
||||
"key": "Flow",
|
||||
"type": "int",
|
||||
"fromByte": 4,
|
||||
"toByte": 6,
|
||||
"byteorder": "big",
|
||||
"signed": true,
|
||||
"multiplier": 0.01
|
||||
},
|
||||
{
|
||||
"key": "Temperature",
|
||||
"type": "int",
|
||||
"fromByte": 8,
|
||||
"toByte": 10,
|
||||
"byteorder": "big",
|
||||
"signed": true,
|
||||
"multiplier": 0.01
|
||||
},
|
||||
{
|
||||
"key": "Pressure",
|
||||
"type": "int",
|
||||
"fromByte": 12,
|
||||
"toByte": 14,
|
||||
"byteorder": "big",
|
||||
"signed": true,
|
||||
"multiplier": 0.01
|
||||
},
|
||||
{
|
||||
"key": "deviceStatus",
|
||||
"type": "int",
|
||||
"byteAddress": 15,
|
||||
"fromBit": 4,
|
||||
"toBit": 8,
|
||||
"byteorder": "big",
|
||||
"signed": false
|
||||
},
|
||||
{
|
||||
"key": "OUT2",
|
||||
"type": "int",
|
||||
"byteAddress": 15,
|
||||
"fromBit": 1,
|
||||
"toBit": 2,
|
||||
"byteorder": "big"
|
||||
},
|
||||
{
|
||||
"key": "OUT1",
|
||||
"type": "int",
|
||||
"byteAddress": 15,
|
||||
"fromBit": 0,
|
||||
"toBit": 1,
|
||||
"byteorder": "big"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"attributeUpdates": [
|
||||
{
|
||||
"httpMethod": "POST",
|
||||
"httpHeaders": {
|
||||
"CONTENT-TYPE": "application/json"
|
||||
},
|
||||
"timeout": 0.5,
|
||||
"tries": 3,
|
||||
"allowRedirects": true,
|
||||
"deviceNameFilter": "SD.*",
|
||||
"attributeFilter": "send_data",
|
||||
"requestUrlExpression": "sensor/${deviceName}/${attributeKey}",
|
||||
"valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}"
|
||||
}
|
||||
],
|
||||
"serverSideRpc": [
|
||||
{
|
||||
"deviceNameFilter": ".*",
|
||||
"methodFilter": "echo",
|
||||
"requestUrlExpression": "sensor/${deviceName}/request/${methodName}/${requestId}",
|
||||
"responseTimeout": 1,
|
||||
"httpMethod": "GET",
|
||||
"valueExpression": "${params}",
|
||||
"timeout": 0.5,
|
||||
"tries": 3,
|
||||
"httpHeaders": {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
},
|
||||
{
|
||||
"deviceNameFilter": ".*",
|
||||
"methodFilter": "no-reply",
|
||||
"requestUrlExpression": "sensor/${deviceName}/request/${methodName}/${requestId}",
|
||||
"httpMethod": "POST",
|
||||
"valueExpression": "${params}",
|
||||
"httpHeaders": {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"host": "127.0.0.1",
|
||||
"port": "5000",
|
||||
"mapping":[
|
||||
{
|
||||
"endpoint": "/device1",
|
||||
"HTTPMethods": [
|
||||
"POST"
|
||||
],
|
||||
"security":
|
||||
{
|
||||
"type": "basic",
|
||||
"username": "user",
|
||||
"password": "passwd"
|
||||
},
|
||||
"converter": {
|
||||
"type": "json",
|
||||
"deviceNameExpression": "Device ${name}",
|
||||
"deviceTypeExpression": "default",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "string",
|
||||
"key": "model",
|
||||
"value": "${sensorModel}"
|
||||
}
|
||||
],
|
||||
"timeseries": [
|
||||
{
|
||||
"type": "double",
|
||||
"key": "${sensorModel}",
|
||||
"value": "${temp}"
|
||||
},
|
||||
{
|
||||
"type": "double",
|
||||
"key": "humidity",
|
||||
"value": "${hum}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"endpoint": "/anon1",
|
||||
"HTTPMethods": [
|
||||
"GET",
|
||||
"POST"
|
||||
],
|
||||
"security":
|
||||
{
|
||||
"type": "anonymous"
|
||||
},
|
||||
"converter": {
|
||||
"type": "json",
|
||||
"deviceNameExpression": "Device 2",
|
||||
"deviceTypeExpression": "default",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "string",
|
||||
"key": "model",
|
||||
"value": "Model2"
|
||||
}
|
||||
],
|
||||
"timeseries": [
|
||||
{
|
||||
"type": "double",
|
||||
"key": "temperature",
|
||||
"value": "${temp}"
|
||||
},
|
||||
{
|
||||
"type": "double",
|
||||
"key": "humidity",
|
||||
"value": "${hum}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"endpoint": "/anon2",
|
||||
"HTTPMethods": [
|
||||
"POST"
|
||||
],
|
||||
"security":
|
||||
{
|
||||
"type": "anonymous"
|
||||
},
|
||||
"converter": {
|
||||
"type": "custom",
|
||||
"deviceNameExpression": "SuperAnonDevice",
|
||||
"deviceTypeExpression": "default",
|
||||
"extension": "CustomRestUplinkConverter",
|
||||
"extension-config": [
|
||||
{
|
||||
"key": "Totaliser",
|
||||
"datatype": "float",
|
||||
"fromByte": 0,
|
||||
"toByte": 4,
|
||||
"byteorder": "big",
|
||||
"signed": true,
|
||||
"multiplier": 1
|
||||
}]
|
||||
}
|
||||
}
|
||||
],
|
||||
"attributeUpdates": [
|
||||
{
|
||||
"HTTPMethod": "POST",
|
||||
"SSLVerify": false,
|
||||
"httpHeaders": {
|
||||
"CONTENT-TYPE": "application/json"
|
||||
},
|
||||
"security": {
|
||||
"type": "basic",
|
||||
"username": "user",
|
||||
"password": "passwd"
|
||||
},
|
||||
"timeout": 0.5,
|
||||
"tries": 3,
|
||||
"allowRedirects": true,
|
||||
"deviceNameFilter": ".*REST$",
|
||||
"attributeFilter": "data",
|
||||
"requestUrlExpression": "sensor/${deviceName}/${attributeKey}",
|
||||
"valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}"
|
||||
}
|
||||
],
|
||||
"serverSideRpc": [
|
||||
{
|
||||
"deviceNameFilter": ".*",
|
||||
"methodFilter": "echo",
|
||||
"requestUrlExpression": "http://127.0.0.1:5001/${deviceName}",
|
||||
"responseTimeout": 1,
|
||||
"HTTPMethod": "GET",
|
||||
"valueExpression": "${params}",
|
||||
"timeout": 0.5,
|
||||
"tries": 3,
|
||||
"httpHeaders": {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
"security": {
|
||||
"type": "anonymous"
|
||||
}
|
||||
},
|
||||
{
|
||||
"deviceNameFilter": ".*",
|
||||
"methodFilter": "no-reply",
|
||||
"requestUrlExpression": "sensor/${deviceName}/request/${methodName}/${requestId}",
|
||||
"HTTPMethod": "POST",
|
||||
"valueExpression": "${params}",
|
||||
"httpHeaders": {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"devices": [
|
||||
{
|
||||
"deviceName": "SNMP router",
|
||||
"deviceType": "snmp",
|
||||
"ip": "snmp.live.gambitcommunications.com",
|
||||
"port": 161,
|
||||
"pollPeriod": 5000,
|
||||
"community": "public",
|
||||
"attributes": [
|
||||
{
|
||||
"key": "ReceivedFromGet",
|
||||
"method": "get",
|
||||
"oid": "1.3.6.1.2.1.1.1.0",
|
||||
"timeout": 6
|
||||
},
|
||||
{
|
||||
"key": "ReceivedFromMultiGet",
|
||||
"method": "multiget",
|
||||
"oid": [
|
||||
"1.3.6.1.2.1.1.1.0",
|
||||
"1.3.6.1.2.1.1.2.0"
|
||||
],
|
||||
"timeout": 6
|
||||
},
|
||||
{
|
||||
"key": "ReceivedFromGetNext",
|
||||
"method": "getnext",
|
||||
"oid": "1.3.6.1.2.1.1.1.0",
|
||||
"timeout": 6
|
||||
},
|
||||
{
|
||||
"key": "ReceivedFromMultiWalk",
|
||||
"method": "multiwalk",
|
||||
"oid": [
|
||||
"1.3.6.1.2.1.1.1.0",
|
||||
"1.3.6.0.1.2.1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "ReceivedFromBulkWalk",
|
||||
"method": "bulkwalk",
|
||||
"oid": [
|
||||
"1.3.6.1.2.1.1.1.0",
|
||||
"1.3.6.1.2.1.1.2.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "ReceivedFromBulkGet",
|
||||
"method": "bulkget",
|
||||
"scalarOid": [
|
||||
"1.3.6.1.2.1.1.1.0",
|
||||
"1.3.6.1.2.1.1.2.0"
|
||||
],
|
||||
"repeatingOid": [
|
||||
"1.3.6.1.2.1.1.1.0",
|
||||
"1.3.6.1.2.1.1.2.0"
|
||||
],
|
||||
"maxListSize": 10
|
||||
}
|
||||
],
|
||||
"telemetry": [
|
||||
{
|
||||
"key": "ReceivedFromWalk",
|
||||
"community": "private",
|
||||
"method": "walk",
|
||||
"oid": "1.3.6.1.2.1.1.1.0"
|
||||
},
|
||||
{
|
||||
"key": "ReceivedFromTable",
|
||||
"method": "table",
|
||||
"oid": "1.3.6.1.2.1.1"
|
||||
}
|
||||
],
|
||||
"attributeUpdateRequests": [
|
||||
{
|
||||
"attributeFilter": "dataToSet",
|
||||
"method": "set",
|
||||
"oid": "1.3.6.1.2.1.1.1.0"
|
||||
},
|
||||
{
|
||||
"attributeFilter": "dataToMultiSet",
|
||||
"method": "multiset",
|
||||
"mappings": {
|
||||
"1.2.3": "10",
|
||||
"2.3.4": "${attribute}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"serverSideRpcRequests": [
|
||||
{
|
||||
"requestFilter": "setData",
|
||||
"method": "set",
|
||||
"oid": "1.3.6.1.2.1.1.1.0"
|
||||
},
|
||||
{
|
||||
"requestFilter": "multiSetData",
|
||||
"method": "multiset"
|
||||
},
|
||||
{
|
||||
"requestFilter": "getData",
|
||||
"method": "get",
|
||||
"oid": "1.3.6.1.2.1.1.1.0"
|
||||
},
|
||||
{
|
||||
"requestFilter": "runBulkWalk",
|
||||
"method": "bulkwalk",
|
||||
"oid": [
|
||||
"1.3.6.1.2.1.1.1.0",
|
||||
"1.3.6.1.2.1.1.2.0"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"deviceName": "SNMP router",
|
||||
"deviceType": "snmp",
|
||||
"ip": "127.0.0.1",
|
||||
"pollPeriod": 5000,
|
||||
"community": "public",
|
||||
"converter": "CustomSNMPConverter",
|
||||
"attributes": [
|
||||
{
|
||||
"key": "ReceivedFromGetWithCustomConverter",
|
||||
"method": "get",
|
||||
"oid": "1.3.6.1.2.1.1.1.0"
|
||||
}
|
||||
],
|
||||
"telemetry": [
|
||||
{
|
||||
"key": "ReceivedFromTableWithCustomConverter",
|
||||
"method": "table",
|
||||
"oid": "1.3.6.1.2.1.1.1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
thingsboard:
|
||||
host: demo.thingsboard.io
|
||||
port: 1883
|
||||
remoteConfiguration: false
|
||||
security:
|
||||
accessToken: PUT_YOUR_GW_ACCESS_TOKEN_HERE
|
||||
storage:
|
||||
type: memory
|
||||
read_records_count: 100
|
||||
max_records_count: 100000
|
||||
# type: file
|
||||
# data_folder_path: ./data/
|
||||
# max_file_count: 10
|
||||
# max_read_records_count: 10
|
||||
# max_records_per_file: 10000
|
||||
connectors:
|
||||
-
|
||||
name: MQTT Broker Connector
|
||||
type: mqtt
|
||||
configuration: mqtt.json
|
||||
|
||||
# -
|
||||
# name: Modbus Connector
|
||||
# type: modbus
|
||||
# configuration: modbus.json
|
||||
#
|
||||
# -
|
||||
# name: Modbus Connector
|
||||
# type: modbus
|
||||
# configuration: modbus_serial.json
|
||||
#
|
||||
# -
|
||||
# name: OPC-UA Connector
|
||||
# type: opcua
|
||||
# configuration: opcua.json
|
||||
#
|
||||
# -
|
||||
# name: BLE Connector
|
||||
# type: ble
|
||||
# configuration: ble.json
|
||||
#
|
||||
# -
|
||||
# name: REQUEST Connector
|
||||
# type: request
|
||||
# configuration: request.json
|
||||
#
|
||||
# -
|
||||
# name: CAN Connector
|
||||
# type: can
|
||||
# configuration: can.json
|
||||
#
|
||||
# -
|
||||
# name: BACnet Connector
|
||||
# type: bacnet
|
||||
# configuration: bacnet.json
|
||||
#
|
||||
# -
|
||||
# name: ODBC Connector
|
||||
# type: odbc
|
||||
# configuration: odbc.json
|
||||
#
|
||||
# -
|
||||
# name: Custom Serial Connector
|
||||
# type: serial
|
||||
# configuration: custom_serial.json
|
||||
# class: CustomSerialConnector
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description = Systemd service for Thingsboard Gateway
|
||||
After = network.target
|
||||
|
||||
[Service]
|
||||
ExecStart = /usr/bin/python3 /usr/bin/thingsboard-gateway
|
||||
ExecStop = /bin/kill -INT $MAINPID
|
||||
ExecReload = /bin/kill -TERM $MAINPID
|
||||
Restart = always
|
||||
Type = simple
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,67 @@
|
||||
SUMMARY = "Open-source IoT platform for data collection, processing, visualization, and device management"
|
||||
DESCRIPTION = "\
|
||||
The Thingsboard IoT Gateway is an open-source solution that allows you \
|
||||
to integrate devices connected to legacy and third-party systems with Thingsboard."
|
||||
HOMEPAGE = "https://thingsboard.io/"
|
||||
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
|
||||
|
||||
SRC_URI[sha256sum] = "06fdb1000cb3f25ff78a2441c0e0f9e5bb2abec3eff907d57f58c1709c110217"
|
||||
|
||||
inherit pypi setuptools3
|
||||
|
||||
PYPI_PACKAGE = "thingsboard-gateway"
|
||||
|
||||
RDEPENDS:${PN} += " python3-jsonpath-rw \
|
||||
python3-regex \
|
||||
python3-paho-mqtt \
|
||||
python3-pyyaml \
|
||||
python3-simplejson \
|
||||
python3-requests \
|
||||
python3-pip \
|
||||
python3-pyrsistent \
|
||||
"
|
||||
|
||||
SRC_URI += "file://bacnet.json \
|
||||
file://ble.json \
|
||||
file://can.json \
|
||||
file://custom_serial.json \
|
||||
file://modbus.json \
|
||||
file://modbus_serial.json \
|
||||
file://mqtt.json \
|
||||
file://opcua.json \
|
||||
file://odbc.json \
|
||||
file://request.json \
|
||||
file://rest.json \
|
||||
file://snmp.json \
|
||||
file://tb_gateway.yaml \
|
||||
file://logs.conf \
|
||||
file://thingsboard-gateway.service \
|
||||
"
|
||||
|
||||
|
||||
inherit systemd
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}"
|
||||
SYSTEMD_SERVICE:${PN} = "thingsboard-gateway.service"
|
||||
|
||||
FILES:${PN} += "/etc \
|
||||
/lib \
|
||||
/usr \
|
||||
"
|
||||
|
||||
do_install:append(){
|
||||
|
||||
install -d ${D}${sysconfdir}/thingsboard-gateway/config
|
||||
|
||||
for file in $(find ${WORKDIR} -maxdepth 1 -type f -name *.json); do
|
||||
install -m 0644 "$file" ${D}${sysconfdir}/thingsboard-gateway/config
|
||||
done
|
||||
|
||||
install -m 0644 ${WORKDIR}/tb_gateway.yaml ${D}${sysconfdir}/thingsboard-gateway/config
|
||||
install -m 0644 ${WORKDIR}/logs.conf ${D}${sysconfdir}/thingsboard-gateway/config
|
||||
|
||||
install -d ${D}${systemd_unitdir}/system/
|
||||
install -m 0644 ${WORKDIR}/thingsboard-gateway.service ${D}${systemd_system_unitdir}/thingsboard-gateway.service
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
RDEPENDS:packagegroup-meta-oe-devtools += "\
|
||||
python3-distutils-extra \
|
||||
rwmem \
|
||||
mongodb \
|
||||
"
|
||||
RDEPENDS:packagegroup-meta-oe-devtools:remove:riscv64 = "mongodb"
|
||||
RDEPENDS:packagegroup-meta-oe-devtools:remove:riscv32 = "mongodb"
|
||||
RDEPENDS:packagegroup-meta-oe-devtools:remove:mipsarch = "mongodb"
|
||||
RDEPENDS:packagegroup-meta-oe-devtools:remove:powerpc = "mongodb"
|
||||
|
||||
RDEPENDS:packagegroup-meta-oe-connectivity += "\
|
||||
lirc \
|
||||
"
|
||||
|
||||
RDEPENDS:packagegroup-meta-oe-extended += "\
|
||||
lcdproc \
|
||||
mozjs-102 \
|
||||
"
|
||||
RDEPENDS:packagegroup-meta-oe-support += "\
|
||||
nvmetcli \
|
||||
smem \
|
||||
"
|
||||
RDEPENDS:packagegroup-meta-oe-extended:remove:libc-musl = "lcdproc"
|
||||
|
||||
@@ -0,0 +1,448 @@
|
||||
From 3690dc5f567906c45f057509305fbaa021b33adb Mon Sep 17 00:00:00 2001
|
||||
From: Yichao Yu <yyc1992@gmail.com>
|
||||
Date: Tue, 15 Sep 2020 12:35:46 -0700
|
||||
Subject: [PATCH] Fix compilation with -fno-common.
|
||||
|
||||
Making all other archs consistent with IA64 which should not have this problem.
|
||||
Also move the FIXME to the correct place.
|
||||
|
||||
Also add some minimum comments about this...
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libunwind/libunwind/pull/166/commits/29e17d8d2ccbca07c423e3089a6d5ae8a1c9cb6e]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/third_party/unwind/dist/src/aarch64/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/arm/Ginit.c | 15 +++++++--------
|
||||
.../src/coredump/_UPT_get_dyn_info_list_addr.c | 5 +++++
|
||||
src/third_party/unwind/dist/src/hppa/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/ia64/Ginit.c | 1 +
|
||||
.../unwind/dist/src/mi/Gfind_dynamic_proc_info.c | 1 +
|
||||
src/third_party/unwind/dist/src/mips/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/ppc32/Ginit.c | 11 +++++++----
|
||||
src/third_party/unwind/dist/src/ppc64/Ginit.c | 11 +++++++----
|
||||
.../dist/src/ptrace/_UPT_get_dyn_info_list_addr.c | 5 +++++
|
||||
src/third_party/unwind/dist/src/s390x/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/sh/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/tilegx/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/x86/Ginit.c | 15 +++++++--------
|
||||
src/third_party/unwind/dist/src/x86_64/Ginit.c | 15 +++++++--------
|
||||
15 files changed, 89 insertions(+), 80 deletions(-)
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/aarch64/Ginit.c b/src/third_party/unwind/dist/src/aarch64/Ginit.c
|
||||
index dec235c829..35389762f2 100644
|
||||
--- a/src/third_party/unwind/dist/src/aarch64/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/aarch64/Ginit.c
|
||||
@@ -61,13 +61,6 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -78,7 +71,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/arm/Ginit.c b/src/third_party/unwind/dist/src/arm/Ginit.c
|
||||
index 2720d063a2..0bac0d72da 100644
|
||||
--- a/src/third_party/unwind/dist/src/arm/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/arm/Ginit.c
|
||||
@@ -57,18 +57,17 @@ tdep_uc_addr (unw_tdep_context_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/coredump/_UPT_get_dyn_info_list_addr.c b/src/third_party/unwind/dist/src/coredump/_UPT_get_dyn_info_list_addr.c
|
||||
index 0d11905566..739ed0569b 100644
|
||||
--- a/src/third_party/unwind/dist/src/coredump/_UPT_get_dyn_info_list_addr.c
|
||||
+++ b/src/third_party/unwind/dist/src/coredump/_UPT_get_dyn_info_list_addr.c
|
||||
@@ -74,6 +74,11 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||
|
||||
#else
|
||||
|
||||
+/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
+ by a remote unwinder. On ia64, this is done via a special
|
||||
+ unwind-table entry. Perhaps something similar can be done with
|
||||
+ DWARF2 unwind info. */
|
||||
+
|
||||
static inline int
|
||||
get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||
int *countp)
|
||||
diff --git a/src/third_party/unwind/dist/src/hppa/Ginit.c b/src/third_party/unwind/dist/src/hppa/Ginit.c
|
||||
index 461e4b93da..265455a68c 100644
|
||||
--- a/src/third_party/unwind/dist/src/hppa/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/hppa/Ginit.c
|
||||
@@ -64,13 +64,6 @@ _Uhppa_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -81,7 +74,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/ia64/Ginit.c b/src/third_party/unwind/dist/src/ia64/Ginit.c
|
||||
index b09a2ad57c..8601bb3ca8 100644
|
||||
--- a/src/third_party/unwind/dist/src/ia64/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/ia64/Ginit.c
|
||||
@@ -68,6 +68,7 @@ get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
if (!_U_dyn_info_list_addr)
|
||||
return -UNW_ENOINFO;
|
||||
#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
*dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
diff --git a/src/third_party/unwind/dist/src/mi/Gfind_dynamic_proc_info.c b/src/third_party/unwind/dist/src/mi/Gfind_dynamic_proc_info.c
|
||||
index 98d3501286..2e7c62e5e8 100644
|
||||
--- a/src/third_party/unwind/dist/src/mi/Gfind_dynamic_proc_info.c
|
||||
+++ b/src/third_party/unwind/dist/src/mi/Gfind_dynamic_proc_info.c
|
||||
@@ -49,6 +49,7 @@ local_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
|
||||
return -UNW_ENOINFO;
|
||||
#endif
|
||||
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
list = (unw_dyn_info_list_t *) (uintptr_t) _U_dyn_info_list_addr ();
|
||||
for (di = list->first; di; di = di->next)
|
||||
if (ip >= di->start_ip && ip < di->end_ip)
|
||||
diff --git a/src/third_party/unwind/dist/src/mips/Ginit.c b/src/third_party/unwind/dist/src/mips/Ginit.c
|
||||
index 3df170c754..bf7a8f5a8f 100644
|
||||
--- a/src/third_party/unwind/dist/src/mips/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/mips/Ginit.c
|
||||
@@ -69,13 +69,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -86,7 +79,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/ppc32/Ginit.c b/src/third_party/unwind/dist/src/ppc32/Ginit.c
|
||||
index ba302448a3..7b45455807 100644
|
||||
--- a/src/third_party/unwind/dist/src/ppc32/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/ppc32/Ginit.c
|
||||
@@ -91,9 +91,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -104,7 +101,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/ppc64/Ginit.c b/src/third_party/unwind/dist/src/ppc64/Ginit.c
|
||||
index 4c88cd6e77..7bfb395a79 100644
|
||||
--- a/src/third_party/unwind/dist/src/ppc64/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/ppc64/Ginit.c
|
||||
@@ -95,9 +95,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -108,7 +105,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/ptrace/_UPT_get_dyn_info_list_addr.c b/src/third_party/unwind/dist/src/ptrace/_UPT_get_dyn_info_list_addr.c
|
||||
index cc5ed04418..16671d453e 100644
|
||||
--- a/src/third_party/unwind/dist/src/ptrace/_UPT_get_dyn_info_list_addr.c
|
||||
+++ b/src/third_party/unwind/dist/src/ptrace/_UPT_get_dyn_info_list_addr.c
|
||||
@@ -71,6 +71,11 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||
|
||||
#else
|
||||
|
||||
+/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
+ by a remote unwinder. On ia64, this is done via a special
|
||||
+ unwind-table entry. Perhaps something similar can be done with
|
||||
+ DWARF2 unwind info. */
|
||||
+
|
||||
static inline int
|
||||
get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
|
||||
int *countp)
|
||||
diff --git a/src/third_party/unwind/dist/src/s390x/Ginit.c b/src/third_party/unwind/dist/src/s390x/Ginit.c
|
||||
index f0886ac933..db01743c06 100644
|
||||
--- a/src/third_party/unwind/dist/src/s390x/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/s390x/Ginit.c
|
||||
@@ -50,8 +50,6 @@ static struct unw_addr_space local_addr_space;
|
||||
|
||||
unw_addr_space_t unw_local_addr_space = &local_addr_space;
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
static inline void *
|
||||
uc_addr (ucontext_t *uc, int reg)
|
||||
{
|
||||
@@ -75,11 +73,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -90,7 +83,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/sh/Ginit.c b/src/third_party/unwind/dist/src/sh/Ginit.c
|
||||
index 52988a721e..9fe96d2bd4 100644
|
||||
--- a/src/third_party/unwind/dist/src/sh/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/sh/Ginit.c
|
||||
@@ -58,13 +58,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -75,7 +68,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/tilegx/Ginit.c b/src/third_party/unwind/dist/src/tilegx/Ginit.c
|
||||
index 7564a558be..925e641324 100644
|
||||
--- a/src/third_party/unwind/dist/src/tilegx/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/tilegx/Ginit.c
|
||||
@@ -64,13 +64,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -81,7 +74,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) (intptr_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/x86/Ginit.c b/src/third_party/unwind/dist/src/x86/Ginit.c
|
||||
index f6b8dc27d4..3cec74a216 100644
|
||||
--- a/src/third_party/unwind/dist/src/x86/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/x86/Ginit.c
|
||||
@@ -54,13 +54,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
|
||||
|
||||
# endif /* UNW_LOCAL_ONLY */
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -71,7 +64,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/src/third_party/unwind/dist/src/x86_64/Ginit.c b/src/third_party/unwind/dist/src/x86_64/Ginit.c
|
||||
index 6161da6401..5c4e4269a6 100644
|
||||
--- a/src/third_party/unwind/dist/src/x86_64/Ginit.c
|
||||
+++ b/src/third_party/unwind/dist/src/x86_64/Ginit.c
|
||||
@@ -49,13 +49,6 @@ static struct unw_addr_space local_addr_space;
|
||||
|
||||
unw_addr_space_t unw_local_addr_space = &local_addr_space;
|
||||
|
||||
-HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
|
||||
-
|
||||
-/* XXX fix me: there is currently no way to locate the dyn-info list
|
||||
- by a remote unwinder. On ia64, this is done via a special
|
||||
- unwind-table entry. Perhaps something similar can be done with
|
||||
- DWARF2 unwind info. */
|
||||
-
|
||||
static void
|
||||
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
|
||||
{
|
||||
@@ -66,7 +59,13 @@ static int
|
||||
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
|
||||
void *arg)
|
||||
{
|
||||
- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
|
||||
+#ifndef UNW_LOCAL_ONLY
|
||||
+# pragma weak _U_dyn_info_list_addr
|
||||
+ if (!_U_dyn_info_list_addr)
|
||||
+ return -UNW_ENOINFO;
|
||||
+#endif
|
||||
+ // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so.
|
||||
+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 81eabea4e4da55cddfe8bcfcbc3759fa90948254 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 3 Mar 2023 14:13:29 -0800
|
||||
Subject: [PATCH] Fix type mismatch on 32bit arches
|
||||
|
||||
std::set::size returns an unsigned integral type.
|
||||
std::max call therefore gets (unsigned int, unsigned long) here.
|
||||
Type of both arguments is not same, so its ambigous
|
||||
and there is no matching std::max implementation for mismatching
|
||||
arguments. std::max expects both input variables to be of
|
||||
same type, max(int,int) etc..
|
||||
|
||||
Fixes
|
||||
src/mongo/util/processinfo_linux.cpp:424:16: error: no matching function for call to 'max'
|
||||
return std::max(socketIds.size(), 1ul);
|
||||
|
||||
Upstream-Status: Submitted [https://jira.mongodb.org/browse/SERVER-74633]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/util/processinfo_linux.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/mongo/util/processinfo_linux.cpp
|
||||
+++ b/src/mongo/util/processinfo_linux.cpp
|
||||
@@ -421,7 +421,7 @@ public:
|
||||
|
||||
// On ARM64, the "physical id" field is unpopulated, causing there to be 0 sockets found. In
|
||||
// this case, we default to 1.
|
||||
- return std::max(socketIds.size(), 1ul);
|
||||
+ return std::max(static_cast<unsigned long>(socketIds.size()), 1ul);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,35 @@
|
||||
From 97914aeab52b4d0ea0ab9e5ff985a1c5cddb0fa1 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:41:39 +0200
|
||||
Subject: [PATCH 06/10] IntelRDFPMathLib20U1: Check for __DEFINED_wchar_t
|
||||
|
||||
This is defined by musl if wchar_t is already defined
|
||||
|
||||
avoids errors like
|
||||
|
||||
src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h:46:15: error: typedef redefinition with different types
|
||||
('int' vs 'unsigned int')
|
||||
typedef int wchar_t;
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
|
||||
index 56775bc..be96a85 100755
|
||||
--- a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
|
||||
+++ b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
#if 0 // MongoDB Modification -- just `#include <stddef.h>`
|
||||
// Fix system header issue on Sun solaris and define required type by ourselves
|
||||
-#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__)
|
||||
+#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__) && !defined(__DEFINED_wchar_t)
|
||||
typedef int wchar_t;
|
||||
#endif
|
||||
#else
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From ca004968b8d2149f72d4edcfe029489a8c5e10ca Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 23 Sep 2019 12:31:31 -0700
|
||||
Subject: [PATCH] Mark one of strerror_r implementation glibc specific
|
||||
|
||||
glibc has two incompatible strerror_r definitions, one of them is
|
||||
specific to glibc, mark this one so
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/util/errno_util.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/mongo/util/errno_util.cpp b/src/mongo/util/errno_util.cpp
|
||||
index 564c0071ea..4f7e1d3a38 100644
|
||||
--- a/src/mongo/util/errno_util.cpp
|
||||
+++ b/src/mongo/util/errno_util.cpp
|
||||
@@ -61,7 +61,7 @@ std::string errnoWithDescription(int errNumber) {
|
||||
char buf[kBuflen];
|
||||
char* msg{nullptr};
|
||||
|
||||
-#if defined(__GNUC__) && defined(_GNU_SOURCE) && \
|
||||
+#if defined(__GNUC__) && defined(_GNU_SOURCE) && defined(__GLIBC__) && \
|
||||
(!defined(__ANDROID_API__) || !(__ANDROID_API__ <= 22)) && !defined(EMSCRIPTEN)
|
||||
msg = strerror_r(errNumber, buf, kBuflen);
|
||||
#elif defined(_WIN32)
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 8d035e84c2edb44461ef4df9cdef0a6dfce0a1d7 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 24 Aug 2018 12:56:22 -0700
|
||||
Subject: [PATCH 07/10] Support deprecated resolver functions
|
||||
|
||||
Needed for musl libc
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/util/dns_query_posix-impl.h | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/mongo/util/dns_query_posix-impl.h b/src/mongo/util/dns_query_posix-impl.h
|
||||
index a5e3629..fb29d2d 100644
|
||||
--- a/src/mongo/util/dns_query_posix-impl.h
|
||||
+++ b/src/mongo/util/dns_query_posix-impl.h
|
||||
@@ -54,6 +54,12 @@
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
+#ifndef res_ninit
|
||||
+#define res_nclose(arg)
|
||||
+#define res_ninit(arg) res_init()
|
||||
+#define res_nsearch(sta, nam, clas, typ, ans, alen) res_search(nam, clas, typ, ans, alen)
|
||||
+#endif
|
||||
+
|
||||
namespace mongo {
|
||||
namespace dns {
|
||||
// The anonymous namespace is safe, in this header, as it is not really a header. It is only used
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
From 8295bb6a60896fed54d6450bca091aea4eea4fb2 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:21:44 +0200
|
||||
Subject: [PATCH 01/10] Tell scons to use build settings from environment
|
||||
variables
|
||||
|
||||
Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
SConstruct | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/SConstruct b/SConstruct
|
||||
index 89c044ab78..2044c0ddb8 100644
|
||||
--- a/SConstruct
|
||||
+++ b/SConstruct
|
||||
@@ -593,6 +593,7 @@ def variable_arch_converter(val):
|
||||
'amd64': 'x86_64',
|
||||
'emt64': 'x86_64',
|
||||
'x86': 'i386',
|
||||
+ 'aarch64': 'arm64',
|
||||
}
|
||||
val = val.lower()
|
||||
|
||||
@@ -723,7 +724,8 @@ env_vars.Add(
|
||||
)
|
||||
|
||||
env_vars.Add('CC',
|
||||
- help='Select the C compiler to use')
|
||||
+ help='Select the C compiler to use',
|
||||
+ default=os.getenv('CC'))
|
||||
|
||||
env_vars.Add('CCFLAGS',
|
||||
help='Sets flags for the C and C++ compiler',
|
||||
@@ -743,7 +745,8 @@ env_vars.Add('CPPPATH',
|
||||
converter=variable_shlex_converter)
|
||||
|
||||
env_vars.Add('CXX',
|
||||
- help='Select the C++ compiler to use')
|
||||
+ help='Select the C++ compiler to use',
|
||||
+ default=os.getenv('CXX'))
|
||||
|
||||
env_vars.Add('CXXFLAGS',
|
||||
help='Sets flags for the C++ compiler',
|
||||
@@ -1127,6 +1130,7 @@ if get_option('build-tools') == 'next' or get_option('ninja') == 'next':
|
||||
SCons.Tool.DefaultToolpath.insert(0, os.path.abspath('site_scons/site_tools/next'))
|
||||
|
||||
env = Environment(variables=env_vars, **envDict)
|
||||
+env.PrependENVPath('PATH', os.getenv('PATH'))
|
||||
|
||||
# Only print the spinner if stdout is a tty
|
||||
if sys.stdout.isatty():
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From f9b55f5a1fab85bf73c95e6372779d6f50f75e84 Mon Sep 17 00:00:00 2001
|
||||
From: jzmaddock <john@johnmaddock.co.uk>
|
||||
Date: Mon, 11 Jul 2022 18:26:07 +0100
|
||||
Subject: [PATCH] The std lib unary/binary_function base classes are
|
||||
deprecated/removed from libcpp15. Fixes
|
||||
https://github.com/boostorg/container_hash/issues/24.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/boostorg/config/pull/440/commits/f0af4a9184457939b89110795ae2d293582c5f66]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/third_party/boost-1.70.0/boost/config/stdlib/libcpp.hpp | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
--- a/src/third_party/boost-1.70.0/boost/config/stdlib/libcpp.hpp
|
||||
+++ b/src/third_party/boost-1.70.0/boost/config/stdlib/libcpp.hpp
|
||||
@@ -140,4 +140,13 @@
|
||||
# define BOOST_NO_CXX14_HDR_SHARED_MUTEX
|
||||
#endif
|
||||
|
||||
+#if _LIBCPP_VERSION >= 15000
|
||||
+//
|
||||
+// Unary function is now deprecated in C++11 and later:
|
||||
+//
|
||||
+#if __cplusplus >= 201103L
|
||||
+#define BOOST_NO_CXX98_FUNCTION_BASE
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
// --- end ---
|
||||
--- a/src/third_party/boost-1.70.0/boost/container_hash/hash.hpp
|
||||
+++ b/src/third_party/boost-1.70.0/boost/container_hash/hash.hpp
|
||||
@@ -118,7 +118,7 @@ namespace boost
|
||||
{
|
||||
namespace hash_detail
|
||||
{
|
||||
-#if defined(_HAS_AUTO_PTR_ETC) && !_HAS_AUTO_PTR_ETC
|
||||
+#if defined(BOOST_NO_CXX98_FUNCTION_BASE)
|
||||
template <typename T>
|
||||
struct hash_base
|
||||
{
|
||||
@@ -0,0 +1,41 @@
|
||||
From 6332823f9fdcb571305b716330e67d0b38810868 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:30:13 +0200
|
||||
Subject: [PATCH 03/10] Use __GLIBC__ to control use of gnu_get_libc_version
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/mongo/util/processinfo_linux.cpp | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
|
||||
index a968c54727..0d8b8874e2 100644
|
||||
--- a/src/mongo/util/processinfo_linux.cpp
|
||||
+++ b/src/mongo/util/processinfo_linux.cpp
|
||||
@@ -44,10 +44,10 @@
|
||||
#include <unistd.h>
|
||||
#ifdef __BIONIC__
|
||||
#include <android/api-level.h>
|
||||
-#elif __UCLIBC__
|
||||
-#include <features.h>
|
||||
-#else
|
||||
+#elif defined(__GLIBC__) && !defined(__UCLIBC__)
|
||||
#include <gnu/libc-version.h>
|
||||
+#else
|
||||
+#include <features.h>
|
||||
#endif
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
@@ -617,7 +617,7 @@ void ProcessInfo::SystemInfo::collectSystemInfo() {
|
||||
std::stringstream ss;
|
||||
ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__;
|
||||
bExtra.append("libcVersion", ss.str());
|
||||
-#else
|
||||
+#elif defined(__GLIBC__)
|
||||
bExtra.append("libcVersion", gnu_get_libc_version());
|
||||
#endif
|
||||
if (!verSig.empty())
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
From 4e7f15346682482bc2071c7209dec97507d3bc4c Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 2 Sep 2017 10:03:37 -0700
|
||||
Subject: [PATCH 02/10] Use long long instead of int64_t
|
||||
|
||||
Fixes
|
||||
error: call to member function 'appendNumber' is ambiguous
|
||||
since this function expects long long as parameter and not int64_t
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/mongo/util/procparser.cpp | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/mongo/util/procparser.cpp b/src/mongo/util/procparser.cpp
|
||||
index 24b9d1e2c9..0f274cfff6 100644
|
||||
--- a/src/mongo/util/procparser.cpp
|
||||
+++ b/src/mongo/util/procparser.cpp
|
||||
@@ -261,7 +261,7 @@ Status parseProcStat(const std::vector<StringData>& keys,
|
||||
|
||||
StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin());
|
||||
|
||||
- uint64_t value;
|
||||
+ long long value;
|
||||
|
||||
if (!NumberParser{}(stringValue, &value).isOK()) {
|
||||
value = 0;
|
||||
@@ -273,7 +273,7 @@ Status parseProcStat(const std::vector<StringData>& keys,
|
||||
} else {
|
||||
StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin());
|
||||
|
||||
- uint64_t value;
|
||||
+ long long value;
|
||||
|
||||
if (!NumberParser{}(stringValue, &value).isOK()) {
|
||||
value = 0;
|
||||
@@ -366,7 +366,7 @@ Status parseProcMemInfo(const std::vector<StringData>& keys,
|
||||
|
||||
StringData stringValue((*partIt).begin(), (*partIt).end());
|
||||
|
||||
- uint64_t value;
|
||||
+ long long value;
|
||||
|
||||
if (!NumberParser{}(stringValue, &value).isOK()) {
|
||||
value = 0;
|
||||
@@ -522,7 +522,7 @@ Status parseProcDiskStats(const std::vector<StringData>& disks,
|
||||
StringData data,
|
||||
BSONObjBuilder* builder) {
|
||||
bool foundKeys = false;
|
||||
- std::vector<uint64_t> stats;
|
||||
+ std::vector<long long> stats;
|
||||
stats.reserve(kDiskFieldCount);
|
||||
|
||||
using string_split_iterator = boost::split_iterator<StringData::const_iterator>;
|
||||
@@ -597,7 +597,7 @@ Status parseProcDiskStats(const std::vector<StringData>& disks,
|
||||
|
||||
StringData stringValue((*partIt).begin(), (*partIt).end());
|
||||
|
||||
- uint64_t value;
|
||||
+ long long value;
|
||||
|
||||
if (!NumberParser{}(stringValue, &value).isOK()) {
|
||||
value = 0;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From ad37ee80b32a1f740a3197105174d74dff11e4e8 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 13 Apr 2022 13:56:32 -0700
|
||||
Subject: [PATCH] add explict static_cast<size_t> to maxMemoryUsageBytes
|
||||
|
||||
Fixes
|
||||
src/mongo/db/pipeline/document_source_group.cpp:377:22: error: non-constant-expression cannot be narrowed from type 'long long' to 'size_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
|
||||
maxMemoryUsageBytes ? *maxMemoryUsageBytes
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
src/mongo/db/pipeline/document_source_group.cpp:377:22: note: insert an explicit cast to silence this issue
|
||||
maxMemoryUsageBytes ? *maxMemoryUsageBytes
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/db/pipeline/document_source_group.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp
|
||||
index 4a7b48d6cd2..9a6076c6041 100644
|
||||
--- a/src/mongo/db/pipeline/document_source_group.cpp
|
||||
+++ b/src/mongo/db/pipeline/document_source_group.cpp
|
||||
@@ -374,8 +374,8 @@ DocumentSourceGroup::DocumentSourceGroup(const intrusive_ptr<ExpressionContext>&
|
||||
_usedDisk(false),
|
||||
_doingMerge(false),
|
||||
_memoryTracker{pExpCtx->allowDiskUse && !pExpCtx->inMongos,
|
||||
- maxMemoryUsageBytes ? *maxMemoryUsageBytes
|
||||
- : internalDocumentSourceGroupMaxMemoryBytes.load()},
|
||||
+ static_cast<size_t>(maxMemoryUsageBytes ? *maxMemoryUsageBytes
|
||||
+ : internalDocumentSourceGroupMaxMemoryBytes.load())},
|
||||
// We spill to disk in debug mode, regardless of allowDiskUse, to stress the system.
|
||||
_file(!pExpCtx->inMongos && (pExpCtx->allowDiskUse || kDebugBuild)
|
||||
? std::make_shared<Sorter<Value, Value>::File>(pExpCtx->tempDir + "/" +
|
||||
--
|
||||
2.35.2
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 03047c81b2601362bcf79cae67e06d1fba0a6101 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 2 Mar 2023 20:17:57 -0800
|
||||
Subject: [PATCH] apply msvc workaround for clang >= 16
|
||||
|
||||
This avoids a new Werror found with clang16
|
||||
|
||||
boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
.../boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp b/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp
|
||||
index 6bc05f7e96e..6bb8d24c9ce 100644
|
||||
--- a/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp
|
||||
+++ b/src/third_party/boost-1.70.0/boost/mpl/aux_/integral_wrapper.hpp
|
||||
@@ -56,7 +56,7 @@ struct AUX_WRAPPER_NAME
|
||||
// have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC),
|
||||
// while some other don't like 'value + 1' (Borland), and some don't like
|
||||
// either
|
||||
-#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
|
||||
+#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) || __clang_major__ > 15
|
||||
private:
|
||||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
|
||||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
|
||||
--
|
||||
2.39.2
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 097e8a66930cfa28ac8bfa35f62d0a9ee3b74488 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:46:52 +0200
|
||||
Subject: [PATCH 10/10] asio: Dont use experimental with clang
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/third_party/asio-master/asio/include/asio/detail/string_view.hpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/third_party/asio-master/asio/include/asio/detail/string_view.hpp b/src/third_party/asio-master/asio/include/asio/detail/string_view.hpp
|
||||
index f09cebc..fa307b5 100644
|
||||
--- a/src/third_party/asio-master/asio/include/asio/detail/string_view.hpp
|
||||
+++ b/src/third_party/asio-master/asio/include/asio/detail/string_view.hpp
|
||||
@@ -33,8 +33,8 @@ namespace asio {
|
||||
using std::basic_string_view;
|
||||
using std::string_view;
|
||||
#elif defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
|
||||
-using std::experimental::basic_string_view;
|
||||
-using std::experimental::string_view;
|
||||
+using std::basic_string_view;
|
||||
+using std::string_view;
|
||||
#endif // defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
|
||||
|
||||
} // namespace asio
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From 5d8218b8a1b5bc71e2a0cf543a000e194daba599 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sun, 29 Jan 2023 17:15:30 -0800
|
||||
Subject: [PATCH] free_mon: Include missing <cstdint>
|
||||
|
||||
gcc 13 moved some includes around and as a result <cstdint> is no
|
||||
longer transitively included [1]. Explicitly include it
|
||||
for uintXX_t.
|
||||
|
||||
[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/db/free_mon/free_mon_options.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/src/mongo/db/free_mon/free_mon_options.h
|
||||
+++ b/src/mongo/db/free_mon/free_mon_options.h
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
+#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 383b1dda4800c2514cb31446cd7478692d7d26cf Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 3 Mar 2021 12:43:16 -0800
|
||||
Subject: [PATCH] include needed c++ header
|
||||
|
||||
Fixes
|
||||
plan_stats.h:214:10: error: 'optional' in namespace 'std' does not name a template type
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/db/exec/plan_stats.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/mongo/db/exec/plan_stats.h b/src/mongo/db/exec/plan_stats.h
|
||||
index ea75f673b8..0cc9b4636d 100644
|
||||
--- a/src/mongo/db/exec/plan_stats.h
|
||||
+++ b/src/mongo/db/exec/plan_stats.h
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
+#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
--
|
||||
2.30.1
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 5c9e0d0fc9188bab0ae09c9c33df01938b0c1b6c Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 14 Apr 2022 09:25:33 -0700
|
||||
Subject: [PATCH] server: Adjust the cache alignment assumptions
|
||||
|
||||
aarch64 has 256 for hardware_destructive_interference_size and gcc 12
|
||||
has added a warning to complain about mismatches which results in
|
||||
static_assert failures
|
||||
|
||||
In file included from src/mongo/s/commands/cluster_find_cmd.cpp:39:
|
||||
src/mongo/db/stats/counters.h:185:47: error: static assertion failed: cache line spill
|
||||
185 | static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size,
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The structure need to ensure true sharing for both the elements
|
||||
so align it to hardware_constructive_interference_size instead
|
||||
|
||||
Upstream-Status: Inappropriate [https://jira.mongodb.org/browse/SERVER-65664]
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/db/stats/counters.h | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/src/mongo/db/stats/counters.h
|
||||
+++ b/src/mongo/db/stats/counters.h
|
||||
@@ -182,8 +182,8 @@ private:
|
||||
AtomicWord<long long> requests{0};
|
||||
};
|
||||
CacheAligned<Together> _together{};
|
||||
- static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size,
|
||||
- "cache line spill");
|
||||
+ static_assert(sizeof(Together) <= stdx::hardware_constructive_interference_size,
|
||||
+ "cache line spill");
|
||||
|
||||
CacheAligned<AtomicWord<long long>> _logicalBytesOut{0};
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From efd79bda1b85a5a4398a71e5ea2bc00ee4b0ea46 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 15 Sep 2020 18:20:27 -0700
|
||||
Subject: [PATCH] stacktrace: Define ARCH_BITS for x86
|
||||
|
||||
stacktrace_somap.cpp:92:33: error: 'ELFCLASSARCH_BITS' was not declared in this scope
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/util/stacktrace_somap.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/mongo/util/stacktrace_somap.cpp b/src/mongo/util/stacktrace_somap.cpp
|
||||
index f7ba66a142..2231948ce8 100644
|
||||
--- a/src/mongo/util/stacktrace_somap.cpp
|
||||
+++ b/src/mongo/util/stacktrace_somap.cpp
|
||||
@@ -83,7 +83,7 @@ void addUnameToSoMap(BSONObjBuilder* soMap) {
|
||||
#define ARCH_BITS __ELF_NATIVE_CLASS
|
||||
#elif defined(__x86_64__) || defined(__aarch64__)
|
||||
#define ARCH_BITS 64
|
||||
-#elif defined(__arm__)
|
||||
+#elif defined(__i386__) || defined(__arm__)
|
||||
#define ARCH_BITS 32
|
||||
#else
|
||||
#error Unknown target architecture.
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 0508c1518c2e7c586a231d344e9f93b08507885b Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 31 Dec 2022 14:23:40 -0800
|
||||
Subject: [PATCH] wiredtiger: Avoid using off64_t
|
||||
|
||||
off64_t is not available on musl since off_t is already 64bit by
|
||||
default. Therefore replace using off64_t with off_t
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/third_party/wiredtiger/src/os_posix/os_fs.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/third_party/wiredtiger/src/os_posix/os_fs.c b/src/third_party/wiredtiger/src/os_posix/os_fs.c
|
||||
index 3898eb74343..9ce2d5edb38 100644
|
||||
--- a/src/third_party/wiredtiger/src/os_posix/os_fs.c
|
||||
+++ b/src/third_party/wiredtiger/src/os_posix/os_fs.c
|
||||
@@ -533,7 +533,7 @@ __posix_file_sync_nowait(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session)
|
||||
pfh = (WT_FILE_HANDLE_POSIX *)file_handle;
|
||||
|
||||
/* See comment in __posix_sync(): sync cannot be retried or fail. */
|
||||
- WT_SYSCALL(sync_file_range(pfh->fd, (off64_t)0, (off64_t)0, SYNC_FILE_RANGE_WRITE), ret);
|
||||
+ WT_SYSCALL(sync_file_range(pfh->fd, 0, 0, SYNC_FILE_RANGE_WRITE), ret);
|
||||
if (ret == 0)
|
||||
return (0);
|
||||
|
||||
--
|
||||
2.39.0
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 28f34191eef1e70c24d2f81b66e4dd40dbefcd35 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 2 Sep 2017 12:42:30 -0700
|
||||
Subject: [PATCH 04/10] Add a definition for the macro __ELF_NATIVE_CLASS
|
||||
|
||||
It depends on the native arch's word size.
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/mongo/util/stacktrace_posix.cpp | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/src/mongo/util/stacktrace_posix.cpp b/src/mongo/util/stacktrace_posix.cpp
|
||||
index 531e21bdc2..fa611499e4 100644
|
||||
--- a/src/mongo/util/stacktrace_posix.cpp
|
||||
+++ b/src/mongo/util/stacktrace_posix.cpp
|
||||
@@ -42,6 +42,15 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
+#if !defined(__GLIBC__)
|
||||
+#if defined __x86_64__ && !defined __ILP32__
|
||||
+# define __WORDSIZE 64
|
||||
+#else
|
||||
+# define __WORDSIZE 32
|
||||
+#endif
|
||||
+#define __ELF_NATIVE_CLASS __WORDSIZE
|
||||
+#endif
|
||||
+
|
||||
#include "mongo/base/init.h"
|
||||
#include "mongo/bson/json.h"
|
||||
#include "mongo/config.h"
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From ffe6045b190b735601cd209d3e7ac121604c5a4e Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 24 Aug 2018 13:07:01 -0700
|
||||
Subject: [PATCH 08/10] Fix default stack size to 256K
|
||||
|
||||
On musl default stack size is ~80K which is too low
|
||||
for mongodb
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/mongo/platform/stack_locator_pthread_getattr_np.cpp | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/src/mongo/platform/stack_locator_pthread_getattr_np.cpp b/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
|
||||
index 4f3044c..68e47e3 100644
|
||||
--- a/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
|
||||
+++ b/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
|
||||
@@ -36,6 +36,16 @@
|
||||
#include "mongo/util/assert_util.h"
|
||||
#include "mongo/util/scopeguard.h"
|
||||
|
||||
+__attribute__((constructor))
|
||||
+static void set_default_stack_size(void)
|
||||
+{
|
||||
+ pthread_attr_t attr;
|
||||
+ invariant(pthread_attr_init(&attr) == 0);
|
||||
+ invariant(pthread_attr_setstacksize(&attr, 256*1024) == 0);
|
||||
+ pthread_setattr_default_np(&attr);
|
||||
+ invariant(pthread_attr_destroy(&attr) == 0);
|
||||
+}
|
||||
+
|
||||
namespace mongo {
|
||||
|
||||
StackLocator::StackLocator() {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
Index: git/SConstruct
|
||||
===================================================================
|
||||
--- git.orig/SConstruct
|
||||
+++ git/SConstruct
|
||||
@@ -977,6 +977,14 @@ env_vars.Add('WINDOWS_OPENSSL_BIN',
|
||||
help='Sets the path to the openssl binaries for packaging',
|
||||
default='c:/openssl/bin')
|
||||
|
||||
+env_vars.Add('PREFIX',
|
||||
+ help='installation prefix')
|
||||
+
|
||||
+env_vars.Add('prefix',
|
||||
+ help='installation prefix')
|
||||
+
|
||||
+
|
||||
+
|
||||
# -- Validate user provided options --
|
||||
|
||||
# A dummy environment that should *only* have the variables we have set. In practice it has
|
||||
@@ -0,0 +1,26 @@
|
||||
From cc95a8878fa581b164dee8fb1f07b05b9d919ef0 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 2 Sep 2017 13:13:15 -0700
|
||||
Subject: [PATCH 09/10] wiredtiger: Disable strtouq on musl
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/third_party/wiredtiger/build_linux/wiredtiger_config.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/third_party/wiredtiger/build_linux/wiredtiger_config.h b/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
|
||||
index 82e9994..0399a67 100644
|
||||
--- a/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
|
||||
+++ b/src/third_party/wiredtiger/build_linux/wiredtiger_config.h
|
||||
@@ -104,7 +104,7 @@
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strtouq' function. */
|
||||
-#define HAVE_STRTOUQ 1
|
||||
+/* #undef HAVE_STRTOUQ 1 */
|
||||
|
||||
/* Define to 1 if you have the `sync_file_range' function. */
|
||||
/* #undef HAVE_SYNC_FILE_RANGE */
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
Upstream-Status: submitted https://github.com/mongodb/mongo/pull/1296
|
||||
From 362be06fc16a5ad0f9e9aa90cc763c5242e8e35c Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Sat, 9 Feb 2019 12:41:45 +0100
|
||||
Subject: [PATCH] ssl_manager.cpp: fix build with gcc 7 and -fpermissive
|
||||
|
||||
Change prototype of DERToken::parse function from
|
||||
parse(ConstDataRange cdr, size_t* outLength);
|
||||
to parse(ConstDataRange cdr, uint64_t* outLength);
|
||||
|
||||
Otherwise, we got the following error:
|
||||
|
||||
src/mongo/util/net/ssl_manager.cpp: In static member function 'static mongo::StatusWith<mongo::{anonymous}::DERToken> mongo::{anonymous}::DERToken::parse(mongo::ConstDataRange, size_t*)':
|
||||
src/mongo/util/net/ssl_manager.cpp:575:79: error: invalid conversion from 'size_t* {aka unsigned int*}' to 'long unsigned int*' [-fpermissive]
|
||||
if (mongoUnsignedAddOverflow64(tagAndLengthByteCount, derLength, outLength) ||
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
src/mongo/util/net/ssl_manager.cpp | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
|
||||
index 455a1662a5..e8497bc0d1 100644
|
||||
--- a/src/mongo/util/net/ssl_manager.cpp
|
||||
+++ b/src/mongo/util/net/ssl_manager.cpp
|
||||
@@ -810,7 +810,7 @@ public:
|
||||
*
|
||||
* Returns a DERToken which consists of the (tag, length, value) tuple.
|
||||
*/
|
||||
- static StatusWith<DERToken> parse(ConstDataRange cdr, size_t* outLength);
|
||||
+ static StatusWith<DERToken> parse(ConstDataRange cdr, uint64_t* outLength);
|
||||
|
||||
private:
|
||||
DERType _type{DERType::EndOfContent};
|
||||
@@ -827,7 +827,7 @@ struct DataType::Handler<DERToken> {
|
||||
size_t length,
|
||||
size_t* advanced,
|
||||
std::ptrdiff_t debug_offset) {
|
||||
- size_t outLength;
|
||||
+ uint64_t outLength;
|
||||
|
||||
auto swPair = DERToken::parse(ConstDataRange(ptr, length), &outLength);
|
||||
|
||||
@@ -889,7 +889,7 @@ StatusWith<DERInteger> readDERInt(ConstDataRangeCursor& cdc) {
|
||||
}
|
||||
|
||||
|
||||
-StatusWith<DERToken> DERToken::parse(ConstDataRange cdr, size_t* outLength) {
|
||||
+StatusWith<DERToken> DERToken::parse(ConstDataRange cdr, uint64_t* outLength) {
|
||||
const size_t kTagLength = 1;
|
||||
const size_t kTagLengthAndInitialLengthByteLength = kTagLength + 1;
|
||||
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
PTHREAD_STACK_MIN is no longer a compile time define in glibc 2.34+ and since
|
||||
we only care for glibc and musl where PTHREAD_STACK_MIN is always defined there
|
||||
is no need to check for constant called PTHREAD_STACK_MIN since its already defined
|
||||
this fix may not work for wider audience but for OE needs its sufficient
|
||||
|
||||
Upstream-Status: Inappropriate [OE-only fix]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
--- a/src/third_party/boost-1.70.0/boost/thread/pthread/thread_data.hpp
|
||||
+++ b/src/third_party/boost-1.70.0/boost/thread/pthread/thread_data.hpp
|
||||
@@ -57,9 +57,7 @@ namespace boost
|
||||
#else
|
||||
std::size_t page_size = ::sysconf( _SC_PAGESIZE);
|
||||
#endif
|
||||
-#if PTHREAD_STACK_MIN > 0
|
||||
if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
|
||||
-#endif
|
||||
size = ((size+page_size-1)/page_size)*page_size;
|
||||
int res = pthread_attr_setstacksize(&val_, size);
|
||||
BOOST_VERIFY(!res && "pthread_attr_setstacksize failed");
|
||||
@@ -0,0 +1,54 @@
|
||||
From 298d958148f1fb2bb7725fed15c68c09677c14c9 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
Date: Mon, 16 Sep 2019 13:37:10 +0200
|
||||
Subject: [PATCH 05/10] Add alises for arm64 which is same as aarch64
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Vincent Prince <vincent.prince.fr@gmail.com>
|
||||
---
|
||||
SConstruct | 1 +
|
||||
src/third_party/IntelRDFPMathLib20U1/SConscript | 2 +-
|
||||
src/third_party/wiredtiger/SConscript | 2 +-
|
||||
3 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/SConstruct b/SConstruct
|
||||
index 448939bdd0..abfd816f3e 100644
|
||||
--- a/SConstruct
|
||||
+++ b/SConstruct
|
||||
@@ -1228,6 +1228,7 @@ if endian == "auto":
|
||||
processor_macros = {
|
||||
'arm' : { 'endian': 'little', 'defines': ('__arm__',) },
|
||||
'aarch64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
|
||||
+ 'arm64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
|
||||
'i386' : { 'endian': 'little', 'defines': ('__i386', '_M_IX86')},
|
||||
'ppc64le' : { 'endian': 'little', 'defines': ('__powerpc64__',)},
|
||||
's390x' : { 'endian': 'big', 'defines': ('__s390x__',)},
|
||||
diff --git a/src/third_party/IntelRDFPMathLib20U1/SConscript b/src/third_party/IntelRDFPMathLib20U1/SConscript
|
||||
index 58e1b7ba65..bffe83b462 100644
|
||||
--- a/src/third_party/IntelRDFPMathLib20U1/SConscript
|
||||
+++ b/src/third_party/IntelRDFPMathLib20U1/SConscript
|
||||
@@ -309,7 +309,7 @@ if processor == 'i386' or processor == 'emscripten':
|
||||
elif processor == 'arm':
|
||||
cpp_defines['IA32'] = '1'
|
||||
cpp_defines['ia32'] = '1'
|
||||
-elif processor == "aarch64":
|
||||
+elif processor == "aarch64" or processor == 'arm64':
|
||||
cpp_defines['efi2'] = '1'
|
||||
cpp_defines['EFI2'] = '1'
|
||||
# Using 64 bit little endian
|
||||
diff --git a/src/third_party/wiredtiger/SConscript b/src/third_party/wiredtiger/SConscript
|
||||
index d6bd665e23..2f1e656a19 100644
|
||||
--- a/src/third_party/wiredtiger/SConscript
|
||||
+++ b/src/third_party/wiredtiger/SConscript
|
||||
@@ -152,7 +152,7 @@ condition_map = {
|
||||
'POSIX_HOST' : not env.TargetOSIs('windows'),
|
||||
'WINDOWS_HOST' : env.TargetOSIs('windows'),
|
||||
|
||||
- 'ARM64_HOST' : env['TARGET_ARCH'] == 'aarch64',
|
||||
+ 'ARM64_HOST' : env['TARGET_ARCH'] in ('aarch64', 'arm64'),
|
||||
'POWERPC_HOST' : env['TARGET_ARCH'] == 'ppc64le',
|
||||
'X86_HOST' : env['TARGET_ARCH'] == 'x86_64',
|
||||
'ZSERIES_HOST' : env['TARGET_ARCH'] == 's390x',
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
Lets use cached result for this otherwise runtime test, on qemuppc64
|
||||
when this test is run using gcc11, it returns 1, since we dont worry
|
||||
about older compilers here, we can cache the result and use it here
|
||||
|
||||
Upstream-Status: Inappropriate [Cross-compile specific]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
--- a/SConstruct
|
||||
+++ b/SConstruct
|
||||
@@ -3904,7 +3904,7 @@ def doConfigure(myenv):
|
||||
|
||||
conf.AddTest('CheckAltivecVbpermqOutput', CheckAltivecVbpermqOutput)
|
||||
|
||||
- outputIndex = next((idx for idx in [0,1] if conf.CheckAltivecVbpermqOutput(idx)), None)
|
||||
+ outputIndex = 1
|
||||
if outputIndex is not None:
|
||||
conf.env.SetConfigHeaderDefine("MONGO_CONFIG_ALTIVEC_VEC_VBPERMQ_OUTPUT_INDEX", outputIndex)
|
||||
else:
|
||||
@@ -0,0 +1,18 @@
|
||||
Subject: [PATCH] stacktrace: Define ARCH_BITS for ppc64
|
||||
|
||||
src/mongo/util/stacktrace_somap.cpp:89:2: error: #error Unknown target architecture.
|
||||
stacktrace_somap.cpp:92:33: error: 'ELFCLASSARCH_BITS' was not declared in this scope
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
--- a/src/mongo/util/stacktrace_somap.cpp
|
||||
+++ b/src/mongo/util/stacktrace_somap.cpp
|
||||
@@ -81,7 +81,7 @@ void addUnameToSoMap(BSONObjBuilder* soM
|
||||
|
||||
#if defined(__ELF_NATIVE_CLASS) // determine ARCH_BITS
|
||||
#define ARCH_BITS __ELF_NATIVE_CLASS
|
||||
-#elif defined(__x86_64__) || defined(__aarch64__)
|
||||
+#elif defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
|
||||
#define ARCH_BITS 64
|
||||
#elif defined(__i386__) || defined(__arm__)
|
||||
#define ARCH_BITS 32
|
||||
@@ -0,0 +1,147 @@
|
||||
SUMMARY = "mongodb"
|
||||
LICENSE = "SSPL-1 & Apache-2.0 & Zlib"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE-Community.txt;md5=3a865f27f11f43ecbe542d9ea387dcf1 \
|
||||
file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
|
||||
|
||||
DEPENDS = "openssl libpcap zlib boost curl python3 \
|
||||
python3-setuptools-native \
|
||||
python3-pyyaml-native python3-cheetah-native \
|
||||
python3-psutil-native python3-regex-native \
|
||||
"
|
||||
|
||||
inherit scons dos2unix siteinfo python3native systemd useradd
|
||||
|
||||
PV = "4.4.19"
|
||||
#v4.4.18
|
||||
SRCREV = "9a996e0ad993148b9650dc402e6d3b1804ad3b8a"
|
||||
SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
|
||||
file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \
|
||||
file://0001-Use-long-long-instead-of-int64_t.patch \
|
||||
file://0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch \
|
||||
file://0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch \
|
||||
file://arm64-support.patch \
|
||||
file://0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch \
|
||||
file://0001-Support-deprecated-resolver-functions.patch \
|
||||
file://0003-Fix-unknown-prefix-env.patch \
|
||||
file://1296.patch \
|
||||
file://0001-Fix-compilation-with-fno-common.patch \
|
||||
file://0001-stacktrace-Define-ARCH_BITS-for-x86.patch \
|
||||
file://0001-include-needed-c-header.patch \
|
||||
file://disable_runtime_check.patch \
|
||||
file://ppc64_ARCH_BITS.patch \
|
||||
file://PTHREAD_STACK_MIN.patch \
|
||||
file://0001-add-explict-static_cast-size_t-to-maxMemoryUsageByte.patch \
|
||||
file://0001-server-Adjust-the-cache-alignment-assumptions.patch \
|
||||
file://0001-The-std-lib-unary-binary_function-base-classes-are-d.patch \
|
||||
file://0001-free_mon-Include-missing-cstdint.patch \
|
||||
file://0001-apply-msvc-workaround-for-clang-16.patch \
|
||||
file://0001-Fix-type-mismatch-on-32bit-arches.patch \
|
||||
"
|
||||
SRC_URI:append:libc-musl ="\
|
||||
file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \
|
||||
file://0002-Fix-default-stack-size-to-256K.patch \
|
||||
file://0004-wiredtiger-Disable-strtouq-on-musl.patch \
|
||||
file://0001-wiredtiger-Avoid-using-off64_t.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:toolchain-clang = "\
|
||||
file://0001-asio-Dont-use-experimental-with-clang.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
CVE_CHECK_IGNORE += "\
|
||||
CVE-2014-8180 \
|
||||
CVE-2017-18381 \
|
||||
CVE-2017-2665 \
|
||||
"
|
||||
|
||||
COMPATIBLE_HOST ?= '(x86_64|i.86|powerpc64|arm|aarch64).*-linux'
|
||||
|
||||
PACKAGECONFIG ??= "tcmalloc system-pcre"
|
||||
# gperftools compilation fails for arm below v7 because of missing support of
|
||||
# dmb operation. So we use system-allocator instead of tcmalloc
|
||||
PACKAGECONFIG:remove:armv6 = "tcmalloc"
|
||||
PACKAGECONFIG:remove:libc-musl = "tcmalloc"
|
||||
PACKAGECONFIG:remove:riscv64 = "tcmalloc"
|
||||
PACKAGECONFIG:remove:riscv32 = "tcmalloc"
|
||||
|
||||
PACKAGECONFIG[tcmalloc] = "--use-system-tcmalloc,--allocator=system,gperftools,"
|
||||
PACKAGECONFIG[shell] = ",--js-engine=none,,"
|
||||
PACKAGECONFIG[system-pcre] = "--use-system-pcre,,libpcre,"
|
||||
|
||||
MONGO_ARCH ?= "${HOST_ARCH}"
|
||||
MONGO_ARCH:powerpc64le = "ppc64le"
|
||||
WIREDTIGER ?= "off"
|
||||
WIREDTIGER:x86-64 = "on"
|
||||
WIREDTIGER:aarch64 = "on"
|
||||
|
||||
# ld.gold: fatal error: build/59f4f0dd/mongo/mongod: Structure needs cleaning
|
||||
LDFLAGS:append:x86:libc-musl = " -fuse-ld=bfd"
|
||||
LDFLAGS:remove:toolchain-clang = "-fuse-ld=bfd"
|
||||
|
||||
EXTRA_OESCONS = "PREFIX=${prefix} \
|
||||
DESTDIR=${D} \
|
||||
MAXLINELENGTH='2097152' \
|
||||
LIBPATH=${STAGING_LIBDIR} \
|
||||
LINKFLAGS='${LDFLAGS}' \
|
||||
CXXFLAGS='${CXXFLAGS}' \
|
||||
TARGET_ARCH=${MONGO_ARCH} \
|
||||
MONGO_VERSION=${PV} \
|
||||
OBJCOPY=${OBJCOPY} \
|
||||
--ssl \
|
||||
--disable-warnings-as-errors \
|
||||
--use-system-zlib \
|
||||
--nostrip \
|
||||
--endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
|
||||
--wiredtiger='${WIREDTIGER}' \
|
||||
--separate-debug \
|
||||
${PACKAGECONFIG_CONFARGS}"
|
||||
|
||||
USERADD_PACKAGES = "${PN}"
|
||||
USERADD_PARAM:${PN} = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}"
|
||||
|
||||
scons_do_compile() {
|
||||
${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} install-core ||
|
||||
die "scons build execution failed."
|
||||
}
|
||||
|
||||
scons_do_install() {
|
||||
# install binaries
|
||||
install -d ${D}${bindir}
|
||||
for i in mongod mongos mongo; do
|
||||
if [ -f ${B}/build/*/mongo/$i ]; then
|
||||
install -m 0755 ${B}/build/*/mongo/$i ${D}${bindir}
|
||||
else
|
||||
bbnote "$i does not exist"
|
||||
fi
|
||||
done
|
||||
|
||||
# install config
|
||||
install -d ${D}${sysconfdir}
|
||||
install -m 0644 ${S}/debian/mongod.conf ${D}${sysconfdir}
|
||||
|
||||
# install systemd service
|
||||
install -d ${D}${systemd_system_unitdir}
|
||||
install -m 0644 ${S}/debian/mongod.service ${D}${systemd_system_unitdir}
|
||||
|
||||
# install mongo data folder
|
||||
install -m 755 -d ${D}${localstatedir}/lib/${BPN}
|
||||
chown ${BPN}:${BPN} ${D}${localstatedir}/lib/${BPN}
|
||||
|
||||
# Create /var/log/mongodb in runtime.
|
||||
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then
|
||||
install -d ${D}${nonarch_libdir}/tmpfiles.d
|
||||
echo "d ${localstatedir}/log/${BPN} 0755 ${BPN} ${BPN} -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
|
||||
fi
|
||||
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
|
||||
install -d ${D}${sysconfdir}/default/volatiles
|
||||
echo "d ${BPN} ${BPN} 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
|
||||
fi
|
||||
}
|
||||
|
||||
CONFFILES:${PN} = "${sysconfdir}/mongod.conf"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "mongod.service"
|
||||
|
||||
FILES:${PN} += "${nonarch_libdir}/tmpfiles.d"
|
||||
@@ -0,0 +1,67 @@
|
||||
From 30c79d1b49839a15c05a0d0ca7e54787cd7988c6 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Jansa <Martin.Jansa@gmail.com>
|
||||
Date: Thu, 4 May 2023 07:17:57 +0000
|
||||
Subject: [PATCH] CMakeLists.txt: allow to set PYTHON_INSTDIR from outside
|
||||
|
||||
CMakeLists.txt used:
|
||||
|
||||
find_package(Python REQUIRED COMPONENTS Interpreter)
|
||||
execute_process(
|
||||
COMMAND ${Python_EXECUTABLE} -c
|
||||
"import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
||||
OUTPUT_VARIABLE PYTHON_INSTDIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
but with python3native this returns:
|
||||
|
||||
nanopb/0.4.7-r0/git $ ../recipe-sysroot-native/usr/bin/python3-native/python3 -c "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
||||
lib/python3.11/site-packages
|
||||
|
||||
which doesn't respect target libdir which might be lib64 with multilib and with python3targetconfig
|
||||
it also doesn't work right because of the long relative path:
|
||||
|
||||
nanopb/0.4.7-r0/build $ ../recipe-sysroot-native/usr/bin/python3-native/python3 -c "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
||||
../../../../../../../../../../../../usr/lib64/python3.11/site-packages
|
||||
|
||||
CMake Error at cmake_install.cmake:46 (file):
|
||||
file cannot create directory:
|
||||
/OE/lge/build/starfish/nanbield/BUILD/work/o22-starfish-linux/nanopb/0.4.7-r0/image/usr/../../../../../../../../../../../../usr/lib64/python3.11/site-packages/proto.
|
||||
Maybe need administrative privileges.
|
||||
|
||||
Let CMake variable to be passed from the recipe to avoid this as we're already using
|
||||
${D}${PYTHON_SITEPACKAGES_DIR} in do_install:append anyway.
|
||||
|
||||
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
|
||||
Upstream-Status: Pending
|
||||
---
|
||||
CMakeLists.txt | 16 +++++++++-------
|
||||
1 file changed, 9 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 8d241c5..7d3f993 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -39,13 +39,15 @@ if(NOT DEFINED CMAKE_INSTALL_CMAKEDIR)
|
||||
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/nanopb")
|
||||
endif()
|
||||
|
||||
-find_package(Python REQUIRED COMPONENTS Interpreter)
|
||||
-execute_process(
|
||||
- COMMAND ${Python_EXECUTABLE} -c
|
||||
- "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
||||
- OUTPUT_VARIABLE PYTHON_INSTDIR
|
||||
- OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
-)
|
||||
+if(NOT DEFINED PYTHON_INSTDIR)
|
||||
+ find_package(Python REQUIRED COMPONENTS Interpreter)
|
||||
+ execute_process(
|
||||
+ COMMAND ${Python_EXECUTABLE} -c
|
||||
+ "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
||||
+ OUTPUT_VARIABLE PYTHON_INSTDIR
|
||||
+ OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
+ )
|
||||
+endif()
|
||||
|
||||
if(nanopb_BUILD_GENERATOR)
|
||||
set(generator_protos nanopb)
|
||||
@@ -0,0 +1,33 @@
|
||||
DESCRIPTION="Protocol Buffers with small code size"
|
||||
LICENSE="Zlib"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9db4b73a55a3994384112efcdb37c01f"
|
||||
|
||||
DEPENDS = "protobuf-native"
|
||||
|
||||
SRC_URI = "git://github.com/nanopb/nanopb.git;branch=master;protocol=https \
|
||||
file://0001-CMakeLists.txt-allow-to-set-PYTHON_INSTDIR-from-outs.patch \
|
||||
"
|
||||
SRCREV = "b97aa657a706d3ba4a9a6ccca7043c9d6fe41cba"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit cmake python3native
|
||||
|
||||
EXTRA_OECMAKE += "-DPYTHON_INSTDIR=${PYTHON_SITEPACKAGES_DIR}"
|
||||
|
||||
do_install:append() {
|
||||
install -Dm 0755 ${S}/generator/nanopb_generator.py ${D}${bindir}/nanopb_generator.py
|
||||
install -Dm 0755 ${S}/generator/protoc-gen-nanopb ${D}${bindir}/protoc-gen-nanopb
|
||||
install -Dm 0755 ${S}/generator/proto/__init__.py ${D}${PYTHON_SITEPACKAGES_DIR}/proto/__init__.py
|
||||
}
|
||||
|
||||
FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}"
|
||||
FILES:${PN}-dev += "${libdir}/cmake/${BPN}"
|
||||
|
||||
RDEPENDS:${PN} += "\
|
||||
${PYTHON_PN}-protobuf \
|
||||
protobuf-compiler \
|
||||
"
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
DESCRIPTION = "LCDproc is a client/server suite to drive all kinds of LCD (-like) devices. The client \
|
||||
shipped with this package can be used to acquire various kinds of system stats."
|
||||
SUMMARY = "Drivers for character-based LCD displays"
|
||||
HOMEPAGE = "http://lcdproc.org"
|
||||
SECTION = "utils"
|
||||
LICENSE = "GPL-2.0-or-later"
|
||||
DEPENDS = "ncurses lirc"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760 \
|
||||
file://README.md;beginline=107;md5=5db392f043253a2d64b1737068ce6b58"
|
||||
|
||||
PV = "0.5.9+git${SRCPV}"
|
||||
SRCREV = "0e2ce9b9c46c47363436f9ee730f7c71bf455f0f"
|
||||
SRC_URI = "git://github.com/lcdproc/lcdproc;branch=master;protocol=https"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit autotools pkgconfig update-rc.d
|
||||
|
||||
LCD_DRIVERS ?= "all,!irman,!svga${SERIALVFD}"
|
||||
SERIALVFD ?= ""
|
||||
SERIALVFD:libc-musl = ",!serialVFD"
|
||||
SERIALVFD:libc-musl:x86 = ""
|
||||
SERIALVFD:libc-musl:x86-64 = ""
|
||||
|
||||
LCD_DEFAULT_DRIVER ?= "curses"
|
||||
|
||||
PACKAGECONFIG ??= "usb"
|
||||
PACKAGECONFIG[usb] = "--enable-libusb,--disable-libusb,virtual/libusb0"
|
||||
PACKAGECONFIG[ftdi] = "--enable-libftdi,--disable-libftdi,libftdi"
|
||||
PACKAGECONFIG[g15] = ",,libg15 g15daemon libg15render,"
|
||||
PACKAGECONFIG[hid] = "--enable-libhid,--disable-libhid,libhid"
|
||||
PACKAGECONFIG[png] = "--enable-libpng,--disable-libpng,libpng"
|
||||
|
||||
LCD_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'g15', '', ',!g15', d)}"
|
||||
|
||||
EXTRA_OECONF = "--enable-drivers='${LCD_DRIVERS}'"
|
||||
|
||||
do_install () {
|
||||
# binaries
|
||||
install -D -m 0755 server/LCDd ${D}${sbindir}/LCDd
|
||||
install -D -m 0755 clients/lcdproc/lcdproc ${D}${bindir}/lcdproc
|
||||
|
||||
# init scripts
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
# so far, not fixed :-( and now even uglier :-((
|
||||
cat scripts/init-LCDd.debian | sed -e s'/--oknodo//' -e 's/ -s -f / -s 1 -f 1 /' -e 's/force-reload/force-restart/' -e 's/sleep 1/sleep 4/' > ${D}${sysconfdir}/init.d/lcdd
|
||||
chmod 0755 ${D}${sysconfdir}/init.d/lcdd
|
||||
install -m 0755 scripts/init-lcdproc.debian ${D}${sysconfdir}/init.d/lcdproc
|
||||
sed -i s'/--oknodo//' ${D}${sysconfdir}/init.d/lcdproc
|
||||
|
||||
# configuration files
|
||||
install -m 0644 ${S}/LCDd.conf ${D}${sysconfdir}/LCDd.conf
|
||||
sed -i 's!^DriverPath=.*!DriverPath=${libdir}/lcdproc/!' ${D}${sysconfdir}/LCDd.conf
|
||||
sed -i 's!^Driver=.*!Driver=${LCD_DEFAULT_DRIVER}!' ${D}${sysconfdir}/LCDd.conf
|
||||
install -m 0644 ${S}/clients/lcdproc/lcdproc.conf ${D}${sysconfdir}/lcdproc.conf
|
||||
|
||||
# driver library files
|
||||
install -d ${D}${libdir}/lcdproc
|
||||
for i in server/drivers/*.so; do
|
||||
install -m 0644 $i ${D}${libdir}/lcdproc/
|
||||
done
|
||||
# binaries
|
||||
install -D -m 0755 clients/lcdvc/lcdvc ${D}${sbindir}/lcdvc
|
||||
|
||||
# configuration files
|
||||
install -D -m 0644 ${S}/clients/lcdvc/lcdvc.conf ${D}${sysconfdir}/lcdvc.conf
|
||||
}
|
||||
|
||||
PACKAGES =+ "lcdd lcdvc"
|
||||
|
||||
RRECOMMENDS:${PN} = "lcdd"
|
||||
|
||||
FILES:lcdd = "${sysconfdir}/LCDd.conf \
|
||||
${sbindir}/LCDd \
|
||||
${sysconfdir}/init.d/lcdd"
|
||||
|
||||
CONFFILES:lcdd = "${sysconfdir}/LCDd.conf"
|
||||
CONFFILES:${PN} = "${sysconfdir}/lcdproc.conf"
|
||||
CONFFILES:lcdvc = "${sysconfdir}/lcdvc.conf"
|
||||
FILES:lcdvc = "${sysconfdir}/lcdvc.conf ${sbindir}/lcdvc"
|
||||
|
||||
# Driver packages
|
||||
|
||||
# USB / no USB trickery
|
||||
|
||||
RCONFLICTS:lcdd-driver-hd47780nousb = "lcdd-driver-hd44780"
|
||||
RCONFLICTS:lcdd-driver-hd47780 = "lcdd-driver-hd44780nousb"
|
||||
|
||||
INITSCRIPT_PACKAGES = "lcdd lcdproc"
|
||||
INITSCRIPT_NAME:lcdd = "lcdd"
|
||||
INITSCRIPT_NAME:lcdproc = "lcdproc"
|
||||
INITSCRIPT_PARAMS:lcdd = "defaults 70 21"
|
||||
INITSCRIPT_PARAMS:lcdproc = "defaults 71 20"
|
||||
|
||||
python populate_packages:prepend() {
|
||||
plugindir = d.expand('${libdir}/lcdproc')
|
||||
do_split_packages(d, plugindir, r'(.*)\.so$', 'lcdd-driver-%s', 'LCDd driver for %s', prepend=True)
|
||||
}
|
||||
|
||||
PACKAGES_DYNAMIC += "^lcdd-driver-.*"
|
||||
@@ -0,0 +1,39 @@
|
||||
SUMMARY = "NVM-Express target user space configuration utility."
|
||||
DESCRIPTION = "This package contains the command line interface to the NVMe \
|
||||
over Fabrics nvmet in the Linux kernel. It allows configuring the nvmet \
|
||||
interactively as well as saving / restoring the configuration to / from a json \
|
||||
file."
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=1dece7821bf3fd70fe1309eaa37d52a2"
|
||||
|
||||
inherit systemd setuptools3
|
||||
|
||||
# nvmet service will start and stop the NVMe Target configuration on boot and
|
||||
# shutdown from a saved NVMe Target configuration in the /etc/nvmet/config.json
|
||||
# file. This file is not installed by default since the configuration will vary
|
||||
# on real systems. Example configuration files are provided by including the
|
||||
# nvmetcli-examples package.
|
||||
SYSTEMD_SERVICE:${PN} = "nvmet.service"
|
||||
|
||||
SYSTEMD_AUTO_ENABLE ?= "disable"
|
||||
|
||||
RDEPENDS:${PN} += "python3 python3-six python3-pyparsing python3-configshell-fb"
|
||||
|
||||
SRCREV = "0a6b088db2dc2e5de11e6f23f1e890e4b54fee64"
|
||||
SRC_URI = "git://git.infradead.org/users/hch/nvmetcli.git;branch=master"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
do_install:append() {
|
||||
# Install example configuration scripts.
|
||||
install -d ${D}${datadir}/nvmet
|
||||
cp -fr ${S}/examples ${D}${datadir}/nvmet/
|
||||
|
||||
# Install systemd service file.
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
cp -fr ${S}/nvmet.service ${D}${systemd_unitdir}/system
|
||||
}
|
||||
|
||||
# Examples package contains example json files used to configure nvmet.
|
||||
PACKAGES += "${PN}-examples"
|
||||
FILES:${PN}-examples = "${datadir}/nvmet/examples/*"
|
||||
@@ -0,0 +1,53 @@
|
||||
From 3ff78f1f00973393d1a7ee4e467a2bacf1c807f3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
|
||||
Date: Wed, 5 Feb 2020 16:14:21 +0000
|
||||
Subject: [PATCH] smem: fix support for --source option (python3)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Using --source doesn't work without this patch:
|
||||
Traceback (most recent call last):
|
||||
File "./smem", line 727, in <module>
|
||||
showpids()
|
||||
File "./smem", line 299, in showpids
|
||||
showtable(pt.keys(), fields, columns.split(), options.sort or 'pss')
|
||||
File "./smem", line 519, in showtable
|
||||
mt = totalmem()
|
||||
File "./smem", line 118, in totalmem
|
||||
_totalmem = memory()['memtotal']
|
||||
File "./smem", line 193, in memory
|
||||
m = f.match(l)
|
||||
TypeError: cannot use a string pattern on a bytes-like object
|
||||
|
||||
python3's tarfile returns bytes, whereas all of the rest of
|
||||
the code assumes str.
|
||||
|
||||
Fix the tarfile usage to convert to str before returning the
|
||||
results.
|
||||
|
||||
Signed-off-by: André Draszik <git@andred.net>
|
||||
Upstream-Status: Inappropriate [upstream wants to support python2 & python3]
|
||||
---
|
||||
smem | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/smem b/smem
|
||||
index 46a3189..54d40dd 100755
|
||||
--- a/smem
|
||||
+++ b/smem
|
||||
@@ -90,9 +90,9 @@ class tardata(procdata):
|
||||
d,f = ti.name.split('/')
|
||||
yield d
|
||||
def _read(self, f):
|
||||
- return self.tar.extractfile(f).read()
|
||||
+ return self.tar.extractfile(f).read().decode()
|
||||
def _readlines(self, f):
|
||||
- return self.tar.extractfile(f).readlines()
|
||||
+ return [l.decode() for l in self.tar.extractfile(f).readlines()]
|
||||
def piduser(self, p):
|
||||
t = self.tar.getmember("%d" % p)
|
||||
if t.uname:
|
||||
--
|
||||
2.23.0.rc1
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
SUMMARY = "Report application memory usage in a meaningful way"
|
||||
DESCRIPTION = "smem is a tool that can give numerous reports on memory usage on Linux \
|
||||
systems. Unlike existing tools, smem can report proportional set size (PSS), \
|
||||
which is a more meaningful representation of the amount of memory used by \
|
||||
libraries and applications in a virtual memory system."
|
||||
HOMEPAGE = "http://www.selenic.com/smem/"
|
||||
SECTION = "Applications/System"
|
||||
|
||||
LICENSE = "GPL-2.0-or-later"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
|
||||
|
||||
HG_CHANGESET = "98273ce331bb"
|
||||
SRC_URI = "https://selenic.com/repo/${BPN}/archive/${HG_CHANGESET}.tar.bz2;downloadfilename=${BP}.tar.bz2 \
|
||||
file://0001-smem-fix-support-for-source-option-python3.patch"
|
||||
SRC_URI[md5sum] = "51c3989779360f42b42ef46b2831be3a"
|
||||
SRC_URI[sha256sum] = "161131c686a6d9962a0e96912526dd46308e022d62e3f8acaed5a56fda8e08ce"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://selenic.com/repo/smem/tags"
|
||||
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
|
||||
|
||||
S = "${WORKDIR}/${BPN}-${HG_CHANGESET}"
|
||||
|
||||
do_compile() {
|
||||
${CC} ${CFLAGS} ${LDFLAGS} smemcap.c -o smemcap
|
||||
}
|
||||
|
||||
do_install() {
|
||||
install -d ${D}/${bindir}/
|
||||
install -d ${D}/${mandir}/man8
|
||||
install -m 0755 ${S}/smem ${D}${bindir}/
|
||||
sed -i -e '1s,#!.*python.*,#!${USRBINPATH}/env python3,' ${D}${bindir}/smem
|
||||
install -m 0755 ${S}/smemcap ${D}${bindir}/
|
||||
install -m 0644 ${S}/smem.8 ${D}/${mandir}/man8/
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} = "python3-core python3-compression"
|
||||
RRECOMMENDS:${PN} = "python3-matplotlib python3-numpy"
|
||||
|
||||
PACKAGE_BEFORE_PN = "smemcap"
|
||||
|
||||
FILES:smemcap = "${bindir}/smemcap"
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
@@ -0,0 +1,2 @@
|
||||
RDEPENDS:packagegroup-meta-oe-support:append:x86 = "${@bb.utils.contains('BBFILE_COLLECTIONS', 'filesystems-layer', ' open-vm-tools', '', d)}"
|
||||
RDEPENDS:packagegroup-meta-oe-support:append:x86-64 = "${@bb.utils.contains('BBFILE_COLLECTIONS', 'filesystems-layer', ' open-vm-tools', '', d)}"
|
||||
@@ -0,0 +1 @@
|
||||
RDEPENDS:packagegroup-meta-oe-support += "debsums rasdaemon"
|
||||
@@ -0,0 +1,56 @@
|
||||
SUMMARY = "Miscellaneous utilities specific to Debian"
|
||||
SUMMARY:${PN}-cron = "Cron scripts to control automatic debsum checking"
|
||||
DESCRIPTION = "A tool for verification of installed package files against \
|
||||
MD5 checksums debsums can verify the integrity of installed package files \
|
||||
against MD5 checksums installed by the package, or generated from a .deb \
|
||||
archive."
|
||||
DESCRIPTION:${PN}-cron = "Cron scripts to control automatic system integrity \
|
||||
checking via debsums."
|
||||
SECTION = "base"
|
||||
LICENSE = "GPL-2.0-only"
|
||||
LIC_FILES_CHKSUM = "file://debian/copyright;md5=770d751553e6559e9eaefd2e11ccf7e9"
|
||||
|
||||
SRC_URI = "http://snapshot.debian.org/archive/debian/20170530T212108Z/pool/main/d/debsums/debsums_2.2.2.tar.xz"
|
||||
SRC_URI[md5sum] = "82b0710855a7e5212d4358163a269e79"
|
||||
SRC_URI[sha256sum] = "aa61896f93a6bbfe0161c21dcd67529ae8e1ec8c3ccf244523c52c4ad8253d97"
|
||||
|
||||
# the package is taken from snapshots.debian.org; that source is static and goes stale
|
||||
# so we check the latest upstream from a directory that does get updated
|
||||
UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/${BPN}/"
|
||||
|
||||
inherit perlnative gettext
|
||||
|
||||
DEPENDS += "po4a-native"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}/${sysconfdir}/cron.daily ${D}/${sysconfdir}/cron.weekly
|
||||
install -d ${D}/${sysconfdir}/cron.monthly ${D}${sbindir} ${D}${bindir}
|
||||
install -d ${D}${mandir}/man1 ${D}${mandir}/man8
|
||||
install -m 0755 debsums ${D}${bindir}/
|
||||
install -m 0755 rdebsums ${D}${bindir}/
|
||||
install -m 0755 debsums_init ${D}${sbindir}
|
||||
install -m 0644 man/debsums.1 ${D}${mandir}/man1/
|
||||
install -m 0644 man/rdebsums.1 ${D}${mandir}/man1/
|
||||
install -m 0644 man/debsums_init.8 ${D}${mandir}/man8/
|
||||
install -m 0644 debian/cron.daily \
|
||||
${D}/${sysconfdir}/cron.daily/debsums
|
||||
install -m 0644 debian/cron.weekly \
|
||||
${D}/${sysconfdir}/cron.weekly/debsums
|
||||
install -m 0644 debian/cron.monthly \
|
||||
${D}/${sysconfdir}/cron.monthly/debsums
|
||||
# Must exist, defaults to empty.
|
||||
touch ${D}/${sysconfdir}/debsums-ignore
|
||||
}
|
||||
|
||||
PACKAGES =+ "${PN}-cron"
|
||||
|
||||
RDEPENDS:${PN} = "dpkg dpkg-perl libfile-fnmatch-perl perl \
|
||||
perl-module-constant perl-module-digest-md5 \
|
||||
perl-module-errno perl-module-fcntl \
|
||||
perl-module-file-basename perl-module-file-copy \
|
||||
perl-module-file-find perl-module-file-glob \
|
||||
perl-module-file-path perl-module-file-spec \
|
||||
perl-module-file-temp perl-module-getopt-long \
|
||||
perl-module-posix"
|
||||
|
||||
FILES:${PN}-cron = "${sysconfdir}/cron.*"
|
||||
@@ -0,0 +1,35 @@
|
||||
From e415152b51eacab8705b6b3274cc0d1a274772e0 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 30 Aug 2022 19:54:35 -0700
|
||||
Subject: [PATCH] libtrace: Use XSI version of strerror_r on non glibc systems
|
||||
|
||||
The version used is glibc specific therefore make it so
|
||||
and provide a fallback for non-glibc systems
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/mchehab/rasdaemon/pull/70]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
libtrace/event-parse.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/libtrace/event-parse.c b/libtrace/event-parse.c
|
||||
index 6c705c3..6b651d5 100644
|
||||
--- a/libtrace/event-parse.c
|
||||
+++ b/libtrace/event-parse.c
|
||||
@@ -5071,7 +5071,13 @@ int pevent_strerror(struct pevent *pevent, enum pevent_errno errnum,
|
||||
const char *msg;
|
||||
|
||||
if (errnum >= 0) {
|
||||
+#if defined(__GLIBC__)
|
||||
msg = strerror_r(errnum, buf, buflen);
|
||||
+#else
|
||||
+ if (strerror_r(errnum, buf, buflen) != 0)
|
||||
+ snprintf(buf, buflen, "unknown error %i", errnum);
|
||||
+ msg = buf;
|
||||
+#endif
|
||||
if (msg != buf) {
|
||||
size_t len = strlen(msg);
|
||||
memcpy(buf, msg, min(buflen - 1, len));
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#! /bin/sh
|
||||
# /etc/init.d/rasdaemon: start rasdaemon service
|
||||
|
||||
. /etc/init.d/functions
|
||||
|
||||
# Defaults
|
||||
PIDFILE=/var/run/rasdaemon.pid
|
||||
BINFILE=/usr/sbin/rasdaemon
|
||||
SCRIPTNAME=/etc/init.d/rasdaemon
|
||||
|
||||
[ -x $BINFILE ] || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting RASdaemon services: "
|
||||
if [ ! -f "$PIDFILE" ]; then
|
||||
start-stop-daemon --start --quiet --exec $BINFILE -- --enable &> /dev/null
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $BINFILE -- --record
|
||||
pidof $BINFILE > $PIDFILE
|
||||
fi
|
||||
[ -f $PIDFILE ] && echo "done." || echo "fail."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping RASdaemon services: "
|
||||
if [ -f "$PIDFILE" ] ; then
|
||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $BINFILE -- --disable &> /dev/null
|
||||
killproc $BINFILE
|
||||
rm $PIDFILE
|
||||
fi
|
||||
[ ! -f $PIDFILE ] && echo "done." || echo "fail."
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
status $BINFILE
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|status}"
|
||||
exit 1
|
||||
esac
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=RAS daemon to log the RAS events
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/rasdaemon -f -r
|
||||
ExecStartPost=/usr/sbin/rasdaemon --enable
|
||||
ExecStop=/usr/sbin/rasdaemon --disable
|
||||
Restart=on-abort
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,51 @@
|
||||
DESCRIPTION = "Tools to provide a way to get Platform Reliability, Availability and Serviceability (RAS) reports made via the Kernel tracing events"
|
||||
HOMEPAGE = "http://git.infradead.org/users/mchehab/rasdaemon.git"
|
||||
LICENSE = "GPL-2.0-only"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=d3070efe0afa3dc41608bd82c00bb0dc"
|
||||
|
||||
SRC_URI = "git://github.com/mchehab/rasdaemon.git;branch=master;protocol=https \
|
||||
file://0001-libtrace-Use-XSI-version-of-strerror_r-on-non-glibc-.patch \
|
||||
file://rasdaemon.service \
|
||||
file://init"
|
||||
|
||||
SRCREV = "c2255178a49f62c53009a456bc37dd5e37332f09"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
RDEPENDS:${BPN} = "perl perl-module-file-basename perl-module-file-find perl-module-file-spec perl-module-getopt-long \
|
||||
perl-module-posix perl-module-file-glob libdbi-perl libdbd-sqlite-perl"
|
||||
|
||||
inherit autotools pkgconfig update-rc.d systemd
|
||||
|
||||
PACKAGECONFIG ??= "sqlite3 mce aer extlog devlink diskerror"
|
||||
PACKAGECONFIG[sqlite3] = "--enable-sqlite3,--disable-sqlite3,sqlite3"
|
||||
PACKAGECONFIG[mce] = "--enable-mce,--disable-mce"
|
||||
PACKAGECONFIG[aer] = "--enable-aer,--disable-aer"
|
||||
PACKAGECONFIG[extlog] = "--enable-extlog,--disable-extlog"
|
||||
PACKAGECONFIG[devlink] = "--enable-devlink,--disable-devlink"
|
||||
PACKAGECONFIG[diskerror] = "--enable-diskerror,--disable-diskerror"
|
||||
PACKAGECONFIG[arm] = "--enable-arm,--disable-arm"
|
||||
PACKAGECONFIG[hisi-ns-decode] = "--enable-hisi-ns-decode,--disable-hisi-ns-decode"
|
||||
PACKAGECONFIG[non-standard] = "--enable-non-standard,--disable-non-standard"
|
||||
PACKAGECONFIG[abrt-report] = "--enable-abrt-report,--disable-abrt-report"
|
||||
|
||||
DEPENDS:append:libc-musl = " argp-standalone"
|
||||
LDFLAGS:append:libc-musl = " -largp"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rasdaemon
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/rasdaemon.service ${D}${systemd_unitdir}/system
|
||||
}
|
||||
|
||||
FILES:${PN} += "${sbindir}/rasdaemon \
|
||||
${sysconfdir}/init.d \
|
||||
${systemd_unitdir}/system/rasdaemon.service"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "rasdaemon.service"
|
||||
SYSTEMD_AUTO_ENABLE = "enable"
|
||||
|
||||
INITSCRIPT_PACKAGES = "${PN}"
|
||||
INITSCRIPT_NAME:${PN} = "rasdaemon"
|
||||
INITSCRIPT_PARAMS:${PN} = "defaults 89"
|
||||
@@ -0,0 +1,4 @@
|
||||
[Service]
|
||||
ExecStartPre=/usr/bin/android-gadget-setup
|
||||
ExecStartPost=/usr/bin/android-gadget-start
|
||||
ExecStopPost=/usr/bin/android-gadget-cleanup
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -d /sys/kernel/config/usb_gadget ] || exit 0
|
||||
|
||||
cd /sys/kernel/config/usb_gadget
|
||||
|
||||
cd adb
|
||||
|
||||
echo "" > UDC || true
|
||||
|
||||
killall adbd || true
|
||||
|
||||
umount /dev/usb-ffs/adb
|
||||
|
||||
rm configs/c.1/ffs.usb0
|
||||
|
||||
rmdir configs/c.1/strings/0x409
|
||||
rmdir configs/c.1
|
||||
|
||||
rmdir functions/ffs.usb0
|
||||
rmdir strings/0x409
|
||||
|
||||
cd ..
|
||||
rmdir adb
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
manufacturer=RPB
|
||||
model="Android device"
|
||||
serial=0123456789ABCDEF
|
||||
|
||||
if [ -r /etc/android-gadget-setup.machine ] ; then
|
||||
. /etc/android-gadget-setup.machine
|
||||
fi
|
||||
|
||||
[ -d /sys/kernel/config/usb_gadget ] || modprobe libcomposite
|
||||
|
||||
cd /sys/kernel/config/usb_gadget
|
||||
|
||||
[ -d adb ] && /usr/bin/android-gadget-cleanup || true
|
||||
|
||||
mkdir adb
|
||||
cd adb
|
||||
|
||||
mkdir configs/c.1
|
||||
mkdir functions/ffs.usb0
|
||||
mkdir strings/0x409
|
||||
mkdir configs/c.1/strings/0x409
|
||||
echo 0x18d1 > idVendor
|
||||
echo 0xd002 > idProduct
|
||||
echo "$serial" > strings/0x409/serialnumber
|
||||
echo "$manufacturer" > strings/0x409/manufacturer
|
||||
echo "$model" > strings/0x409/product
|
||||
echo "Conf 1" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/ffs.usb0 configs/c.1
|
||||
|
||||
mkdir -p /dev/usb-ffs/adb
|
||||
mount -t functionfs usb0 /dev/usb-ffs/adb
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
sleep 3
|
||||
|
||||
ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
|
||||
@@ -0,0 +1,35 @@
|
||||
DESCRIPTION = "Various utilities from Android - corresponding configuration files for using ConfigFS"
|
||||
SECTION = "console/utils"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
SRC_URI = " \
|
||||
file://android-gadget-setup \
|
||||
file://android-gadget-start \
|
||||
file://android-gadget-cleanup \
|
||||
file://10-adbd-configfs.conf \
|
||||
"
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${bindir}
|
||||
install -m 0755 ${WORKDIR}/android-gadget-setup ${D}${bindir}
|
||||
install -m 0755 ${WORKDIR}/android-gadget-start ${D}${bindir}
|
||||
install -m 0755 ${WORKDIR}/android-gadget-cleanup ${D}${bindir}
|
||||
|
||||
if [ -r ${WORKDIR}/android-gadget-setup.machine ] ; then
|
||||
install -d ${D}${sysconfdir}
|
||||
install -m 0644 ${WORKDIR}/android-gadget-setup.machine ${D}${sysconfdir}
|
||||
fi
|
||||
|
||||
install -d ${D}${systemd_unitdir}/system/android-tools-adbd.service.d
|
||||
install -m 0644 ${WORKDIR}/10-adbd-configfs.conf ${D}${systemd_unitdir}/system/android-tools-adbd.service.d
|
||||
}
|
||||
|
||||
FILES:${PN} += " \
|
||||
${systemd_unitdir}/system/ \
|
||||
"
|
||||
|
||||
PROVIDES += "android-tools-conf"
|
||||
RPROVIDES:${PN} = "android-tools-conf"
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ ! -e /dev/pts ] && mkdir -p /dev/pts
|
||||
[ ! -e /dev/pts/0 ] && mount devpts /dev/pts -t devpts
|
||||
|
||||
# TODO enable the lines below once we have support for getprop
|
||||
# retrieve the product info from Android
|
||||
# manufacturer=$(getprop ro.product.manufacturer Android)
|
||||
# model=$(getprop ro.product.model Android)
|
||||
# serial=$(getprop ro.serialno 0123456789ABCDEF)
|
||||
|
||||
#below are now needed in order to use FunctionFS for ADB, tested to work with 3.4+ kernels
|
||||
if grep -q functionfs /proc/filesystems; then
|
||||
mkdir -p /dev/usb-ffs/adb
|
||||
mount -t functionfs adb /dev/usb-ffs/adb
|
||||
#android-gadget-setup doesn't provide below 2 and without them it won't work, so we provide them here.
|
||||
echo adb > /sys/class/android_usb/android0/f_ffs/aliases
|
||||
echo ffs > /sys/class/android_usb/android0/functions
|
||||
fi
|
||||
|
||||
manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)"
|
||||
model="$(cat /system/build.prop | grep -o 'ro.product.model=.*' | cut -d'=' -f 2)"
|
||||
# get the device serial number from /proc/cmdline directly(since we have no getprop on
|
||||
# GNU/Linux)
|
||||
serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')"
|
||||
|
||||
echo $serial > /sys/class/android_usb/android0/iSerial
|
||||
echo $manufacturer > /sys/class/android_usb/android0/iManufacturer
|
||||
echo $model > /sys/class/android_usb/android0/iProduct
|
||||
|
||||
echo "0" > /sys/class/android_usb/android0/enable
|
||||
echo "18d1" > /sys/class/android_usb/android0/idVendor
|
||||
echo "D002" > /sys/class/android_usb/android0/idProduct
|
||||
echo "adb" > /sys/class/android_usb/android0/functions
|
||||
echo "1" > /sys/class/android_usb/android0/enable
|
||||
|
||||
sleep 4
|
||||
@@ -0,0 +1,18 @@
|
||||
DESCRIPTION = "Different utilities from Android - corresponding configuration files"
|
||||
SECTION = "console/utils"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
SRC_URI = "file://android-gadget-setup"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${bindir}
|
||||
install -m 0755 ${WORKDIR}/android-gadget-setup ${D}${bindir}
|
||||
}
|
||||
|
||||
python () {
|
||||
pn = d.getVar('PN')
|
||||
profprov = d.getVar("PREFERRED_PROVIDER_" + pn)
|
||||
if profprov and pn != profprov:
|
||||
raise bb.parse.SkipRecipe("PREFERRED_PROVIDER_%s set to %s, not %s" % (pn, profprov, pn))
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user