Merge pull request #14690 from neheb/p
authorRosen Penev <rosenp@gmail.com>
Tue, 9 Feb 2021 06:20:07 +0000 (22:20 -0800)
committerGitHub <noreply@github.com>
Tue, 9 Feb 2021 06:20:07 +0000 (22:20 -0800)
pdns-recursor: update to 4.4.2

18 files changed:
lang/python/python-ubus/Makefile [new file with mode: 0644]
libs/libxml2/Makefile
net/acme/Makefile
net/acme/files/run.sh
net/frr/Makefile
net/frr/files/frr
net/frr/files/frrcommon.sh
net/mosquitto/Makefile
net/strongswan/Makefile
net/strongswan/files/ipsec.init
net/uacme/files/run.sh
net/wg-installer/Makefile
net/wg-installer/README.md
net/wg-installer/wg-server/hotplug.d/99-mesh-babeld [new file with mode: 0644]
utils/oci-runtime-tools/Makefile [new file with mode: 0644]
utils/oci-runtime-tools/patches/001-fix-32-bit-build.patch [new file with mode: 0644]
utils/prometheus-node-exporter-lua/Makefile
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/ltq-dsl.lua

diff --git a/lang/python/python-ubus/Makefile b/lang/python/python-ubus/Makefile
new file mode 100644 (file)
index 0000000..c980399
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2018-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-ubus
+PKG_VERSION:=0.1.1
+PKG_RELEASE:=$(AUTORELEASE)
+
+PYPI_NAME:=ubus
+PKG_HASH:=7e57bda989bc35b48c7075d03ec2818226e722bbf1bde138d7e7ea26d462682a
+
+PKG_MAINTAINER:=Erik Larsson <who+openwrt@cnackers.org>
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=LICENSE
+
+include ../pypi.mk
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-ubus
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Python3 ubus
+  URL:=https://gitlab.nic.cz/turris/python-ubus/
+  DEPENDS:=+libubus +libblobmsg-json +python3-light
+endef
+
+define Package/python3-ubus/description
+  Python bindings for ubus.
+endef
+
+$(eval $(call Py3Package,python3-ubus))
+$(eval $(call BuildPackage,python3-ubus))
+$(eval $(call BuildPackage,python3-ubus-src))
index 1430dc8f53fd24c12a5524f93057db01559efbe0..a9c9332fe0389e352a46e028b004097dc6ef4355 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libxml2
 PKG_VERSION:=2.9.10
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://xmlsoft.org/sources/
@@ -27,13 +27,14 @@ PKG_BUILD_PARALLEL:=0
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
 
 define Package/libxml2
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=Gnome XML library
   URL:=http://xmlsoft.org/
-  DEPENDS:=+libpthread +zlib
+  DEPENDS:=+libpthread +zlib $(ICONV_DEPENDS)
 endef
 
 define Package/libxml2/description
@@ -80,7 +81,6 @@ CONFIGURE_ARGS += \
        --with-html \
        --without-ftp \
        --without-http \
-       --without-iconv \
        --without-iso8859x \
        --without-legacy \
        --with-output \
index 0ac93a96985bb43676df31b621ed913ff8b3a934..54ee236dbd7a507b7005109a9512326a0ee0d5bf 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme
 PKG_VERSION:=2.8.7
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/acmesh-official/acme.sh/tar.gz/$(PKG_VERSION)?
index 9cc8e35972dd8d58a585660e62526cfc22f307a0..87863b58d42840ce58c20328795231893105b1d5 100644 (file)
@@ -335,7 +335,18 @@ issue_cert()
                # commit and reload is in post_checks
        fi
 
