added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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;

View File

@@ -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

View File

@@ -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])

View File

@@ -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

View File

@@ -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 \

View File

@@ -0,0 +1 @@
d /run/lirc 0755 root root -

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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}"

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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"
}
]
}
]
}

View File

@@ -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"
}
]
}
]
}

View File

@@ -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"
}
]
}
]
}

View File

@@ -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"
}
]
}
]
}

View File

@@ -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"

View File

@@ -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
}
]
}
]
}
}

View File

@@ -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
}
]
}
]
}
}

View File

@@ -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}"
}
]
}

View File

@@ -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 ]
}
]
}
}

View File

@@ -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"
}
]
}
]
}
}

View File

@@ -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"
}
}
]
}

View File

@@ -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"
}
}
]
}

View File

@@ -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"
}
]
}
]
}

View File

@@ -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

View File

@@ -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

View File

@@ -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
}

View File

@@ -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"

View File

@@ -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

View File

@@ -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);
}
/**

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
{

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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>

View File

@@ -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

View File

@@ -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};

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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");

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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"

View File

@@ -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)

View File

@@ -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"

View File

@@ -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-.*"

View File

@@ -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/*"

View File

@@ -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

View File

@@ -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"