-       if [ -e /etc/init.d/nginx ] && [ "$update_nginx" -eq "1" ]; then
+       local nginx_updated
+       nginx_updated=0
+       if command -v nginx-util 2>/dev/null && [ "$update_nginx" -eq "1" ]; then
+               nginx_updated=1
+               for domain in $domains; do
+                       nginx-util add_ssl "${domain}" acme "${domain_dir}/fullchain.cer" \
+                               "${domain_dir}/${main_domain}.key" || nginx_updated=0
+               done
+               # reload is in post_checks
+       fi
+
+       if [ "$nginx_updated" -eq "0" ] && [ -w /etc/nginx/nginx.conf ] && [ "$update_nginx" -eq "1" ]; then
                sed -i "s#ssl_certificate\ .*#ssl_certificate ${domain_dir}/fullchain.cer;#g" /etc/nginx/nginx.conf
                sed -i "s#ssl_certificate_key\ .*#ssl_certificate_key ${domain_dir}/${main_domain}.key;#g" /etc/nginx/nginx.conf
                # commit and reload is in post_checks
index fabfbb9759ad9930d3952ccb2a46065fc207fb3f..f9767365fb55688e126d7019c0299dccc47f3973 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 PKG_NAME:=frr
 PKG_VERSION:=7.5
-PKG_RELEASE:=3
-PKG_SOURCE_DATE:=2021-01-22
+PKG_RELEASE:=4
+PKG_SOURCE_DATE:=2021-02-05
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
-PKG_SOURCE_VERSION:=a4af08a19e93cc8560f571ffc4819d53ed35ad66
+PKG_SOURCE_VERSION:=20b35e4c3386de798f3b0cb9f2a7e6b04d995485
 PKG_SOURCE_URL:=https://codeload.github.com/FRRouting/frr/tar.gz/$(PKG_SOURCE_VERSION)?
 
 
-PKG_HASH:=69bcbcde984560e9c41f52f5c509c58ea3d8d287750cc546d3a95e2ec9110dd4
+PKG_HASH:=f3b4a4ce43ad60fcf4b908dc4467cbc9dae277b5829489b3d221913e043dd250
 PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
index caeea21c6be8620dd829e1fc4851af3ff8ee561b..6ae80954cb1e8f5fd9791db86c48e793f34813b5 100644 (file)
@@ -12,6 +12,8 @@ log_failure_msg() {
         echo "$@" >&2
 }
 
+# "/usr/lib/frr/frrinit.sh start somenamespace"
+FRR_PATHSPACE="$2"
 self="`dirname $0`"
 if [ -r "$self/frrcommon.sh" ]; then
        . "$self/frrcommon.sh"
index d89cd891cabdd673f9122e1e4f6d50f1deb984ef..324a972693ce0bc4fe6a82f25e759ef2762e46fc 100644 (file)
@@ -16,6 +16,9 @@
 # file does not exist.
 #
 # This script should be installed in  /usr/sbin/frrcommon.sh
+# FRR_PATHSPACE is passed in from watchfrr
+suffix="${FRR_PATHSPACE:+/${FRR_PATHSPACE}}"
+nsopt="${FRR_PATHSPACE:+-N ${FRR_PATHSPACE}}"
 
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 D_PATH="/usr/sbin" # /usr/lib/frr
@@ -25,6 +28,8 @@ VTYSH="/usr/bin/vtysh" # /usr/bin/vtysh
 FRR_USER="network" # frr
 FRR_GROUP="network" # frr
 FRR_VTY_GROUP="" # frrvty
+FRR_CONFIG_MODE="0600" # 0600
+FRR_DEFAULT_PROFILE="traditional" # traditional / datacenter
 
 # ORDER MATTERS FOR $DAEMONS!
 # - keep zebra first
@@ -53,15 +58,19 @@ debug() {
 chownfrr() {
        [ -n "$FRR_USER" ] && chown "$FRR_USER" "$1"
        [ -n "$FRR_GROUP" ] && chgrp "$FRR_GROUP" "$1"
+       [ -n "$FRR_CONFIG_MODE" ] && chmod "$FRR_CONFIG_MODE" "$1"
+       if [ -d "$1" ]; then
+               chmod u+x "$1"
+       fi
 }
 
 vtysh_b () {
        [ "$1" = "watchfrr" ] && return 0
        [ -r "$C_PATH/frr.conf" ] || return 0
        if [ -n "$1" ]; then
-               "$VTYSH" -b -n -d "$1"
+               "$VTYSH" `echo $nsopt` -b -d "$1"
        else
-               "$VTYSH" -b -n
+               "$VTYSH" `echo $nsopt` -b
        fi
 }
 
@@ -90,7 +99,8 @@ daemon_list() {
                                continue
                        fi
                        debug "$daemon enabled"
-                       enabled="$enabled $daemon"
+#                      enabled="$enabled $daemon"
+
                        if [ -n "$inst" ]; then
                                debug "$daemon multi-instance $inst"
                                oldifs="${IFS}"
@@ -99,6 +109,8 @@ daemon_list() {
                                        enabled="$enabled $daemon-$i"
                                done
                                IFS="${oldifs}"
+                       else
+                               enabled="$enabled $daemon"
                        fi
                else
                        debug "$daemon disabled"
@@ -152,7 +164,7 @@ daemon_start() {
        instopt="${inst:+-n $inst}"
        eval args="\$${daemon}_options"
 
-       if eval "$all_wrap $wrap $bin -d $instopt $args"; then
+       if eval "$all_wrap $wrap $bin $nsopt -d $frr_global_options $instopt $args"; then
                log_success_msg "Started $dmninst"
                vtysh_b "$daemon"
        else
@@ -288,9 +300,11 @@ load_old_config() {
 }
 . "$C_PATH/daemons"
 
-load_old_config "$C_PATH/daemons.conf"
-load_old_config "/etc/default/frr"
-load_old_config "/etc/sysconfig/frr"
+if [ -z "$FRR_PATHSPACE" ]; then
+       load_old_config "$C_PATH/daemons.conf"
+       load_old_config "/etc/default/frr"
+       load_old_config "/etc/sysconfig/frr"
+fi
 
 if { declare -p watchfrr_options 2>/dev/null || true; } | grep -q '^declare \-a'; then
        log_warning_msg "watchfrr_options contains a bash array value." \
@@ -299,6 +313,19 @@ if { declare -p watchfrr_options 2>/dev/null || true; } | grep -q '^declare \-a'
        unset watchfrr_options
 fi
 
+if test -z "$frr_profile"; then
+       # try to autodetect config profile
+       if test -d /etc/cumulus; then
+               frr_profile=datacenter
+       # elif test ...; then
+       # -- add your distro/system here
+       elif test -n "$FRR_DEFAULT_PROFILE"; then
+               frr_profile="$FRR_DEFAULT_PROFILE"
+       fi
+fi
+test -n "$frr_profile" && frr_global_options="$frr_global_options -F $frr_profile"
+
+
 #
 # other defaults and dispatch
 #
index f7e39e2badd9db05a0c17b7d5ad88715ed641cef..f6bab736713cacf7d59b9f4347ca3acee30bfae3 100644 (file)
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mosquitto
-PKG_VERSION:=2.0.5
+PKG_VERSION:=2.0.7
 PKG_RELEASE:=1
 PKG_LICENSE:=EPL-2.0
 PKG_LICENSE_FILES:=LICENSE.txt
@@ -17,7 +17,7 @@ PKG_CPE_ID:=cpe:/a:eclipse:mosquitto
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://mosquitto.org/files/source/
-PKG_HASH:=67eaeb4160e5793715c017f53c4f42808d76129b7ad131d765a6a23792e58d5d
+PKG_HASH:=a98054f0b8161588975ef24e1d467550d3935f4c16ccee63ecb623248a28356e
 
 include $(INCLUDE_DIR)/package.mk
 
index 18c48e6382a3bfa9e87e140cf94b9dcd21985f60..82a3a43ac7e294f771a7a6d22f25e7693254856c 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=strongswan
 PKG_VERSION:=5.9.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://download.strongswan.org/ https://download2.strongswan.org/
index b2efc74e8651dce384c411a07b42734501eb93b8..63b7507a23340ee5c5555b741c4fff0222b2063b 100644 (file)
@@ -326,9 +326,6 @@ config_ipsec() {
        swan_xappend "    daemon {"
        swan_xappend "      default = $debug"
        swan_xappend "    }"
-       swan_xappend "    auth {"
-       swan_xappend "      default = $debug"
-       swan_xappend "    }"
        swan_xappend "  }"
        swan_xappend "}"
 }
index 20b4076a29eab310ef5c76416b69d513ffda7f61..aafcad82f1bcc8a341c49f4d6f814c5973ea257d 100644 (file)
@@ -355,7 +355,23 @@ issue_cert()
        # commit and reload is in post_checks
     fi
 
-    if [ -e /etc/init.d/nginx ] && [ "$update_nginx" -eq "1" ]; then
+    local nginx_updated
+    nginx_updated=0
+    if command -v nginx-util 2>/dev/null && [ "$update_nginx" -eq "1" ]; then
+       nginx_updated=1
+       for domain in $domains; do
+           if [ "$APP" = "uacme" ]; then
+               nginx-util add_ssl "${domain}" uacme "$STATE_DIR/${main_domain}/cert.pem" \
+                   "$STATE_DIR/private/${main_domain}/key.pem" || nginx_updated=0
+           else
+               nginx-util add_ssl "${domain}" acme "$STATE_DIR/${main_domain}/fullchain.cer" \
+                   "$STATE_DIR/${main_domain}/${main_domain}.key" || nginx_updated=0
+           fi
+       done
+       # reload is in post_checks
+    fi
+
+    if [ "$nginx_updated" -eq "0" ] && [ -w /etc/nginx/nginx.conf ] && [ "$update_nginx" -eq "1" ]; then
        if [ "$APP" = "uacme" ]; then
            sed -i "s#ssl_certificate\ .*#ssl_certificate $STATE_DIR/${main_domain}/cert.pem;#g" /etc/nginx/nginx.conf
            sed -i "s#ssl_certificate_key\ .*#ssl_certificate_key $STATE_DIR/private/${main_domain}/key.pem;#g" /etc/nginx/nginx.conf
index d43407b03b41046c688a3640d31c3a7f8b58896b..b39a8903cdf273327610a80c328fff173ede7000 100644 (file)
@@ -21,6 +21,7 @@ endef
 define Package/wg-installer-server
        $(call Package/wg-installer/Default)
        TITLE+= (server)
+       MENU:=1
        DEPENDS:=+rpcd +uhttpd +uhttpd-mod-ubus +owipcalc
 endef
 
@@ -47,6 +48,16 @@ define Package/wg-installer-server/postinst
        fi
 endef
 
+define Package/wg-installer-server-hotplug-babeld
+       $(call Package/wg-installer-server)
+       DEPENDS:=wg-installer-server
+endef
+
+define Package/wg-installer-server-hotplug-babeld/install
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/net/
+       $(INSTALL_BIN) ./wg-server/hotplug.d/99-mesh-babeld $(1)/etc/hotplug.d/net/99-mesh-babeld
+endef
+
 define Package/wg-installer-client
        $(call Package/wg-installer/Default)
        TITLE+= (client)
@@ -66,4 +77,5 @@ define Package/wg-installer-client/install
 endef
 
 $(eval $(call BuildPackage,wg-installer-server))
+$(eval $(call BuildPackage,wg-installer-server-hotplug-babeld))
 $(eval $(call BuildPackage,wg-installer-client))
index f64fa61d3d495748bbab940b0ae29cea05212bb7..0f8189d97bfb3ddf09dd654284213e6be5360945 100644 (file)
@@ -24,3 +24,7 @@ Get Usage Statistics
 Register Tunnel Interface
 
     wg-client-installer register --ip 127.0.0.1 --user wginstaller --password wginstaller --bandwidth 10
+
+## Hotplugs
+
+- wg-installer-server-hotplug-babeld: mesh automatically via wireguard with babeld
diff --git a/net/wg-installer/wg-server/hotplug.d/99-mesh-babeld b/net/wg-installer/wg-server/hotplug.d/99-mesh-babeld
new file mode 100644 (file)
index 0000000..068b199
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# check if wireguard
+if [ "${DEVTYPE}" != "wireguard" ]; then
+       exit 0
+fi
+
+# check if correct naming
+slicedint=$(echo $INTERFACE | cut -c1-3)
+if [ "${slicedint}" != "wg_" ]; then
+       exit 0
+fi
+
+if [ "${ACTION}" == "add" ]; then
+       uci add babeld interface
+       uci set babeld.@interface[-1].ifname="${INTERFACE}"
+       uci commit
+       /etc/init.d/babeld reload
+fi
+
+if [ "${ACTION}" == "remove" ]; then
+       i=0
+       while uci get babeld.@interface[$i] &> /dev/null ; do
+               if [ "$(uci get babeld.@interface[$i].ifname)" == "${INTERFACE}" ]; then
+                       uci delete babeld.@interface[$i]
+               fi
+               i=$((i+1));
+       done
+       uci commit
+       /etc/init.d/babeld reload
+fi
diff --git a/utils/oci-runtime-tools/Makefile b/utils/oci-runtime-tools/Makefile
new file mode 100644 (file)
index 0000000..35d8f7f
--- /dev/null
@@ -0,0 +1,83 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=oci-runtime-tools
+PKG_VERSION:=1.0.0-pre20210122
+PKG_RELEASE:=1
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_NAME:=runtime-tools
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/opencontainers/runtime-tools.git
+PKG_SOURCE_VERSION:=453547deb724af135587e654f52d86b8619f21b9
+PKG_MIRROR_HASH:=34f3aefc4f6f3bb93330ec7cbeb2eb987b82184da53d453e8b04b5750faa8728
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DEPENDS:=golang/host
+PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
+
+GO_PKG:=github.com/opencontainers/runtime-tools/
+GO_PKG_LDFLAGS_X:=main.gitCommit=$(PKG_SOURCE_VERSION) main.version=$(PKG_SOURCE_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../../lang/golang/golang-package.mk
+
+define Package/oci-runtime-tool
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=oci-runtime-tool
+  URL:=https://github.com/opencontainers/runtime-tools
+  DEPENDS:=$(GO_ARCH_DEPENDS)
+endef
+
+define Package/oci-runtime-tool/description
+  OCI (Open Container Initiative) runtime tools
+  Generate OCI runtime spec configuration files and validate OCI bundles.
+endef
+
+define Package/oci-runtime-tests
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=OCI runtimetest tool
+  URL:=https://github.com/opencontainers/runtime-tools
+  DEPENDS:=@(i386||i686||x86_64) oci-runtime-tool +tar
+endef
+
+define Package/oci-runtime-tests/description
+  OCI (Open Container Initiative) runtime tools
+  This package provides test cases as well as artifacts required to
+  validate an OCI runtime.
+  Best used in combination with a TAP consumer like 'node-tap',
+  installable via npm.
+endef
+
+define Build/Compile
+       $(call GoPackage/Build/Compile)
+       $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
+endef
+
+define Package/oci-runtime-tool/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/oci-runtime-tool $(1)/usr/bin
+endef
+
+define Package/oci-runtime-tests/install
+       $(INSTALL_DIR) $(1)/usr/libexec/oci-runtime-test
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/runtimetest $(1)/usr/libexec/oci-runtime-test/
+       ( cd $(PKG_BUILD_DIR) ; $(FIND) ./validation/ -name *.go | grep -v util | \
+       xargs -I'%' -n 1 basename % .go | while read testbin; do \
+               $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${testbin} \
+                       $(1)/usr/libexec/oci-runtime-test/$$$${testbin}.t ; \
+       done )
+ifdef CONFIG_x86_64
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/rootfs-amd64.tar.gz $(1)/usr/libexec/oci-runtime-test
+endif
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/rootfs-386.tar.gz $(1)/usr/libexec/oci-runtime-test
+endef
+
+$(eval $(call GoBinPackage,oci-runtime-tools))
+$(eval $(call BuildPackage,oci-runtime-tool))
+$(eval $(call BuildPackage,oci-runtime-tests))
diff --git a/utils/oci-runtime-tools/patches/001-fix-32-bit-build.patch b/utils/oci-runtime-tools/patches/001-fix-32-bit-build.patch
new file mode 100644 (file)
index 0000000..e7ec5c2
--- /dev/null
@@ -0,0 +1,43 @@
+From 6502e57dbebcacd9b55fc7a80655c8f31d7dae8f Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel@makrotopia.org>
+Date: Mon, 8 Feb 2021 01:26:31 +0000
+Subject: [PATCH] Fix build of hugetlb tests on 32-bit platforms
+
+https://github.com/opencontainers/runtime-tools/pull/712
+
+Use explicit 64-bit types to avoid fall-back on incompatible 32-bit
+types on 32-bit platforms.
+
+Fixes: #711
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+---
+ validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go       | 2 +-
+ .../linux_cgroups_relative_hugetlb.go                           | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go b/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go
+index d71dfb9e..e1db3f1b 100644
+--- a/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go
++++ b/validation/linux_cgroups_hugetlb/linux_cgroups_hugetlb.go
+@@ -24,7 +24,7 @@ func testHugetlbCgroups() error {
+       // When setting the limit just for checking if writing works, the amount of memory
+       // requested does not matter, as all insigned integers will be accepted.
+       // Use 2GiB as an example
+-      const limit = 2 * (1 << 30)
++      var limit uint64 = 2 * (1 << 30)
+       for _, pageSize := range pageSizes {
+               g, err := util.GetDefaultGenerator()
+diff --git a/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go b/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go
+index b6d7ae81..583a9fa8 100644
+--- a/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go
++++ b/validation/linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.go
+@@ -21,7 +21,7 @@ func main() {
+       // When setting the limit just for checking if writing works, the amount of memory
+       // requested does not matter, as all insigned integers will be accepted.
+       // Use 2GiB as an example
+-      const limit = 2 * (1 << 30)
++      var limit uint64 = 2 * (1 << 30)
+       for _, pageSize := range pageSizes {
+               g, err := util.GetDefaultGenerator()
index 3487be3048fbe95479e382adfea20079449c457f..d094b831fd7ace0b6b15bb112b4ff15a14133c3d 100644 (file)
@@ -4,8 +4,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=prometheus-node-exporter-lua
-PKG_VERSION:=2020.12.07
-PKG_RELEASE:=2
+PKG_VERSION:=2021.01.27
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
 PKG_LICENSE:=Apache-2.0
index a59c1507ee4754e2a08ee93dd2c9edbc78b9122b..0a33fa4fd9d4bbc30ffc3d33cde8f9d6c65381f0 100644 (file)
@@ -1,14 +1,6 @@
-local function scrape()
-  local fd = io.popen("/etc/init.d/dsl_control lucistat")
-  local dsl_func = loadstring(fd:read("*a"))
-  fd:close()
-
-  if not dsl_func then
-    return
-  end
-
-  local dsl_stat = dsl_func()
+local ubus = require "ubus"
 
+local function scrape()
   local dsl_line_attenuation = metric("dsl_line_attenuation_db", "gauge")
   local dsl_signal_attenuation = metric("dsl_signal_attenuation_db", "gauge")
   local dsl_snr = metric("dsl_signal_to_noise_margin_db", "gauge")
@@ -19,82 +11,76 @@ local function scrape()
   local dsl_error_seconds_total = metric("dsl_error_seconds_total", "counter")
   local dsl_errors_total = metric("dsl_errors_total", "counter")
 
+  local u = ubus.connect()
+  local m = u:call("dsl", "metrics", {})
+
   -- dsl hardware/firmware information
   metric("dsl_info", "gauge", {
-    atuc_vendor_id = dsl_stat.atuc_vendor_id,
-    atuc_system_vendor_id = dsl_stat.atuc_system_vendor_id,
-    chipset = dsl_stat.chipset,
-    firmware_version = dsl_stat.firmware_version,
-    api_version = dsl_stat.api_version,
+    atuc_vendor = m.atu_c.vendor,
+    atuc_system_vendor = m.atu_c.system_vendor,
+    chipset = m.chipset,
+    firmware_version = m.firmware_version,
+    api_version = m.api_version,
   }, 1)
 
   -- dsl line settings information
   metric("dsl_line_info", "gauge", {
-    xtse1   = dsl_stat.xtse1,
-    xtse2   = dsl_stat.xtse2,
-    xtse3   = dsl_stat.xtse3,
-    xtse4   = dsl_stat.xtse4,
-    xtse5   = dsl_stat.xtse5,
-    xtse6   = dsl_stat.xtse6,
-    xtse7   = dsl_stat.xtse7,
-    xtse8   = dsl_stat.xtse8,
-    annex   = dsl_stat.annex_s,
-    mode    = dsl_stat.line_mode_s,
-    profile = dsl_stat.profile_s,
+    annex = m.annex,
+    mode = m.mode,
+    profile = m.profile,
   }, 1)
 
-  -- dsl up is 1 if the line is up and running
   local dsl_up
-  if dsl_stat.line_state == "UP" then
+  if m.up then
     dsl_up = 1
   else
     dsl_up = 0
   end
 
   metric("dsl_up", "gauge", {
-    detail = dsl_stat.line_state_detail,
+    detail = m.state,
   }, dsl_up)
 
   -- dsl line status data
-  metric("dsl_uptime_seconds", "gauge", {}, dsl_stat.line_uptime)
+  metric("dsl_uptime_seconds", "gauge", {}, m.uptime)
 
   -- dsl db measurements
-  dsl_line_attenuation({direction="down"}, dsl_stat.line_attenuation_down)
-  dsl_line_attenuation({direction="up"}, dsl_stat.line_attenuation_up)
-  dsl_signal_attenuation({direction="down"}, dsl_stat.signal_attenuation_down)
-  dsl_signal_attenuation({direction="up"}, dsl_stat.signal_attenuation_up)
-  dsl_snr({direction="down"}, dsl_stat.noise_margin_down)
-  dsl_snr({direction="up"}, dsl_stat.noise_margin_up)
-  dsl_aggregated_transmit_power({direction="down"}, dsl_stat.actatp_down)
-  dsl_aggregated_transmit_power({direction="up"}, dsl_stat.actatp_up)
+  dsl_line_attenuation({direction="down"}, m.downstream.latn)
+  dsl_line_attenuation({direction="up"}, m.upstream.latn)
+  dsl_signal_attenuation({direction="down"}, m.downstream.satn)
+  dsl_signal_attenuation({direction="up"}, m.upstream.satn)
+  dsl_snr({direction="down"}, m.downstream.snr)
+  dsl_snr({direction="up"}, m.upstream.snr)
+  dsl_aggregated_transmit_power({direction="down"}, m.downstream.actatp)
+  dsl_aggregated_transmit_power({direction="up"}, m.upstream.actatp)
 
   -- dsl performance data
-  if dsl_stat.latency_down ~= nil then
-    dsl_latency({direction="down"}, dsl_stat.latency_down / 1000000)
-    dsl_latency({direction="up"}, dsl_stat.latency_up / 1000000)
+  if m.downstream.interleave_delay ~= nil then
+    dsl_latency({direction="down"}, m.downstream.interleave_delay / 1000000)
+    dsl_latency({direction="up"}, m.upstream.interleave_delay / 1000000)
   end
-  dsl_datarate({direction="down"}, dsl_stat.data_rate_down)
-  dsl_datarate({direction="up"}, dsl_stat.data_rate_up)
-  dsl_max_datarate({direction="down"}, dsl_stat.max_data_rate_down)
-  dsl_max_datarate({direction="up"}, dsl_stat.max_data_rate_up)
+  dsl_datarate({direction="down"}, m.downstream.data_rate)
+  dsl_datarate({direction="up"}, m.upstream.data_rate)
+  dsl_max_datarate({direction="down"}, m.downstream.attndr)
+  dsl_max_datarate({direction="up"}, m.upstream.attndr)
 
   -- dsl errors
-  dsl_error_seconds_total({err="forward error correction",loc="near"}, dsl_stat.errors_fecs_near)
-  dsl_error_seconds_total({err="forward error correction",loc="far"}, dsl_stat.errors_fecs_far)
-  dsl_error_seconds_total({err="errored",loc="near"}, dsl_stat.errors_es_near)
-  dsl_error_seconds_total({err="errored",loc="far"}, dsl_stat.errors_es_near)
-  dsl_error_seconds_total({err="severely errored",loc="near"}, dsl_stat.errors_ses_near)
-  dsl_error_seconds_total({err="severely errored",loc="near"}, dsl_stat.errors_ses_near)
-  dsl_error_seconds_total({err="loss of signal",loc="near"}, dsl_stat.errors_loss_near)
-  dsl_error_seconds_total({err="loss of signal",loc="far"}, dsl_stat.errors_loss_far)
-  dsl_error_seconds_total({err="unavailable",loc="near"}, dsl_stat.errors_uas_near)
-  dsl_error_seconds_total({err="unavailable",loc="far"}, dsl_stat.errors_uas_far)
-  dsl_errors_total({err="header error code error",loc="near"}, dsl_stat.errors_hec_near)
-  dsl_errors_total({err="header error code error",loc="far"}, dsl_stat.errors_hec_far)
-  dsl_errors_total({err="non pre-emptive crc error",loc="near"}, dsl_stat.errors_crc_p_near)
-  dsl_errors_total({err="non pre-emptive crc error",loc="far"}, dsl_stat.errors_crc_p_far)
-  dsl_errors_total({err="pre-emptive crc error",loc="near"}, dsl_stat.errors_crcp_p_near)
-  dsl_errors_total({err="pre-emptive crc error",loc="far"}, dsl_stat.errors_crcp_p_far)
+  dsl_error_seconds_total({err="forward error correction", loc="near"}, m.errors.near.fecs)
+  dsl_error_seconds_total({err="forward error correction", loc="far"}, m.errors.far.fecs)
+  dsl_error_seconds_total({err="errored", loc="near"}, m.errors.near.es)
+  dsl_error_seconds_total({err="errored", loc="far"}, m.errors.far.es)
+  dsl_error_seconds_total({err="severely errored", loc="near"}, m.errors.near.ses)
+  dsl_error_seconds_total({err="severely errored", loc="far"}, m.errors.far.ses)
+  dsl_error_seconds_total({err="loss of signal", loc="near"}, m.errors.near.loss)
+  dsl_error_seconds_total({err="loss of signal", loc="far"}, m.errors.far.loss)
+  dsl_error_seconds_total({err="unavailable", loc="near"}, m.errors.near.uas)
+  dsl_error_seconds_total({err="unavailable", loc="far"}, m.errors.far.uas)
+  dsl_errors_total({err="header error code error", loc="near"}, m.errors.near.hec)
+  dsl_errors_total({err="header error code error", loc="far"}, m.errors.far.hec)
+  dsl_errors_total({err="non pre-emptive crc error", loc="near"}, m.errors.near.crc_p)
+  dsl_errors_total({err="non pre-emptive crc error", loc="far"}, m.errors.far.crc_p)
+  dsl_errors_total({err="pre-emptive crc error", loc="near"}, m.errors.near.crcp_p)
+  dsl_errors_total({err="pre-emptive crc error", loc="far"}, m.errors.far.crcp_p)
 end
 
 return { scrape = scrape }