diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e1ea6b1058..9931ffb5a4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,7 +8,8 @@ collect/pakon-lists/ @mmtj hardware/ @miska hardware/crypto-wrapper/ @VojtechMyslivec hardware/mox/mox-otp/ @VojtechMyslivec -hardware/mox/mox-uboot/ @pali @elkablo +hardware/mox/mox-uboot-uboot/ @pali @elkablo +hardware/mox/mox-a53-firmware/ @pali @elkablo hardware/omnia/omnia-uboot/ @pali @elkablo # Lang - Python Packages diff --git a/.github/workflows/multi-arch-test-build.yml b/.github/workflows/multi-arch-test-build.yml index f4e3584eda..c8bd40bc3f 100644 --- a/.github/workflows/multi-arch-test-build.yml +++ b/.github/workflows/multi-arch-test-build.yml @@ -13,16 +13,12 @@ jobs: - powerpc_8540 version: - master - - 19.07.8 - - 21.02.0 + - 21.02.1 runtime_test: [false] include: - arch: aarch64_cortex-a53 version: master runtime_test: true - - arch: aarch64_cortex-a53 - version: 19.07.8 - runtime_test: true - arch: aarch64_cortex-a53 version: 21.02.0 runtime_test: true @@ -37,7 +33,7 @@ jobs: - name: Determine changed packages run: | # only detect packages with changed Makefiles - PACKAGES="$(git diff --diff-filter=d --name-only origin/develop \ + PACKAGES="$(git diff --diff-filter=d --name-only origin/master \ | grep -E 'Makefile$|test.sh$' | grep -Ev '/files/|/src/' \ | awk -F/ '{ print $(NF-1) }' | tr '\n' ' ')" diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index e398075e12..a1cbd52b7b 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -8,7 +8,8 @@ collect/pakon-lists/ @mmatejek hardware/ @mhrusecky hardware/crypto-wrapper/ @vmyslivec hardware/mox/mox-otp/ @vmyslivec -hardware/mox/mox-uboot/ @prohar @mbehun +hardware/mox/mox-uboot-uboot/ @prohar @mbehun +hardware/mox/mox-a53-firmware/ @prohar @mbehun hardware/omnia/omnia-uboot/ @prohar @mbehun # Lang - Python Packages diff --git a/WORKFLOW.adoc b/WORKFLOW.adoc index 5ea870af63..43b82d9be5 100644 --- a/WORKFLOW.adoc +++ b/WORKFLOW.adoc @@ -248,8 +248,21 @@ First find git hash for turris-os-packages feed from tag in turris-build. Then y can create appropriate tag. [,sh] ---------------------------------------------------------------------------------- -git tag -s -m "Turris OS X.Y.Z" vX.Y.Z HASH -git push --tags origin vX.Y.Z +git tag -s vX.Y.Z HASH +---------------------------------------------------------------------------------- +Enter tag message containing changelog of the tagged version from NEWS. +``` +Turris OS packages for Turris OS X.Y.Z + +* A NEW FEATURE +* ANOTHER NEW FEATURE +* ... +``` + +After creating the tag, it is necessary to push it to the remote repository. +[,sh] +---------------------------------------------------------------------------------- +git push origin vX.Y.Z ---------------------------------------------------------------------------------- === Preparing next minor or major version of Turris OS @@ -263,7 +276,15 @@ recursive merge (without merge conflicts). [,sh] ---------------------------------------------------------------------------------- git checkout master -git merge --no-ff --gpg-sign develop +git merge --no-ff --no-commit develop +---------------------------------------------------------------------------------- + +Change the branch in .github/workflows/multi-arch-test-build.yml from develop +to master. +[,sh] +---------------------------------------------------------------------------------- +git add .github/workflows/multi-arch-test-build.yml +git commit --no-edit --gpg-sign git push origin master ---------------------------------------------------------------------------------- diff --git a/admin/cronie/Makefile b/admin/cronie/Makefile index b97a2defb5..010461f451 100644 --- a/admin/cronie/Makefile +++ b/admin/cronie/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cronie PKG_VERSION:=1.5.7 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/cronie-crond/cronie/archive diff --git a/collect/haas-proxy/Makefile b/collect/haas-proxy/Makefile index 4e88a58d8e..fe7d039a6c 100644 --- a/collect/haas-proxy/Makefile +++ b/collect/haas-proxy/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=haas-proxy PKG_VERSION:=2.0.2 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=proxy-v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://gitlab.nic.cz/haas/proxy/-/archive/v$(PKG_VERSION)/ @@ -39,7 +39,6 @@ define Package/haas-proxy +sentinel-firewall \ +@KERNEL_CFS_BANDWIDTH CONFLICTS:=mitmproxy - VARIANT:=python3 endef define Package/haas-proxy/description diff --git a/collect/pakon-lists/Makefile b/collect/pakon-lists/Makefile index 3440988080..6c6429a98c 100644 --- a/collect/pakon-lists/Makefile +++ b/collect/pakon-lists/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pakon-lists PKG_VERSION:=6 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/pakon-light-lists.git diff --git a/collect/pakon/Makefile b/collect/pakon/Makefile index f7330de8a9..0310cba745 100644 --- a/collect/pakon/Makefile +++ b/collect/pakon/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2017-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# Copyright (C) 2017-2022 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. @@ -8,46 +8,67 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pakon -PKG_VERSION:=1.2.1 -PKG_RELEASE:=4 +PKG_VERSION:=1.3.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/pakon.git -PKG_MIRROR_HASH:=19ab1643d0133b6324eda6df2c5c4d2cf90cc3994ca8cb7e03fb3f265dcc72d2 +PKG_MIRROR_HASH:=04ab824e22a60378eb94018f3024e44c43397eceed99c4562f78b7d9b7f0fcc5 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-only PKG_LICENSE_FILES:=LICENSE -PKG_INSTALL:=0 - include $(INCLUDE_DIR)/package.mk define Package/pakon SECTION:=collect CATEGORY:=Collect TITLE:=PArental KONtrol - light - DEPENDS:=+suricata-pakon +xz +python3-light +python3-logging +python3-ctypes +python3-cachetools +python3-sqlite3 +sqlite3-cli +pakon-lists +ouidb +suricata-conntrack-flows + DEPENDS:=\ + +suricata-pakon \ + +suricata-conntrack-flows \ + +pakon-lists \ + +python3-light \ + +python3-logging \ + +python3-ctypes \ + +python3-cachetools \ + +python3-sqlite3 \ + +sqlite3-cli \ + +xz \ + +ouidb \ + +turris-auth \ + +lighttpd-mod-proxy endef define Package/pakon/description - Simple daemon that is able to collect events from suricata, store them locally to SQLite DB. + Simple daemon that is able to collect events from suricata and store them locally to SQLite DB. endef -define Build/Compile - true -endef - -define Build/Install - true -endef +Build/Compile:=: define Package/pakon/conffiles /etc/config/pakon endef define Package/pakon/install + # WebApps + $(INSTALL_DIR) $(1)/usr/share/turris-webapps/ + $(INSTALL_DATA) ./files/webapps-pakon.json $(1)/usr/share/turris-webapps/10_pakon.json + $(INSTALL_DIR) $(1)/www/webapps-icons/ + $(INSTALL_DATA) ./files/pakon.png $(1)/www/webapps-icons/ + + # Web + $(INSTALL_DIR) $(1)/www/pakon + $(INSTALL_DATA) $(PKG_BUILD_DIR)/web/index.html $(1)/www/pakon + $(CP) -r $(PKG_BUILD_DIR)/web/static $(1)/www/pakon + $(INSTALL_DIR) $(1)/www/cgi-bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/web/api.cgi $(1)/www/cgi-bin/pakon + $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/ + $(INSTALL_DATA) ./files/lighttpd-pakon.conf $(1)/etc/lighttpd/conf.d/80-pakon.conf + + # PaKon itself $(INSTALL_DIR) $(1)/etc/suricata-pakon/output_conf.d $(INSTALL_DATA) ./files/pakon-output.yaml $(1)/etc/suricata-pakon/output_conf.d/pakon.yaml $(INSTALL_DIR) $(1)/etc/init.d @@ -73,25 +94,33 @@ endef define Package/pakon/postinst #!/bin/sh -[ -n "$$IPKG_INSTROOT" ] || { +if [ -z "$$IPKG_INSTROOT" ]; then /usr/libexec/pakon-light/create_db.py # one time fix - convert all names to lowercase. Mixed case names shouldn't be saved anymore (fixed in monitor) [ -f /var/lib/pakon.db ] && sqlite3 /var/lib/pakon.db "UPDATE traffic SET app_hostname = LOWER(app_hostname);" || true - [ -f /srv/pakon/pakon-archive.db ] && /usr/bin/sqlite3 /srv/pakon/pakon-archive.db "UPDATE traffic SET app_hostname = LOWER(app_hostname);" || true - /etc/init.d/pakon-monitor enable - /etc/init.d/pakon-monitor restart 2>/dev/null - /etc/init.d/pakon-handler enable - /etc/init.d/pakon-handler restart 2>/dev/null + [ -f /srv/pakon/pakon-archive.db ] && sqlite3 /srv/pakon/pakon-archive.db "UPDATE traffic SET app_hostname = LOWER(app_hostname);" || true + /etc/init.d/pakon-monitor enable + /etc/init.d/pakon-monitor restart 2>/dev/null + /etc/init.d/pakon-handler enable + /etc/init.d/pakon-handler restart 2>/dev/null /etc/init.d/suricata-pakon restart 2>/dev/null -} + /etc/init.d/lighttpd restart 2>/dev/null +fi +endef + +define Package/pakon/postrm +#!/bin/sh +if [ -z "$$IPKG_INSTROOT" ]; then + /etc/init.d/lighttpd restart 2>/dev/null +fi endef define Package/pakon/prerm #!/bin/sh - /etc/init.d/pakon-monitor disable - /etc/init.d/pakon-monitor stop - /etc/init.d/pakon-handler disable - /etc/init.d/pakon-handler stop +/etc/init.d/pakon-monitor disable +/etc/init.d/pakon-monitor stop +/etc/init.d/pakon-handler disable +/etc/init.d/pakon-handler stop endef $(eval $(call BuildPackage,pakon)) diff --git a/collect/pakon/files/lighttpd-pakon.conf b/collect/pakon/files/lighttpd-pakon.conf new file mode 100644 index 0000000000..62824727e7 --- /dev/null +++ b/collect/pakon/files/lighttpd-pakon.conf @@ -0,0 +1,18 @@ +## API CGI +$HTTP["url"] =~ "^/pakon/api" { + cgi.assign += ( "" => "" ) +} + +# Set security +$HTTP["url"] =~ "^/pakon/" { + fastcgi.server = ( "/" => ( turris_auth_scriptname => turris_auth )) +} + +## Set URLs +alias.url += ( + "/pakon/api" => "/www/cgi-bin/pakon", + "/pakon/" => "/www/pakon/" +) +$HTTP["url"] =~ "^/pakon$" { + url.redirect = ( "^/pakon$" => "/pakon/" ) +} diff --git a/collect/pakon/files/pakon.png b/collect/pakon/files/pakon.png new file mode 100644 index 0000000000..0e57382934 Binary files /dev/null and b/collect/pakon/files/pakon.png differ diff --git a/collect/pakon/files/webapps-pakon.json b/collect/pakon/files/webapps-pakon.json new file mode 100644 index 0000000000..a332600d17 --- /dev/null +++ b/collect/pakon/files/webapps-pakon.json @@ -0,0 +1,10 @@ +{ + "id": "pakon", + "title": "PaKon", + "url": "/pakon/", + "icon": "/icons/pakon.png", + "description": { + "en": "Your network traffic history.", + "cs": "Záznam síťového provozu." + } +} diff --git a/collect/pakon/patches/cleanup-faster.patch b/collect/pakon/patches/cleanup-faster.patch deleted file mode 100644 index 9c61ea784e..0000000000 --- a/collect/pakon/patches/cleanup-faster.patch +++ /dev/null @@ -1,22 +0,0 @@ - -From 997bc0d12fa3dbbf21582d41f657a6caff25c583 Mon Sep 17 00:00:00 2001 -From: Michal Hrusecky -Date: Mon, 6 Sep 2021 15:46:25 +0200 -Subject: [PATCH] Trigger cleanup faster - -Call cleanup of the database faster to allow smaller databases. ---- - monitor.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/monitor.py -+++ b/monitor.py -@@ -343,7 +343,7 @@ def main(): - # it's recommended not to touch this, unless you know really well what you're doing - # filling all available space in /var/lib (tmpfs) will probably break your router - hard_limit = int(uci_get('pakon.monitor.database_limit') or 3000000) -- run_check = everyN(100000) -+ run_check = everyN(1000) - while True: - try: - line = data_source.get_message() diff --git a/collect/sentinel/sentinel-certgen/Makefile b/collect/sentinel/sentinel-certgen/Makefile index 0d6f21617a..d1fde91651 100644 --- a/collect/sentinel/sentinel-certgen/Makefile +++ b/collect/sentinel/sentinel-certgen/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sentinel-certgen PKG_VERSION:=6.2 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/sentinel/certgen.git @@ -30,7 +30,6 @@ define Package/sentinel-certgen TITLE:=Certgen URL:=https://gitlab.nic.cz/turris/sentinel/certgen DEPENDS:=+python3-light +python3-six +python3-requests +python3-cryptography +crypto-wrapper - VARIANT:=python3 endef define Package/sentinel-certgen/description diff --git a/collect/sentinel/sentinel-dynfw-client/Makefile b/collect/sentinel/sentinel-dynfw-client/Makefile index e1ea402aed..44d6975dec 100644 --- a/collect/sentinel/sentinel-dynfw-client/Makefile +++ b/collect/sentinel/sentinel-dynfw-client/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sentinel-dynfw-client PKG_VERSION:=1.4.0 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/sentinel/dynfw-client.git diff --git a/collect/sentinel/sentinel-eula/Makefile b/collect/sentinel/sentinel-eula/Makefile index a13002200c..a4b43b383a 100644 --- a/collect/sentinel/sentinel-eula/Makefile +++ b/collect/sentinel/sentinel-eula/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sentinel-eula PKG_VERSION:=1.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/sentinel/eula.git diff --git a/collect/sentinel/sentinel-firewall/Makefile b/collect/sentinel/sentinel-firewall/Makefile index 172e02d543..c9a7facc8d 100644 --- a/collect/sentinel/sentinel-firewall/Makefile +++ b/collect/sentinel/sentinel-firewall/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sentinel-firewall PKG_VERSION:=0.1.2 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/collect/sentinel/sentinel-fwlogs/Makefile b/collect/sentinel/sentinel-fwlogs/Makefile index b0709f34e6..bc9dc4fdc8 100644 --- a/collect/sentinel/sentinel-fwlogs/Makefile +++ b/collect/sentinel/sentinel-fwlogs/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +## Copyright (C) 2020, 2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,13 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sentinel-fwlogs -PKG_VERSION:=0.1.0 -PKG_RELEASE:=3 +PKG_VERSION:=0.3.0 +PKG_RELEASE:=$(AUTORELEASE) -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/sentinel/fwlogs.git -PKG_MIRROR_HASH:=fdb2dae1d7f62d5f57ccf70232a7b1aeededea3844845002167701272340029b -PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://gitlab.nic.cz/api/v4/projects/976/packages/generic/sentinel-fwlogs/$(PKG_VERSION) +PKG_HASH:=e9df14ac2d2fef15b02a6291f0a580e998b74c9a5fe1c85cb6becbcbc167c8c7 PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later @@ -23,9 +22,9 @@ PKG_LICENSE_FILES:=LICENSE PKG_BUILD_DEPENDS:=argp-standalone PKG_INSTALL:=1 -PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/autotools.mk define Package/sentinel-fwlogs SECTION:=collect @@ -36,7 +35,7 @@ define Package/sentinel-fwlogs DEPENDS:=\ +czmq \ +msgpack-c \ - +logc +logc-argp \ + +logc +logc-argp +logc-czmq \ +libnetfilter-log \ +sentinel-firewall +iptables-mod-nflog \ +sentinel-proxy diff --git a/collect/sentinel/sentinel-i_agree_with_eula/Makefile b/collect/sentinel/sentinel-i_agree_with_eula/Makefile index 64ea9843f6..6584d17464 100644 --- a/collect/sentinel/sentinel-i_agree_with_eula/Makefile +++ b/collect/sentinel/sentinel-i_agree_with_eula/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sentinel-i_agree_with_eula PKG_VERSION:=1 -PKG_RELEASE:=4 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC include $(INCLUDE_DIR)/package.mk diff --git a/collect/sentinel/sentinel-minipot/Makefile b/collect/sentinel/sentinel-minipot/Makefile index 08db62906a..2a0412af87 100644 --- a/collect/sentinel/sentinel-minipot/Makefile +++ b/collect/sentinel/sentinel-minipot/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sentinel-minipot -PKG_VERSION:=2.2 -PKG_RELEASE:=2 +PKG_VERSION:=2.3.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/sentinel/minipot.git -PKG_MIRROR_HASH:=a842b4b47e13300759dd197da59700375160f89a207619d8844c79a095ba5478 +PKG_MIRROR_HASH:=01f6ff3e95c277c692aba589718cd8eafc44c3a6304cd402df7b37d2bdb14592 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -37,6 +37,8 @@ define Package/sentinel-minipot +libevent2 \ +logc \ +logc-argp \ + +logc-czmq \ + +logc-libevent \ +msgpack-c \ +base64c \ +sentinel-firewall \ diff --git a/collect/sentinel/sentinel-minipot/patches/0001-configure-Do-not-check-for-bootstrap-file.patch b/collect/sentinel/sentinel-minipot/patches/0001-configure-Do-not-check-for-bootstrap-file.patch new file mode 100644 index 0000000000..ef133f1e5c --- /dev/null +++ b/collect/sentinel/sentinel-minipot/patches/0001-configure-Do-not-check-for-bootstrap-file.patch @@ -0,0 +1,34 @@ +From 5bf796bd73ce6e2ad8f2e42c8f64b9440ae1c227 Mon Sep 17 00:00:00 2001 +From: Michal Hrusecky +Date: Mon, 20 Dec 2021 14:50:43 +0100 +Subject: [PATCH] configure: Do not check for bootstrap file + +We can check for gperf unconditionally. No idea why would existence of a +file prevent us for checking for iperf, but this particular check fails +when cross-compiling. And dropping it shouldn't hurt. + +checking for ./bootstrap... configure: error: cannot check for file existence when cross compiling +--- + configure.ac | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 96729e8..078e784 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -29,10 +29,8 @@ AS_IF([test "$argp_standalone_required" = "yes"], + AC_CHECK_LIB([argp], [argp_parse], , AC_MSG_ERROR([Unable to find libargp]))) + + dnl Build helpers +-AC_CHECK_FILE([${0%/*}/bootstrap],[ +- AC_PATH_PROG([GPERF], [gperf]) +- AS_IF([test -z "$GPERF"], [AC_MSG_ERROR([Missing gperf generator])]) +-]) ++AC_PATH_PROG([GPERF], [gperf]) ++AS_IF([test -z "$GPERF"], [AC_MSG_ERROR([Missing gperf generator])]) + AM_CONDITIONAL([GPERF_GENERATE], [test -n "$GPERF"]) + + +-- +2.34.1 + diff --git a/collect/sentinel/sentinel-proxy/Makefile b/collect/sentinel/sentinel-proxy/Makefile index b5bb1bed37..82c31e0480 100644 --- a/collect/sentinel/sentinel-proxy/Makefile +++ b/collect/sentinel/sentinel-proxy/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sentinel-proxy PKG_VERSION:=1.4 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/sentinel/proxy.git diff --git a/collect/sentinel/turris-survey/Makefile b/collect/sentinel/turris-survey/Makefile index 0df88507f0..2d9241894a 100644 --- a/collect/sentinel/turris-survey/Makefile +++ b/collect/sentinel/turris-survey/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2020-2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) +## Copyright (C) 2020-2022 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. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-survey -PKG_VERSION:=0.2 -PKG_RELEASE:=1 +PKG_VERSION:=0.4 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/sentinel/turris-survey.git -PKG_MIRROR_HASH:=26aca2bb9bcdf0be1b858ec8e8557360969cfa6db826d5fe205cc10a8df93e18 +PKG_MIRROR_HASH:=ac6cf838afc5cd78d430c138cd9f76abffb5072232ce3770ca77233e7c11c2fe PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -30,11 +30,11 @@ define Package/turris-survey TITLE:=Turris Survey URL:=https://gitlab.nic.cz/turris/sentinel/turris-survey DEPENDS:=+python3-light +python3-msgpack +python3-zmq +sentinel-proxy +updater-supervisor +cronie - VARIANT:=python3 endef define Package/turris-survey/description - Periodically collect router statistics like usage, installed software. + Periodically collects Turris OS usage information - OS version, list of + installed packages and package lists. endef define Py3Package/turris-survey/install diff --git a/collect/suricata-conntrack-flows/Makefile b/collect/suricata-conntrack-flows/Makefile index 625a72b6f6..6dc47c681a 100644 --- a/collect/suricata-conntrack-flows/Makefile +++ b/collect/suricata-conntrack-flows/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=suricata-conntrack-flows PKG_VERSION:=1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/suricata_conntrack_flows.git diff --git a/hardware/atsha204/getmac/Makefile b/hardware/atsha204/getmac/Makefile index de1029e7c1..af3e286734 100644 --- a/hardware/atsha204/getmac/Makefile +++ b/hardware/atsha204/getmac/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=getmac PKG_VERSION:=1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/misc.git @@ -22,7 +22,7 @@ include $(INCLUDE_DIR)/package.mk define Package/getmac TITLE:=Get MAC - DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_turris1x + DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x endef define Build/Compile diff --git a/hardware/atsha204/libatsha204/Makefile b/hardware/atsha204/libatsha204/Makefile index 1a07f7f6d6..47129035ad 100644 --- a/hardware/atsha204/libatsha204/Makefile +++ b/hardware/atsha204/libatsha204/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libatsha204 PKG_VERSION:=29.2 -PKG_RELEASE:=4 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/libatsha204.git @@ -27,7 +27,7 @@ define Package/libatsha204 URL:=https://gitlab.nic.cz/turris/libatsha204 PROVIDES:=turris-otp DEPENDS:=+libopenssl +libunbound - DEPENDS+=@(TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia||TARGET_mpc85xx_p2020_DEVICE_turris1x) + DEPENDS+=@(TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia||TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x) VARIANT:=real endef @@ -35,6 +35,7 @@ define Package/libatsha204-emul TITLE:=libatsha204-emul PROVIDES:=libatsha204 turris-otp DEPENDS:=+libopenssl +libunbound + CONFLICTS:=libatsha204 VARIANT:=emul endef @@ -44,7 +45,7 @@ ifeq ($(BUILD_VARIANT),real) MAKE_FLAGS += USE_LAYER=USE_LAYER_NI2C ifeq ($(CONFIG_TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia),y) MAKE_FLAGS += DEFAULT_NI2C_DEV_PATH=NI2C_DEV_PATH_OMNIA - else ifeq ($(CONFIG_TARGET_mpc85xx_p2020_DEVICE_turris1x),y) + else ifeq ($(CONFIG_TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x),y) MAKE_FLAGS += DEFAULT_NI2C_DEV_PATH=NI2C_DEV_PATH_TURRIS endif endif diff --git a/hardware/atsha204/update_mac/Makefile b/hardware/atsha204/update_mac/Makefile index 2e38d89d87..cfcc33a4a3 100644 --- a/hardware/atsha204/update_mac/Makefile +++ b/hardware/atsha204/update_mac/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=update_mac PKG_VERSION:=2 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/hardware/cert-backup/Makefile b/hardware/cert-backup/Makefile index 3e19534ed6..ce09cb8da2 100644 --- a/hardware/cert-backup/Makefile +++ b/hardware/cert-backup/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cert-backup PKG_VERSION:=14 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=BSD-3-Clause @@ -42,7 +42,7 @@ endef define Package/cert-backup-turris1x $(call Package/CommonBackend) TITLE+= - Turris 1.x backend - DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_turris1x + DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x CONFLICTS:=cert-backup-btrfs endef diff --git a/hardware/crypto-wrapper/Makefile b/hardware/crypto-wrapper/Makefile index bce9610cea..efd7d45a18 100644 --- a/hardware/crypto-wrapper/Makefile +++ b/hardware/crypto-wrapper/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=crypto-wrapper -PKG_VERSION:=0.4 -PKG_RELEASE:=2 +PKG_VERSION:=0.4.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/crypto-wrapper.git -PKG_MIRROR_HASH:=1fb45c61479a17e20601ad91c48ce00f358b1ad5f5f9b49ba3e6717403d9ceb7 +PKG_MIRROR_HASH:=bed966c136174c7cb5eb3837be21f7d671ec3f5d3b5983d2317dcd447212d814 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC diff --git a/hardware/mox/mox-a53-firmware/Makefile b/hardware/mox/mox-a53-firmware/Makefile new file mode 100644 index 0000000000..b5cf784179 --- /dev/null +++ b/hardware/mox/mox-a53-firmware/Makefile @@ -0,0 +1,55 @@ +# +## Copyright (C) 2022 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:=mox-a53-firmware +PKG_VERSION:=2.7 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE:=trusted-firmware-a-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot +PKG_HASH:=53422dc649153838e03820330ba17cb10afe3e330ecde0db11e4d5f1361a33e6 + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=docs/license.rst +PKG_BUILD_PARALLEL:=1 + +export GCC_HONOUR_COPTS=s + +PKG_BUILD_DIR:=$(BUILD_DIR)/trusted-firmware-a-$(PKG_VERSION) +PKG_BUILD_DEPENDS:=uboot-mvebu + +include $(INCLUDE_DIR)/package.mk + +define Package/mox-a53-firmware + TITLE:=Trusted firmware for Turris MOX + DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox + PROVIDES:=u-boot-mox +endef + +define Build/Compile + $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + USE_COHERENT_MEM=0 \ + PLAT=a3700 \ + CM3_SYSTEM_RESET=1 \ + FIP_ALIGN=0x100 \ + BL33=$(STAGING_DIR_IMAGE)/mox-u-boot.bin \ + OPENSSL_DIR=$(STAGING_DIR_HOST) \ + mrvl_bootimage + cp $(PKG_BUILD_DIR)/build/a3700/release/boot-image.bin $(PKG_BUILD_DIR)/a53-firmware.bin + cd $(PKG_BUILD_DIR); od -v -tu8 -An -j 131184 -N 8 $(PKG_BUILD_DIR)/a53-firmware.bin | LC_ALL=C awk '{ for (i = 0; i < 64; i += 8) printf "%c", and(rshift(1310720-$$$$1, i), 255) }' | dd of=$(PKG_BUILD_DIR)/a53-firmware.bin bs=1 seek=131192 count=8 conv=notrunc 2>/dev/null +endef + +define Package/mox-a53-firmware/install + $(INSTALL_DIR) $(1)/usr/share/mox + $(INSTALL_DATA) $(PKG_BUILD_DIR)/a53-firmware.bin $(1)/usr/share/mox/uboot-devel +endef + +$(eval $(call BuildPackage,mox-a53-firmware)) diff --git a/hardware/mox/mox-dtb/Makefile b/hardware/mox/mox-dtb/Makefile index 4f70dc541a..50c605b040 100644 --- a/hardware/mox/mox-dtb/Makefile +++ b/hardware/mox/mox-dtb/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mox-dtb PKG_VERSION:=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC) -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages PKG_BUILD_DEPENDS:=linux @@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/package.mk define Package/mox-dtb TITLE:=Device tree for Turris MOX - DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic-mox + DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox endef define Package/mox-dtb/description diff --git a/hardware/mox/mox-firmware/Makefile b/hardware/mox/mox-firmware/Makefile index 19a4037577..7ab1fe4316 100644 --- a/hardware/mox/mox-firmware/Makefile +++ b/hardware/mox/mox-firmware/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-mox-firmware -PKG_VERSION:=1.1 -PKG_RELEASE:=1 +PKG_VERSION:=2.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC @@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk define Package/turris-mox-firmware TITLE:=Firmware for Turris MOX - DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic-mox + DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox PROVIDES:=turris-nor-update-firmware endef @@ -27,9 +27,9 @@ endef define Package/turris-mox-devel-firmware TITLE:=Data files for nor-update (development version) - DEPENDS:=+turris-nor-update +rescue-image +u-boot-mox @TARGET_mvebu_cortexa53_DEVICE_cznic-mox + DEPENDS:=+turris-nor-update +rescue-image +mox-a53-firmware @TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox PROVIDES:=turris-nor-update-devel-firmware - VERSION:=0.1 + VERSION:=1.0 RELEASE:=1 endef diff --git a/hardware/mox/mox-firmware/files/secure-firmware-devel.bin b/hardware/mox/mox-firmware/files/secure-firmware-devel.bin index 1a3586515f..2f367dde00 100644 Binary files a/hardware/mox/mox-firmware/files/secure-firmware-devel.bin and b/hardware/mox/mox-firmware/files/secure-firmware-devel.bin differ diff --git a/hardware/mox/mox-firmware/files/secure-firmware.bin b/hardware/mox/mox-firmware/files/secure-firmware.bin index 9dc09f319b..2f367dde00 100644 Binary files a/hardware/mox/mox-firmware/files/secure-firmware.bin and b/hardware/mox/mox-firmware/files/secure-firmware.bin differ diff --git a/hardware/mox/mox-firmware/files/uboot b/hardware/mox/mox-firmware/files/uboot index 7ac62dcaac..fa39b18753 100644 Binary files a/hardware/mox/mox-firmware/files/uboot and b/hardware/mox/mox-firmware/files/uboot differ diff --git a/hardware/mox/mox-otp/Makefile b/hardware/mox/mox-otp/Makefile index 6e6c7d394e..a0d1297498 100644 --- a/hardware/mox/mox-otp/Makefile +++ b/hardware/mox/mox-otp/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +## Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mox-otp -PKG_VERSION:=0.3 -PKG_RELEASE:=1 +PKG_VERSION:=0.3.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/mox-otp.git -PKG_MIRROR_HASH:=22e9aea11e7d1a49d0e3cd1ac06c94a0dfd5bfb67d3ec9a33ad8ee0affdc2d32 +PKG_MIRROR_HASH:=3e10093edb08c82f3aeff9d95ce18ca4a391d726df5dc85a4fbb56d7957cf3de PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -28,8 +28,7 @@ define Package/mox-otp URL:=https://gitlab.nic.cz/turris/mox-otp PROVIDES:=turris-otp DEPENDS:=+python3-light - DEPENDS+=@TARGET_mvebu_cortexa53_DEVICE_cznic-mox - VARIANT:=python3 + DEPENDS+=@TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox endef define Package/mox-otp/description diff --git a/hardware/mox/mox-pkcs11/Makefile b/hardware/mox/mox-pkcs11/Makefile index 3bb5b5dee7..b053c0abb0 100644 --- a/hardware/mox/mox-pkcs11/Makefile +++ b/hardware/mox/mox-pkcs11/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mox-pkcs11 PKG_VERSION:=0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/mox-pkcs11.git @@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/package.mk define Package/mox-pkcs11 TITLE:=MOX PKCS11 - DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic-mox +libopenssl + DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox +libopenssl endef define Package/mox-pkcs11/description diff --git a/hardware/mox/mox-rainbow-backend/Makefile b/hardware/mox/mox-rainbow-backend/Makefile new file mode 100644 index 0000000000..ff77d0e480 --- /dev/null +++ b/hardware/mox/mox-rainbow-backend/Makefile @@ -0,0 +1,41 @@ +# +## Copyright (C) 2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# +## This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mox-rainbow-backend +PKG_VERSION:=0.1.1 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/rainbow-ng.git +PKG_MIRROR_HASH:=83f86b7c52862f4fcada855b52f70834dbcf4fccab0885348e9a35a3404b8492 +PKG_SOURCE_VERSION:=v$(PKG_VERSION) + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/mox-rainbow-backend + TITLE:=mox-rainbow-backend + DEPENDS:=\ + @TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox \ + +kmod-ledtrig-activity \ + +rainbow-animator \ + +python3-uci + PROVIDES:=rainbow-backend +endef + +Build/Compile:=: + +define Package/mox-rainbow-backend/install + cd $(PKG_BUILD_DIR); make mox-install DESTDIR=$(1) +endef + +$(eval $(call BuildPackage,mox-rainbow-backend)) diff --git a/hardware/mox/mox-rainbow-backend/patches/compatibility.patch b/hardware/mox/mox-rainbow-backend/patches/compatibility.patch new file mode 100644 index 0000000000..369fb4cfb0 --- /dev/null +++ b/hardware/mox/mox-rainbow-backend/patches/compatibility.patch @@ -0,0 +1,87 @@ +diff --git a/backend/mox/backend.sh b/backend/mox/backend.sh +index cbaad82..51ba510 100644 +--- a/backend/mox/backend.sh ++++ b/backend/mox/backend.sh +@@ -55,13 +55,13 @@ set_led() { + + # We have to disable trigger first to make sure that changes are correctly + # applied and not modified by this in the meantime. +- echo "none" > "$SYSFS/trigger" +- echo "$brightness" > "$SYSFS/brightness" ++ [ ! -e "$SYSFS/trigger" ] || echo "none" > "$SYSFS/trigger" ++ [ ! -e "$SYSFS/brightness" ] || echo "$brightness" > "$SYSFS/brightness" + if [ "$trigger" = "activity" ]; then + apply_activity "$led" $mode_args "$@" \ + || echo "Warning: activity setup failed for: $led" >&2 + else +- echo "$trigger" > "$SYSFS/trigger" ++ [ ! -e "$SYSFS/trigger" ] || echo "$trigger" > "$SYSFS/trigger" + fi + } + +diff --git a/backend/omnia/backend.sh b/backend/omnia/backend.sh +index 0eeab08..035133c 100644 +--- a/backend/omnia/backend.sh ++++ b/backend/omnia/backend.sh +@@ -42,7 +42,7 @@ preapply() { + brightness_level="$(brightness)" + # The full range is only 0-100 but that is good enough so we don't adjust + # more. We just loose the precision on Omnia but who can see it anyway. +- echo "$((brightness_level * 100 / 255))" > "$SYSFS/brightness" ++ [ ! -e "$SYSFS/brightness" ] || echo "$((brightness_level * 100 / 255))" > "$SYSFS/brightness" + } + + set_led() { +@@ -95,14 +95,14 @@ set_led() { + sysfs="$(led2sysfs "$led")" + # We have to disable trigger first to make sure that changes are correctly + # applied and not modified by this in the meantime. +- echo "none" > "$sysfs/trigger" +- echo "$brightness" > "$sysfs/brightness" +- echo "$r $g $b" > "$sysfs/multi_intensity" ++ [ ! -e "$sysfs/trigger" ] || echo "none" > "$sysfs/trigger" ++ [ ! -e "$sysfs/brightness" ] || echo "$brightness" > "$sysfs/brightness" ++ [ ! -e "$sysfs/multi_intensity" ] || echo "$r $g $b" > "$sysfs/multi_intensity" + if [ "$trigger" = "activity" ]; then + apply_activity "$led" "$@" \ + || echo "Warning: activity setup failed for: $led" >&2 + else +- echo "$trigger" > "$sysfs/trigger" ++ [ ! -e "$sysfs/trigger" ] || echo "$trigger" > "$sysfs/trigger" + fi + } + +diff --git a/backend/turris1x/backend.sh b/backend/turris1x/backend.sh +index 4744928..f1a614d 100644 +--- a/backend/turris1x/backend.sh ++++ b/backend/turris1x/backend.sh +@@ -47,8 +47,8 @@ preapply() { + if [ $brightness_level = 8 ]; then + brightness_level=7 + fi +- echo 0 2 4 8 16 32 64 255 > $SYSFS/brightness_values +- echo $brightness_level > $SYSFS/brightness_level ++ [ ! -e $SYSFS/brightness_values ] || echo 0 2 4 8 16 32 64 255 > $SYSFS/brightness_values ++ [ ! -e $SYSFS/brightness_level ] || echo $brightness_level > $SYSFS/brightness_level + } + + set_led() { +@@ -91,14 +91,14 @@ set_led() { + sysfs="$(led2sysfs "$led")" + # We have to disable trigger first to make sure that changes are correctly + # applied and not modified by this in the meantime. +- echo "none" > "$sysfs/trigger" +- echo "$brightness" > "$sysfs/brightness" +- echo "$r $g $b" > "$sysfs/multi_intensity" ++ [ ! -e "$sysfs/trigger" ] || echo "none" > "$sysfs/trigger" ++ [ ! -e "$sysfs/brightness" ] || echo "$brightness" > "$sysfs/brightness" ++ [ ! -e "$sysfs/multi_intensity" ] || echo "$r $g $b" > "$sysfs/multi_intensity" + if [ "$trigger" = "activity" ]; then + apply_activity "$led" "$@" \ + || echo "Warning: activity setup failed for: $led" >&2 + else +- echo "$trigger" > "$sysfs/trigger" ++ [ ! -e "$sysfs/trigger" ] || echo "$trigger" > "$sysfs/trigger" + fi + } + diff --git a/hardware/mox/mox-support/Makefile b/hardware/mox/mox-support/Makefile index b91cafc200..dad3b88464 100644 --- a/hardware/mox/mox-support/Makefile +++ b/hardware/mox/mox-support/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +## Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -9,25 +9,25 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mox-support PKG_VERSION:=2.3.0 -PKG_RELEASE:=4 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC include $(INCLUDE_DIR)/package.mk define Package/mox-generic-support TITLE:=Generic MOX support package - DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic-mox \ + DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox \ +mtd +kmod-gpio-button-hotplug +mox-dtb endef define Package/mox-support TITLE:=MOX support package - DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic-mox +mox-generic-support + DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox +mox-generic-support endef define Package/shield-support TITLE:=Shield support package - DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic-mox +mox-generic-support \ + DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox +mox-generic-support \ +pkglists +turris-nor-update +turris-mox-firmware PROVIDES:=mox-support CONFLICTS:=mox-support @@ -61,9 +61,6 @@ define Package/mox-support/install $(INSTALL_BIN) ./files/mox_autosetup $(1)/usr/share/mox $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/init $(1)/etc/init.d/mox_autosetup - $(INSTALL_DIR) $(1)/lib/firmware/mrvl/ - $(INSTALL_DATA) ./files/sdsd8997_combo_v4.bin $(1)/lib/firmware/mrvl - ln -s sdsd8997_combo_v4.bin $(1)/lib/firmware/mrvl/sd8997_uapsta.bin $(INSTALL_DIR) $(1)/etc/hotplug.d/button $(INSTALL_DATA) ./files/reset_btn $(1)/etc/hotplug.d/button/mox_reset endef @@ -79,7 +76,7 @@ define Package/shield-support/install $(INSTALL_BIN) ./files/enable_sentinel $(1)/etc/uci-defaults/10_sentinel-enable $(INSTALL_BIN) ./files/enable_updater $(1)/etc/uci-defaults/10_updater-enable $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d - $(INSTALL_DATA) ./files/lighttpd-reforis-only.conf $(1)/etc/lighttpd/conf.d/reforis-redirect.conf + $(INSTALL_DATA) ./files/lighttpd-reforis-only.conf $(1)/etc/lighttpd/conf.d/60-reforis-redirect.conf $(INSTALL_DIR) $(1)/etc/hotplug.d/button $(INSTALL_DATA) ./files/shield_reset_btn $(1)/etc/hotplug.d/button/mox_reset endef diff --git a/hardware/mox/mox-support/files/dtb b/hardware/mox/mox-support/files/dtb deleted file mode 100644 index 4e687665a2..0000000000 Binary files a/hardware/mox/mox-support/files/dtb and /dev/null differ diff --git a/hardware/mox/mox-support/files/mox_autosetup b/hardware/mox/mox-support/files/mox_autosetup index 67eb6ca8e8..bb02000947 100644 --- a/hardware/mox/mox-support/files/mox_autosetup +++ b/hardware/mox/mox-support/files/mox_autosetup @@ -8,15 +8,15 @@ if [ \! -f /etc/mox_modules ]; then uci delete network.lan uci delete network.wan - lans="$(echo $(cd /sys/class/net/; ls -d lan* 2> /dev/null))" + lans="$(cd /sys/class/net/; echo lan* 2> /dev/null)" wan_if="" lan_if="" lan_mac="$(cat /sys/class/net/eth1/address)" # If we have SFP, it is definitely WAN - if expr "$modules" : '.*sfp.*' > /dev/null; then - wan_if=eth1 - lan_if="eth0 $lans" + if expr "$modules" : '.*sfp.*' > /dev/null && [ -z "$lans" ]; then + wan_if=sfp + lan_if="eth0" # If we have switch, then CPU port is obviously WAN elif expr "$modules" : '.*topaz.*' > /dev/null || expr "$modules" : '.*peridot.*' > /dev/null; then @@ -30,7 +30,7 @@ if [ \! -f /etc/mox_modules ]; then fi uci set network.wan=interface - uci set network.wan.ifname=$wan_if + uci set network.wan.ifname="$wan_if" uci set network.wan.proto=none uci set network.lan=interface @@ -43,7 +43,7 @@ if [ \! -f /etc/mox_modules ]; then # Try dhcpp on LAN after interfaces settle a little bit sleep 5 - if udhcpc -fqnR -i br-lan; then + if [ -z "$wan_if" ] && udhcpc -fqnR -i br-lan; then uci set network.lan.proto=dhcp uci set network.lan._turris_mode=unmanaged else diff --git a/hardware/mox/mox-support/files/sdsd8997_combo_v4.bin b/hardware/mox/mox-support/files/sdsd8997_combo_v4.bin deleted file mode 100644 index d278ffd043..0000000000 Binary files a/hardware/mox/mox-support/files/sdsd8997_combo_v4.bin and /dev/null differ diff --git a/hardware/mox/mox-uboot/Makefile b/hardware/mox/mox-uboot/Makefile deleted file mode 100644 index d6ebe5c7ea..0000000000 --- a/hardware/mox/mox-uboot/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -# -## Copyright (C) 2018-2021 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:=mox-uboot -PKG_VERSION:=2021-04-rc1 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/mox-boot-builder.git -PKG_MIRROR_HASH:=960e37c522a48d994b4ee99a2f039ccd3dc26fda1e17027929c90bab344844f1 -PKG_SOURCE_VERSION:=b8928b294a863f2c698c4b230e598f984828a2ad - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-2.0-or-later -PKG_LICENSE_FILES:=README - -include $(INCLUDE_DIR)/package.mk - -define Package/mox-uboot - TITLE:=U-boot for Turris MOX - DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic-mox - PROVIDES:=u-boot-mox -endef - -define Build/Compile - cd $(PKG_BUILD_DIR); make CROSS_COMPILE=$(TARGET_CROSS) a53-firmware.bin -endef - -define Package/mox-uboot/install - $(INSTALL_DIR) $(1)/usr/share/mox - $(INSTALL_DATA) $(PKG_BUILD_DIR)/a53-firmware.bin $(1)/usr/share/mox/uboot-devel -endef - -$(eval $(call BuildPackage,mox-uboot)) diff --git a/hardware/omnia/omnia-firmware/Makefile b/hardware/omnia/omnia-firmware/Makefile index 022199c4f0..bdca186820 100644 --- a/hardware/omnia/omnia-firmware/Makefile +++ b/hardware/omnia/omnia-firmware/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-omnia-firmware -PKG_VERSION:=1.1 -PKG_RELEASE:=1 +PKG_VERSION:=1.2.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/hardware/omnia/omnia-firmware/files/config.sh b/hardware/omnia/omnia-firmware/files/config.sh index 02a354c6f5..95dfc8c005 100644 --- a/hardware/omnia/omnia-firmware/files/config.sh +++ b/hardware/omnia/omnia-firmware/files/config.sh @@ -2,36 +2,7 @@ UBOOT_PART="mtd0" RESCUE_PART="mtd1" UBOOT_DEVEL="/usr/share/omnia/uboot-devel" -have_old_uboot() { - if fw_printenv -c /usr/share/nor-update/old-uboot.config 2>&1 | grep -q 'Bad CRC, using default environment'; then - return 0 - else - return 1 - fi -} - -board_pre_hook() { - UPDATE_UENV="" - have_old_uboot || return 0 - v_echo "Storing old U-boot environment to be preserved" - UPDATE_UENV="/usr/share/nor-update/uenv.backup" - [ \! -e "$UPDATE_UENV" ] || die "You already have a backup of U-Boot environment in $UPDATE_UENV, clean it up first!" - fw_printenv -c /usr/share/nor-update/old-fwenv.config 2>&1 > "$UPDATE_UENV" - # Replace deprecated btrload command with load, see comment bellow - # btrload mmc 0 0x02000000 boot/dtb @ => load mmc 0 0x02000000 @/boot/dtb - sed -i 's|btr\(load[[:blank:]]\+[^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+[[:blank:]]\+\)\([^[:blank:]]\+\)[[:blank:]]\+\([^[:blank:];]\+\)|\1\3/\2|g' "$UPDATE_UENV" -} - -board_post_hook() { - if [ "$UPDATE_UENV" ]; then - if fw_setenv -c /usr/share/nor-update/new-fwenv.config -s "$UPDATE_UENV"; then - echo "Your U-Boot environment was migrated to new U-Boot" - echo "You can find it in $UPDATE_UENV" - echo "You can reset it via 'fw_setenv bootcmd \"env default -f -a; saveenv; reset\"'" - else - echo "Migration of your U-Boot environment failed." - echo "You can find it in $UPDATE_UENV" - echo "Set whatever you need manually via 'fw_setenv'" - fi - fi +board_ubootenv_hook() { + sed -i 's|btr\(load[[:blank:]]\+[^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+[[:blank:]]\+\)\([^[:blank:]]\+\)[[:blank:]]\+\([^[:blank:];]\+\)|\1\3/\2|g' \ + "$BACKUP_UBOOT_ENV" } diff --git a/hardware/omnia/omnia-firmware/files/new-fwenv.config b/hardware/omnia/omnia-firmware/files/new-fwenv.config deleted file mode 100644 index 13e445a7e3..0000000000 --- a/hardware/omnia/omnia-firmware/files/new-fwenv.config +++ /dev/null @@ -1 +0,0 @@ -/dev/mtd0 0xf0000 0x10000 0x10000 diff --git a/hardware/omnia/omnia-firmware/files/old-fwenv.config b/hardware/omnia/omnia-firmware/files/old-fwenv.config deleted file mode 100644 index a1b2118c86..0000000000 --- a/hardware/omnia/omnia-firmware/files/old-fwenv.config +++ /dev/null @@ -1 +0,0 @@ -/dev/mtd0 0xC0000 0x10000 0x40000 diff --git a/hardware/omnia/omnia-firmware/files/rescue b/hardware/omnia/omnia-firmware/files/rescue index 3dac52b341..9dc6e8a61c 100644 Binary files a/hardware/omnia/omnia-firmware/files/rescue and b/hardware/omnia/omnia-firmware/files/rescue differ diff --git a/hardware/omnia/omnia-firmware/files/uboot b/hardware/omnia/omnia-firmware/files/uboot index cc7234da0e..d382a3fc65 100644 Binary files a/hardware/omnia/omnia-firmware/files/uboot and b/hardware/omnia/omnia-firmware/files/uboot differ diff --git a/hardware/omnia/omnia-mcutool/Makefile b/hardware/omnia/omnia-mcutool/Makefile index 681ed08e4f..dc89749fd4 100644 --- a/hardware/omnia/omnia-mcutool/Makefile +++ b/hardware/omnia/omnia-mcutool/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=omnia-mcutool PKG_VERSION:=0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/omnia-mcutool.git diff --git a/hardware/omnia/omnia-rainbow-backend/Makefile b/hardware/omnia/omnia-rainbow-backend/Makefile new file mode 100644 index 0000000000..c17ca8afff --- /dev/null +++ b/hardware/omnia/omnia-rainbow-backend/Makefile @@ -0,0 +1,40 @@ +# +## Copyright (C) 2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# +## This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=omnia-rainbow-backend +PKG_VERSION:=0.1.1 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/rainbow-ng.git +PKG_MIRROR_HASH:=9d9e126949dd16bd52cc9fe520c5e834a637cbdb124c24d41589565cddda8073 +PKG_SOURCE_VERSION:=v$(PKG_VERSION) + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/omnia-rainbow-backend + TITLE:=omnia-rainbow-backend + DEPENDS:=\ + @TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia \ + +rainbow-button-sync \ + +rainbow-animator + PROVIDES:=rainbow-backend +endef + +Build/Compile:=: + +define Package/omnia-rainbow-backend/install + cd $(PKG_BUILD_DIR); make omnia-install DESTDIR=$(1) +endef + +$(eval $(call BuildPackage,omnia-rainbow-backend)) diff --git a/hardware/omnia/omnia-rainbow-backend/patches/0001-backend-omnia-turris1x-include-backwards-compatibili.patch b/hardware/omnia/omnia-rainbow-backend/patches/0001-backend-omnia-turris1x-include-backwards-compatibili.patch new file mode 100644 index 0000000000..1a4278ca4c --- /dev/null +++ b/hardware/omnia/omnia-rainbow-backend/patches/0001-backend-omnia-turris1x-include-backwards-compatibili.patch @@ -0,0 +1,38 @@ +From 3a9608e38e4dc0e5e1f0e94a3c2c80dc8e223f52 Mon Sep 17 00:00:00 2001 +From: Josef Schlehofer +Date: Thu, 20 Oct 2022 16:05:16 +0200 +Subject: [PATCH] backend/{omnia,turris1x}: include backwards compatibility + script + +--- + backend/omnia/backend.sh | 1 + + backend/turris1x/backend.sh | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/backend/omnia/backend.sh b/backend/omnia/backend.sh +index 0eeab08..1f04e30 100644 +--- a/backend/omnia/backend.sh ++++ b/backend/omnia/backend.sh +@@ -9,6 +9,7 @@ LEDS="power lan-0 lan-1 lan-2 lan-3 lan-4 wan wlan-1 wlan-2 wlan-3 indicator-1 i + SYSFS="/sys/class/leds/rgb:power/device" + + loadsrc led_activity ++loadsrc compat + + led2sysfs() { + local led="$1" +diff --git a/backend/turris1x/backend.sh b/backend/turris1x/backend.sh +index 4744928..d973ed3 100644 +--- a/backend/turris1x/backend.sh ++++ b/backend/turris1x/backend.sh +@@ -9,6 +9,7 @@ LEDS="wan lan-1 lan-2 lan-3 lan-4 lan-5 wlan power" + SYSFS="/sys/class/leds/rgb:wan/device" + + loadsrc led_activity ++loadsrc compat + + led2sysfs() { + local led="$1" +-- +2.34.1 + diff --git a/hardware/omnia/omnia-rainbow-backend/patches/compatibility.patch b/hardware/omnia/omnia-rainbow-backend/patches/compatibility.patch new file mode 100644 index 0000000000..369fb4cfb0 --- /dev/null +++ b/hardware/omnia/omnia-rainbow-backend/patches/compatibility.patch @@ -0,0 +1,87 @@ +diff --git a/backend/mox/backend.sh b/backend/mox/backend.sh +index cbaad82..51ba510 100644 +--- a/backend/mox/backend.sh ++++ b/backend/mox/backend.sh +@@ -55,13 +55,13 @@ set_led() { + + # We have to disable trigger first to make sure that changes are correctly + # applied and not modified by this in the meantime. +- echo "none" > "$SYSFS/trigger" +- echo "$brightness" > "$SYSFS/brightness" ++ [ ! -e "$SYSFS/trigger" ] || echo "none" > "$SYSFS/trigger" ++ [ ! -e "$SYSFS/brightness" ] || echo "$brightness" > "$SYSFS/brightness" + if [ "$trigger" = "activity" ]; then + apply_activity "$led" $mode_args "$@" \ + || echo "Warning: activity setup failed for: $led" >&2 + else +- echo "$trigger" > "$SYSFS/trigger" ++ [ ! -e "$SYSFS/trigger" ] || echo "$trigger" > "$SYSFS/trigger" + fi + } + +diff --git a/backend/omnia/backend.sh b/backend/omnia/backend.sh +index 0eeab08..035133c 100644 +--- a/backend/omnia/backend.sh ++++ b/backend/omnia/backend.sh +@@ -42,7 +42,7 @@ preapply() { + brightness_level="$(brightness)" + # The full range is only 0-100 but that is good enough so we don't adjust + # more. We just loose the precision on Omnia but who can see it anyway. +- echo "$((brightness_level * 100 / 255))" > "$SYSFS/brightness" ++ [ ! -e "$SYSFS/brightness" ] || echo "$((brightness_level * 100 / 255))" > "$SYSFS/brightness" + } + + set_led() { +@@ -95,14 +95,14 @@ set_led() { + sysfs="$(led2sysfs "$led")" + # We have to disable trigger first to make sure that changes are correctly + # applied and not modified by this in the meantime. +- echo "none" > "$sysfs/trigger" +- echo "$brightness" > "$sysfs/brightness" +- echo "$r $g $b" > "$sysfs/multi_intensity" ++ [ ! -e "$sysfs/trigger" ] || echo "none" > "$sysfs/trigger" ++ [ ! -e "$sysfs/brightness" ] || echo "$brightness" > "$sysfs/brightness" ++ [ ! -e "$sysfs/multi_intensity" ] || echo "$r $g $b" > "$sysfs/multi_intensity" + if [ "$trigger" = "activity" ]; then + apply_activity "$led" "$@" \ + || echo "Warning: activity setup failed for: $led" >&2 + else +- echo "$trigger" > "$sysfs/trigger" ++ [ ! -e "$sysfs/trigger" ] || echo "$trigger" > "$sysfs/trigger" + fi + } + +diff --git a/backend/turris1x/backend.sh b/backend/turris1x/backend.sh +index 4744928..f1a614d 100644 +--- a/backend/turris1x/backend.sh ++++ b/backend/turris1x/backend.sh +@@ -47,8 +47,8 @@ preapply() { + if [ $brightness_level = 8 ]; then + brightness_level=7 + fi +- echo 0 2 4 8 16 32 64 255 > $SYSFS/brightness_values +- echo $brightness_level > $SYSFS/brightness_level ++ [ ! -e $SYSFS/brightness_values ] || echo 0 2 4 8 16 32 64 255 > $SYSFS/brightness_values ++ [ ! -e $SYSFS/brightness_level ] || echo $brightness_level > $SYSFS/brightness_level + } + + set_led() { +@@ -91,14 +91,14 @@ set_led() { + sysfs="$(led2sysfs "$led")" + # We have to disable trigger first to make sure that changes are correctly + # applied and not modified by this in the meantime. +- echo "none" > "$sysfs/trigger" +- echo "$brightness" > "$sysfs/brightness" +- echo "$r $g $b" > "$sysfs/multi_intensity" ++ [ ! -e "$sysfs/trigger" ] || echo "none" > "$sysfs/trigger" ++ [ ! -e "$sysfs/brightness" ] || echo "$brightness" > "$sysfs/brightness" ++ [ ! -e "$sysfs/multi_intensity" ] || echo "$r $g $b" > "$sysfs/multi_intensity" + if [ "$trigger" = "activity" ]; then + apply_activity "$led" "$@" \ + || echo "Warning: activity setup failed for: $led" >&2 + else +- echo "$trigger" > "$sysfs/trigger" ++ [ ! -e "$sysfs/trigger" ] || echo "$trigger" > "$sysfs/trigger" + fi + } + diff --git a/hardware/omnia/omnia-rainbow/Makefile b/hardware/omnia/omnia-rainbow/Makefile deleted file mode 100644 index a8bf846837..0000000000 --- a/hardware/omnia/omnia-rainbow/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# -## Copyright (C) 2016-2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) -# -## This is free software, licensed under the GNU General Public License v3. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=omnia-rainbow -PKG_VERSION:=3.1 -PKG_RELEASE:=2 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/rainbow_omnia.git -PKG_MIRROR_HASH:=34b82a94837caf928f472cf3da82d8e17a1bdfcd503532bede0cacb7bac964c4 -PKG_SOURCE_VERSION:=d4ded015bd5a400059ea20f2234a311e749dc519 - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=LICENSE - -include $(INCLUDE_DIR)/package.mk - -define Package/omnia-rainbow - TITLE:=omnia-rainbow - URL:=https://gitlab.nic.cz/turris/rainbow_omnia - PROVIDES:=turris-rainbow - DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia -endef - -define Package/omnia-rainbow/conffiles -/etc/config/rainbow -endef - -define Build/Compile - $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) -endef - -define Package/omnia-rainbow/install - $(INSTALL_DIR) $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/rainbow $(1)/usr/bin/ - $(INSTALL_DIR) $(1)/etc/init.d/ - $(INSTALL_BIN) ./files/rainbow.init $(1)/etc/init.d/rainbow - $(INSTALL_DIR) $(1)/etc/config/ - $(INSTALL_DATA) ./files/rainbow.config $(1)/etc/config/rainbow - $(INSTALL_DIR) $(1)/etc/cron.d - $(INSTALL_DATA) ./files/rainbow.cron $(1)/etc/cron.d/rainbow - $(INSTALL_BIN) ./files/rainbow_button_sync.sh $(1)/usr/bin/rainbow_button_sync.sh -endef - -define Package/omnia-rainbow/postinst -#!/bin/sh -[ -n "$$IPKG_INSTROOT" ] || { - /etc/init.d/rainbow enable - /etc/init.d/rainbow restart -} -endef - -define Package/omnia-rainbow/prerm -#!/bin/sh -[ -n "$$IPKG_INSTROOT" ] || { - /etc/init.d/rainbow stop - /etc/init.d/rainbow disable - rainbow all auto white -} -endef - -$(eval $(call BuildPackage,omnia-rainbow)) diff --git a/hardware/omnia/omnia-rainbow/files/rainbow.config b/hardware/omnia/omnia-rainbow/files/rainbow.config deleted file mode 100644 index 88122fcf41..0000000000 --- a/hardware/omnia/omnia-rainbow/files/rainbow.config +++ /dev/null @@ -1,25 +0,0 @@ -# You can set all the leds at once. -config led 'all' - option color 'white' - option status 'auto' - -# Any other config will overwrite the value -#config led 'pwr' -# option color 'FF0066' -# option status 'auto' -# -#config led 'lan0' -# option color 'FFFF00' -# option status 'auto' -# -#config led 'wan' -# option color 'green' -# option status 'auto' -# -#config led 'pci1' -# option color 'blue' -# option status 'auto' -# -# Available LEDs: all, pwr, lan0, lan1, lan2, lan3, wan, pci1, pci2, pci3, usr1, usr2 -# Available color: white, black, red, green, blue, or use hex code of color like: FFFF00 -# For more information: rainbow --help diff --git a/hardware/omnia/omnia-rainbow/files/rainbow.cron b/hardware/omnia/omnia-rainbow/files/rainbow.cron deleted file mode 100644 index cb4d5923d0..0000000000 --- a/hardware/omnia/omnia-rainbow/files/rainbow.cron +++ /dev/null @@ -1,2 +0,0 @@ -MAILTO="" -* * * * * root /usr/bin/rainbow_button_sync.sh diff --git a/hardware/omnia/omnia-rainbow/files/rainbow.init b/hardware/omnia/omnia-rainbow/files/rainbow.init deleted file mode 100644 index 1f1d48059b..0000000000 --- a/hardware/omnia/omnia-rainbow/files/rainbow.init +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh /etc/rc.common - -# Start at the end, so the colors change after the boot is done. -START=99 -STOP=00 - -PID_FILE="/var/run/rainbow.pid" - -reload() { - # Set the colors based on user preferrences - uci show rainbow | sed -ne 's/rainbow\.\([^.]*\)=led/\1/p' | sort | while read SECTION ; do - STATUS=$(uci get rainbow.$SECTION.status) - COLOR=$(uci get rainbow.$SECTION.color) - rainbow $SECTION $STATUS $COLOR - done -} - -restart() { - rainbow all enable green - sleep 1 - reload -} - -start() { - ( - # Signal the boot is finished - rainbow all enable blue - sleep 1 - rainbow all enable green - sleep 1 - reload - # Resume last intensity settings - rainbow intensity $(cat /etc/rainbow.magic) - ) & -} - -stop() { - # Reset to the default, so a reboot can be recognized. - rainbow all enable white -} diff --git a/hardware/omnia/omnia-rainbow/files/rainbow_button_sync.sh b/hardware/omnia/omnia-rainbow/files/rainbow_button_sync.sh deleted file mode 100755 index 5f30d9f3cb..0000000000 --- a/hardware/omnia/omnia-rainbow/files/rainbow_button_sync.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -MAGIC_FILE="/etc/rainbow.magic" - -# Get actual intensity -ACT_INTENSITY=$(rainbow get intensity) - -# Get value from magic file -[ -f "$MAGIC_FILE" ] || echo 0 > "$MAGIC_FILE" -LAST_VALUE=$(cat "$MAGIC_FILE") - -# Compare them and if last value is different from stored one update it -if [ "$ACT_INTENSITY" != "$LAST_VALUE" ]; then - echo $ACT_INTENSITY > "$MAGIC_FILE" -fi diff --git a/hardware/omnia/omnia-support/Makefile b/hardware/omnia/omnia-support/Makefile index 58acfbd7c8..d8dc285d0d 100644 --- a/hardware/omnia/omnia-support/Makefile +++ b/hardware/omnia/omnia-support/Makefile @@ -3,7 +3,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=omnia-support PKG_VERSION:=3.4 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/hardware/omnia/omnia-uboot/Makefile b/hardware/omnia/omnia-uboot/Makefile index ebf1179fa9..d4164030f8 100644 --- a/hardware/omnia/omnia-uboot/Makefile +++ b/hardware/omnia/omnia-uboot/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2018-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2018-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,14 +8,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=omnia-uboot -PKG_VERSION:=2019-07.1 -PKG_RELEASE:=1 +PKG_VERSION:=$(if $(DUMP),x,$(shell sed -ne 's#PKG_VERSION:=##p' $(TOPDIR)/package/boot/uboot-mvebu/Makefile)) +PKG_RELEASE:=$(AUTORELEASE) -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/turris-omnia-uboot.git -PKG_MIRROR_HASH:=aeab20bcc0f36f57ca95fb4bc093d49e39c04fe50ab88bcd8ee280739acacea7 -PKG_SOURCE_DATE:=2020-09-07 -PKG_SOURCE_VERSION:=6dd804d78fdcd775f6eeebe0aa0527d6761a115f +PKG_BUILD_DEPENDS:=uboot-mvebu PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-2.0-or-later @@ -24,20 +20,26 @@ PKG_LICENSE_FILES:=README include $(INCLUDE_DIR)/package.mk define Package/omnia-uboot - TITLE:=u-boot-omnia + TITLE:=U-boot for Turris Omnia DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia PROVIDES:=u-boot-omnia endef +define Package/omnia-uboot/description + U-boot image for Turris Omnia +endef + +define Build/Configure + true +endef + define Build/Compile - sed -i '/DCONFIG_KWB_SECURE/ d' $(PKG_BUILD_DIR)/tools/Makefile - cd $(PKG_BUILD_DIR); make CROSS_COMPILE=$(TARGET_CROSS) turris_omnia_defconfig - cd $(PKG_BUILD_DIR); make CROSS_COMPILE=$(TARGET_CROSS) u-boot-spl.kwb OMNIA_OLD_SPL=1 + true endef define Package/omnia-uboot/install $(INSTALL_DIR) $(1)/usr/share/omnia - $(INSTALL_DATA) $(PKG_BUILD_DIR)/u-boot-spl.kwb $(1)/usr/share/omnia/uboot-devel + $(CP) $(STAGING_DIR_IMAGE)/omnia-u-boot-spl.kwb $(1)/usr/share/omnia/uboot-devel endef $(eval $(call BuildPackage,omnia-uboot)) diff --git a/hardware/rainbow/Makefile b/hardware/rainbow/Makefile new file mode 100644 index 0000000000..64d641869c --- /dev/null +++ b/hardware/rainbow/Makefile @@ -0,0 +1,108 @@ +# +## Copyright (C) 2022 CZ.NIC z.s.p.o. (http://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:=rainbow +PKG_VERSION:=0.1.1 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/rainbow-ng.git +PKG_MIRROR_HASH:=b0916c6e666e57c0d9fbf0faa10817ea14137d329edbc7750901004373011e12 +PKG_SOURCE_VERSION:=v$(PKG_VERSION) + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/Common + TITLE:=rainbow + DEPENDS:=@(TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia||TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x||TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox) + URL:=https://gitlab.nic.cz/turris/rainbow-ng +endef + +define Package/rainbow + $(call Package/Common) + DEPENDS+= +rainbow-backend +flock + PROVIDES:=turris-rainbow +endef + +define Package/rainbow-button-sync + $(call Package/Common) + TITLE+=-button-sync +endef + +define Package/rainbow-animator + $(call Package/Common) + TITLE+=-animator + DEPENDS+= +python3-base +endef + +define Package/rainbow/description + LEDs control on Turris Omnia, Mox and 1.x routers. +endef + +define Package/rainbow-button-sync/description + Button synchronization extension for Turris Rainbow. This is used to synchronize system configuration with hardware button. +endef + +define Package/rainbow-animator/description + Animation extension for Turris Rainbow. This is used to animate leds in case of missing or unusable kernel support. +endef + +define Package/rainbow/install + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/rainbow.init $(1)/etc/init.d/rainbow + $(INSTALL_DIR) $(1)/etc/config/ + touch $(1)/etc/config/rainbow + + cd $(PKG_BUILD_DIR); make rainbow-install DESTDIR=$(1) +endef + +define Package/rainbow-button-sync/install + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/rainbow-button-sync.init $(1)/etc/init.d/rainbow-button-sync + + cd $(PKG_BUILD_DIR); make button-sync-install DESTDIR=$(1) +endef + +define Package/rainbow-animator/install + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/rainbow-animator.init $(1)/etc/init.d/rainbow-animator + + cd $(PKG_BUILD_DIR); make animator-install DESTDIR=$(1) +endef + +define Package/rainbow/conffiles +/etc/config/rainbow +endef + +Build/Compile:=: + +define Package/rainbow/postinst +#!/bin/sh +[ -n "$$IPKG_INSTROOT" ] || { + /etc/init.d/rainbow enable 2>/dev/null || true + /etc/init.d/rainbow restart 2>/dev/null || true +} +endef + +define Package/rainbow/prerm +#!/bin/sh +[ -n "$$IPKG_INSTROOT" ] || { + /etc/init.d/rainbow stop + /etc/init.d/rainbow disable + rainbow all auto white +} +endef + +$(eval $(call BuildPackage,rainbow)) +$(eval $(call BuildPackage,rainbow-button-sync)) +$(eval $(call BuildPackage,rainbow-animator)) diff --git a/hardware/rainbow/files/rainbow-animator.init b/hardware/rainbow/files/rainbow-animator.init new file mode 100755 index 0000000000..d30759fcd4 --- /dev/null +++ b/hardware/rainbow/files/rainbow-animator.init @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common + +START=98 +STOP=01 + +USE_PROCD=1 + +reload_service() { + procd_send_signal "$(basename "$(readlink -f "$initscript")")" '*' SIGUSR2 +} + +extra_command "pause" "Pause animator loop" +pause() { + procd_send_signal "$(basename "$(readlink -f "$initscript")")" '*' SIGUSR1 +} + +start_service() { + config_load rainbow + config_get animation_ups "animation" "ups" "15" + + procd_open_instance rainbow + procd_set_param command /usr/libexec/rainbow/animator.py --ups "$animation_ups" + procd_set_param respawn 600 5 5 + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} diff --git a/hardware/rainbow/files/rainbow-button-sync.init b/hardware/rainbow/files/rainbow-button-sync.init new file mode 100755 index 0000000000..ab5ba0f1f2 --- /dev/null +++ b/hardware/rainbow/files/rainbow-button-sync.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common + +START=98 +STOP=01 + +USE_PROCD=1 + +start_service() { + procd_open_instance + procd_set_param command /usr/libexec/rainbow/button_sync.sh + procd_set_param respawn 600 5 5 + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} diff --git a/hardware/rainbow/files/rainbow.init b/hardware/rainbow/files/rainbow.init new file mode 100755 index 0000000000..356d49a0c4 --- /dev/null +++ b/hardware/rainbow/files/rainbow.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common + +# Start at the end, so the colors change after the boot is done. +START=99 +STOP=00 + +reload() { + rainbow reset -n +} + +restart() { + rainbow reset -a +} + +start() { + rainbow reset -a -b & +} + +stop() { + # Reset to the default, so a reboot can be recognized. + rainbow -p 100 -n shutdown all enable white +} diff --git a/hardware/rainbow/patches/0001-rainbow.sh-use-bash.patch b/hardware/rainbow/patches/0001-rainbow.sh-use-bash.patch new file mode 100644 index 0000000000..d1a5eab10e --- /dev/null +++ b/hardware/rainbow/patches/0001-rainbow.sh-use-bash.patch @@ -0,0 +1,23 @@ +From 56c097fef801fa0ec63c36a1de67488a0e084dee Mon Sep 17 00:00:00 2001 +From: Michal Vasilek +Date: Thu, 13 Oct 2022 18:02:13 +0200 +Subject: [PATCH] rainbow.sh: use bash + +color.sh sourced by rainbow uses many bash specific features +--- + rainbow/rainbow.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rainbow/rainbow.sh b/rainbow/rainbow.sh +index 4d60771..3578021 100755 +--- a/rainbow/rainbow.sh ++++ b/rainbow/rainbow.sh +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # SPDX-License-Identifier: GPL-3.0-or-later + # Copyright 2022, CZ.NIC z.s.p.o. (https://www.nic.cz/) +-- +2.38.0 + diff --git a/hardware/rescue-image/Makefile b/hardware/rescue-image/Makefile index 9b94643e8c..991e181b39 100644 --- a/hardware/rescue-image/Makefile +++ b/hardware/rescue-image/Makefile @@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rescue-image PKG_VERSION:=3.6.1 -PKG_RELEASE:=1 -BB_VERSION:=1.32.1 +PKG_RELEASE:=$(AUTORELEASE) +BB_VERSION:=1.33.2 PKG_SOURCE:=busybox-$(BB_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.busybox.net/downloads \ http://sources.buildroot.net -PKG_HASH:=9d57c4bd33974140fd4111260468af22856f12f5b5ef7c70c8d9b75c712a0dee +PKG_HASH:=6843ba7977081e735fa0fdb05893e3c002c8c5ad7c9c80da206e603cc0ac47e7 PKG_MAINTAINER:=Michal Hrusecky PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) -ROOTFS_INSTALL:=+libgcc +libc +libubox +mtd +libpthread +librt +libattr +libuuid +zlib +libblkid +liblzo +btrfs-progs +schnapps +dropbear +uboot-envtools +usign +cznic-repo-keys +libopenssl +libpcre +wget +libhavege +haveged +ROOTFS_INSTALL:=+libgcc +libc +libubox +mtd +libpthread +librt +libattr +libuuid +zlib +libblkid +liblzo +btrfs-progs +schnapps +dropbear +uboot-envtools +usign +cznic-repo-keys +libopenssl +libpcre +wget-ssl +libhavege +haveged PKG_BUILD_DEPENDS:=opkg/host mtd btrfs-progs schnapps wget cznic-repo-keys usign uboot-tools dropbear haveged KERNEL_BUILD_DIR:=$(PKG_BUILD_DIR)/kernel @@ -31,18 +31,18 @@ include $(INCLUDE_DIR)/quilt.mk include $(INCLUDE_DIR)/package.mk PATCH_DIR := $(PLATFORM_DIR)/patches$(if $(wildcard $(PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER)) -ifeq ($(CONFIG_TARGET_mvebu_cortexa53_DEVICE_cznic-mox),y) +ifeq ($(CONFIG_TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox),y) DEVICE := mox else ifeq ($(CONFIG_TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia),y) DEVICE := omnia else DEVICE := unknown endif -kernel_files=$(TOPDIR)/target/linux/$(BOARD)/files-$(KERNEL_PATCHVER)/. $(TOPDIR)/target/linux/generic/files/. +kernel_files=$(TOPDIR)/target/linux/$(BOARD)/files/. $(TOPDIR)/target/linux/generic/files/. define Package/rescue-image TITLE:=rescue-image - DEPENDS:=@(TARGET_mvebu_cortexa53_DEVICE_cznic-mox||TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia) + DEPENDS:=@(TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox||TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia) endef define Build/Prepare @@ -99,11 +99,11 @@ define Build/Compile $(STAGING_DIR_HOST)/bin/opkg --offline-root "$(PKG_BUILD_DIR)/rootfs" --force-depends install \{\} \; ;\ done rm -rf "$(PKG_BUILD_DIR)/rootfs"/usr/lib/opkg - $(KERNEL_MAKE) $(PKG_JOBS) silentoldconfig $(KERNELNAME) - cd $(LINUX_DIR); ./scripts/gen_initramfs_list.sh \ + $(KERNEL_MAKE) $(PKG_JOBS) oldconfig $(KERNELNAME) + cd $(LINUX_DIR); ./usr/gen_initramfs.sh \ -o "$(PKG_BUILD_DIR)"/kernel/linux-$(LINUX_VERSION)/arch/$(LINUX_KARCH)/boot/initrd.gz -u squash -g squash \ "$(PKG_BUILD_DIR)/rootfs" "$(PKG_BUILD_DIR)/rootfs.extra" - gzip -d "$(PKG_BUILD_DIR)"/kernel/linux-$(LINUX_VERSION)/arch/$(LINUX_KARCH)/boot/initrd.gz + cp "$(PKG_BUILD_DIR)"/kernel/linux-$(LINUX_VERSION)/arch/$(LINUX_KARCH)/boot/initrd.gz "$(PKG_BUILD_DIR)"/kernel/linux-$(LINUX_VERSION)/arch/$(LINUX_KARCH)/boot/initrd $(CP) "$(PKG_BUILD_DIR)"/rescue.its "$(PKG_BUILD_DIR)"/kernel/linux-$(LINUX_VERSION)/arch/$(LINUX_KARCH)/boot/rescue.its endef @@ -114,6 +114,7 @@ define Package/rescue-image/install "$(STAGING_DIR_HOST)"/bin/mkimage -f rescue.its $(1)/usr/share/rescue-image/image.fit xz -k9 -F lzma $(1)/usr/share/rescue-image/image.fit [ "`stat -c '%s' $(1)/usr/share/rescue-image/image.fit.lzma`" -lt 7340032 ] + [ "`stat -c '%s' $(1)/usr/share/rescue-image/image.fit.lzma`" -gt 1000000 ] endef $(eval $(call BuildPackage,rescue-image)) diff --git a/hardware/rescue-image/files/busybox-config b/hardware/rescue-image/files/busybox-config index 769556968b..9ccb40dca2 100644 --- a/hardware/rescue-image/files/busybox-config +++ b/hardware/rescue-image/files/busybox-config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Busybox version: 1.29.2 -# Wed Sep 19 14:55:01 2018 +# Busybox version: 1.33.2 +# Fri Feb 18 13:28:39 2022 # CONFIG_HAVE_DOT_CONFIG=y @@ -34,8 +34,8 @@ CONFIG_FEATURE_PREFER_APPLETS=y CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" # CONFIG_SELINUX is not set # CONFIG_FEATURE_CLEAN_UP is not set +# CONFIG_FEATURE_SYSLOG_INFO is not set # CONFIG_FEATURE_SYSLOG is not set -CONFIG_PLATFORM_LINUX=y # # Build Options @@ -54,6 +54,7 @@ CONFIG_EXTRA_LDFLAGS="" CONFIG_EXTRA_LDLIBS="" # CONFIG_USE_PORTABLE_CODE is not set CONFIG_STACK_OPTIMIZATION_386=y +# CONFIG_STATIC_LIBGCC is not set # # Installation Options ("make install" behavior) @@ -62,7 +63,7 @@ CONFIG_INSTALL_APPLET_SYMLINKS=y # CONFIG_INSTALL_APPLET_HARDLINKS is not set # CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set # CONFIG_INSTALL_APPLET_DONT is not set -CONFIG_INSTALL_SH_APPLET_SYMLINK=y +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set # CONFIG_INSTALL_SH_APPLET_HARDLINK is not set # CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set CONFIG_PREFIX="./_install" @@ -86,6 +87,7 @@ CONFIG_NO_DEBUG_LIB=y # CONFIG_FEATURE_USE_BSS_TAIL is not set CONFIG_FLOAT_DURATION=y # CONFIG_FEATURE_RTMINMAX is not set +# CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS is not set # CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y # CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set @@ -199,10 +201,16 @@ CONFIG_BASENAME=y CONFIG_CAT=y # CONFIG_FEATURE_CATN is not set # CONFIG_FEATURE_CATV is not set +# CONFIG_CHGRP is not set +# CONFIG_CHMOD is not set +# CONFIG_CHOWN is not set +# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +# CONFIG_CHROOT is not set # CONFIG_CKSUM is not set # CONFIG_COMM is not set CONFIG_CP=y # CONFIG_FEATURE_CP_LONG_OPTIONS is not set +# CONFIG_FEATURE_CP_REFLINK is not set # CONFIG_CUT is not set CONFIG_DATE=y CONFIG_FEATURE_DATE_ISOFMT=y @@ -230,15 +238,9 @@ CONFIG_EXPR_MATH_SUPPORT_64=y # CONFIG_FACTOR is not set CONFIG_FALSE=y # CONFIG_FOLD is not set -# CONFIG_FSYNC is not set CONFIG_HEAD=y CONFIG_FEATURE_FANCY_HEAD=y # CONFIG_HOSTID is not set -# CONFIG_CHGRP is not set -# CONFIG_CHMOD is not set -# CONFIG_CHOWN is not set -# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set -# CONFIG_CHROOT is not set # CONFIG_ID is not set # CONFIG_GROUPS is not set CONFIG_INSTALL=y @@ -290,7 +292,6 @@ CONFIG_SHRED=y # CONFIG_SHUF is not set CONFIG_SLEEP=y CONFIG_FEATURE_FANCY_SLEEP=y -CONFIG_FEATURE_FLOAT_SLEEP=y CONFIG_SORT=y # CONFIG_FEATURE_SORT_BIG is not set # CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set @@ -303,6 +304,7 @@ CONFIG_STTY=y # CONFIG_SUM is not set CONFIG_SYNC=y # CONFIG_FEATURE_SYNC_FANCY is not set +# CONFIG_FSYNC is not set # CONFIG_TAC is not set CONFIG_TAIL=y CONFIG_FEATURE_FANCY_TAIL=y @@ -329,14 +331,15 @@ CONFIG_UNAME_OSNAME="" # CONFIG_UNLINK is not set # CONFIG_USLEEP is not set # CONFIG_UUDECODE is not set +# CONFIG_BASE32 is not set # CONFIG_BASE64 is not set # CONFIG_UUENCODE is not set CONFIG_WC=y # CONFIG_FEATURE_WC_LARGE is not set -# CONFIG_WHOAMI is not set # CONFIG_WHO is not set # CONFIG_W is not set # CONFIG_USERS is not set +# CONFIG_WHOAMI is not set CONFIG_YES=y # @@ -357,11 +360,11 @@ CONFIG_FEATURE_HUMAN_READABLE=y # # Console Utilities # +# CONFIG_CHVT is not set CONFIG_CLEAR=y # CONFIG_DEALLOCVT is not set # CONFIG_DUMPKMAP is not set # CONFIG_FGCONSOLE is not set -# CONFIG_CHVT is not set # CONFIG_KBD_MODE is not set # CONFIG_LOADFONT is not set # CONFIG_SETFONT is not set @@ -507,23 +510,23 @@ CONFIG_INIT_TERMINAL_TYPE="" # CONFIG_USE_BB_SHADOW is not set # CONFIG_USE_BB_CRYPT is not set # CONFIG_USE_BB_CRYPT_SHA is not set -# CONFIG_ADDGROUP is not set -# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set # CONFIG_ADD_SHELL is not set # CONFIG_REMOVE_SHELL is not set +# CONFIG_ADDGROUP is not set +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set # CONFIG_ADDUSER is not set # CONFIG_FEATURE_CHECK_NAMES is not set CONFIG_LAST_ID=0 CONFIG_FIRST_SYSTEM_ID=0 CONFIG_LAST_SYSTEM_ID=0 +# CONFIG_CHPASSWD is not set +CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" # CONFIG_CRYPTPW is not set # CONFIG_MKPASSWD is not set # CONFIG_DELUSER is not set # CONFIG_DELGROUP is not set # CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set # CONFIG_GETTY is not set -# CONFIG_CHPASSWD is not set -CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" # CONFIG_LOGIN is not set # CONFIG_LOGIN_SESSION_AS_CHILD is not set # CONFIG_LOGIN_SCRIPTS is not set @@ -541,8 +544,8 @@ CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" # # Linux Ext2 FS Progs # -# CONFIG_FSCK is not set # CONFIG_CHATTR is not set +# CONFIG_FSCK is not set # CONFIG_LSATTR is not set # CONFIG_TUNE2FS is not set @@ -574,8 +577,8 @@ CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" # CONFIG_FEATURE_INSMOD_TRY_MMAP is not set # CONFIG_FEATURE_MODUTILS_ALIAS is not set # CONFIG_FEATURE_MODUTILS_SYMBOLS is not set -# CONFIG_DEFAULT_MODULES_DIR is not set -# CONFIG_DEFAULT_DEPMOD_FILE is not set +CONFIG_DEFAULT_MODULES_DIR="" +CONFIG_DEFAULT_DEPMOD_FILE="" # # Linux System Utilities @@ -587,6 +590,7 @@ CONFIG_BLKID=y CONFIG_FEATURE_BLKID_TYPE=y CONFIG_BLOCKDEV=y # CONFIG_CAL is not set +# CONFIG_CHRT is not set CONFIG_DMESG=y CONFIG_FEATURE_DMESG_PRETTY=y # CONFIG_EJECT is not set @@ -616,12 +620,10 @@ CONFIG_FSTRIM=y # CONFIG_GETOPT is not set # CONFIG_FEATURE_GETOPT_LONG is not set # CONFIG_HEXDUMP is not set -# CONFIG_FEATURE_HEXDUMP_REVERSE is not set # CONFIG_HD is not set # CONFIG_XXD is not set CONFIG_HWCLOCK=y # CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set -# CONFIG_CHRT is not set # CONFIG_IONICE is not set # CONFIG_IPCRM is not set # CONFIG_IPCS is not set @@ -661,6 +663,7 @@ CONFIG_FEATURE_MOUNT_FSTAB=y CONFIG_FEATURE_MOUNT_OTHERTAB=y # CONFIG_MOUNTPOINT is not set # CONFIG_NOLOGIN is not set +# CONFIG_NOLOGIN_DEPENDENCIES is not set # CONFIG_NSENTER is not set # CONFIG_PIVOT_ROOT is not set # CONFIG_RDATE is not set @@ -687,6 +690,7 @@ CONFIG_SETSID=y # CONFIG_SWITCH_ROOT is not set # CONFIG_TASKSET is not set # CONFIG_FEATURE_TASKSET_FANCY is not set +# CONFIG_FEATURE_TASKSET_CPULIST is not set # CONFIG_UEVENT is not set CONFIG_UMOUNT=y CONFIG_FEATURE_UMOUNT_ALL=y @@ -707,10 +711,11 @@ CONFIG_VOLUMEID=y # CONFIG_FEATURE_VOLUMEID_BCACHE is not set CONFIG_FEATURE_VOLUMEID_BTRFS=y # CONFIG_FEATURE_VOLUMEID_CRAMFS is not set +# CONFIG_FEATURE_VOLUMEID_EROFS is not set CONFIG_FEATURE_VOLUMEID_EXFAT=y CONFIG_FEATURE_VOLUMEID_EXT=y -CONFIG_FEATURE_VOLUMEID_FAT=y # CONFIG_FEATURE_VOLUMEID_F2FS is not set +CONFIG_FEATURE_VOLUMEID_FAT=y # CONFIG_FEATURE_VOLUMEID_HFS is not set # CONFIG_FEATURE_VOLUMEID_ISO9660 is not set # CONFIG_FEATURE_VOLUMEID_JFS is not set @@ -735,11 +740,24 @@ CONFIG_FEATURE_VOLUMEID_NTFS=y # # CONFIG_ADJTIMEX is not set # CONFIG_BBCONFIG is not set -# CONFIG_BC is not set # CONFIG_FEATURE_COMPRESS_BBCONFIG is not set +# CONFIG_BC is not set +# CONFIG_DC is not set +# CONFIG_FEATURE_DC_BIG is not set +# CONFIG_FEATURE_DC_LIBM is not set +# CONFIG_FEATURE_BC_INTERACTIVE is not set +# CONFIG_FEATURE_BC_LONG_OPTIONS is not set # CONFIG_BEEP is not set CONFIG_FEATURE_BEEP_FREQ=0 CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set # CONFIG_CONSPY is not set # CONFIG_CROND is not set # CONFIG_FEATURE_CROND_D is not set @@ -747,8 +765,6 @@ CONFIG_FEATURE_BEEP_LENGTH_MS=0 # CONFIG_FEATURE_CROND_SPECIAL_TIMES is not set CONFIG_FEATURE_CROND_DIR="" # CONFIG_CRONTAB is not set -# CONFIG_DC is not set -# CONFIG_FEATURE_DC_LIBM is not set # CONFIG_DEVFSD is not set # CONFIG_DEVFSD_MODLOAD is not set # CONFIG_DEVFSD_FG_NP is not set @@ -756,10 +772,10 @@ CONFIG_FEATURE_CROND_DIR="" # CONFIG_FEATURE_DEVFS is not set # CONFIG_DEVMEM is not set # CONFIG_FBSPLASH is not set -# CONFIG_FLASHCP is not set # CONFIG_FLASH_ERASEALL is not set # CONFIG_FLASH_LOCK is not set # CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASHCP is not set # CONFIG_HDPARM is not set # CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set # CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set @@ -768,27 +784,32 @@ CONFIG_FEATURE_CROND_DIR="" # CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set # CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set # CONFIG_HEXEDIT is not set -# CONFIG_CHAT is not set -# CONFIG_FEATURE_CHAT_NOFAIL is not set -# CONFIG_FEATURE_CHAT_TTY_HIFI is not set -# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set -# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set -# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set -# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set -# CONFIG_FEATURE_CHAT_CLR_ABORT is not set -# CONFIG_INOTIFYD is not set CONFIG_I2CGET=y CONFIG_I2CSET=y CONFIG_I2CDUMP=y CONFIG_I2CDETECT=y # CONFIG_I2CTRANSFER is not set +# CONFIG_INOTIFYD is not set # CONFIG_LESS is not set +CONFIG_FEATURE_LESS_MAXLINES=0 +# CONFIG_FEATURE_LESS_BRACKETS is not set +# CONFIG_FEATURE_LESS_FLAGS is not set +# CONFIG_FEATURE_LESS_TRUNCATE is not set +# CONFIG_FEATURE_LESS_MARKS is not set +# CONFIG_FEATURE_LESS_REGEXP is not set +# CONFIG_FEATURE_LESS_WINCH is not set +# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set +# CONFIG_FEATURE_LESS_DASHCMD is not set +# CONFIG_FEATURE_LESS_LINENUMS is not set +# CONFIG_FEATURE_LESS_RAW is not set +# CONFIG_FEATURE_LESS_ENV is not set # CONFIG_LSSCSI is not set # CONFIG_MAKEDEVS is not set # CONFIG_FEATURE_MAKEDEVS_LEAF is not set # CONFIG_FEATURE_MAKEDEVS_TABLE is not set # CONFIG_MAN is not set # CONFIG_MICROCOM is not set +# CONFIG_MIM is not set # CONFIG_MT is not set CONFIG_NANDWRITE=y # CONFIG_NANDDUMP is not set @@ -804,13 +825,13 @@ CONFIG_PARTPROBE=y # CONFIG_TIME is not set # CONFIG_TS is not set # CONFIG_TTYSIZE is not set -# CONFIG_UBIRENAME is not set # CONFIG_UBIATTACH is not set # CONFIG_UBIDETACH is not set # CONFIG_UBIMKVOL is not set # CONFIG_UBIRMVOL is not set # CONFIG_UBIRSVOL is not set # CONFIG_UBIUPDATEVOL is not set +# CONFIG_UBIRENAME is not set # CONFIG_VOLNAME is not set CONFIG_WATCHDOG=y @@ -821,6 +842,7 @@ CONFIG_FEATURE_IPV6=y # CONFIG_FEATURE_UNIX_LOCAL is not set CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y CONFIG_VERBOSE_RESOLUTION_ERRORS=y +# CONFIG_FEATURE_TLS_SHA1 is not set # CONFIG_ARP is not set # CONFIG_ARPING is not set # CONFIG_BRCTL is not set @@ -849,6 +871,10 @@ CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y # CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set # CONFIG_FEATURE_HTTPD_PROXY is not set # CONFIG_FEATURE_HTTPD_GZIP is not set +# CONFIG_FEATURE_HTTPD_ETAG is not set +# CONFIG_FEATURE_HTTPD_LAST_MODIFIED is not set +# CONFIG_FEATURE_HTTPD_DATE is not set +# CONFIG_FEATURE_HTTPD_ACL_IP is not set CONFIG_IFCONFIG=y CONFIG_FEATURE_IFCONFIG_STATUS=y # CONFIG_FEATURE_IFCONFIG_SLIP is not set @@ -908,6 +934,7 @@ CONFIG_FEATURE_IPCALC_FANCY=y # CONFIG_NTPD is not set # CONFIG_FEATURE_NTPD_SERVER is not set # CONFIG_FEATURE_NTPD_CONF is not set +# CONFIG_FEATURE_NTP_AUTH is not set CONFIG_PING=y CONFIG_PING6=y CONFIG_FEATURE_FANCY_PING=y @@ -928,12 +955,13 @@ CONFIG_ROUTE=y # CONFIG_FEATURE_TELNETD_INETD_WAIT is not set # CONFIG_TFTP is not set # CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_FEATURE_TFTP_HPA_COMPAT is not set # CONFIG_TFTPD is not set # CONFIG_FEATURE_TFTP_GET is not set # CONFIG_FEATURE_TFTP_PUT is not set # CONFIG_FEATURE_TFTP_BLOCKSIZE is not set # CONFIG_TFTP_DEBUG is not set -CONFIG_TLS=y +# CONFIG_TLS is not set CONFIG_TRACEROUTE=y CONFIG_TRACEROUTE6=y CONFIG_FEATURE_TRACEROUTE_VERBOSE=y @@ -941,7 +969,13 @@ CONFIG_FEATURE_TRACEROUTE_USE_ICMP=y # CONFIG_TUNCTL is not set # CONFIG_FEATURE_TUNCTL_UG is not set # CONFIG_VCONFIG is not set -CONFIG_WGET=n +# CONFIG_WGET is not set +# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set +# CONFIG_FEATURE_WGET_STATUSBAR is not set +# CONFIG_FEATURE_WGET_AUTHENTICATION is not set +# CONFIG_FEATURE_WGET_TIMEOUT is not set +# CONFIG_FEATURE_WGET_HTTPS is not set +# CONFIG_FEATURE_WGET_OPENSSL is not set # CONFIG_WHOIS is not set # CONFIG_ZCIP is not set # CONFIG_UDHCPD is not set @@ -1047,9 +1081,9 @@ CONFIG_SV_DEFAULT_SERVICE_DIR="" # CONFIG_SVC is not set # CONFIG_SVOK is not set # CONFIG_SVLOGD is not set +# CONFIG_CHCON is not set # CONFIG_GETENFORCE is not set # CONFIG_GETSEBOOL is not set -# CONFIG_CHCON is not set # CONFIG_LOAD_POLICY is not set # CONFIG_MATCHPATHCON is not set # CONFIG_RUNCON is not set @@ -1070,6 +1104,7 @@ CONFIG_SH_IS_ASH=y CONFIG_BASH_IS_ASH=y # CONFIG_BASH_IS_HUSH is not set # CONFIG_BASH_IS_NONE is not set +CONFIG_SHELL_ASH=y CONFIG_ASH=y # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set CONFIG_ASH_INTERNAL_GLOB=y @@ -1153,6 +1188,7 @@ CONFIG_FEATURE_SH_READ_FRAC=y # CONFIG_FEATURE_REMOTE_LOG is not set # CONFIG_FEATURE_SYSLOGD_DUP is not set # CONFIG_FEATURE_SYSLOGD_CFG is not set +# CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS is not set CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 # CONFIG_FEATURE_IPC_SYSLOG is not set CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 diff --git a/hardware/rescue-image/files/omnia.sh b/hardware/rescue-image/files/omnia.sh index 050bb334ec..7299e304a1 100644 --- a/hardware/rescue-image/files/omnia.sh +++ b/hardware/rescue-image/files/omnia.sh @@ -2,12 +2,26 @@ . /lib/board_helpers.sh +find_mtd_index() { + local PART="$(grep "\"$1\"" /proc/mtd | awk -F: '{print $1}')" + local INDEX="${PART##mtd}" + + echo ${INDEX} +} + board_init() { + local idx + generic_pre_init # Default mode on Omnia is serial MODE=7 mkdir -p /etc - echo '/dev/mtd0 0xF0000 0x10000 0x10000' > /etc/fw_env.config + idx="$(find_mtd_index u-boot-env)" + if [ -n "$idx" ]; then + echo "/dev/mtd${idx} 0x0 0x10000 0x10000" > /etc/fw_env.config + else + echo '/dev/mtd0 0xF0000 0x10000 0x10000' > /etc/fw_env.config + fi TARGET_DRIVE="/dev/mmcblk0" PART_NO="1" TARGET_PART="${TARGET_DRIVE}p${PART_NO}" diff --git a/hardware/start-indicator/Makefile b/hardware/start-indicator/Makefile index 59eef706e6..03ce004fa7 100644 --- a/hardware/start-indicator/Makefile +++ b/hardware/start-indicator/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=start-indicator PKG_VERSION:=1.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-2.0-or-later diff --git a/hardware/turris-nor-update/Makefile b/hardware/turris-nor-update/Makefile index e54f6a9170..807b21d145 100644 --- a/hardware/turris-nor-update/Makefile +++ b/hardware/turris-nor-update/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-nor-update -PKG_VERSION:=1.0.1 -PKG_RELEASE:=2 +PKG_VERSION:=1.1.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC @@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk define Package/turris-nor-update TITLE:=NOR update for Turris routers - DEPENDS:=+mtd +turris-nor-update-firmware + DEPENDS:=+mtd +turris-nor-update-firmware +uboot-envtools endef define Package/turris-nor-update/description diff --git a/hardware/turris-nor-update/files/nor-update b/hardware/turris-nor-update/files/nor-update index 35c47d965b..bb56fb1103 100644 --- a/hardware/turris-nor-update/files/nor-update +++ b/hardware/turris-nor-update/files/nor-update @@ -3,6 +3,7 @@ set -eu DEVEL="" VERBOSE="" +BACKUP_UBOOT_ENV="/usr/share/nor-update/uboot-env.backup" SECURE_FIRMWARE="secure-firmware.bin" SECURE_FIRMWARE_PART="" @@ -29,6 +30,10 @@ board_post_hook() { : } +board_ubootenv_hook() { + : +} + # Note: die and v_echo might be used by board configuration so they are defined early die() { @@ -62,6 +67,8 @@ print_help() { flash() { local flashing="$1" local part="$2" + local preupdate_hook="$3" + local postupdate_hook="$4" [ -n "$part" ] || return 0 @@ -84,14 +91,47 @@ flash() { if mtd verify "$1" "/dev/$part"; then v_echo "Partition with $flashing was up to date already." else + "$preupdate_hook" mtd -e "/dev/$part" write "$1" "/dev/$part" || \ die "Flashing '$flashing' partition (/dev/$part) failed!" + "$postupdate_hook" fi } -boot_scr_cleanup() { - umount -fl "$tmpdir" - rmdir "$tmpdir" +uboot_preupdate() { + BACKUP_UBOOT_ENV="/usr/share/nor-update/uboot-env.backup" + v_echo "Storing old U-boot environment to be preserved" + fw_printenv >"$BACKUP_UBOOT_ENV" || { + # Let's assume that there is a default environment if we can't read it. + rm -f "$BACKUP_UBOOT_ENV" + return 0 + } + board_ubootenv_hook # to perform any possible migrations +} + +uboot_postupdate() { + [ -f "$BACKUP_UBOOT_ENV" ] || return 0 + if ! fw_printenv >/dev/null 2>&1; then + echo "Updating configuration for U-Boot environment access." + rm -f /etc/config/ubootenv + fw_env-config-init.sh + fi + + if [ "$(fw_printenv 2>/dev/null)" = "$(cat "$BACKUP_UBOOT_ENV")" ]; then + # The environment is the same so no migration is needed + rm "$BACKUP_UBOOT_ENV" + return 0 + fi + + if fw_setenv -s "$BACKUP_UBOOT_ENV"; then + echo "Your U-Boot environment was migrated to new U-Boot" + echo "You can find it in $BACKUP_UBOOT_ENV" + echo "You can reset it via 'fw_setenv bootcmd \"env default -f -a; saveenv; reset\"'" + else + echo "Migration of your U-Boot environment failed." + echo "You can find it in $BACKUP_UBOOT_ENV" + echo "Set whatever you need manually via 'fw_setenv'" + fi } # We need boot.scr in root of Btrfs partition to be symlink to @ subvolume to @@ -99,10 +139,10 @@ boot_scr_cleanup() { fix_boot_scr() ( local dev="$(sed -n 's|^\(/dev/[a-z0-9]*\) / btrfs .*|\1|p' /proc/mounts)" # Fix is required only for BTRFS. No need to continue if root filesystem is not BTRFS. - [ -n "$dev" ] || return + [ -n "$dev" ] || return 0 tmpdir="$(mktemp -d)" [ -n "$tmpdir" ] || die "Can't create a temp directory!" - trap boot_scr_cleanup EXIT + trap 'umount -fl "$tmpdir" && rmdir "$tmpdir"' EXIT mount "$dev" "$tmpdir" || die "Can't mount root filesystem" [ -e "$tmpdir"/boot.scr ] || \ ln -sf @/boot/boot.scr "$tmpdir"/boot.scr || \ @@ -147,8 +187,8 @@ if [ -z "$DEVEL" ]; then fi board_pre_hook -flash "secure firmware" "$SECURE_FIRMWARE_PART" "$SECURE_FIRMWARE_DEVEL" "$SECURE_FIRMWARE" -flash "U-Boot" "$UBOOT_PART" "$UBOOT_DEVEL" "$UBOOT" -flash "rescue system" "$RESCUE_PART" "$RESCUE_DEVEL" "$RESCUE" -flash "dtb" "$DTB_PART" "$DTB_DEVEL" "$DTB" +flash "secure firmware" "$SECURE_FIRMWARE_PART" true true "$SECURE_FIRMWARE_DEVEL" "$SECURE_FIRMWARE" +flash "U-Boot" "$UBOOT_PART" uboot_preupdate uboot_postupdate "$UBOOT_DEVEL" "$UBOOT" +flash "rescue system" "$RESCUE_PART" true true "$RESCUE_DEVEL" "$RESCUE" +flash "dtb" "$DTB_PART" true true "$DTB_DEVEL" "$DTB" board_post_hook diff --git a/hardware/turris1x/turris1x-btrfs/Makefile b/hardware/turris1x/turris1x-btrfs/Makefile index 866554887e..e89b9d8156 100644 --- a/hardware/turris1x/turris1x-btrfs/Makefile +++ b/hardware/turris1x/turris1x-btrfs/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris1x-btrfs -PKG_VERSION:=3.0 -PKG_RELEASE:=1 +PKG_VERSION:=3.1.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-2.0-or-later @@ -20,7 +20,7 @@ define Package/Common SECTION:=utils CATEGORY:=Utilities SUBMENU:=Filesystem - DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_turris1x + DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x endef define Package/turris1x-btrfs diff --git a/hardware/turris1x/turris1x-btrfs/files/btrfs_migrate.sh b/hardware/turris1x/turris1x-btrfs/files/btrfs_migrate.sh index 4628b8d867..a8957bf92e 100644 --- a/hardware/turris1x/turris1x-btrfs/files/btrfs_migrate.sh +++ b/hardware/turris1x/turris1x-btrfs/files/btrfs_migrate.sh @@ -118,7 +118,7 @@ p w EOF - mkfs.vfat -n turris-boot "${SDCARDP}1" || die "Can't create fat!" + mkfs.fat -n turris-boot "${SDCARDP}1" || die "Can't create fat!" mkfs.btrfs -L turris-rootfs -f "${SDCARDP}2" || die "Can't format btrfs partition!" ROOT_UUID="$(blkid "${SDCARDP}2" | sed -n 's|^/dev/.*UUID="\([0-9a-fA-F-]*\)".*|\1|p')" } diff --git a/hardware/turris1x/turris1x-btrfs/files/kernel-install b/hardware/turris1x/turris1x-btrfs/files/kernel-install index 7458a2ef56..7a03388992 100644 --- a/hardware/turris1x/turris1x-btrfs/files/kernel-install +++ b/hardware/turris1x/turris1x-btrfs/files/kernel-install @@ -19,3 +19,5 @@ deploy() { deploy zImage deploy fdt +deploy turris1x.dtb +deploy boot.scr diff --git a/hardware/turris1x/turris1x-firmware/Makefile b/hardware/turris1x/turris1x-firmware/Makefile index 5c5c17a889..f94998c917 100644 --- a/hardware/turris1x/turris1x-firmware/Makefile +++ b/hardware/turris1x/turris1x-firmware/Makefile @@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-1x-firmware PKG_VERSION:=1.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC include $(INCLUDE_DIR)/package.mk define Package/turris-1x-firmware - TITLE:=Firmware for Turris MOX - DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_turris1x + TITLE:=Firmware for Turris 1.x + DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x PROVIDES:=turris-nor-update-firmware endef diff --git a/hardware/turris1x/turris1x-rainbow-backend/Makefile b/hardware/turris1x/turris1x-rainbow-backend/Makefile new file mode 100644 index 0000000000..2ff5e645ed --- /dev/null +++ b/hardware/turris1x/turris1x-rainbow-backend/Makefile @@ -0,0 +1,40 @@ +# +## Copyright (C) 2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# +## This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=turris1x-rainbow-backend +PKG_VERSION:=0.1.1 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/rainbow-ng.git +PKG_MIRROR_HASH:=0171626261439a81b4ae84d8a3a7ae94f0997be8b7a9317f88a41c111fe04b1d +PKG_SOURCE_VERSION:=v$(PKG_VERSION) + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/turris1x-rainbow-backend + TITLE:=turris1x-rainbow-backend + DEPENDS:=\ + @TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x \ + +rainbow-button-sync \ + +rainbow-animator + PROVIDES:=rainbow-backend +endef + +Build/Compile:=: + +define Package/turris1x-rainbow-backend/install + cd $(PKG_BUILD_DIR); make turris1x-install DESTDIR=$(1) +endef + +$(eval $(call BuildPackage,turris1x-rainbow-backend)) diff --git a/hardware/turris1x/turris1x-rainbow-backend/patches/0001-backend-omnia-turris1x-include-backwards-compatibili.patch b/hardware/turris1x/turris1x-rainbow-backend/patches/0001-backend-omnia-turris1x-include-backwards-compatibili.patch new file mode 100644 index 0000000000..1a4278ca4c --- /dev/null +++ b/hardware/turris1x/turris1x-rainbow-backend/patches/0001-backend-omnia-turris1x-include-backwards-compatibili.patch @@ -0,0 +1,38 @@ +From 3a9608e38e4dc0e5e1f0e94a3c2c80dc8e223f52 Mon Sep 17 00:00:00 2001 +From: Josef Schlehofer +Date: Thu, 20 Oct 2022 16:05:16 +0200 +Subject: [PATCH] backend/{omnia,turris1x}: include backwards compatibility + script + +--- + backend/omnia/backend.sh | 1 + + backend/turris1x/backend.sh | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/backend/omnia/backend.sh b/backend/omnia/backend.sh +index 0eeab08..1f04e30 100644 +--- a/backend/omnia/backend.sh ++++ b/backend/omnia/backend.sh +@@ -9,6 +9,7 @@ LEDS="power lan-0 lan-1 lan-2 lan-3 lan-4 wan wlan-1 wlan-2 wlan-3 indicator-1 i + SYSFS="/sys/class/leds/rgb:power/device" + + loadsrc led_activity ++loadsrc compat + + led2sysfs() { + local led="$1" +diff --git a/backend/turris1x/backend.sh b/backend/turris1x/backend.sh +index 4744928..d973ed3 100644 +--- a/backend/turris1x/backend.sh ++++ b/backend/turris1x/backend.sh +@@ -9,6 +9,7 @@ LEDS="wan lan-1 lan-2 lan-3 lan-4 lan-5 wlan power" + SYSFS="/sys/class/leds/rgb:wan/device" + + loadsrc led_activity ++loadsrc compat + + led2sysfs() { + local led="$1" +-- +2.34.1 + diff --git a/hardware/turris1x/turris1x-rainbow-backend/patches/compatibility.patch b/hardware/turris1x/turris1x-rainbow-backend/patches/compatibility.patch new file mode 100644 index 0000000000..369fb4cfb0 --- /dev/null +++ b/hardware/turris1x/turris1x-rainbow-backend/patches/compatibility.patch @@ -0,0 +1,87 @@ +diff --git a/backend/mox/backend.sh b/backend/mox/backend.sh +index cbaad82..51ba510 100644 +--- a/backend/mox/backend.sh ++++ b/backend/mox/backend.sh +@@ -55,13 +55,13 @@ set_led() { + + # We have to disable trigger first to make sure that changes are correctly + # applied and not modified by this in the meantime. +- echo "none" > "$SYSFS/trigger" +- echo "$brightness" > "$SYSFS/brightness" ++ [ ! -e "$SYSFS/trigger" ] || echo "none" > "$SYSFS/trigger" ++ [ ! -e "$SYSFS/brightness" ] || echo "$brightness" > "$SYSFS/brightness" + if [ "$trigger" = "activity" ]; then + apply_activity "$led" $mode_args "$@" \ + || echo "Warning: activity setup failed for: $led" >&2 + else +- echo "$trigger" > "$SYSFS/trigger" ++ [ ! -e "$SYSFS/trigger" ] || echo "$trigger" > "$SYSFS/trigger" + fi + } + +diff --git a/backend/omnia/backend.sh b/backend/omnia/backend.sh +index 0eeab08..035133c 100644 +--- a/backend/omnia/backend.sh ++++ b/backend/omnia/backend.sh +@@ -42,7 +42,7 @@ preapply() { + brightness_level="$(brightness)" + # The full range is only 0-100 but that is good enough so we don't adjust + # more. We just loose the precision on Omnia but who can see it anyway. +- echo "$((brightness_level * 100 / 255))" > "$SYSFS/brightness" ++ [ ! -e "$SYSFS/brightness" ] || echo "$((brightness_level * 100 / 255))" > "$SYSFS/brightness" + } + + set_led() { +@@ -95,14 +95,14 @@ set_led() { + sysfs="$(led2sysfs "$led")" + # We have to disable trigger first to make sure that changes are correctly + # applied and not modified by this in the meantime. +- echo "none" > "$sysfs/trigger" +- echo "$brightness" > "$sysfs/brightness" +- echo "$r $g $b" > "$sysfs/multi_intensity" ++ [ ! -e "$sysfs/trigger" ] || echo "none" > "$sysfs/trigger" ++ [ ! -e "$sysfs/brightness" ] || echo "$brightness" > "$sysfs/brightness" ++ [ ! -e "$sysfs/multi_intensity" ] || echo "$r $g $b" > "$sysfs/multi_intensity" + if [ "$trigger" = "activity" ]; then + apply_activity "$led" "$@" \ + || echo "Warning: activity setup failed for: $led" >&2 + else +- echo "$trigger" > "$sysfs/trigger" ++ [ ! -e "$sysfs/trigger" ] || echo "$trigger" > "$sysfs/trigger" + fi + } + +diff --git a/backend/turris1x/backend.sh b/backend/turris1x/backend.sh +index 4744928..f1a614d 100644 +--- a/backend/turris1x/backend.sh ++++ b/backend/turris1x/backend.sh +@@ -47,8 +47,8 @@ preapply() { + if [ $brightness_level = 8 ]; then + brightness_level=7 + fi +- echo 0 2 4 8 16 32 64 255 > $SYSFS/brightness_values +- echo $brightness_level > $SYSFS/brightness_level ++ [ ! -e $SYSFS/brightness_values ] || echo 0 2 4 8 16 32 64 255 > $SYSFS/brightness_values ++ [ ! -e $SYSFS/brightness_level ] || echo $brightness_level > $SYSFS/brightness_level + } + + set_led() { +@@ -91,14 +91,14 @@ set_led() { + sysfs="$(led2sysfs "$led")" + # We have to disable trigger first to make sure that changes are correctly + # applied and not modified by this in the meantime. +- echo "none" > "$sysfs/trigger" +- echo "$brightness" > "$sysfs/brightness" +- echo "$r $g $b" > "$sysfs/multi_intensity" ++ [ ! -e "$sysfs/trigger" ] || echo "none" > "$sysfs/trigger" ++ [ ! -e "$sysfs/brightness" ] || echo "$brightness" > "$sysfs/brightness" ++ [ ! -e "$sysfs/multi_intensity" ] || echo "$r $g $b" > "$sysfs/multi_intensity" + if [ "$trigger" = "activity" ]; then + apply_activity "$led" "$@" \ + || echo "Warning: activity setup failed for: $led" >&2 + else +- echo "$trigger" > "$sysfs/trigger" ++ [ ! -e "$sysfs/trigger" ] || echo "$trigger" > "$sysfs/trigger" + fi + } + diff --git a/hardware/turris1x/turris1x-rainbow/Makefile b/hardware/turris1x/turris1x-rainbow/Makefile deleted file mode 100644 index aaac87bfc7..0000000000 --- a/hardware/turris1x/turris1x-rainbow/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -# -## Copyright (C) 2013-2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) -# -## This is free software, licensed under the GNU General Public License v3. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=turris1x-rainbow -PKG_VERSION:=17 -PKG_RELEASE:=3 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/rainbow.git -PKG_MIRROR_HASH:=ed6a2411a9d373a3e8779c37d344851cabca22e2af58f38ea13c1dcc543dd1d2 -PKG_SOURCE_VERSION:=5d7d5c8c3bdec184bdb418e857a6d5a11726fac4 - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=LICENSE - -include $(INCLUDE_DIR)/package.mk - -define Package/turris1x-rainbow - TITLE:=turris1x-rainbow - URL:=https://gitlab.nic.cz/turris/rainbow - PROVIDES:=turris-rainbow - DEPENDS:=@KERNEL_DEVMEM @TARGET_mpc85xx_p2020_DEVICE_turris1x -endef - -define Package/turris1x-rainbow/conffiles -/etc/config/rainbow -endef - -define Package/turris1x-rainbow/install - $(INSTALL_DIR) $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/rainbow $(1)/usr/bin/ - $(INSTALL_DIR) $(1)/etc/init.d/ - $(INSTALL_BIN) ./files/rainbow.init $(1)/etc/init.d/rainbow - $(INSTALL_DIR) $(1)/etc/config/ - $(INSTALL_DATA) ./files/rainbow.config $(1)/etc/config/rainbow - $(INSTALL_DIR) $(1)/etc/cron.d - $(INSTALL_DATA) ./files/rainbow.cron $(1)/etc/cron.d/rainbow - $(INSTALL_BIN) ./files/rainbow_button_sync.sh $(1)/usr/bin/rainbow_button_sync.sh -endef - -define Package/turris1x-rainbow/prerm -#!/bin/sh -[ -n "$$IPKG_INSTROOT" ] || \ - rainbow all auto white -endef - -$(eval $(call BuildPackage,turris1x-rainbow)) diff --git a/hardware/turris1x/turris1x-rainbow/files/rainbow.config b/hardware/turris1x/turris1x-rainbow/files/rainbow.config deleted file mode 100644 index bbaceb1a22..0000000000 --- a/hardware/turris1x/turris1x-rainbow/files/rainbow.config +++ /dev/null @@ -1,25 +0,0 @@ -# You can set all the leds at once. -config led 'all' - option color 'turris-default' - option status 'auto' - -# Any other config will overwrite the one set in all -#config led 'pwr' -# option color 'FF0066' -# option status 'auto' -# -#config led 'wifi' -# option color 'FFFF00' -# option status 'auto' -# -#config led 'lan' -# option color 'green' -# option status 'auto' -# -#config led 'wan' -# option color 'blue' -# option status 'auto' - -# The ones with lan can't set color and the status overwrites the one in the 'lan' section, if mentioned -#config led 'lan4' -# option status 'disabled' diff --git a/hardware/turris1x/turris1x-rainbow/files/rainbow.cron b/hardware/turris1x/turris1x-rainbow/files/rainbow.cron deleted file mode 100644 index cb4d5923d0..0000000000 --- a/hardware/turris1x/turris1x-rainbow/files/rainbow.cron +++ /dev/null @@ -1,2 +0,0 @@ -MAILTO="" -* * * * * root /usr/bin/rainbow_button_sync.sh diff --git a/hardware/turris1x/turris1x-rainbow/files/rainbow.init b/hardware/turris1x/turris1x-rainbow/files/rainbow.init deleted file mode 100644 index 94bf1a4916..0000000000 --- a/hardware/turris1x/turris1x-rainbow/files/rainbow.init +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh /etc/rc.common - -# Start at the end, so the colors change after the boot is done. -START=99 -STOP=00 - -PID_FILE="/var/run/rainbow.pid" - -start() { - # Signal the boot is finished - rainbow all enable blue - sleep 1 - rainbow all enable green - sleep 1 - # Set the colors based on user preferrences - uci show rainbow | sed -ne 's/rainbow\.\([^.]*\)=led/\1/p' | sort | while read SECTION ; do - STATUS=$(uci get rainbow.$SECTION.status) - COLOR=$(uci get rainbow.$SECTION.color) - rainbow $SECTION $STATUS $COLOR - done - # Resume last intensity settings - rainbow intensity $(cat /etc/rainbow.magic) - - # Setup LEDs if enabled - if [ -x /etc/init.d/setup_led ] && /etc/init.d/setup_led enabled; then - /etc/init.d/setup_led restart - fi - - # Start the daemon - if [ -s $PID_FILE ]; then - echo "Daemon is alredy running..." - else - rainbow --daemonize - fi -} - -stop() { - # Reset to the default, so a reboot can be recognized. - rainbow all enable white - kill -9 $(cat $PID_FILE) - rm $PID_FILE -} diff --git a/hardware/turris1x/turris1x-rainbow/files/rainbow_button_sync.sh b/hardware/turris1x/turris1x-rainbow/files/rainbow_button_sync.sh deleted file mode 100755 index 5f30d9f3cb..0000000000 --- a/hardware/turris1x/turris1x-rainbow/files/rainbow_button_sync.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -MAGIC_FILE="/etc/rainbow.magic" - -# Get actual intensity -ACT_INTENSITY=$(rainbow get intensity) - -# Get value from magic file -[ -f "$MAGIC_FILE" ] || echo 0 > "$MAGIC_FILE" -LAST_VALUE=$(cat "$MAGIC_FILE") - -# Compare them and if last value is different from stored one update it -if [ "$ACT_INTENSITY" != "$LAST_VALUE" ]; then - echo $ACT_INTENSITY > "$MAGIC_FILE" -fi diff --git a/hardware/turris1x/turris1x-support/Makefile b/hardware/turris1x/turris1x-support/Makefile index b5f53a544f..913318e594 100644 --- a/hardware/turris1x/turris1x-support/Makefile +++ b/hardware/turris1x/turris1x-support/Makefile @@ -2,8 +2,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=turris1x-support -PKG_VERSION:=1.2 -PKG_RELEASE:=2 +PKG_VERSION:=1.3 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC @@ -15,7 +15,7 @@ include $(INCLUDE_DIR)/package.mk define Package/turris1x-support TITLE:=Turris 1.x hardware support files VERSION:=$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC) - DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_turris1x + DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x endef define Package/turris1x-support/description @@ -34,8 +34,9 @@ endef define Package/turris1x-support/install $(INSTALL_DIR) $(1)/boot - $(INSTALL_DATA) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/turris1x.dtb "$(1)"/boot/fdt - mkimage -T script -C none -n boot -d files/boot.txt "$(1)"/boot.scr + $(INSTALL_DATA) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts/turris1x.dtb "$(1)"/boot/ + ln -sf turris1x.dtb "$(1)"/boot/fdt + mkimage -T script -C none -n boot -d files/boot.txt "$(1)"/boot/boot.scr endef $(eval $(call BuildPackage,turris1x-support)) diff --git a/hardware/turris1x/turris1x-support/files/boot.txt b/hardware/turris1x/turris1x-support/files/boot.txt index ce44ce4009..3e73e97231 100644 --- a/hardware/turris1x/turris1x-support/files/boot.txt +++ b/hardware/turris1x/turris1x-support/files/boot.txt @@ -1,3 +1,90 @@ -setenv bootargsubi 'root=ubi0:rootfs rootfstype=ubifs ubi.mtd=9,2048 rootflags=chk_data_crc rw console=ttyS0,115200' -setenv ubiboot 'max6370_wdt_off; setenv bootargs $bootargsubi; ubi part rootfs; ubifsmount ubi0:rootfs; ubifsload $nandfdtaddr /boot/fdt; ubifsload $nandbootaddr /boot/zImage; bootm $nandbootaddr - $nandfdtaddr' -run ubiboot +if test "${bootfstype}" = "btrfs"; then + subvol="/@" +else + subvol="" +fi + +loaded=0 +for bootdir in ${prefix} ${boot_prefixes}; do + if test "${loaded}" != "1"; then + # In reality kernel image is in uImage format and not in zImage format + if test -e ${devtype} ${devnum}:${distro_bootpart} ${subvol}${bootdir}zImage && test -e ${devtype} ${devnum}:${distro_bootpart} ${subvol}${bootdir}${fdtfile}; then + echo "Found Kernel image ${subvol}${bootdir}zImage" + if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${subvol}${bootdir}zImage; then + echo "Found Device Tree file ${subvol}${bootdir}${fdtfile}" + if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${subvol}${bootdir}${fdtfile}; then + loaded=1 + fi + fi + fi + fi +done + +if test "${loaded}" = "1"; then + # Kernel may be stored on first FAT partition and rootfs on second btrfs partition + if test "${bootfstype}" = "fat"; then + setexpr bootpart2 ${distro_bootpart} + 1 + if part size ${devtype} ${devnum} ${bootpart2} fssize; then + if fstype ${devtype} ${devnum}:${bootpart2} fstype; then else + # U-Boot does not have to support btrfs, so check for btrfs superblock + part start ${devtype} ${devnum} ${bootpart2} fsstart + setexpr superblock ${fsstart} + 0x80 + ${devtype} read ${loadaddr} ${superblock} 1 + setexpr loadaddr4 ${loadaddr} + 0x4 + setexpr loadaddr40 ${loadaddr} + 0x40 + mw ${loadaddr} 0x5f424852 # _BHR + mw ${loadaddr4} 0x66535f4d # fS_M + if cmp ${loadaddr} ${loadaddr40} 2; then + setenv fstype "btrfs" + else + setenv fstype + fi + setenv fsstart + setenv superblock + setenv loadaddr4 + setenv loadaddr40 + fi + if test ${fstype} = "btrfs"; then + setenv bootfstype "btrfs" + setenv distro_bootpart ${bootpart2} + fi + setenv fstype + fi + setenv bootpart2 + setenv fssize + fi + + if test "${devtype}" = "ubi"; then + rootflags="chk_data_crc" + elif test "${bootfstype}" = "btrfs"; then + rootflags="subvol=@,commit=5" + elif test "${bootfstype}" = "ext4"; then + rootflags="commit=5" + else + rootflags="" + fi + + if test "${devtype}" = "ubi"; then + # old fdt files have rootfs mtd named "rootfs-ubifs" and new just "rootfs" + # read mtd label from loaded fdt file, it may be on two different locations + fdt addr ${fdt_addr_r} + fdt get value rootfsmtd /localbus@ffe05000/nand@1,0/partitions/partition@00 label || fdt get value rootfsmtd /localbus@ffe05000/nand@1,0/partition@00 label || fdt get value rootfsmtd /localbus@ffe05000/nand@1,0/partitions + setenv bootfstype "ubifs" + if test "${bootubioff}" != ""; then + setenv rootfsmtd ${rootfsmtd},${bootubioff} + else + setenv rootfsmtd ${rootfsmtd},2048 + fi + setenv bootargs root=ubi0:${bootubivol} ubi.mtd=${rootfsmtd} + setenv rootfsmtd + else + part uuid ${devtype} ${devnum}:${distro_bootpart} partuuid + setenv bootargs root=PARTUUID=${partuuid} + fi + setenv bootargs ${bootargs} rootfstype=${bootfstype} rootflags=${rootflags} rootwait rw cfg80211.freg=${regdomain} console=ttyS0,115200 ${quirks} + + # Disable watchdog (temporary workaround until the driver will land in kernel) + mw.b 0xffa00002 0x03 + + bootm ${kernel_addr_r} - ${fdt_addr_r} +fi diff --git a/hardware/turris1x/turris1x-uboot/Makefile b/hardware/turris1x/turris1x-uboot/Makefile new file mode 100644 index 0000000000..fd0ae29700 --- /dev/null +++ b/hardware/turris1x/turris1x-uboot/Makefile @@ -0,0 +1,60 @@ +# +## Copyright (C) 2018-2022 CZ.NIC z.s.p.o. (http://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:=turris1x-uboot +PKG_VERSION:=$(if $(DUMP),x,$(shell sed -ne 's#PKG_VERSION:=##p' $(TOPDIR)/package/boot/uboot-mpc85xx/Makefile)) +PKG_RELEASE:=$(AUTORELEASE) + +PKG_BUILD_DEPENDS:=uboot-mpc85xx + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=README + +include $(INCLUDE_DIR)/package.mk + +define Package/turris1x-uboot + TITLE:=Turris 1.x U-boot + DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x + PROVIDES:=u-boot-turris1x +endef + +define Package/turris1x-uboot-sd + TITLE:=Turris 1.x U-boot SD + DEPENDS:=@TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x +endef + +define Package/turris1x-uboot/description + NOR U-boot version for Turris 1.x +endef + +define Package/turris1x-uboot-sd/description + SDCard U-boot version for Turris 1.x +endef + +define Build/Configure + true +endef + +define Build/Compile + true +endef + +define Package/turris1x-uboot/install + $(INSTALL_DIR) $(1)/usr/share/turris1x + $(CP) $(STAGING_DIR_IMAGE)/turris1x-nor-u-boot-with-dtb.bin $(1)/usr/share/turris1x/u-boot-nor.bin +endef + +define Package/turris1x-uboot-sd/install + $(INSTALL_DIR) $(1)/usr/share/turris1x + $(CP) $(STAGING_DIR_IMAGE)/turris1x-sd-u-boot-with-spl.bin $(1)/usr/share/turris1x/u-boot-sdcard.bin +endef + +$(eval $(call BuildPackage,turris1x-uboot)) +$(eval $(call BuildPackage,turris1x-uboot-sd)) diff --git a/hardware/watchdog_adjust/Makefile b/hardware/watchdog_adjust/Makefile index a91af792c1..f712081202 100644 --- a/hardware/watchdog_adjust/Makefile +++ b/hardware/watchdog_adjust/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=watchdog_adjust PKG_VERSION:=6 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/lang/cython/Makefile b/lang/cython/Makefile index 7d9d16e59c..8f1405fce5 100644 --- a/lang/cython/Makefile +++ b/lang/cython/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cython -PKG_VERSION:=0.29.23 -PKG_RELEASE:=1 +PKG_VERSION:=0.29.28 +PKG_RELEASE:=$(AUTORELEASE) PYPI_NAME:=Cython -PKG_HASH:=6a0d31452f0245daacb14c979c77e093eb1a546c760816b5eed0047686baad8e +PKG_HASH:=d6fac2342802c30e51426828fe084ff4deb1b3387367cf98976bb2e64b6f8e45 PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=Apache-2.0 @@ -22,7 +22,6 @@ define Package/cython TITLE:=Cython compiler for writing C extensions for Python URL:=https://www.cython.org/ DEPENDS:=+python3 - VARIANT:=python3 endef define Package/cython/description diff --git a/lang/luajit/Makefile b/lang/luajit/Makefile deleted file mode 100644 index dcfbc8c12b..0000000000 --- a/lang/luajit/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=luajit -PKG_VERSION:=2.2.0 -PKG_RELEASE:=2 - -PKG_SOURCE:=moonjit-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/moonjit/moonjit/tar.gz/$(PKG_VERSION)? -PKG_HASH:=83deb2c880488dfe7dd8ebf09e3b1e7613ef4b8420de53de6f712f01aabca2b6 -PKG_BUILD_DIR:=$(BUILD_DIR)/moonjit-$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=COPYRIGHT - -PKG_USE_MIPS16:=0 -PKG_INSTALL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/host-build.mk - -define Package/luajit - SUBMENU:=Lua - SECTION:=lang - CATEGORY:=Languages - TITLE:=LuaJIT (MoonJIT) - URL:=https://github.com/moonjit/moonjit - DEPENDS:=@(i386||x86_64||arm||armeb||aarch64||mips||mipsel) - ALTERNATIVES:=300:/usr/bin/luajit:/usr/bin/moonjit -endef - -define Package/luajit/description - LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. *** Requires GCC Multilib on host system to build! *** -endef - -ifeq ($(HOST_ARCH),x86_64) - ifeq ($(CONFIG_ARCH_64BIT),) - HOST_BITS := -m32 - endif -endif - -MAKE_VARS = - -MAKE_FLAGS = \ - DPREFIX=$(PKG_INSTALL_DIR)/usr \ - PREFIX=/usr \ - CROSS="$(TARGET_CROSS)" \ - TARGET_CFLAGS="$(TARGET_CFLAGS)" \ - TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \ - TARGET_SYS=Linux \ - HOST_CC="$(HOSTCC)" \ - HOST_CFLAGS="$(HOST_CFLAGS) $(HOST_BITS)" \ - HOST_LDFLAGS="$(HOST_LDFLAGS) $(HOST_BITS)" - -MAKE_INSTALL_FLAGS = \ - DPREFIX=$(PKG_INSTALL_DIR)/usr \ - PREFIX=/usr \ - TARGET_SYS=Linux \ - -HOST_MAKE_FLAGS = \ - DPREFIX=$(STAGING_DIR_HOSTPKG) \ - TARGET_CFLAGS="$(HOST_CFLAGS)" \ - TARGET_LDFLAGS="$(HOST_LDFLAGS)" - -define Package/luajit/install - $(INSTALL_DIR) $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ - $(LN) moonjit-$(PKG_VERSION) $(1)/usr/bin/moonjit -endef - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include/moonjit-2.2 - $(CP) $(PKG_INSTALL_DIR)/usr/include/moonjit-2.2/*.{h,hpp} $(1)/usr/include/moonjit-2.2 - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/ - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/ - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/moonjit-$(PKG_VERSION) $(1)/usr/bin/moonjit -endef - -$(eval $(call HostBuild,luajit)) -$(eval $(call BuildPackage,luajit)) diff --git a/lang/luajit/patches/010-lua-path.patch b/lang/luajit/patches/010-lua-path.patch deleted file mode 100644 index 4a1a028584..0000000000 --- a/lang/luajit/patches/010-lua-path.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/luaconf.h -+++ b/src/luaconf.h -@@ -35,8 +35,8 @@ - #ifndef LUA_LMULTILIB - #define LUA_LMULTILIB "lib" - #endif --#define LUA_LROOT "/usr/local" --#define LUA_LUADIR "/lua/5.1/" -+#define LUA_LROOT "/usr" -+#define LUA_LUADIR "/lua/" - #define LUA_LJDIR "/moonjit-2.2.0/" - - #ifdef LUA_ROOT diff --git a/lang/python-bottle-i18n/Makefile b/lang/python-bottle-i18n/Makefile deleted file mode 100644 index 811f787fb6..0000000000 --- a/lang/python-bottle-i18n/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (C) 2013-2020 CZ.NIC z.s.p.o. (http://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-bottle-i18n -PKG_VERSION:=0.1.5 -PKG_RELEASE:=5 - -PYPI_NAME:=bottle-i18n -PKG_HASH:=7f9d343ae30b18a9676cbe612a8be2e99d4741aa4aa6a1b875ea232ba94c7678 - -PKG_BUILD_DIR:=$(BUILD_DIR)/bottle-i18n-$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE - -include $(TOPDIR)/feeds/packages/lang/python/pypi.mk -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk - -define Package/python3-bottle-i18n - SUBMENU:=Python - SECTION:=lang - CATEGORY:=Languages - TITLE:=python3-bottle-i18n - URL:=https://github.com/iocast/bottle-i18n - DEPENDS:=+python3-light +python3-bottle - VARIANT:=python3 -endef - -define Package/python3-bottle-i18n/description - i18n support for bottle.py -endef - -PYTHON3_PKG_SETUP_ARGS:= - -$(eval $(call Py3Package,python3-bottle-i18n)) -$(eval $(call BuildPackage,python3-bottle-i18n)) -$(eval $(call BuildPackage,python3-bottle-i18n-src)) diff --git a/lang/python-bottle-i18n/patches/01-exception-fix.patch b/lang/python-bottle-i18n/patches/01-exception-fix.patch deleted file mode 100644 index bfda793498..0000000000 --- a/lang/python-bottle-i18n/patches/01-exception-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/bottle_i18n.py -+++ b/bottle_i18n.py -@@ -179,7 +179,7 @@ class I18NPlugin(object): - for app in self._apps: - app._ = trans.gettext - self._cache[self._lang_code] = trans -- except Exception, e: -+ except Exception as e: - for app in self._apps: - app._ = lambda s: s - self._cache[self._lang_code] = None diff --git a/lang/python-crontab/Makefile b/lang/python-crontab/Makefile new file mode 100644 index 0000000000..e6c708cf17 --- /dev/null +++ b/lang/python-crontab/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2021 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-crontab +PKG_VERSION:=0.23.0 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_LICENSE:=LGPL-3.0-or-later +PKG_LICENSE_FILES:=LICENSE3 + +PYPI_NAME:=crontab +PKG_HASH:=ca79dede9c2f572bb32f38703e8fddcf3427e86edc838f2ffe7ae4b9ee2b0733 + +include $(TOPDIR)/feeds/packages/lang/python/pypi.mk +include $(INCLUDE_DIR)/package.mk +include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk + +PYTHON3_PKG_SETUP_ARGS := + +define Package/python3-crontab + SECTION:=lang-python + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Parse and use crontab schedules in Python + URL:=https://github.com/josiahcarlson/parse-crontab + DEPENDS:=+python3-light +endef + +define Package/python3-crontab/description + This package intends to offer a method of parsing crontab schedule entries and + determining when an item should next be run. More specifically, it calculates a + delay in seconds from when the .next() method is called to when the item should + next be executed. +endef + +$(eval $(call Py3Package,python3-crontab)) +$(eval $(call BuildPackage,python3-crontab)) +$(eval $(call BuildPackage,python3-crontab-src)) diff --git a/lang/python-libatsha204/Makefile b/lang/python-libatsha204/Makefile index 98db0b8f06..38a7369d11 100644 --- a/lang/python-libatsha204/Makefile +++ b/lang/python-libatsha204/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-atsha204 PKG_VERSION:=29.2 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/libatsha204.git @@ -32,7 +32,6 @@ define Package/python3-atsha204 URL:=https://gitlab.nic.cz/turris/libatsha204 DEPENDS:=+python3-light +libatsha204 PROVIDES:=python3-libatsha204 - VARIANT:=python3 endef PYTHON3_PKG_SETUP_DIR:=/src/python diff --git a/lang/python-pbkdf2/Makefile b/lang/python-pbkdf2/Makefile index f4a75074ce..9f98cd5cf2 100644 --- a/lang/python-pbkdf2/Makefile +++ b/lang/python-pbkdf2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-pbkdf2 PKG_VERSION:=1.3 -PKG_RELEASE:=4 +PKG_RELEASE:=$(AUTORELEASE) PYPI_NAME:=pbkdf2 PKG_HASH:=ac6397369f128212c43064a2b4878038dab78dab41875364554aaf2a684e6979 @@ -28,7 +28,6 @@ define Package/python3-pbkdf2 TITLE:=PKCS#5 v2.0 PBKDF2 Module URL:=https://www.dlitz.net/software/python-pbkdf2/ DEPENDS:=+python3-light +python3-openssl - VARIANT:=python3 endef define Package/python-pbkdf2/description diff --git a/lang/python-periphery/Makefile b/lang/python-periphery/Makefile index b3fa649b5b..774d46cfc7 100644 --- a/lang/python-periphery/Makefile +++ b/lang/python-periphery/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-periphery PKG_VERSION:=2.3.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE @@ -28,7 +28,6 @@ define Package/python3-periphery TITLE:=Linux Peripheral I/O URL:=https://github.com/vsergeev/python-periphery DEPENDS:=+python3-light - VARIANT:=python3 endef define Package/python3-periphery/description diff --git a/lang/python-prctl/Makefile b/lang/python-prctl/Makefile index 1e0c43b5c0..6b06e28c6c 100644 --- a/lang/python-prctl/Makefile +++ b/lang/python-prctl/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-prctl -PKG_VERSION:=1.7 -PKG_RELEASE:=2 +PKG_VERSION:=1.8.1 +PKG_RELEASE:=$(AUTORELEASE) PYPI_NAME:=python-prctl -PKG_HASH:=57ebd556616d6ffe1f794f514680e84a03737cb070de37722198d7ad6c8f4fda +PKG_HASH:=b4ca9a25a7d4f1ace4fffd1f3a2e64ef5208fe05f929f3edd5e27081ca7e67ce PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later @@ -31,7 +31,6 @@ define Package/python3-prctl DEPENDS:= \ +python3-light \ +libcap - VARIANT:=python3 endef define Package/python3-prctl/description diff --git a/lang/python-prctl/patches/001-skip-checks.patch b/lang/python-prctl/patches/001-skip-checks.patch index 74768f3c2f..4f6dbef4a1 100644 --- a/lang/python-prctl/patches/001-skip-checks.patch +++ b/lang/python-prctl/patches/001-skip-checks.patch @@ -31,13 +31,13 @@ - sys.stderr.write("You need to install gcc to build this module\n") - sys.exit(1) - --sp = subprocess.Popen(['cpp'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +-sp = subprocess.Popen(['cpp'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=os.environ) -sp.communicate('#include \n'.encode()) -if sp.returncode: - sys.stderr.write("You need to install libc development headers to build this module\n") - exit = True - --sp = subprocess.Popen(['cpp'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +-sp = subprocess.Popen(['cpp'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=os.environ) -sp.communicate('#include \n'.encode()) -if sp.returncode: - sys.stderr.write("You need to install libcap development headers to build this module\n") diff --git a/lang/python-ubus/Makefile b/lang/python-ubus/Makefile index ddd1cbdee5..83f5b9ff28 100644 --- a/lang/python-ubus/Makefile +++ b/lang/python-ubus/Makefile @@ -8,15 +8,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-ubus -PKG_VERSION:=0.1 -PKG_RELEASE:=2 +PKG_VERSION:=0.1.2 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=LGPLv2.1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/python-ubus.git -PKG_MIRROR_HASH:=8a1ee1eaa811d983ccdef186f3f248a099867e651575f56b72318367f19d56e9 +PKG_MIRROR_HASH:=ab8fb7ca84ee22fa4f3ca96c3c130e619e346f9abad4c1da5c72cb951acb043b PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) @@ -31,7 +31,6 @@ define Package/python3-ubus TITLE:=Python3 ubus URL:=https://gitlab.nic.cz/turris/python-ubus/ DEPENDS:=+libubus +libblobmsg-json +python3-light - VARIANT:=python3 endef define Package/python3-ubus/description diff --git a/lang/python-websockets/Makefile b/lang/python-websockets/Makefile deleted file mode 100644 index 46d4ce25ea..0000000000 --- a/lang/python-websockets/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (C) 2018-2021 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-websockets -PKG_VERSION:=9.1 -PKG_RELEASE:=1 - -PYPI_NAME:=websockets -PKG_HASH:=276d2339ebf0df4f45df453923ebd2270b87900eda5dfd4a6b0cfa15f82111c3 - -PKG_MAINTAINER:= -PKG_LICENSE:=BSD-3-Clause -PKG_LICENSE_FILES:=LICENSE - -include $(TOPDIR)/feeds/packages/lang/python/pypi.mk -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk - -define Package/python3-websockets - SUBMENU:=Python - SECTION:=lang - CATEGORY:=Languages - TITLE:=library for developing WebSocket servers and clients - URL:=https://websockets.readthedocs.io/ - DEPENDS:=+python3-light - VARIANT:=python3 -endef - -define Package/python3-websockets/description - websockets is a library for building WebSocket servers and clients - in Python with a focus on correctness and simplicity. - - Built on top of asyncio, Python’s standard asynchronous I/O framework. - It provides an elegant coroutine-based API. -endef - -$(eval $(call Py3Package,python3-websockets)) -$(eval $(call BuildPackage,python3-websockets)) -$(eval $(call BuildPackage,python3-websockets-src)) diff --git a/lang/python3-python/Makefile b/lang/python3-python/Makefile deleted file mode 100644 index 9731619e15..0000000000 --- a/lang/python3-python/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# -## Copyright (C) 2020 CZ.NIC z.s.p.o. (http://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:=python3-python -PKG_VERSION:=1.0.0 -PKG_RELEASE:=1 -PKG_MAINTAINER:=CZ.NIC -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk - -define Package/python3-python - TITLE:=Python3 python link - DEPENDS:=+python3-base - CONFLICTS:=python-base -endef - -define Package/python3-python/description - This package provides python link to python3. -endef - -define Package/python3-python/install - $(INSTALL_DIR) $(1)/usr/bin - ln -s /usr/bin/python3 $(1)/usr/bin/python -endef - -Build/Compile:=: - -$(eval $(call BuildPackage,python3-python)) diff --git a/lang/pyzmq/Makefile b/lang/pyzmq/Makefile index cef3028090..91bda14b15 100644 --- a/lang/pyzmq/Makefile +++ b/lang/pyzmq/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2017-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# Copyright (C) 2017-2021 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. @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pyzmq -PKG_VERSION:=19.0.1 -PKG_RELEASE:=1 +PKG_VERSION:=22.3.0 +PKG_RELEASE:=$(AUTORELEASE) PYPI_NAME:=pyzmq -PKG_HASH:=13a5638ab24d628a6ade8f794195e1a1acd573496c3b85af2f1183603b7bf5e0 +PKG_HASH:=8eddc033e716f8c91c6a2112f0a8ebc5e00532b4a6ae1eb0ccc48e027f9c671c PKG_BUILD_DEPENDS:=cython @@ -27,7 +27,6 @@ define Package/python3-zmq TITLE:=Python bindings for 0MQ URL:=https://github.com/zeromq/pyzmq DEPENDS:=+python3 +libzmq - VARIANT:=python3 endef define Package/python3-zmq/description diff --git a/lang/pyzmq/patches/0001-setup.py-use-darwin-hack-for-all-platforms.patch b/lang/pyzmq/patches/0001-setup.py-use-darwin-hack-for-all-platforms.patch index 5711e31ad9..dea6f41f10 100644 --- a/lang/pyzmq/patches/0001-setup.py-use-darwin-hack-for-all-platforms.patch +++ b/lang/pyzmq/patches/0001-setup.py-use-darwin-hack-for-all-platforms.patch @@ -20,7 +20,7 @@ are handled in such a way. Implemented here because distutils runtime_library_dirs doesn't do anything on darwin """ - if sys.platform == 'darwin': -- settings['extra_link_args'].extend(['-Wl,-rpath','-Wl,%s' % path]) +- settings['extra_link_args'].extend(['-Wl,-rpath', '-Wl,%s' % path]) - else: - settings['runtime_library_dirs'].append(path) + settings['extra_link_args'].extend(['-Wl,-rpath','-Wl,%s' % path]) diff --git a/lang/ruby-breakpoint/Makefile b/lang/ruby-breakpoint/Makefile deleted file mode 100644 index 37697b1078..0000000000 --- a/lang/ruby-breakpoint/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -## Copyright (C) 2019 CZ.NIC z.s.p.o. (http://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:=ruby-breakpoint -PKG_VERSION:=2.7.1 -PKG_RELEASE:=1 -PKG_MAINTAINER:=CZ.NIC - -HOST_BUILD_DEPENDS:=ruby/host - -include $(INCLUDE_DIR)/host-build.mk -include $(INCLUDE_DIR)/package.mk - -Build/Compile:=: -Host/Compile:=: - -define Host/Install - $(STAGING_DIR_HOSTPKG)/bin/gem install breakpoint -v $(PKG_VERSION) -endef - -$(eval $(call HostBuild)) -$(eval $(call Build/DefaultTargets)) diff --git a/libs/base64c/Makefile b/libs/base64c/Makefile index 0e75bb5684..825b3f141c 100644 --- a/libs/base64c/Makefile +++ b/libs/base64c/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=base64c PKG_VERSION:=0.2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=base64c-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://gitlab.nic.cz/api/v4/projects/973/packages/generic/base64c/$(PKG_VERSION) diff --git a/libs/libhtp/Makefile b/libs/libhtp/Makefile index 3227764471..03e258256c 100644 --- a/libs/libhtp/Makefile +++ b/libs/libhtp/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libhtp PKG_VERSION:=0.5.37 -PKG_RELEASE=1 +PKG_RELEASE=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/OISF/libhtp/tar.gz/$(PKG_VERSION)? diff --git a/libs/libpaho-mqtt-c/Makefile b/libs/libpaho-mqtt-c/Makefile index 94afa81566..37865eb056 100644 --- a/libs/libpaho-mqtt-c/Makefile +++ b/libs/libpaho-mqtt-c/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libpaho-mqtt-c -PKG_VERSION:=1.3.8 -PKG_RELEASE=1 +PKG_VERSION:=1.3.9 +PKG_RELEASE=$(AUTORELEASE) PKG_SOURCE:=v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/eclipse/paho.mqtt.c/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=4920ff685344cdb0272568bc4414dcf48fcdfc4a98c78b1f3ca49c38417bf391 +PKG_HASH:=386c9b5fa1cf6d0d516db12d57fd8f6a410dd0fdc5e9a2da870aae437a2535ed PKG_BUILD_DIR:=$(BUILD_DIR)/paho.mqtt.c-$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC diff --git a/libs/libsass/Makefile b/libs/libsass/Makefile deleted file mode 100644 index 505f64fefc..0000000000 --- a/libs/libsass/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -# -## 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:=libsass -PKG_VERSION:=3.6.4 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/sass/libsass/tar.gz/$(PKG_VERSION)? -PKG_HASH:=f9484d9a6df60576e791566eab2f757a97fd414fce01dd41fc0a693ea5db2889 - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE - -HOST_BUILD_DEPENDS:= -PKG_INSTALL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/host-build.mk - -define Package/libsass - SECTION:=libs - CATEGORY:=Libraries - TITLE:=libsass - URL:=https://sass-lang.com/libsass - DEPENDS:=libstdcpp -endef - -define Package/libsass/description - LibSass is a C++ port of the original Ruby Sass CSS compiler with a C API. -endef - -MAKE_FLAGS += \ - BUILD=shared \ - PREFIX=/ \ - -define Host/Compile - cd $(HOST_BUILD_DIR)/; $(MAKE) -C "$(HOST_BUILD_DIR)" BUILD=shared PREFIX=$(STAGING_DIR_HOST)/usr/lib/ -endef - -define Host/Install - cd $(HOST_BUILD_DIR)/; $(MAKE) -C "$(HOST_BUILD_DIR)" BUILD=shared PREFIX=$(STAGING_DIR_HOST)/usr/lib/ install -endef - -define Package/libsass/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/lib/libsass.so $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,libsass)) -$(eval $(call HostBuild)) diff --git a/libs/logc-libs/Makefile b/libs/logc-libs/Makefile new file mode 100644 index 0000000000..948d962c80 --- /dev/null +++ b/libs/logc-libs/Makefile @@ -0,0 +1,74 @@ +# +## Copyright (C) 2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# +## This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# # +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=logc-libs +PKG_VERSION:=0.1.0 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/logc-libs.git +PKG_MIRROR_HASH:=f89cda404e12e927c01facf094a22c7a47298c7dfc4a9cf16d9122f6904bbcf4 +PKG_SOURCE_VERSION:=v$(PKG_VERSION) + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/autotools.mk + +define Package/logc-libs/Default + SECTION:=libs + CATEGORY:=Libraries + URL:=https://gitlab.nic.cz/turris/logc-libs +endef + +define Package/logc-czmq + $(call Package/logc-libs/Default) + DEPENDS:=+logc +czmq + TITLE:=logc-czmq +endef + +define Package/logc-libevent + $(call Package/logc-libs/Default) + DEPENDS:=+logc +libevent2 + TITLE:=logc-libevent +endef + +define Package/logc-czmq/description + Logging library for C - CZMQ plugin +endef + +define Package/logc-libevent/description + Logging library for C - libevent plugin +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ +endef + +define Package/logc-czmq/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libczmq_logc.so* $(1)/usr/lib/ +endef + +define Package/logc-libevent/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_logc.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,logc-czmq)) +$(eval $(call BuildPackage,logc-libevent)) diff --git a/libs/logc/Makefile b/libs/logc/Makefile index 91aed42613..85f2cccd9a 100644 --- a/libs/logc/Makefile +++ b/libs/logc/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +## Copyright (C) 2020-2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=logc -PKG_VERSION:=0.1.0 -PKG_RELEASE:=1 +PKG_VERSION:=0.4.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/logc.git -PKG_MIRROR_HASH:=20e2d4079436a223a9449b5cdf6084f7100c8587e9981591000873dc42c571c5 +PKG_MIRROR_HASH:=8d9d5d0fec6b70e1c85c78eb786c77d0b4489935f88aaf6b4901af6a73626e85 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -53,6 +53,9 @@ define Package/logc-argp/description endef define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ + $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ diff --git a/libs/logc/patches/0001-configure-Do-not-check-for-bootstrap-file.patch b/libs/logc/patches/0001-configure-Do-not-check-for-bootstrap-file.patch new file mode 100644 index 0000000000..490a672b32 --- /dev/null +++ b/libs/logc/patches/0001-configure-Do-not-check-for-bootstrap-file.patch @@ -0,0 +1,27 @@ +From 7105fb9859f4d3264dbaaee5dc7596c561dc3e1a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= +Date: Tue, 4 Jan 2022 18:38:38 +0100 +Subject: [PATCH] configure.ac: fix cross compilation + +The AC_CHECK_FILE is not supported when cross compiling. We can just use +plain AS_IF with test for the same effect. +--- + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 5946a53..b6d42ea 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -18,7 +18,7 @@ PKG_INSTALLDIR + AX_CHECK_COMPILE_FLAG([-std=c11], , AC_MSG_ERROR([Compiler with C11 standard support is required])) + AX_APPEND_FLAG([-std=c11]) + +-AC_CHECK_FILE([${0%/*}/bootstrap],[ ++AS_IF([test -x "${0%/*}/bootstrap" ],[ + AC_PATH_PROG([GPERF], [gperf]) + AS_IF([test -z "$GPERF"], [AC_MSG_ERROR([Missing gperf generator])]) + ]) +-- +GitLab + diff --git a/libs/logc/patches/0002-Set-internal-inline-functions-as-static-as-well.patch b/libs/logc/patches/0002-Set-internal-inline-functions-as-static-as-well.patch new file mode 100644 index 0000000000..466cfc9685 --- /dev/null +++ b/libs/logc/patches/0002-Set-internal-inline-functions-as-static-as-well.patch @@ -0,0 +1,35 @@ +From 334bcb27c9f01a67899a78187ffa88971c8a26db Mon Sep 17 00:00:00 2001 +From: Michal Hrusecky +Date: Mon, 20 Dec 2021 14:39:25 +0100 +Subject: [PATCH 2/2] Set internal inline functions as static as well + +Making sure those functions are not exported and prevent future build +errors like those: + +/home/fast/miska/omnia6-build/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-8.4.0_musl_eabi/lib64/gcc/arm-openwrt-linux-muslgnueabi/8.4.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/fast/miska/omnia6-build/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/lib/liblogc.so: undefined reference to `msg2syslog_level' +/home/fast/miska/omnia6-build/staging_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-8.4.0_musl_eabi/lib64/gcc/arm-openwrt-linux-muslgnueabi/8.4.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/fast/miska/omnia6-build/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/usr/lib/liblogc.so: undefined reference to `str_empty' +--- + logc/util.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/logc/util.h b/logc/util.h +index f0c1c27..4c77d8c 100644 +--- a/logc/util.h ++++ b/logc/util.h +@@ -24,11 +24,11 @@ + #include + + +-inline bool str_empty(const char *str) { ++static inline bool str_empty(const char *str) { + return !str || *str == '\0'; + } + +-inline int msg2syslog_level(enum log_message_level msg_level) { ++static inline int msg2syslog_level(enum log_message_level msg_level) { + switch (msg_level) { + case LL_CRITICAL: + return LOG_CRIT; +-- +2.34.1 + diff --git a/libs/turrishw/Makefile b/libs/turrishw/Makefile index 74ec191d81..5ff052580f 100644 --- a/libs/turrishw/Makefile +++ b/libs/turrishw/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2018-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# Copyright (C) 2018-2022 CZ.NIC, z. s. p. o. (https://www.nic.cz/) # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turrishw -PKG_VERSION:=0.5.1 -PKG_RELEASE:=1 +PKG_VERSION:=0.9.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/turrishw.git -PKG_MIRROR_HASH:=5f640319843409e6b7e1cab13b5c8273809ef0b57f90f45d569bccff03919125 +PKG_MIRROR_HASH:=e865fefa306dc827725f6556f3fe012173175d7b3e8060bafefff69506bc3e12 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -28,8 +28,7 @@ define Package/turrishw CATEGORY:=Languages SUBMENU:=Python TITLE:=turrishw - DEPENDS:=+python3-light - VARIANT:=python3 + DEPENDS:=+python3-light +python3-logging endef define Package/turrishw/description diff --git a/libs/uriparser/Makefile b/libs/uriparser/Makefile index 96c6c1d77f..0b0879b2e8 100644 --- a/libs/uriparser/Makefile +++ b/libs/uriparser/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uriparser -PKG_VERSION:=0.9.5 -PKG_RELEASE:=1 +PKG_VERSION:=0.9.6 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/uriparser/uriparser/archive -PKG_HASH:=dece5067b4517c4b16cde332c491b4b3508249d2a8f4ba393229575d3c5241c0 +PKG_HASH:=defaf550bf6fe05e89afb9814dccc6bd643a3b0a8308801a2c04b76682b87383 PKG_BUILD_DIR:=$(BUILD_DIR)/uriparser-uriparser-$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC diff --git a/libs/uthash/Makefile b/libs/uthash/Makefile index 15e57a97c7..d7c5db380c 100644 --- a/libs/uthash/Makefile +++ b/libs/uthash/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uthash PKG_VERSION:=2.3.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/troydhanson/uthash/archive diff --git a/multimedia/ffmpeg/Config.in b/multimedia/ffmpeg/Config.in deleted file mode 100644 index 760dad6bf7..0000000000 --- a/multimedia/ffmpeg/Config.in +++ /dev/null @@ -1,434 +0,0 @@ -menu "Configuration" - depends on PACKAGE_libffmpeg-custom - -config FFMPEG_CUSTOM_PATENTED - bool "Include patented codecs and technologies" - default BUILD_PATENTED - -comment "Profiles ---" - -config FFMPEG_CUSTOM_FFSERVER_SUPPORT - bool "Include support for ffserver (FFmpeg streaming server)" - select FFMPEG_CUSTOM_MUXER_ffm - select FFMPEG_CUSTOM_DEMUXER_ffm - select FFMPEG_CUSTOM_DEMUXER_rtsp - select FFMPEG_CUSTOM_PROTOCOL_rtp - -config FFMPEG_CUSTOM_MINIDLNA_SUPPORT - bool "Include support for minidlna" - depends on FFMPEG_CUSTOM_PATENTED - select FFMPEG_CUSTOM_DECODER_aac - select FFMPEG_CUSTOM_DECODER_ac3 - select FFMPEG_CUSTOM_DECODER_flac - select FFMPEG_CUSTOM_DECODER_h264 - select FFMPEG_CUSTOM_DECODER_jpegls - select FFMPEG_CUSTOM_DECODER_mp3 - select FFMPEG_CUSTOM_DECODER_mpeg1video - select FFMPEG_CUSTOM_DECODER_mpeg2video - select FFMPEG_CUSTOM_DECODER_mpeg4 - select FFMPEG_CUSTOM_DECODER_mpegvideo - select FFMPEG_CUSTOM_DECODER_png - select FFMPEG_CUSTOM_DECODER_wmav1 - select FFMPEG_CUSTOM_DECODER_wmav2 - select FFMPEG_CUSTOM_DEMUXER_aac - select FFMPEG_CUSTOM_DEMUXER_ac3 - select FFMPEG_CUSTOM_DEMUXER_avi - select FFMPEG_CUSTOM_DEMUXER_flac - select FFMPEG_CUSTOM_DEMUXER_h264 - select FFMPEG_CUSTOM_DEMUXER_matroska - select FFMPEG_CUSTOM_DEMUXER_mov - select FFMPEG_CUSTOM_DEMUXER_mp3 - select FFMPEG_CUSTOM_DEMUXER_mpegts - select FFMPEG_CUSTOM_DEMUXER_mpegvideo - select FFMPEG_CUSTOM_PARSER_ac3 - select FFMPEG_CUSTOM_PARSER_flac - select FFMPEG_CUSTOM_PARSER_h264 - select FFMPEG_CUSTOM_PARSER_mpeg4video - select FFMPEG_CUSTOM_PARSER_mpegaudio - select FFMPEG_CUSTOM_PROTOCOL_file - -config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT - bool "Include support for most audio decoding requirements" - depends on FFMPEG_CUSTOM_PATENTED - select FFMPEG_CUSTOM_DECODER_aac - select FFMPEG_CUSTOM_DECODER_aac_latm - select FFMPEG_CUSTOM_DECODER_ac3 - select FFMPEG_CUSTOM_SELECT_adpcm - select FFMPEG_CUSTOM_DECODER_alac - select FFMPEG_CUSTOM_DECODER_amrnb - select FFMPEG_CUSTOM_DECODER_amrwb - select FFMPEG_CUSTOM_DECODER_ape - select FFMPEG_CUSTOM_DECODER_atrac3 - select FFMPEG_CUSTOM_DECODER_flac - select FFMPEG_CUSTOM_DECODER_mp2 - select FFMPEG_CUSTOM_DECODER_mp3 - select FFMPEG_CUSTOM_DECODER_mpc7 - select FFMPEG_CUSTOM_DECODER_mpc8 - select FFMPEG_CUSTOM_DECODER_opus - select FFMPEG_CUSTOM_DECODER_pcm_s16be - select FFMPEG_CUSTOM_DECODER_pcm_s16le - select FFMPEG_CUSTOM_SELECT_speex - select FFMPEG_CUSTOM_DECODER_vorbis - select FFMPEG_CUSTOM_DECODER_wavpack - select FFMPEG_CUSTOM_DECODER_wmav1 - select FFMPEG_CUSTOM_DECODER_wmav2 - select FFMPEG_CUSTOM_DECODER_wmalossless - select FFMPEG_CUSTOM_DECODER_wmapro - select FFMPEG_CUSTOM_DECODER_zlib - select FFMPEG_CUSTOM_DEMUXER_aac - select FFMPEG_CUSTOM_DEMUXER_ac3 - select FFMPEG_CUSTOM_DEMUXER_aiff - select FFMPEG_CUSTOM_DEMUXER_amr - select FFMPEG_CUSTOM_DEMUXER_ape - select FFMPEG_CUSTOM_DEMUXER_avi - select FFMPEG_CUSTOM_DEMUXER_flac - select FFMPEG_CUSTOM_DEMUXER_ffm - select FFMPEG_CUSTOM_DEMUXER_matroska - select FFMPEG_CUSTOM_DEMUXER_mp3 - select FFMPEG_CUSTOM_DEMUXER_mov - select FFMPEG_CUSTOM_DEMUXER_mpc - select FFMPEG_CUSTOM_DEMUXER_mpc8 - select FFMPEG_CUSTOM_DEMUXER_mpegts - select FFMPEG_CUSTOM_DEMUXER_ogg - select FFMPEG_CUSTOM_DEMUXER_rm - select FFMPEG_CUSTOM_DEMUXER_rtsp - select FFMPEG_CUSTOM_DEMUXER_rtp - select FFMPEG_CUSTOM_DEMUXER_sdp - select FFMPEG_CUSTOM_DEMUXER_wav - select FFMPEG_CUSTOM_DEMUXER_wv - select FFMPEG_CUSTOM_PARSER_aac - select FFMPEG_CUSTOM_PARSER_aac_latm - select FFMPEG_CUSTOM_PARSER_ac3 - select FFMPEG_CUSTOM_PARSER_flac - select FFMPEG_CUSTOM_PARSER_mpegaudio - select FFMPEG_CUSTOM_PARSER_opus - select FFMPEG_CUSTOM_PROTOCOL_file - select FFMPEG_CUSTOM_PROTOCOL_http - select FFMPEG_CUSTOM_PROTOCOL_rtp - select FFMPEG_CUSTOM_PROTOCOL_tcp - select FFMPEG_CUSTOM_PROTOCOL_udp - -comment "External Libraries ---" - -config FFMPEG_CUSTOM_SELECT_libopus - bool "Opus" - -config FFMPEG_CUSTOM_SELECT_speex - bool "Speex" - -comment "Encoders ---" - -config FFMPEG_CUSTOM_ENCODER_ac3 - bool "AC3" - depends on FFMPEG_CUSTOM_PATENTED - select FFMPEG_CUSTOM_PARSER_ac3 - -config FFMPEG_CUSTOM_ENCODER_jpegls - bool "JPEG-LS" - -config FFMPEG_CUSTOM_ENCODER_mpeg1video - bool "MPEG-1 Video" - -config FFMPEG_CUSTOM_ENCODER_mpeg2video - bool "MPEG-2 Video" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_ENCODER_mpeg4 - bool "MPEG-4" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_ENCODER_pcm_s16be - bool "PCM signed 16-bit big-endian" - -config FFMPEG_CUSTOM_ENCODER_pcm_s16le - bool "PCM signed 16-bit little-endian" - -config FFMPEG_CUSTOM_ENCODER_png - bool "PNG" - select FFMPEG_CUSTOM_ENCODER_zlib - -config FFMPEG_CUSTOM_ENCODER_vorbis - bool "Vorbis" - -config FFMPEG_CUSTOM_ENCODER_zlib - bool "Zlib" - -comment "Decoders ---" - -config FFMPEG_CUSTOM_DECODER_aac - bool "AAC (Advanced Audio Coding)" - depends on FFMPEG_CUSTOM_PATENTED - select FFMPEG_CUSTOM_PARSER_aac - -config FFMPEG_CUSTOM_SELECT_adpcm - bool "ADPCM (multiple types)" - -config FFMPEG_CUSTOM_DECODER_ac3 - bool "AC3" - depends on FFMPEG_CUSTOM_PATENTED - select FFMPEG_CUSTOM_PARSER_ac3 - -config FFMPEG_CUSTOM_DECODER_alac - bool "ALAC" - -config FFMPEG_CUSTOM_DECODER_amrnb - bool "AMR-NB" - select FFMPEG_CUSTOM_DEMUXER_amr - -config FFMPEG_CUSTOM_DECODER_amrwb - bool "AMR-WB" - select FFMPEG_CUSTOM_DEMUXER_amr - -config FFMPEG_CUSTOM_DECODER_ape - bool "APE" - -config FFMPEG_CUSTOM_DECODER_atrac3 - bool "ATRAC3" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_DECODER_flac - bool "FLAC" - select FFMPEG_CUSTOM_PARSER_flac - -config FFMPEG_CUSTOM_DECODER_gif - bool "GIF" - -config FFMPEG_CUSTOM_DECODER_h264 - bool "H.264" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_DECODER_jpegls - bool "JPEG-LS" - -config FFMPEG_CUSTOM_DECODER_mp2 - bool "MP2 (MPEG Audio Layer 2)" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_DECODER_mp3 - bool "MP3 (MPEG Audio Layer 2)" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_DECODER_mpegvideo - bool "MPEG Video" - -config FFMPEG_CUSTOM_DECODER_mpeg1video - bool "MPEG-1 Video" - -config FFMPEG_CUSTOM_DECODER_mpeg2video - bool "MPEG-2 Video" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_DECODER_mpeg4 - bool "MPEG-4" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_DECODER_mpc7 - bool "Musepack 7" - select FFMPEG_CUSTOM_DEMUXER_mpc - -config FFMPEG_CUSTOM_DECODER_mpc8 - bool "Musepack 8" - select FFMPEG_CUSTOM_DEMUXER_mpc8 - -config FFMPEG_CUSTOM_DECODER_opus - bool "Opus" - -config FFMPEG_CUSTOM_DECODER_pcm_s16be - bool "PCM signed 16-bit big-endian" - -config FFMPEG_CUSTOM_DECODER_pcm_s16le - bool "PCM signed 16-bit little-endian" - -config FFMPEG_CUSTOM_DECODER_png - bool "PNG" - select FFMPEG_CUSTOM_DECODER_zlib - -config FFMPEG_CUSTOM_DECODER_vorbis - bool "Vorbis" - select FFMPEG_CUSTOM_DEMUXER_ogg - -config FFMPEG_CUSTOM_DECODER_wavpack - bool "Wavpack" - -config FFMPEG_CUSTOM_DECODER_wmav1 - bool "WMAv1" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_DECODER_wmav2 - bool "WMAv2" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_DECODER_zlib - bool "Zlib" - -comment "Muxers ---" - -config FFMPEG_CUSTOM_MUXER_ac3 - bool "AC3" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_MUXER_ffm - bool "FFM (ffserver live feed)" - -config FFMPEG_CUSTOM_MUXER_h264 - bool "H.264" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_MUXER_mp3 - bool "MP3 (MPEG Audio Layer 3)" - -config FFMPEG_CUSTOM_MUXER_mp4 - bool "MP4" - -config FFMPEG_CUSTOM_MUXER_mpeg1video - bool "MPEG-1 Video" - -config FFMPEG_CUSTOM_MUXER_mpeg2video - bool "MPEG-2 Video" - -config FFMPEG_CUSTOM_MUXER_mpegts - bool "MPEG-2 (TS)" - -config FFMPEG_CUSTOM_MUXER_ogg - bool "Ogg" - -config FFMPEG_CUSTOM_MUXER_rtp - bool "RTP" - -comment "Demuxers ---" - -config FFMPEG_CUSTOM_DEMUXER_aac - bool "AAC" - -config FFMPEG_CUSTOM_DEMUXER_avi - bool "AVI (Audio Video Interleave)" - -config FFMPEG_CUSTOM_DEMUXER_ac3 - bool "AC3" - -config FFMPEG_CUSTOM_DEMUXER_amr - bool "AMR" - -config FFMPEG_CUSTOM_DEMUXER_ape - bool "APE" - -config FFMPEG_CUSTOM_DEMUXER_flac - bool "FLAC" - -config FFMPEG_CUSTOM_DEMUXER_ffm - bool "FFM (ffserver live feed)" - -config FFMPEG_CUSTOM_DEMUXER_h264 - bool "H.264" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_DEMUXER_matroska - bool "Matroska (MKA,MKV)" - select FFMPEG_CUSTOM_DECODER_zlib - -config FFMPEG_CUSTOM_DEMUXER_mov - bool "MOV/MP4/M4A/3GP/3G2/MJ2" - select FFMPEG_CUSTOM_DECODER_zlib - -config FFMPEG_CUSTOM_DEMUXER_mp3 - bool "MP3 (MPEG Audio Layer 3)" - select FFMPEG_CUSTOM_PARSER_mpegaudio - -config FFMPEG_CUSTOM_DEMUXER_mpegvideo - bool "MPEG Video" - -config FFMPEG_CUSTOM_DEMUXER_mpegps - bool "MPEG-2 (PS)" - -config FFMPEG_CUSTOM_DEMUXER_mpegts - bool "MPEG-2 (TS)" - -config FFMPEG_CUSTOM_DEMUXER_mpc - bool "Musepack" - -config FFMPEG_CUSTOM_DEMUXER_mpc8 - bool "Musepack 8" - -config FFMPEG_CUSTOM_DEMUXER_ogg - bool "Ogg" - -config FFMPEG_CUSTOM_DEMUXER_rm - bool "RM" - help - RealMedia format demuxer - -config FFMPEG_CUSTOM_DEMUXER_rtsp - bool "RTSP" - select FFMPEG_CUSTOM_DEMUXER_rm - select FFMPEG_CUSTOM_DEMUXER_sdp - select FFMPEG_CUSTOM_DEMUXER_rtp - -config FFMPEG_CUSTOM_DEMUXER_sdp - bool "SDP" - select FFMPEG_CUSTOM_DEMUXER_mpegts - -config FFMPEG_CUSTOM_DEMUXER_rtp - bool "RTP" - -config FFMPEG_CUSTOM_DEMUXER_wav - bool "WAV" - -config FFMPEG_CUSTOM_DEMUXER_wv - bool "WV" - -comment "Parsers ---" - -config FFMPEG_CUSTOM_PARSER_aac - bool "AAC (Advanced Audio Coding)" - depends on FFMPEG_CUSTOM_PATENTED - -config FFMPEG_CUSTOM_PARSER_ac3 - bool "AC3" - -config FFMPEG_CUSTOM_PARSER_flac - bool "FLAC" - -config FFMPEG_CUSTOM_PARSER_h264 - bool "H.264" - depends on FFMPEG_CUSTOM_PATENTED - select FFMPEG_CUSTOM_DECODER_h264 - -config FFMPEG_CUSTOM_PARSER_mpegaudio - bool "MPEG Audio" - -config FFMPEG_CUSTOM_PARSER_mpegvideo - bool "MPEG Video" - -config FFMPEG_CUSTOM_PARSER_mpeg4video - bool "MPEG-4 Video" - -config FFMPEG_CUSTOM_PARSER_opus - bool "Opus" - -comment "Protocols ---" - -config FFMPEG_CUSTOM_PROTOCOL_file - bool "file:" - -config FFMPEG_CUSTOM_PROTOCOL_http - bool "http:" - -config FFMPEG_CUSTOM_PROTOCOL_icecast - bool "icecast:" - select FFMPEG_CUSTOM_PROTOCOL_http - -config FFMPEG_CUSTOM_PROTOCOL_pipe - bool "pipe:" - -config FFMPEG_CUSTOM_PROTOCOL_rtp - bool "rtp:" - select FFMPEG_CUSTOM_PROTOCOL_udp - -config FFMPEG_CUSTOM_PROTOCOL_tcp - bool "tcp:" - -config FFMPEG_CUSTOM_PROTOCOL_udp - bool "udp:" - -endmenu - diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile deleted file mode 100644 index bcefc00a6c..0000000000 --- a/multimedia/ffmpeg/Makefile +++ /dev/null @@ -1,212 +0,0 @@ -# -# Copyright (C) 2006-2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=ffmpeg -PKG_VERSION:=4.2.5 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=https://ffmpeg.org/releases/ -PKG_HASH:=574e66a7caa4b08c1d2c0e26a79559cdd23732cbc57894bd74df3989c35594c9 - -PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3 -PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3 - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - -include $(INCLUDE_DIR)/package.mk - -define Package/ffmpeg/Default - TITLE:=FFmpeg - URL:=https://www.ffmpeg.org/ -endef - -define Package/ffmpeg/Default/description - FFmpeg is a a software package that can record, convert and stream digital - audio and video in numerous formats. -endef - -define Package/ffmpeg -$(call Package/ffmpeg/Default) - SECTION:=multimedia - CATEGORY:=Multimedia - TITLE+= program - DEPENDS+= +libpthread +libffmpeg - VARIANT:=full -endef - -define Package/ffmpeg/description -$(call Package/ffmpeg/Default/description) - . - This package contains the FFmpeg command line tool. -endef - - -define Package/ffprobe -$(call Package/ffmpeg/Default) - SECTION:=multimedia - CATEGORY:=Multimedia - TITLE+= CLI media identifier - DEPENDS+= +libffmpeg - VARIANT:=full -endef - -define Package/ffprobe/description -$(call Package/ffmpeg/Default/description) - . - This package contains the FFprobe command line tool. -endef - -define Package/libffmpeg -$(call Package/ffmpeg/Default) - SECTION:=libs - CATEGORY:=Libraries - TITLE+= libraries (full) - DEPENDS+= +libpthread +zlib +libbz2 +libspeex +alsa-lib +LIBC_USE_MUSL:libfreetype - PROVIDES:= libffmpeg-mini libffmpeg-full libffmpeg-custom libffmpeg-audio-dec - VARIANT:=full -endef - -define Package/libffmpeg/description -$(call Package/ffmpeg/Default/description) - . - This package contains full-featured FFmpeg shared libraries. -endef - -# Strip off FPU notation -REAL_CPU_TYPE:=$(firstword $(subst +, ,$(CONFIG_CPU_TYPE))) -# Fixup cpu types recogized by ffmpeg configure -REAL_CPU_TYPE:=$(subst octeonplus,octeon+,$(REAL_CPU_TYPE)) - -FFMPEG_CONFIGURE:= \ - CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - ./configure \ - --enable-cross-compile \ - --cross-prefix="$(TARGET_CROSS)" \ - --arch="$(ARCH)" \ - $(if $(REAL_CPU_TYPE),--cpu=$(call qstrip,$(REAL_CPU_TYPE)),) \ - --target-os=linux \ - --prefix="/usr" \ - --pkg-config="pkg-config" \ - --enable-shared \ - --enable-static \ - --enable-pthreads \ - --enable-zlib \ - --disable-doc \ - --disable-debug \ - --enable-gpl \ - --enable-version3 \ - \ - --disable-lzma \ - --disable-vaapi \ - --disable-vdpau \ - --disable-outdevs \ - --enable-avresample - -ifeq ($(CONFIG_SOFT_FLOAT),y) -FFMPEG_CONFIGURE+= \ - --disable-altivec \ - --disable-vsx \ - --disable-power8 \ - --disable-armv5te \ - --disable-armv6 \ - --disable-armv6t2 \ - --disable-inline-asm \ - --disable-mipsdsp \ - --disable-mipsdspr2 \ - --disable-mipsfpu \ - --disable-msa \ - --disable-mmi \ - --disable-fast-unaligned \ - --disable-runtime-cpudetect - -else ifneq ($(findstring arm,$(CONFIG_ARCH)),) -FFMPEG_CONFIGURE+= \ - --disable-runtime-cpudetect -# XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700) -else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),) -FFMPEG_CONFIGURE+= \ - --disable-altivec -endif - -# libavcodec/mips/aacdec_mips.c build problem -# XXX: disable use of assembly on MIPS. Patches welcome. -ifneq ($(findstring mips,$(CONFIG_ARCH)),) -FFMPEG_CONFIGURE+= \ - --disable-asm --disable-inline-asm -endif - -# selectively disable optimizations according to arch/cpu type -ifneq ($(findstring arm,$(CONFIG_ARCH)),) - FFMPEG_CONFIGURE+= --enable-lto - - ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),) - FFMPEG_CONFIGURE+= --enable-vfp - else - FFMPEG_CONFIGURE+= --disable-vfp - endif - ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),) - FFMPEG_CONFIGURE+= \ - --enable-neon \ - --enable-vfp - else - FFMPEG_CONFIGURE+= --disable-neon - endif -endif - -ifeq ($(ARCH),x86_64) - FFMPEG_CONFIGURE+= --enable-lto -endif - -ifneq ($(CONFIG_TARGET_x86),) -ifeq ($(CONFIG_NASM),y) - FFMPEG_CONFIGURE += --enable-x86asm -else - FFMPEG_CONFIGURE += --disable-x86asm -endif -endif - -define Build/Configure - ( cd $(PKG_BUILD_DIR); $(FFMPEG_CONFIGURE) ) -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - all install -endef - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,postproc,swresample,swscale} $(1)/usr/include/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,postproc,swresample,swscale}.{a,so*} $(1)/usr/lib/ - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,postproc,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/ -endef - -define Package/ffmpeg/install - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffmpeg $(1)/usr/bin/ -endef - -define Package/ffprobe/install - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/ffprobe $(1)/usr/bin/ -endef - -define Package/libffmpeg/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,postproc,swresample,swscale}.so.* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,ffmpeg)) -$(eval $(call BuildPackage,ffprobe)) -$(eval $(call BuildPackage,libffmpeg)) diff --git a/multimedia/libx265/Makefile b/multimedia/libx265/Makefile index aa7b90c848..c50b6b89d1 100644 --- a/multimedia/libx265/Makefile +++ b/multimedia/libx265/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=x265 PKG_VERSION:=3.2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://ftp.videolan.org/pub/videolan/x265 diff --git a/multimedia/tvheadend-cz-dvb-t2/Makefile b/multimedia/tvheadend-cz-dvb-t2/Makefile index ea18a2abe8..be721ed3bc 100644 --- a/multimedia/tvheadend-cz-dvb-t2/Makefile +++ b/multimedia/tvheadend-cz-dvb-t2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tvheadend-cz-dvt-t2 PKG_VERSION:=1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/multimedia/tvheadend/Config.in b/multimedia/tvheadend/Config.in deleted file mode 100644 index 61a3774a8b..0000000000 --- a/multimedia/tvheadend/Config.in +++ /dev/null @@ -1,17 +0,0 @@ -config TVHEADEND_CWC_SUPPORT - bool "NewCamd support" - default y - -config TVHEADEND_LINUXDVB_SUPPORT - bool "Linux DVB support" - default y - -config TVHEADEND_DVBSCAN_SUPPORT - bool "Fetch DVB-scan data" - depends on TVHEADEND_LINUXDVB_SUPPORT - default TVHEADEND_LINUXDVB_SUPPORT - -config TVHEADEND_AVAHI_SUPPORT - bool "Avahi client support" - select PACKAGE_libavahi-client - default n diff --git a/multimedia/tvheadend/Makefile b/multimedia/tvheadend/Makefile deleted file mode 100644 index 18904fafb8..0000000000 --- a/multimedia/tvheadend/Makefile +++ /dev/null @@ -1,96 +0,0 @@ -# -# Copyright (C) 2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=tvheadend -PKG_VERSION:=4.2.8 -PKG_RELEASE:=7 - -PKG_SOURCE_URL:=https://codeload.github.com/tvheadend/tvheadend/tar.gz/v$(PKG_VERSION)? -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH=1aef889373d5fad2a7bd2f139156d4d5e34a64b6d38b87b868a2df415f01f7ad - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-3.0 -PKG_LICENSE_FILES:=LICENSE.md - -PKG_FIXUP:=autoreconf - -PKG_USE_MIPS16:=0 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk - -define Package/tvheadend - SECTION:=multimedia - CATEGORY:=Multimedia - TITLE:=TV streaming server and recorder - DEPENDS:=+libopenssl +librt +zlib +TVHEADEND_AVAHI_SUPPORT:libavahi-client $(ICONV_DEPENDS) +libffmpeg +libx264 +libx265 +libpcre2 - URL:=https://tvheadend.org -endef - -define Package/tvheadend/description - Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android - supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, SAT>IP and HDHomeRun as input sources. - - Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming. -endef - -define Package/tvheadend/config - menu "Configuration" - depends on PACKAGE_tvheadend - source "$(SOURCE)/Config.in" - endmenu -endef - -ifeq ($(CONFIG_TVHEADEND_CWC_SUPPORT),) - CONFIGURE_ARGS += --disable-cwc -endif - -ifeq ($(CONFIG_TVHEADEND_LINUXDVB_SUPPORT),) - CONFIGURE_ARGS += --disable-linuxdvb -endif - -ifeq ($(CONFIG_TVHEADEND_DVBSCAN_SUPPORT),) - CONFIGURE_ARGS += --disable-dvbscan -endif - -ifeq ($(CONFIG_TVHEADEND_AVAHI_SUPPORT),) - CONFIGURE_ARGS += --disable-avahi -else - CONFIGURE_ARGS += --enable-avahi -endif - -CONFIGURE_ARGS += \ - --arch=$(ARCH) \ - --disable-dbus_1 \ - --enable-libav \ - --disable-bundle \ - --disable-uriparser \ - --disable-ffmpeg_static - -define Build/Prepare - $(call Build/Prepare/Default) - echo 'Tvheadend $(PKG_VERSION)-$(PKG_RELEASE)~turrisos' \ - > $(PKG_BUILD_DIR)/debian/changelog -endef - -define Package/tvheadend/conffiles -/etc/config/tvheadend -endef - -define Package/tvheadend/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/tvheadend.init $(1)/etc/init.d/tvheadend - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/tvheadend.config $(1)/etc/config/tvheadend - - $(MAKE) -C $(PKG_BUILD_DIR) install DESTDIR=$(1) -endef - -$(eval $(call BuildPackage,tvheadend)) diff --git a/multimedia/tvheadend/files/tvheadend.config b/multimedia/tvheadend/files/tvheadend.config deleted file mode 100644 index 62c139de53..0000000000 --- a/multimedia/tvheadend/files/tvheadend.config +++ /dev/null @@ -1,13 +0,0 @@ -#config tvheadend service -# option nosyslog '0' -# option use_temp_epgdb '0' -# option config_path '/etc/tvheadend' - -config tvheadend server - option ipv6 '1' -# option bindaddr '0.0.0.0' -# option http_port '9981' -# option http_root '/tvheadend' -# option htsp_port '9982' -# option htsp_port2 '9983' -# option xspf '0' diff --git a/multimedia/tvheadend/files/tvheadend.init b/multimedia/tvheadend/files/tvheadend.init deleted file mode 100644 index ab0ccb5227..0000000000 --- a/multimedia/tvheadend/files/tvheadend.init +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=98 -STOP=00 - -USE_PROCD=1 -PROG=/usr/bin/tvheadend - -TEMP_CONFIG=/tmp/tvheadend -PERSISTENT_CONFIG=/etc/tvheadend - -execute_first_run() { - "$PROG" -c "$1" -B -C -A >/dev/null 2>&1 -} - -ensure_config_exists() { - local config_path - - config_load tvheadend - config_get config_path service config_path - - [ -n "$config_path" ] || config_path="$PERSISTENT_CONFIG" - if [ \! -d "$config_path" ] || [ -z "$(ls -A $config_path)" ]; then - "$PROG" -c "$config_path" -B -C -A >/dev/null 2>&1 - fi - - # if use_temp_epgdb is enabled (default), most of the config is put to config_path - # (or /etc/config), except for epgdb.v2, which grows quite large and is write-heavy, - # so it's put into volatile tmpfs - # epgdb.v2 is created and symlinked to main config dir upon each start (if it doesn't exist) - config_get_bool use_temp_epgdb service use_temp_epgdb 1 - if [ "$use_temp_epgdb" == "1" ]; then - TEMP_EPG="${TEMP_CONFIG}/epgdb.v2" - [ ! -f "$TEMP_EPG" ] && mkdir -p "$TEMP_CONFIG" && touch "$TEMP_EPG" && chmod 700 "$TEMP_EPG" - [ -z "$config_path" ] && config_path="$PERSISTENT_CONFIG" - ln -sf "$TEMP_EPG" "${config_path}/epgdb.v2" - fi -} - -load_uci_config() { - config_load tvheadend - config_get config_path service config_path "$PERSISTENT_CONFIG" - [ -n "$config_path" ] && procd_append_param command -c "$config_path" - config_get_bool nosyslog service nosyslog 0 - [ -d "$config_path"/passwd ] || { - procd_append_param command --noacl - while sleep 1; do - if [ -d "$config_path"/passwd ]; then - /etc/init.d/tvheadend restart - exit 0 - fi - done > /dev/null 2>&1 & - } - [ "$nosyslog" -eq 1 ] && procd_append_param command --nosyslog - config_get_bool ipv6 server ipv6 0 - [ "$ipv6" -eq 1 ] && procd_append_param command --ipv6 - config_get bindaddr server bindaddr - [ -n "$bindaddr" ] && procd_append_param command --bindaddr "$bindaddr" - config_get http_port server http_port - [ -n "$http_port" ] && procd_append_param command --http_port "$http_port" - config_get http_root server http_root - [ -n "$http_root" ] && procd_append_param command --http_root "$http_root" - config_get htsp_port server htsp_port - [ -n "$htsp_port" ] && procd_append_param command --htsp_port "$htsp_port" - config_get htsp_port2 server htsp_port2 - [ -n "$htsp_port2" ] && procd_append_param command --htsp_port "$htsp_port2" - config_get xspf server xspf 0 - [ "$xspf" -eq 1 ] && procd_append_param command --xspf -} - -start_service() { - ensure_config_exists - procd_open_instance - procd_set_param file /etc/config/tvheadend - procd_set_param command "$PROG" -B - load_uci_config - procd_close_instance -} diff --git a/multimedia/tvheadend/patches/0001-Fix-compilation-for-OpenWrt.patch b/multimedia/tvheadend/patches/0001-Fix-compilation-for-OpenWrt.patch deleted file mode 100644 index a31473e948..0000000000 --- a/multimedia/tvheadend/patches/0001-Fix-compilation-for-OpenWrt.patch +++ /dev/null @@ -1,36 +0,0 @@ -From c8eb1a8326954c437ce32aa918d8d21662ff2344 Mon Sep 17 00:00:00 2001 -From: Josef Schlehofer -Date: Mon, 25 Nov 2019 23:55:25 +0100 -Subject: [PATCH] Fix compilation for OpenWrt - -Fixes -In file included from src/tvheadend.h:31:0, - from src/intlconv.c:2: -/build/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-7.3.0_musl_eabi/include/fortify/string.h: In function 'mempcpy': -/build/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-7.3.0_musl_eabi/include/fortify/string.h:149:9: error: called object '__orig_mempcpy' is not a function or function pointer -return __orig_mempcpy(__d, __s, __n); ---- - src/tvheadend.h | 5 ----- - 1 file changed, 5 deletions(-) - ---- a/src/tvheadend.h -+++ b/src/tvheadend.h -@@ -20,8 +20,6 @@ - - #include "build.h" - --#define _GNU_SOURCE --#include - #include - #include - #include -@@ -32,9 +30,6 @@ - #include - #include - #include --#if ENABLE_LOCKOWNER || ENABLE_ANDROID --#include --#endif - #include "queue.h" - #include "tvh_string.h" - #include "hts_strtab.h" diff --git a/multimedia/tvheadend/patches/0001-Load-OpenSSL-engines.patch b/multimedia/tvheadend/patches/0001-Load-OpenSSL-engines.patch deleted file mode 100644 index 690cd8170f..0000000000 --- a/multimedia/tvheadend/patches/0001-Load-OpenSSL-engines.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 7772e01bba614215430b0907b0f572683fd2558f Mon Sep 17 00:00:00 2001 -From: Josef Schlehofer -Date: Sun, 10 Mar 2019 10:26:11 +0100 -Subject: [PATCH] Load OpenSSL engines - ---- - src/main.c | 26 ++++++++++++++++---------- - 1 file changed, 16 insertions(+), 10 deletions(-) - ---- a/src/main.c -+++ b/src/main.c -@@ -98,7 +98,7 @@ typedef struct { - enum { - OPT_STR, - OPT_INT, -- OPT_BOOL, -+ OPT_BOOL, - OPT_STR_LIST, - } type; - void *param; -@@ -526,7 +526,7 @@ show_usage - free(desc); - } - } -- printf("%s", -+ printf("%s", - _("\n" - "For more information please visit the Tvheadend website:\n" - "https://tvheadend.org\n")); -@@ -615,7 +615,7 @@ mtimer_thread(void *aux) - next = now + sec2mono(3600); - - while((mti = LIST_FIRST(&mtimers)) != NULL) { -- -+ - if (mti->mti_expire > now) { - next = mti->mti_expire; - break; -@@ -648,7 +648,7 @@ mtimer_thread(void *aux) - tvh_cond_timedwait(&mtimer_cond, &global_lock, next); - pthread_mutex_unlock(&global_lock); - } -- -+ - return NULL; - } - -@@ -678,7 +678,7 @@ mainloop(void) - - // TODO: there is a risk that if timers re-insert themselves to - // the top of the list with a 0 offset we could loop indefinitely -- -+ - #if 0 - tvhdebug(LS_GTIMER, "now %"PRItime_t, ts.tv_sec); - LIST_FOREACH(gti, >imers, gti_link) -@@ -686,7 +686,7 @@ mainloop(void) - #endif - - while((gti = LIST_FIRST(>imers)) != NULL) { -- -+ - if (gti->gti_expire > now) { - ts.tv_sec = gti->gti_expire; - break; -@@ -1033,12 +1033,12 @@ main(int argc, char **argv) - } - if (opt_log_debug) - log_debug = opt_log_debug; -- -+ - tvhlog_init(log_level, log_options, opt_logpath); - tvhlog_set_debug(log_debug); - tvhlog_set_trace(log_trace); - tvhinfo(LS_MAIN, "Log started"); -- -+ - signal(SIGPIPE, handle_sigpipe); // will be redundant later - signal(SIGILL, handle_sigill); // see handler.. - -@@ -1144,7 +1144,7 @@ main(int argc, char **argv) - tvhlog_options &= ~TVHLOG_OPT_STDERR; - if (!isatty(2)) - tvhlog_options &= ~TVHLOG_OPT_DECORATE; -- -+ - /* Initialise clock */ - pthread_mutex_lock(&global_lock); - __mdispatch_clock = getmonoclock(); -@@ -1159,6 +1159,12 @@ main(int argc, char **argv) - OPENSSL_config(NULL); - SSL_load_error_strings(); - SSL_library_init(); -+ -+ #ifndef OPENSSL_NO_ENGINE -+ /* ENGINE init */ -+ ENGINE_load_builtin_engines(); -+ #endif -+ - /* Rand seed */ - randseed.thread_id = (void *)main_tid; - gettimeofday(&randseed.tv, NULL); -@@ -1345,7 +1351,7 @@ main(int argc, char **argv) - - if(opt_fork) - unlink(opt_pidpath); -- -+ - /* OpenSSL - welcome to the "cleanup" hell */ - ENGINE_cleanup(); - RAND_cleanup(); diff --git a/multimedia/tvheadend/patches/0002-main-Fix-OpenSSL-1.1-compilation-without-deprecated-.patch b/multimedia/tvheadend/patches/0002-main-Fix-OpenSSL-1.1-compilation-without-deprecated-.patch deleted file mode 100644 index 20197cb97b..0000000000 --- a/multimedia/tvheadend/patches/0002-main-Fix-OpenSSL-1.1-compilation-without-deprecated-.patch +++ /dev/null @@ -1,109 +0,0 @@ -From b4b93a2844e79c0394d130b02541a5cfd363fa81 Mon Sep 17 00:00:00 2001 -From: Josef Schlehofer -Date: Sun, 10 Mar 2019 10:33:14 +0100 -Subject: [PATCH] main: Fix OpenSSL 1.1 compilation without deprecated APIs - ---- - src/httpc.c | 12 ++++++++---- - src/main.c | 16 ++++++++++++---- - 2 files changed, 20 insertions(+), 8 deletions(-) - ---- a/src/httpc.c -+++ b/src/httpc.c -@@ -56,7 +56,7 @@ struct http_client_ssl { - char *rbio_buf; - size_t rbio_size; - size_t rbio_pos; -- -+ - BIO *wbio; - char *wbio_buf; - size_t wbio_size; -@@ -890,7 +890,7 @@ http_client_data_received( http_client_t - if (!hdr && hc->hc_rpos >= hc->hc_csize) - return 1; - return 0; -- } -+ } - - csize = hc->hc_csize == (size_t)-1 ? 0 : hc->hc_csize; - l = len; -@@ -1505,7 +1505,11 @@ http_client_reconnect - if (strcasecmp(scheme, "https") == 0 || strcasecmp(scheme, "rtsps") == 0) { - ssl = calloc(1, sizeof(*ssl)); - hc->hc_ssl = ssl; -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - ssl->ctx = SSL_CTX_new(SSLv23_client_method()); -+#else -+ ssl->ctx = SSL_CTX_new(TLS_client_method()); -+#endif - if (ssl->ctx == NULL) { - tvherror(LS_HTTPC, "%04X: Unable to get SSL_CTX", shortid(hc)); - goto err1; -@@ -1552,7 +1556,7 @@ errnval: - } - - http_client_t * --http_client_connect -+http_client_connect - ( void *aux, http_ver_t ver, const char *scheme, - const char *host, int port, const char *bindaddr ) - { -@@ -1593,7 +1597,7 @@ http_client_register( http_client_t *hc - { - assert(hc->hc_data_received || hc->hc_conn_closed || hc->hc_data_complete); - assert(hc->hc_efd == NULL); -- -+ - pthread_mutex_lock(&http_lock); - - TAILQ_INSERT_TAIL(&http_clients, hc, hc_link); ---- a/src/main.c -+++ b/src/main.c -@@ -83,7 +83,9 @@ - #include - #include - #include -+#ifndef OPENSSL_NO_ENGINE - #include -+#endif - - pthread_t main_tid; - -@@ -1155,10 +1157,12 @@ main(int argc, char **argv) - sigprocmask(SIG_BLOCK, &set, NULL); - trap_init(argv[0]); - -- /* SSL library init */ -- OPENSSL_config(NULL); -- SSL_load_error_strings(); -- SSL_library_init(); -+ #if OPENSSL_VERSION_NUMBER < 0x10100000L -+ /* SSL library init */ -+ OPENSSL_config(NULL); -+ SSL_load_error_strings(); -+ SSL_library_init(); -+ #endif - - #ifndef OPENSSL_NO_ENGINE - /* ENGINE init */ -@@ -1352,8 +1356,11 @@ main(int argc, char **argv) - if(opt_fork) - unlink(opt_pidpath); - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - /* OpenSSL - welcome to the "cleanup" hell */ -+ #ifndef OPENSSL_NO_ENGINE - ENGINE_cleanup(); -+ #endif - RAND_cleanup(); - CRYPTO_cleanup_all_ex_data(); - EVP_cleanup(); -@@ -1367,6 +1374,7 @@ main(int argc, char **argv) - sk_SSL_COMP_free(SSL_COMP_get_compression_methods()); - #endif - /* end of OpenSSL cleanup code */ -+#endif - - #if ENABLE_DBUS_1 - extern void dbus_shutdown(void); diff --git a/multimedia/tvheadend/patches/0003-Makefile.hdhomerun-update-library-to-version-2018081.patch b/multimedia/tvheadend/patches/0003-Makefile.hdhomerun-update-library-to-version-2018081.patch deleted file mode 100644 index fcdf57c150..0000000000 --- a/multimedia/tvheadend/patches/0003-Makefile.hdhomerun-update-library-to-version-2018081.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 7d657f0a87be1f135f7e5146b06e26121691c33a Mon Sep 17 00:00:00 2001 -From: Josef Schlehofer -Date: Mon, 18 Oct 2021 22:54:02 +0200 -Subject: [PATCH] Makefile.hdhomerun: update library to version 20180817 - -The previous tarball is not available and because of that, the -compilation of tvheadend does not proceed. - -The latest version can not be used somehow as the compilation fails. ---- - Makefile.hdhomerun | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/Makefile.hdhomerun b/Makefile.hdhomerun -index dcce37d1b..e8fa736ca 100644 ---- a/Makefile.hdhomerun -+++ b/Makefile.hdhomerun -@@ -32,10 +32,10 @@ endif - # Upstream Packages - # ########################################################################### - --LIBHDHR = libhdhomerun_20171221 -+LIBHDHR = libhdhomerun_20180817 - LIBHDHR_TB = $(LIBHDHR).tgz --LIBHDHR_URL = http://download.silicondust.com/hdhomerun/$(LIBHDHR_TB) --LIBHDHR_SHA1 = 6b019728eadea3af7a5686ed5ba44e970bca7365 -+LIBHDHR_URL = https://download.silicondust.com/hdhomerun/$(LIBHDHR_TB) -+LIBHDHR_SHA1 = 052868bde3a5713c55b4d060b77e0bc3a0d891d6 - - # ########################################################################### - # Library Config --- -2.30.2 - diff --git a/multimedia/tvheadend/patches/dvr_init.patch b/multimedia/tvheadend/patches/dvr_init.patch deleted file mode 100644 index c2c23dcba4..0000000000 --- a/multimedia/tvheadend/patches/dvr_init.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/dvr/dvr_config.c -+++ b/src/dvr/dvr_config.c -@@ -181,8 +181,8 @@ dvr_config_create(const char *name, cons - cfg->dvr_removal_days = DVR_RET_REM_FOREVER; - cfg->dvr_clone = 1; - cfg->dvr_tag_files = 1; -- cfg->dvr_skip_commercials = 1; -- dvr_charset_update(cfg, intlconv_filesystem_charset()); -+ cfg->dvr_skip_commercials = 0; -+ dvr_charset_update(cfg, "UTF-8"); - cfg->dvr_warm_time = 30; - cfg->dvr_update_window = 24 * 3600; - cfg->dvr_pathname = strdup("$t$n.$x"); diff --git a/net/atlas-probe/Makefile b/net/atlas-probe/Makefile deleted file mode 100644 index c8f76b3fcf..0000000000 --- a/net/atlas-probe/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# -# Copyright (C) 2019 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:=atlas-probe -PKG_VERSION:=2.2.0 -PKG_RELEASE:=1 - -PKG_SOURCE:=ripe-atlas-probe-busybox-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/RIPE-NCC/ripe-atlas-probe-busybox/archive/v$(PKG_VERSION) -PKG_HASH:=4fd1b5ace8218239d2395ef912080d22fad46a27ff7836b176d6634e79bfaa18 - -PKG_BUILD_DIR:=$(BUILD_DIR)/ripe-atlas-probe-busybox-$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-2.0-or-later -PKG_LICENSE_FILES:=LICENSE - -PKG_FIXUP:=autoreconf - -include $(INCLUDE_DIR)/package.mk - -define Package/atlas-probe - SECTION:=net - CATEGORY:=Network - TITLE:=RIPE Atlas probe measurement - DEPENDS:=+librt +libopenssl +openssh-client +sudo - USERID:=atlas=444:atlas=444 - URL:=https://atlas.ripe.net/ -endef - -define Package/atlas-probe/description - RIPE Atlas is a global, open, distributed Internet measurement platform, - consisting of thousands of measurement devices that measure Internet - connectivity in real time. -endef - -TARGET_CFLAGS += $(FPIC) - -CONFIGURE_ARGS += \ - --disable-shared \ - --enable-static - -CONFIGURE_PATH = libevent-2.1.11-stable - -TARGET_LDFLAGS = -L$(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/.libs - -define Build/Compile - +$(MAKE_VARS) \ - $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(CONFIGURE_PATH) \ - $(MAKE_FLAGS) - +$(MAKE_VARS) \ - $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(MAKE_FLAGS) -endef - -define Package/atlas-probe/install - +$(MAKE_VARS) \ - $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(MAKE_FLAGS) CONFIG_PREFIX=$(1)/usr/libexec/atlas-probe install - $(INSTALL_DIR) $(1)/usr/libexec/atlas-probe/state - echo $(PKG_VERSION) > $(1)/usr/libexec/atlas-probe/state/VERSION -endef - -$(eval $(call BuildPackage,atlas-probe)) diff --git a/net/atlas-sw-probe/Makefile b/net/atlas-sw-probe/Makefile deleted file mode 100644 index f23dad786f..0000000000 --- a/net/atlas-sw-probe/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -# -# Copyright (C) 2019-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:=atlas-sw-probe -PKG_VERSION:=5020 -PKG_RELEASE:=3 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/ripe-atlas-software-probe -PKG_MIRROR_HASH:=7cc8accc87fd02e98d0e9fd3783bd66a34489c35ae7335ad0acc7df0077d3061 -PKG_SOURCE_VERSION:=6c08a2cd5dc24ad100f0dbca8375c0b7cba14b40 - -PKG_SOURCE:=ripe-atlas-software-probe-$(PKG_VERSION).tar.gz - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=LICENSE - -PKG_INSTALL:=1 - -include $(INCLUDE_DIR)/package.mk - -define Package/atlas-sw-probe - SECTION:=net - CATEGORY:=Network - TITLE:=RIPE Atlas software probe - URL:=https://atlas.ripe.net/about/probes/ - DEPENDS:=+atlas-probe -endef - -define Package/atlas-sw-probe/description - RIPE Atlas SW probe is software variant of RIPE Atlas Probe. - It contains utilities which helps actively measure - Internet connectivity through ping, traceroute, DNS, SSL/TLS, NTP, and HTTP. - Data are then collected, aggregated and published by the RIPE NCC. -endef - -Build/Compile:=: -Build/Install:=: - -define Package/atlas-sw-probe/postinst - true -endef - -define Package/atlas-sw-probe/conffiles -/etc/config/atlas -/usr/libexec/atlas-probe-scripts/state/config.txt -endef - -TMP_BASE_DIR:=/tmp/ripe_atlas_probe -SCRIPTS_DIR:=/usr/libexec/atlas-probe-scripts - -define Package/atlas-sw-probe/install - $(INSTALL_DIR) $(1)/$(SCRIPTS_DIR) - $(INSTALL_DIR) $(1)/$(SCRIPTS_DIR)/{etc,state,bin/arch,bin/bin} - - # Copy config - $(CP) $(PKG_BUILD_DIR)/atlas-config/etc/* $(1)/$(SCRIPTS_DIR)/etc/ - - # Copy firmware version - $(CP) $(PKG_BUILD_DIR)/atlas-config/state/FIRMWARE_APPS_VERSION $(1)/$(SCRIPTS_DIR)/state/ - # Set probe mode - echo "prod" > $(1)/$(SCRIPTS_DIR)/state/mode - - # Copy scripts - $(CP) $(PKG_BUILD_DIR)/bin/{ATLAS,common-pre.sh,common.sh,reginit.sh,resolvconf} $(1)/$(SCRIPTS_DIR)/bin/ - $(CP) $(PKG_BUILD_DIR)/bin/arch/{linux,turris-sw-probe} $(1)/$(SCRIPTS_DIR)/bin/arch/ - - # Create config info - echo "DEVICE_NAME=turris-sw-probe" > $(1)/$(SCRIPTS_DIR)/bin/config.sh - echo "ATLAS_BASE=$(SCRIPTS_DIR)" >> $(1)/$(SCRIPTS_DIR)/bin/config.sh - echo "ATLAS_STATIC=$(SCRIPTS_DIR)" >> $(1)/$(SCRIPTS_DIR)/bin/config.sh - echo "SUB_ARCH=turris-$(ARCH)-$(PKG_VERSION)-$(PKG_RELEASE)" >> $(1)/$(SCRIPTS_DIR)/bin/bin/config.sh - - # Enable sending interface traffic statistics as Atlas measurement results - echo "RXTXRPT=yes" > $(1)/$(SCRIPTS_DIR)/state/config.txt - - # Fix permision - chmod 755 $(1)/$(SCRIPTS_DIR)/bin - - # Create softlinks for writable dirs - $(LN) $(TMP_BASE_DIR)/crons $(1)/$(SCRIPTS_DIR)/crons - $(LN) $(TMP_BASE_DIR)/data $(1)/$(SCRIPTS_DIR)/data - $(LN) $(TMP_BASE_DIR)/run $(1)/$(SCRIPTS_DIR)/run - $(LN) $(TMP_BASE_DIR)/status $(1)/$(SCRIPTS_DIR)/status - - # Copy init and config - $(INSTALL_DIR) $(1)/etc/init.d/ - $(INSTALL_BIN) ./files/atlas.init $(1)/etc/init.d/atlas - - $(INSTALL_DIR) $(1)/etc/config/ - $(INSTALL_CONF) ./files/atlas.conf $(1)/etc/config/atlas -endef - -$(eval $(call BuildPackage,atlas-sw-probe)) diff --git a/net/atlas-sw-probe/files/atlas.conf b/net/atlas-sw-probe/files/atlas.conf deleted file mode 100644 index d2a12a523f..0000000000 --- a/net/atlas-sw-probe/files/atlas.conf +++ /dev/null @@ -1,4 +0,0 @@ -config atlas 'common' - option log_stderr '1' - option log_stdout '0' - option rxtxrpt '1' diff --git a/net/atlas-sw-probe/files/atlas.init b/net/atlas-sw-probe/files/atlas.init deleted file mode 100644 index c5495cd9a2..0000000000 --- a/net/atlas-sw-probe/files/atlas.init +++ /dev/null @@ -1,178 +0,0 @@ -#!/bin/sh /etc/rc.common - -USE_PROCD=1 -START=30 -EXTRA_COMMANDS="get_key probeid log create_backup load_backup" -EXTRA_HELP=" get_key print probe public key (used for probe registration) - probeid print probe id - log print probe status log - create_backup backup ssh key to tar.gz - load_backup 'backup.tar.gz' load backup ssh key from tar.gz -" - -SCRIPTS_DIR="/usr/libexec/atlas-probe-scripts" -TMP_BASE_DIR="/tmp/ripe_atlas_probe" -PUB_KEY_FILE="$SCRIPTS_DIR/etc/probe_key.pub" -PRIV_KEY_FILE="$SCRIPTS_DIR/etc/probe_key" -PROBE_ID_FILE="$TMP_BASE_DIR/status/reg_init_reply.txt" -LOG_FILE="/tmp/log/ripe_sw_probe" -STATE_CONFIG="$SCRIPTS_DIR/state/config.txt" - -load_backup() { - local backup_arch - local tmp_dir - - backup_arch="$1" - tmp_dir="$(mktemp -u -p /var/run/atlas)" - if [ -f "$backup_arch" ]; then - safe_mkdir "$tmp_dir" - tar -xzf "$backup_arch" -C "$tmp_dir/" - if [ -f "$tmp_dir/probe_key.pub" ] && [ -f "$tmp_dir/probe_key" ]; then - mv "$tmp_dir/probe_key.pub" "$PUB_KEY_FILE" - mv "$tmp_dir/probe_key" "$PRIV_KEY_FILE" - rm -rf "$tmp_dir" - print_msg "Info: public and private key loaded from backup" - else - print_msg "Error: Could not extract probe_key or probe_key form backup archive" - rm -rf "$tmp_dir" - exit 1 - fi - else - print_msg "Error: Provided backup file $backup_arch does not exists" - exit 1 - fi -} - -create_backup() { - local back_dir - - back_dir="$(pwd)" - - if [ -f "$PUB_KEY_FILE" -a -f "$PRIV_KEY_FILE" ]; then - print_msg "Info: Creating backup arch in $back_dir" - tar -czf "$back_dir/atlas-key-backup.tar.gz" -C "$SCRIPTS_DIR/etc" probe_key probe_key.pub - else - print_msg "Error: private or public key does not exists." - exit 1 - fi -} - -log() { - if [ -f "$LOG_FILE" ];then - tail "$LOG_FILE" - else - print_msg "Error. No log file found. Probe isn't probably running" - exit 1 - fi -} - -get_key() { - if [ -f "$PUB_KEY_FILE" ]; then - echo "Probe public key (use for registration)" - echo "URL with registration form https://atlas.ripe.net/apply/swprobe/" - echo "==========================================" - cat "$PUB_KEY_FILE" - else - print_msg "Error! Pub. key not found" - exit 1 - fi -} - -probeid() { - local probe_id - - if [ -f "$PROBE_ID_FILE" ]; then - probe_id="$(awk '/PROBE_ID/ {print $2}' "$PROBE_ID_FILE")" - if [ -z "$probe_id" ]; then - print_msg "Probe ID not found SW probe isn't probably registered yet" - exit 1 - else - print_msg "Probe ID is $probe_id" - fi - else - print_msg "Probe ID not found. SW probe is not running or probe_key isn't registered yet" - exit 1 - fi -} - -print_msg() { - echo "$1" >&2 - logger -t atlas-sw-probe "$1" -} - -stop_service() { - local atlas_pid - local tunnel_pid - local pid_file - - print_msg "Stopping atlas sw probe" - print_msg "Kill all atlas processes" - - for pid_file in "$SCRIPTS_DIR/run/"*.vol; do - [ -f "$pid_file" ] || continue - # test if proccess is still running - atlas_pid="$(cat "$pid_file")" - if kill -0 "$atlas_pid" 2>/dev/null; then - kill "$atlas_pid" - fi - done - - if [ -f "$SCRIPTS_DIR/status/con_keep_pid.vol" ]; then - print_msg "Kill ssh tunnel" - tunnel_pid="$(cat "$SCRIPTS_DIR/status/con_keep_pid.vol")" - if kill -0 "$tunnel_pid" 2>/dev/null; then - kill "$tunnel_pid" - fi - fi -} - -safe_mkdir() { - local dir="$1" - if [ -e "$dir" ] && [ ! -d "$dir" -o -L "$dir" ]; then - rm -rf "$dir" - fi - mkdir -p "$dir" - chmod 700 "$dir" - chown root:root "$dir" -} - -create_tmp_dirs() { - local dirs - - chown -R atlas:atlas "$SCRIPTS_DIR/bin" - chmod 755 "$SCRIPTS_DIR/bin" - dirs='crons data run status' - - safe_mkdir "$TMP_BASE_DIR" - for i in $dirs; do - safe_mkdir "$TMP_BASE_DIR/$i" - done -} - -start_service() { - local log_stderr - local log_stdout - local rxtxrpt - local test_setting - - create_tmp_dirs - - config_load atlas - config_get_bool log_stderr "common" log_stderr "0" - config_get_bool log_stdout "common" log_stdout "0" - config_get_bool rxtxrpt "common" rxtxrpt "1" - test_setting=$(grep "^[ ]*RXTXRPT=yes" "$STATE_CONFIG") - - # Decide if we should write to permanent storage - if [ "$rxtxrpt" == "1" ] && [ -z "$test_setting" ]; then - echo "RXTXRPT=yes">$STATE_CONFIG - elif [ "$rxtxrpt" == "0" ] && [ ! -z "$test_setting" ]; then - echo "RXTXRPT=no">$STATE_CONFIG - fi - - procd_open_instance - procd_set_param command "$SCRIPTS_DIR/bin/ATLAS" - procd_set_param stdout "$log_stdout" - procd_set_param stderr "$log_stderr" - procd_close_instance -} diff --git a/net/deckard/Makefile b/net/deckard/Makefile index a9c9992aa2..9e870db72e 100644 --- a/net/deckard/Makefile +++ b/net/deckard/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2020-2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2020-2022 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. @@ -7,12 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=deckard -PKG_VERSION:=0.1 -PKG_RELEASE:=1 +PKG_VERSION:=3.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/knot/deckard -PKG_SOURCE_VERSION:=a179ddb1b5b67a61dc89a97833520485c49f784b +PKG_SOURCE_VERSION:=2cb9779c550e8327667e96e28be83ecab430af96 +PKG_MIRROR_HASH:=e10fe75613b5da883baaeb02055c5d878ce0a125060c339ebae07201463bb8b8 PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=BSD-2-Clause diff --git a/net/dev-detect/Makefile b/net/dev-detect/Makefile index 928731020f..86400f7c4a 100644 --- a/net/dev-detect/Makefile +++ b/net/dev-detect/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dev-detect PKG_VERSION:=0.3.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/dev-detect.git @@ -33,7 +33,6 @@ define Package/dev-detect +python3-sqlite3 \ +python3-uci \ +ouidb - VARIANT:=python3 endef define Package/dev-detect/description @@ -54,6 +53,7 @@ define Py3Package/dev-detect/install $(INSTALL_BIN) ./files/notify_new_device.sh $(1)/usr/libexec/ $(INSTALL_DIR) $(1)/srv/dev-detect + touch $(1)/srv/dev-detect/.keep endef $(eval $(call Py3Package,dev-detect)) diff --git a/net/dnssec-rootkey/Makefile b/net/dnssec-rootkey/Makefile index ae421c91d8..383b572ff3 100644 --- a/net/dnssec-rootkey/Makefile +++ b/net/dnssec-rootkey/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnssec-rootkey PKG_VERSION:=0.0.2 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=Jan Pavlinec PKG_LICENSE:=GPL-3.0 diff --git a/net/firewall-redirect-192-168-1-1/Makefile b/net/firewall-redirect-192-168-1-1/Makefile index 2942c3cf8b..02329960ba 100644 --- a/net/firewall-redirect-192-168-1-1/Makefile +++ b/net/firewall-redirect-192-168-1-1/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=firewall-redirect-192_168_1_1 PKG_VERSION:=0.1.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/net/knot-resolver/Config.in b/net/knot-resolver/Config.in index 71cbc5b7c9..0dc600f4de 100644 --- a/net/knot-resolver/Config.in +++ b/net/knot-resolver/Config.in @@ -1,7 +1,7 @@ menu "Configuration" config PACKAGE_knot-resolver_dnstap bool "Build with dnstap support." - default n + default y help knot-resolver dnstap module supports logging DNS responses to a unix socket in dnstap format using fstrm framing library. diff --git a/net/knot-resolver/Makefile b/net/knot-resolver/Makefile index 7fb6f301be..71420e9717 100644 --- a/net/knot-resolver/Makefile +++ b/net/knot-resolver/Makefile @@ -10,12 +10,12 @@ PKG_RELRO_FULL:=0 include $(TOPDIR)/rules.mk PKG_NAME:=knot-resolver -PKG_VERSION:=5.4.2 -PKG_RELEASE:=1 +PKG_VERSION:=5.5.3 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-resolver -PKG_HASH:=ea6a219571a752056669bae3f2c0c3ed0bec58af5ab832d505a3ec9c4063a58b +PKG_HASH:=a38f57c68b7d237d662784d8406e6098aad66a148f44dcf498d1e9664c5fed2d PKG_MAINTAINER:=Knot DNS PKG_LICENSE:=GPL-3.0-later @@ -64,7 +64,6 @@ MESON_ARGS+= \ -Dcapng=disabled \ -Dclient=disabled \ -Dconfig_tests=disabled \ - -Ddnstap=disabled \ -Ddoc=disabled \ -Dinstall_kresd_conf=disabled \ -Dinstall_root_keys=disabled \ diff --git a/net/knot-resolver/files/kresd.init b/net/knot-resolver/files/kresd.init index 9bed975201..e893636e92 100755 --- a/net/knot-resolver/files/kresd.init +++ b/net/knot-resolver/files/kresd.init @@ -6,7 +6,7 @@ START=61 STOP=00 USE_PROCD=1 -EXTRA_COMMANDS="test_ipv6" +extra_command "test_ipv6" "Test IPv6 connection" PROG=/usr/sbin/kresd CONFIGFILE=/tmp/kresd.config ROOTKEYFILE=/etc/root.keys @@ -103,15 +103,9 @@ load_uci_config_common() { if [ -z "$interface" ]; then { echo "for iface_name, iface in pairs(net.interfaces()) do" - echo " for _, ip in pairs(iface.addr) do" - echo " local suffix = ''" - echo " if string.sub(ip,1,string.len('fe80')) == 'fe80' then" - echo " suffix = '%' .. iface_name" - echo " end" - echo " if iface_name == 'lo' or iface_name == 'br-lan' then" - echo " net.listen(ip .. suffix, $port, { kind = 'dns' })" - echo " net.listen(ip .. suffix, 853, { kind = 'tls' })" - echo " end" + echo " if iface_name == 'lo' or iface_name == 'br-lan' then" + echo " net.listen(iface, $port, { kind = 'dns' })" + echo " net.listen(iface, 853, { kind = 'tls' })" echo " end" echo "end" } >> "$CONFIGFILE" @@ -171,12 +165,12 @@ load_uci_config_common() { # Test for resolv.conf.auto new location # https://github.com/openwrt/openwrt/commit/cd48d8d3420dd4df03daaa548227ceb487ba7104 - resolv_conf_path="$(ls -1 /etc/resolv.conf.vpn.* | head -n1)" - if [ \! -f "$resolv_conv_path" ]; then - if [ -f "/tmp/resolv.conf.auto" ]; then - resolv_conf_path="/tmp/resolv.conf.auto" - elif [ -f "/tmp/resolv.conf.d/resolv.conf.auto" ]; then + resolv_conf_path="$(ls -1 /tmp/resolv.conf.d/resolv.conf.vpn.* 2>/dev/null | head -n1)" + if [ \! -f "$resolv_conf_path" ]; then + if [ -f "/tmp/resolv.conf.d/resolv.conf.auto" ]; then resolv_conf_path="/tmp/resolv.conf.d/resolv.conf.auto" + elif [ -f "/tmp/resolv.conf.auto" ]; then + resolv_conf_path="/tmp/resolv.conf.auto" else resolv_conf_path="" echo "Error! File resolv.conf.auto is missing" diff --git a/net/knot-resolver/patches/020-shorter-timeout.patch b/net/knot-resolver/patches/020-shorter-timeout.patch index c2501361be..5f8f746a6d 100644 --- a/net/knot-resolver/patches/020-shorter-timeout.patch +++ b/net/knot-resolver/patches/020-shorter-timeout.patch @@ -1,6 +1,6 @@ --- a/lib/defines.h +++ b/lib/defines.h -@@ -47,7 +47,7 @@ static inline int KR_COLD kr_error(int x +@@ -48,7 +48,7 @@ static inline int KR_COLD kr_error(int x * @cond internal */ #define KR_CONN_RTT_MAX 2000 /* Timeout for network activity */ diff --git a/net/knot-resolver/patches/030-fix-policy-hack.patch b/net/knot-resolver/patches/030-fix-policy-hack.patch index f7d46bafd3..70c6f81b06 100644 --- a/net/knot-resolver/patches/030-fix-policy-hack.patch +++ b/net/knot-resolver/patches/030-fix-policy-hack.patch @@ -2,7 +2,7 @@ This patch fixes the problem with forwarding in knot-resolver v4.3.0. It reintroduces a fix which enables policy related hack (knot/knot-resolver#205 (comment 94566) ) --- a/modules/policy/policy.lua +++ b/modules/policy/policy.lua -@@ -1000,7 +1000,7 @@ policy.layer = { +@@ -1098,7 +1098,7 @@ policy.layer = { if bit.band(state, bit.bor(kres.FAIL, kres.DONE)) ~= 0 then return state end local qry = req:initial() -- same as :current() but more descriptive return policy.evaluate(policy.rules, req, qry, state) diff --git a/net/lighttpd-https-cert/Makefile b/net/lighttpd-https-cert/Makefile index c54a6d0e09..9026c8bc88 100644 --- a/net/lighttpd-https-cert/Makefile +++ b/net/lighttpd-https-cert/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2013-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2013-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lighttpd-https-cert PKG_VERSION:=6.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0 @@ -26,7 +26,7 @@ endef define Package/lighttpd-https-cert/install $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/ $(1)/etc/uci-defaults - $(INSTALL_CONF) ./files/ssl-enable.conf $(1)/etc/lighttpd/conf.d/ssl-enable.conf + $(INSTALL_CONF) ./files/ssl-enable.conf $(1)/etc/lighttpd/conf.d/40-ssl-enable.conf $(INSTALL_BIN) ./files/uci-defaults $(1)/etc/uci-defaults/99_lighttpd_https_cert endef diff --git a/net/lighttpd/Makefile b/net/lighttpd/Makefile index 09d53102cc..edc5ea14ff 100644 --- a/net/lighttpd/Makefile +++ b/net/lighttpd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lighttpd -PKG_VERSION:=1.4.61 -PKG_RELEASE:=1 +PKG_VERSION:=1.4.67 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://download.lighttpd.net/lighttpd/releases-1.4.x -PKG_HASH:=43f0d63d04a1b7c5b8aab07e0612e44ccad0afc0614bab784c5b019872363432 +PKG_HASH:=7e04d767f51a8d824b32e2483ef2950982920d427d1272ef4667f49d6f89f358 PKG_MAINTAINER:=W. Michael Petullo PKG_LICENSE:=BSD-3-Clause @@ -25,7 +25,7 @@ PKG_INSTALL:=1 PKG_CONFIG_DEPENDS:=CONFIG_LIGHTTPD_SSL $(patsubst %,CONFIG_PACKAGE_lighttpd-mod-%,$(REBUILD_MODULES)) -REBUILD_MODULES=authn_gssapi authn_ldap authn_mysql cml magnet mysql_vhost trigger_b4_dl webdav +REBUILD_MODULES=authn_gssapi authn_ldap magnet webdav include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/devel/meson/meson.mk @@ -40,7 +40,7 @@ endef define Package/lighttpd $(call Package/lighttpd/Default) MENU:=1 - DEPENDS:=+LIGHTTPD_SSL:libopenssl +libpcre +libpthread + DEPENDS:=+LIGHTTPD_SSL:libopenssl +libpcre2 +libpthread TITLE:=A flexible and lightweight web server endef @@ -91,19 +91,17 @@ MESON_ARGS += \ -Dwith_bzip=false \ -Dwith_dbi=false \ -Dwith_fam=false \ - -Dwith_gdbm=$(if $(CONFIG_PACKAGE_lighttpd-mod-trigger_b4_dl),true,false) \ - -Dwith_geoip=$(if $(CONFIG_PACKAGE_lighttpd-mod-geoip),true,false) \ -Dwith_krb5=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_gssapi),true,false) \ -Dwith_ldap=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_ldap)$(CONFIG_PACKAGE_lighttpd-mod-vhostdb_ldap),true,false) \ -Dwith_libev=false \ -Dwith_libunwind=false \ - -Dwith_lua=$(if $(CONFIG_PACKAGE_lighttpd-mod-cml)$(CONFIG_PACKAGE_lighttpd-mod-magnet),true,false) \ + -Dwith_lua=$(if $(CONFIG_PACKAGE_lighttpd-mod-magnet),true,false) \ + -Dlua_version=lua \ -Dwith_maxminddb=$(if $(CONFIG_PACKAGE_lighttpd-mod-maxminddb),true,false) \ - -Dwith_memcached=false \ - -Dwith_mysql=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_mysql)$(CONFIG_PACKAGE_lighttpd-mod-mysql_vhost)$(CONFIG_PACKAGE_lighttpd-mod-vhostdb_mysql),true,false) \ + -Dwith_mysql=$(if $(CONFIG_PACKAGE_lighttpd-mod-vhostdb_mysql),true,false) \ -Dwith_openssl=$(if $(CONFIG_LIGHTTPD_SSL),true,false) \ -Dwith_pam=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_pam),true,false) \ - -Dwith_pcre=true \ + -Dwith_pcre2=true \ -Dwith_pgsql=$(if $(CONFIG_PACKAGE_lighttpd-mod-vhostdb_pgsql),true,false) \ -Dwith_sasl=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_sasl),true,false) \ -Dwith_webdav_locks=$(if $(CONFIG_PACKAGE_lighttpd-mod-webdav),true,false) \ @@ -150,16 +148,22 @@ define BuildPlugin /etc/lighttpd/conf.d/$(4)-$(1).conf endef + ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-$(1)),) define Package/lighttpd-mod-$(1)/install $(INSTALL_DIR) $$(1)/usr/lib/lighttpd $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$(1).so $$(1)/usr/lib/lighttpd - $(INSTALL_DIR) $$(1)/etc/lighttpd/modules.d/ + $(INSTALL_DIR) $$(1)/etc/lighttpd/conf.d if [ -f $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf ]; then \ - $(CP) $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf $$(1)/etc/lighttpd/modules.d/$(4)-$(1).load ; \ + $(CP) $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \ + if ! grep -qF 'mod_$(1)' $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf; then \ + sed -i "`sed '/^##/ !q' $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf | wc -l` i\ +server.modules += ( \"mod_$(1)\" )" $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \ + fi \ else \ - echo 'server.modules += ( "mod_$(1)" )' > $$(1)/etc/lighttpd/modules.d/$(4)-$(1).load ; \ + echo 'server.modules += ( "mod_$(1)" )' > $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \ fi endef + endif $$(eval $$(call BuildPackage,lighttpd-mod-$(1))) endef @@ -167,40 +171,33 @@ endef $(eval $(call BuildPackage,lighttpd)) # First, permit redirect from HTTP to HTTPS. -$(eval $(call BuildPlugin,redirect,URL redirection,+PACKAGE_lighttpd-mod-redirect:libpcre,10)) +$(eval $(call BuildPlugin,redirect,URL redirection,+PACKAGE_lighttpd-mod-redirect:libpcre2,10)) # Next, permit authentication. $(eval $(call BuildPlugin,auth,Authentication,,20)) -$(eval $(call BuildPlugin,authn_file,File-based authentication,,20)) -$(eval $(call BuildPlugin,authn_pam,PAM-based authentication,+PACKAGE_lighttpd-mod-authn_pam:libpam,20)) +$(eval $(call BuildPlugin,authn_file,File-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_file:libnettle,20)) +$(eval $(call BuildPlugin,authn_pam,PAM-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_pam:libpam,20)) # Finally, everything else. $(eval $(call BuildPlugin,access,Access restrictions,,30)) $(eval $(call BuildPlugin,accesslog,Access logging,,30)) $(eval $(call BuildPlugin,alias,Directory alias,,30)) $(eval $(call BuildPlugin,cgi,CGI,,30)) -$(eval $(call BuildPlugin,cml,Cache Meta Language,+PACKAGE_lighttpd-mod-cml:liblua,30)) $(eval $(call BuildPlugin,deflate,Compress dynamic output,+PACKAGE_lighttpd-mod-deflate:zlib,30)) -$(eval $(call BuildPlugin,evasive,Evasive,,30)) $(eval $(call BuildPlugin,evhost,Enhanced Virtual-Hosting,,30)) $(eval $(call BuildPlugin,expire,Expire,,30)) $(eval $(call BuildPlugin,openssl,TLS using openssl,@LIGHTTPD_SSL +PACKAGE_lighttpd-mod-openssl:libopenssl,30)) $(eval $(call BuildPlugin,extforward,Extract client,,30)) $(eval $(call BuildPlugin,fastcgi,FastCGI,,30)) -$(eval $(call BuildPlugin,flv_streaming,FLV streaming,,30)) $(eval $(call BuildPlugin,magnet,Magnet,+PACKAGE_lighttpd-mod-magnet:liblua,30)) -# $(eval $(call BuildPlugin,mysql_vhost,Mysql virtual hosting,+PACKAGE_lighttpd-mod-mysql_vhost:libmysqlclient,30)) $(eval $(call BuildPlugin,proxy,Proxy,,30)) -$(eval $(call BuildPlugin,rewrite,URL rewriting,+PACKAGE_lighttpd-mod-rewrite:libpcre,30)) +$(eval $(call BuildPlugin,rewrite,URL rewriting,+PACKAGE_lighttpd-mod-rewrite:libpcre2,30)) $(eval $(call BuildPlugin,rrdtool,RRDtool,,30)) $(eval $(call BuildPlugin,scgi,SCGI,,30)) -$(eval $(call BuildPlugin,secdownload,Secure and fast download,,30)) $(eval $(call BuildPlugin,setenv,Environment variable setting,,30)) $(eval $(call BuildPlugin,simple_vhost,Simple virtual hosting,,30)) -$(eval $(call BuildPlugin,ssi,SSI,+PACKAGE_lighttpd-mod-ssi:libpcre,30)) +$(eval $(call BuildPlugin,ssi,SSI,,30)) $(eval $(call BuildPlugin,status,Server status display,,30)) -$(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre +PACKAGE_lighttpd-mod-trigger_b4_dl:libgdbm,30)) $(eval $(call BuildPlugin,userdir,User directory,,30)) -$(eval $(call BuildPlugin,usertrack,User tracking,,30)) $(eval $(call BuildPlugin,webdav,WebDAV,+PACKAGE_lighttpd-mod-webdav:libsqlite3 +PACKAGE_lighttpd-mod-webdav:libuuid +PACKAGE_lighttpd-mod-webdav:libxml2,30)) $(eval $(call BuildPlugin,wstunnel,Websocket tunneling,,30)) diff --git a/net/lighttpd/files/lighttpd.conf b/net/lighttpd/files/lighttpd.conf index 3b39fe3bda..56c6b61781 100644 --- a/net/lighttpd/files/lighttpd.conf +++ b/net/lighttpd/files/lighttpd.conf @@ -1,6 +1,3 @@ -server.modules = ( -) - server.document-root = "/www" server.upload-dirs = ( "/tmp" ) server.errorlog = "/var/log/lighttpd/error.log" @@ -14,6 +11,11 @@ index-file.names = ( "index.php", "index.html", static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) +### Features +#https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_feature-flagsDetails +server.feature-flags += ("server.graceful-shutdown-timeout" => 5) +#server.feature-flags += ("server.graceful-restart-bg" => "enable") + ### Options that are useful but not always necessary: #server.chroot = "/" #server.port = 81 @@ -22,9 +24,6 @@ static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) #server.errorlog-use-syslog = "enable" #server.network-backend = "writev" -# listen on IPv6 -$SERVER["socket"] == "[::]:80" { } - ### Use IPv6 if available #include_shell "/usr/share/lighttpd/use-ipv6.pl" @@ -32,5 +31,4 @@ $SERVER["socket"] == "[::]:80" { } #server.dir-listing = "enable" include "/etc/lighttpd/mime.conf" -include "/etc/lighttpd/modules.d/*.load" include "/etc/lighttpd/conf.d/*.conf" diff --git a/net/lighttpd/patches/010-meson-lua.patch b/net/lighttpd/patches/010-meson-lua.patch deleted file mode 100644 index b67795ea1b..0000000000 --- a/net/lighttpd/patches/010-meson-lua.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f47d569311d51ec9ab5dad7452b43c1b5a8290b6 Mon Sep 17 00:00:00 2001 -From: Glenn Strauss -Date: Tue, 1 Dec 2020 16:41:58 -0500 -Subject: [PATCH] [PATCH] [meson] do not search for lua versions - -openwrt net/lighttpd/Makefile declares dependency on liblua, and not on -specific lua versions, so have meson.build look for 'lua' and not for -specific lua versions. - -Signed-off-by: Glenn Strauss ---- - src/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/src/meson.build -+++ b/src/meson.build -@@ -390,7 +390,7 @@ endif - liblua = [] - if get_option('with_lua') - found_lua = false -- foreach l: ['lua5.4', 'lua-5.4', 'lua5.3', 'lua-5.3', 'lua5.2', 'lua-5.2', 'lua5.1', 'lua-5.1', 'lua'] -+ foreach l: ['lua'] - if not(found_lua) - liblua = dependency(l, required: false) - if (liblua.found()) diff --git a/net/lighttpd/patches/020-mod-alias.patch b/net/lighttpd/patches/020-mod-alias.patch deleted file mode 100644 index b81037e57e..0000000000 --- a/net/lighttpd/patches/020-mod-alias.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 584a69c4ae756f6b304e7d0592cf00859eff6daa Mon Sep 17 00:00:00 2001 -From: Glenn Strauss -Date: Fri, 29 Oct 2021 08:15:41 -0400 -Subject: [PATCH] [mod_alias] fix use-after-free bug (fixes #3114) - -(thx LoneFox) - -bug introduced in 62a874df in lighttpd 1.4.59 - -x-ref: - "Use-after-free bug in mod_alias" - https://redmine.lighttpd.net/issues/3114 ---- - src/mod_alias.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - ---- a/src/mod_alias.c -+++ b/src/mod_alias.c -@@ -128,7 +128,7 @@ mod_alias_remap (request_st * const r, const array * const aliases) - if (0 == path_len || path_len < basedir_len) return HANDLER_GO_ON; - - const uint32_t uri_len = path_len - basedir_len; -- const char * const uri_ptr = r->physical.path.ptr + basedir_len; -+ const char *uri_ptr = r->physical.path.ptr + basedir_len; - data_string * const ds = (data_string *) - (!r->conf.force_lowercase_filenames - ? array_match_key_prefix_klen(aliases, uri_ptr, uri_len) -@@ -159,8 +159,10 @@ mod_alias_remap (request_st * const r, const array * const aliases) - * (though resulting r->physical.basedir would not be a dir))*/ - if (vlen != basedir_len + alias_len) { - const uint32_t nlen = vlen + uri_len - alias_len; -- if (path_len + buffer_string_space(&r->physical.path) < nlen) -+ if (path_len + buffer_string_space(&r->physical.path) < nlen) { - buffer_string_prepare_append(&r->physical.path, nlen - path_len); -+ uri_ptr = r->physical.path.ptr + basedir_len;/*(refresh if alloc)*/ -+ } - memmove(r->physical.path.ptr + vlen, - uri_ptr + alias_len, uri_len - alias_len); - buffer_truncate(&r->physical.path, nlen); diff --git a/net/morce/Makefile b/net/morce/Makefile new file mode 100644 index 0000000000..9ab627027d --- /dev/null +++ b/net/morce/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2022 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:=morce +PKG_VERSION:=1.0.2 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/morce.git +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_MIRROR_HASH:=b253eb17bdd8fe09b4b4d4c96beac58d540beae4d1519bdbe57ade19d2c0c548 + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/morce + SECTION:=net + CATEGORY:=Network + TITLE:=MORCE - Simple IDS integration + DEPENDS:=+libuci-lua +luasql-sqlite3 +snort3 +sqlite3-cli +tar +wget-ssl +endef + +define Package/morce/description + Simple integration of Snort IDS into Turris OS +endef + +Build/Compile:=: + +define Package/morce/install + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/init/morce $(1)/etc/init.d/morce + + $(INSTALL_DIR) $(1)/usr/share/morce/loggers/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/logger/alert_morce.lua $(1)/usr/share/morce/loggers/ + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) $(PKG_BUILD_DIR)/uci/morce $(1)/etc/config +endef + +define Package/morce/conffiles +/etc/config/morce +endef + +$(eval $(call BuildPackage,morce)) diff --git a/net/netmetr/Makefile b/net/netmetr/Makefile index 162f1d768a..85fe269319 100644 --- a/net/netmetr/Makefile +++ b/net/netmetr/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netmetr -PKG_VERSION:=1.6.0 -PKG_RELEASE:=1 +PKG_VERSION:=2.0.2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/netmetr-client.git -PKG_MIRROR_HASH:=bb8ad9a2284fe5cd336f234ce5789fcdcede2c2f89db3312ec21553592206b1a +PKG_MIRROR_HASH:=f70491317015299b5c61015062421f2ddf35de67e1b5cc23aa4a6db679a5a089 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_SOURCE:=netmetr-client-v$(PKG_SOURCE_VERSION).tar.gz @@ -35,7 +35,6 @@ define Package/netmetr +rmbt-client \ +cronie \ +xz - VARIANT:=python3 endef define Package/netmetr/description diff --git a/net/netmetr/files/netmetr.config b/net/netmetr/files/netmetr.config index e65cb1e5e5..a98d9b75c0 100644 --- a/net/netmetr/files/netmetr.config +++ b/net/netmetr/files/netmetr.config @@ -1,7 +1,2 @@ config settings 'settings' - option autostart_enabled '0' - list hours_to_run '4' - option control_server 'control.netmetr.cz' - option max_history_logs '10' - option sync_code '' diff --git a/net/netmetr/files/netmetr.cron b/net/netmetr/files/netmetr.cron index 6512b2b1cd..1384c185dc 100644 --- a/net/netmetr/files/netmetr.cron +++ b/net/netmetr/files/netmetr.cron @@ -1,2 +1,2 @@ MAILTO="" -00 * * * * root netmetr --autostart --dwlhist --rwait 1800 & +00 * * * * root netmetr --autostart --dwlhist --syslog & diff --git a/net/nextcloud/Makefile b/net/nextcloud/Makefile index 2c2bb16766..ebe1f03da8 100644 --- a/net/nextcloud/Makefile +++ b/net/nextcloud/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2018-2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# Copyright (C) 2018-2022 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. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nextcloud -PKG_VERSION:=20.0.4 -PKG_RELEASE:=3 +PKG_VERSION:=22.2.10 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://download.nextcloud.com/server/releases/ -PKG_HASH:=269f1622e326f5d11e387d3861aad4e2b0e79334ae97eed5a7b3352ba7661420 +PKG_HASH:=8de167bfcfcaa661245a00a5ac36628e7961951b9fe2dfaf4f8a5aac6907ccdb PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) @@ -30,7 +30,7 @@ define Package/nextcloud CATEGORY:=Network TITLE:=Nextcloud server URL:=https://nextcloud.com/ - DEPENDS=+php7-mod-opcache +php7-fpm +php7-cli +sudo +php7-mod-ctype +php7-mod-fileinfo +php7-mod-xmlreader +php7-mod-openssl +php7-mod-hash +php7-mod-gd +php7-mod-xml +php7-mod-xmlwriter +php7-mod-json +php7-mod-mbstring +php7-mod-pcntl +php7-mod-opcache +php7-mod-session +php7-mod-simplexml +php7-mod-iconv +php7-mod-curl +php7-mod-zip +php7-mod-dom +coreutils-stat +php7 +lighttpd-mod-access +php7-mod-intl +icu-full-data + DEPENDS=+php7-mod-opcache +php7-fpm +php7-cli +sudo +php7-mod-ctype +php7-mod-fileinfo +php7-mod-xmlreader +php7-mod-openssl +php7-mod-gd +php7-mod-xml +php7-mod-xmlwriter +php7-mod-json +php7-mod-mbstring +php7-mod-pcntl +php7-mod-opcache +php7-mod-session +php7-mod-simplexml +php7-mod-iconv +php7-mod-curl +php7-mod-zip +php7-mod-dom +coreutils-stat +php7 +lighttpd-mod-access +php7-mod-intl +php7-mod-filter +icu-full-data endef define Package/nextcloud-install @@ -60,7 +60,7 @@ define Package/$(PKG_NAME)/install expr $$$$i : ipkg || $(CP) -r $(PKG_BUILD_DIR)/$$$$i $(1)/srv/www/nextcloud;\ done $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/ - $(INSTALL_DATA) ./files/nextcloud.conf $(1)/etc/lighttpd/conf.d/ + $(INSTALL_DATA) ./files/nextcloud.conf $(1)/etc/lighttpd/conf.d/80-nextcloud.conf $(INSTALL_DIR) $(1)/etc/cron.d $(INSTALL_DATA) ./files/nextcloud.cron $(1)/etc/cron.d/nextcloud $(INSTALL_DIR) $(1)/usr/bin @@ -84,6 +84,8 @@ if [ -z "$$IPKG_INSTROOT" ]; then if [ -n "$$VER" ] && [ $$VER -lt "`echo $(PKG_VERSION) | sed 's|\.||g'`" ]; then sudo -u nobody php-cli ./occ upgrade --no-app-disable --no-interaction fi + else + /etc/init.d/lighttpd restart fi fi chown -R nobody "$$IPKG_INSTROOT"/srv/www/nextcloud/ diff --git a/net/nextcloud/files/easy_install.sh b/net/nextcloud/files/easy_install.sh index 5c1df294bd..1c4563d191 100644 --- a/net/nextcloud/files/easy_install.sh +++ b/net/nextcloud/files/easy_install.sh @@ -1,7 +1,8 @@ #!/bin/sh die() { - echo "$@" >&2 + echo "ERROR: $1" >&2 + foris-notify-wrapper -m nextcloud -a state_change '{"configuration": "failed", "msg": "'"$1"'"}' rm -f /tmp/nextcloud_configuring exit 1 } @@ -22,7 +23,13 @@ if [ -f /srv/www/nextcloud/config/config.php ]; then echo "You can enter MySQL console using 'mysql -u root' command" echo echo "WARNING: This will delete all your data from Nextcloud!!" - exit 1 + echo + die "Already configured" +fi + +if [ "x$1" = x--daemon ] || [ "x$1" = x-d ]; then + "$0" --batch "$@" > /dev/null 2>&1 & + exit 0 fi [ \! -f /tmp/nextcloud_configuring ] || die "Installation already in process" @@ -41,6 +48,7 @@ else read answer if [ "$answer" \!= YES ]; then echo "You decided not to proceed, so not doing anything" + foris-notify-wrapper -m nextcloud -a state_change '{"configuration": "failed", "msg": "Canceled"}' exit 0 fi fi @@ -50,7 +58,6 @@ fi /etc/init.d/mysqld enable /etc/init.d/php7-fpm start /etc/init.d/php7-fpm enable -/etc/init.d/lighttpd restart DELAY=5 @@ -72,7 +79,7 @@ fi # Hack MySQL database /etc/init.d/mysqld stop 2> /dev/null sleep $DELAY -sudo -u mysql mysqld --skip-networking --skip-grant-tables --socket=/tmp/mysql_nextcloud.sock > /dev/null 2>&1 & +sudo -u mariadb mysqld --skip-networking --skip-grant-tables --socket=/tmp/mysql_nextcloud.sock > /dev/null 2>&1 & PID="$!" i=0 while [ "$i" -lt 15 ] && [ \! -S /tmp/mysql_nextcloud.sock ]; do @@ -86,7 +93,7 @@ CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY '$DBPASS'; GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost'; CREATE USER 'nextcloud'@'127.0.0.1' IDENTIFIED BY '$DBPASS'; GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'127.0.0.1'; -" | mysql -u root -B --socket=/tmp/mysql_nextcloud.sock || die "Creating nextcloud database failed" +" | mysql -u root -B --socket=/tmp/mysql_nextcloud.sock || die "Creating Nextcloud database failed" sleep 1 kill "$PID" i=0 @@ -119,9 +126,11 @@ sudo -u nobody php-cli ./occ config:system:set --value false updatechecker --typ [ -z "$(uname -n)" ] || sudo -u nobody php-cli ./occ config:system:set --value "$(uname -n ).local" trusted_domains 2 /etc/init.d/php7-fpm restart -/etc/init.d/lighttpd restart echo "Your Nextcloud installation should be available at http://$IP/nextcloud" echo "Your username is '$ALOGIN' and password '$APASS'" rm -f /tmp/nextcloud_configuring + +# Send notification about the Nextcloud configuration process +foris-notify-wrapper -m nextcloud -a state_change '{"configuration": "completed"}' diff --git a/net/openvpn-hotplug/Makefile b/net/openvpn-hotplug/Makefile index 0533cb4832..eff650ffc5 100644 --- a/net/openvpn-hotplug/Makefile +++ b/net/openvpn-hotplug/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn-hotplug PKG_VERSION:=0.2 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/net/resolver-conf/Makefile b/net/resolver-conf/Makefile index 50b93b958c..5a3a03c1cb 100644 --- a/net/resolver-conf/Makefile +++ b/net/resolver-conf/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=resolver-conf PKG_VERSION:=0.0.4 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later @@ -23,7 +23,7 @@ define Package/resolver-conf CATEGORY:=Network SUBMENU:=IP Addresses and Names TITLE:=Resolver configuration - DEPENDS:=+python3-light +python3-multiprocessing +python3-logging +ca-bundle + DEPENDS:=+python3-light +python3-multiprocessing +python3-logging +ca-bundle +python3-uci endef define Package/resolver-conf/description @@ -39,11 +39,8 @@ Build/Install:=: define Package/resolver-conf/install $(INSTALL_DIR) $(1)/etc/config -ifneq ($(filter-out n,$(CONFIG_PACKAGE_knot-resolver)),) - $(INSTALL_CONF) ./files/resolver-omnia-config $(1)/etc/config/resolver -else - $(INSTALL_CONF) ./files/resolver-turris-config $(1)/etc/config/resolver -endif + $(INSTALL_CONF) ./files/resolver-config $(1)/etc/config/resolver + $(INSTALL_DIR) $(1)/etc/resolver $(INSTALL_BIN) ./files/resolver-conv $(1)/etc/resolver/resolver-conv.sh $(INSTALL_BIN) ./files/dhcp_host_domain_ng.py $(1)/etc/resolver/dhcp_host_domain_ng.py diff --git a/net/resolver-conf/files/dhcp_host_domain_ng.py b/net/resolver-conf/files/dhcp_host_domain_ng.py index 0c9bcd40d3..494ae6af7d 100755 --- a/net/resolver-conf/files/dhcp_host_domain_ng.py +++ b/net/resolver-conf/files/dhcp_host_domain_ng.py @@ -8,7 +8,18 @@ import socket import os from os import listdir - +from euci import EUci +from uci import UciExceptionNotFound + +try: + whats_my_name = next( + e.get('system', section, 'hostname') + for e in [EUci()] + for section in e.get('system') + if e.get('system', section) == 'system' + ) +except UciExceptionNotFound: + whats_my_name = None def is_valid_hostname(hostname): if len(hostname) > 255: @@ -17,6 +28,8 @@ def is_valid_hostname(hostname): return False if hostname[-1] == ".": hostname = hostname[:-1] + if hostname == whats_my_name: + return False allowed = re.compile(r"^(?!-)[A-Z\d_-]{1,63}(? /tmp/resolv.conf.vpn."$INSTANCE" - grep -q nameserver /tmp/resolv.conf.vpn."$INSTANCE" || rm -f /tmp/resolv.conf.vpn."$INSTANCE" + set | sed -n "s|foreign_option_[0-9]*='dhcp-option DNS \([^']*\)'|nameserver \1|p" > /tmp/resolv.conf.d/resolv.conf.vpn."$INSTANCE" + grep -q nameserver /tmp/resolv.conf.d/resolv.conf.vpn."$INSTANCE" || rm -f /tmp/resolv.conf.d/resolv.conf.vpn."$INSTANCE" [ \! -x /etc/hotplug.d/iface/40-resolver-reload ] || /etc/hotplug.d/iface/40-resolver-reload elif [ "$ACTION" = down ]; then - rm -f /tmp/resolv.conf.vpn."$INSTANCE" + rm -f /tmp/resolv.conf.d/resolv.conf.vpn."$INSTANCE" [ \! -x /etc/hotplug.d/iface/40-resolver-reload ] || /etc/hotplug.d/iface/40-resolver-reload fi diff --git a/net/resolver-conf/files/resolver-omnia-config b/net/resolver-conf/files/resolver-config similarity index 100% rename from net/resolver-conf/files/resolver-omnia-config rename to net/resolver-conf/files/resolver-config diff --git a/net/resolver-conf/files/resolver-turris-config b/net/resolver-conf/files/resolver-turris-config deleted file mode 100644 index 99b8e81116..0000000000 --- a/net/resolver-conf/files/resolver-turris-config +++ /dev/null @@ -1,63 +0,0 @@ -config resolver 'common' - list interface '0.0.0.0' - list interface '::0' - option port '53' - option keyfile '/etc/root.keys' - option verbose '0' - option edns_buffer_size '1232' - option msg_buffer_size '65552' - option msg_cache_size '20M' - option net_ipv6 '1' - option net_ipv4 '1' - option forward_upstream '1' - option prefered_resolver 'unbound' - option ignore_root_key '0' - option prefetch 'yes' - option static_domains '1' - option dynamic_domains '0' - -config resolver 'kresd' - option rundir '/tmp/kresd' - option log_stderr '0' - option log_stdout '0' - option keep_cache '1' - #option include_config '/tmp/kresd.custom.conf' - #list hostname_config '/etc/hosts' - #list rpz_file '/tmp/file.rpz' - -config resolver 'unbound' - option outgoing_range '60' - option outgoing_num_tcp '1' - option incoming_num_tcp '1' - option msg_cache_slabs '1' - option num_queries_per_thread '30' - option rrset_cache_size '100K' - option rrset_cache_slabs '1' - option infra_cache_slabs '1' - option infra_cache_numhosts '200' - option cache_max_negative_ttl '1000' - list access_control '0.0.0.0/0 allow' - list access_control '::0/0 allow' - option pidfile '/var/run/unbound.pid' - option root_hints '/etc/unbound/named.cache' - option target_fetch_policy '2 1 0 0 0' - option harden_short_bufsize 'yes' - option harden_large_queries 'yes' - option qname_minimisation 'yes' - option harden_below_nxdomain 'yes' - option key_cache_size '100k' - option key_cache_slabs '1' - option neg_cache_size '10k' - option prefetch_key 'yes' - #option hostname_config '/etc/hosts' - -#config resolver 'unbound_python' -# list python_script "/etc/unbound/ubmodule-tst.py" - -config resolver 'unbound_remote_control' - option control_enable 'yes' - option control_use_cert 'no' - list control_interface '127.0.0.1' - -# config resolver 'unbound_includes' -# list include_path "/etc/unbound/unbound-part.conf" diff --git a/net/resolver-debug/Makefile b/net/resolver-debug/Makefile index 57082f64ee..37c0ba00c3 100644 --- a/net/resolver-debug/Makefile +++ b/net/resolver-debug/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=resolver-debug PKG_VERSION:=0.0.3 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0 diff --git a/net/rmbt-client/Makefile b/net/rmbt-client/Makefile index df790f299f..e3fdd4fa40 100644 --- a/net/rmbt-client/Makefile +++ b/net/rmbt-client/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rmbt-client PKG_VERSION:=1.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/lwimmer/rmbt-client/tar.gz/v$(PKG_VERSION)? diff --git a/net/suricata-bin/Makefile b/net/suricata-bin/Makefile index e346a13ec9..00321b6172 100644 --- a/net/suricata-bin/Makefile +++ b/net/suricata-bin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=suricata-bin PKG_VERSION:=4.0.7 -PKG_RELEASE=4 +PKG_RELEASE=$(AUTORELEASE) PKG_SOURCE:=suricata-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.openinfosecfoundation.org/download/ @@ -51,6 +51,7 @@ define Package/suricata-bin +libpthread \ +librt \ +libpcap \ + +libcap-ng \ $(LUAJIT_DEP) \ +libnetfilter-queue \ +iptables-mod-nfqueue \ diff --git a/net/suricata-emergingthreats-rules/Makefile b/net/suricata-emergingthreats-rules/Makefile index 32e55ef183..9e13f3f0e0 100644 --- a/net/suricata-emergingthreats-rules/Makefile +++ b/net/suricata-emergingthreats-rules/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=suricata-emergingthreats-rules PKG_VERSION:=4 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) include $(INCLUDE_DIR)/package.mk diff --git a/net/suricata-pakon/Makefile b/net/suricata-pakon/Makefile index 135faa35b3..cea5079378 100644 --- a/net/suricata-pakon/Makefile +++ b/net/suricata-pakon/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=suricata-pakon -PKG_VERSION:=1 -PKG_RELEASE:=8 +PKG_VERSION:=1.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_LICENSE:=GPL-2.0 PKG_INSTALL:=1 diff --git a/net/suricata-pakon/files/suricata.init b/net/suricata-pakon/files/suricata.init index 6c3962bb4b..c4ae7fad4e 100644 --- a/net/suricata-pakon/files/suricata.init +++ b/net/suricata-pakon/files/suricata.init @@ -3,8 +3,7 @@ USE_PROCD=1 START=95 STOP=05 -EXTRA_COMMANDS="status" -EXTRA_HELP=" status Get suricata status (as exit code)" +extra_command "status" "Display the service status (as exit code)" IPTABLES_RULES="/tmp/suricata/suricata.fw" IP6TABLES_RULES="/tmp/suricata/suricata.fw6" PID_FILE="/var/run/suricata/suricata.pid" diff --git a/net/unbound/Makefile b/net/unbound/Makefile index 2f4cfd7602..c1a40450a8 100644 --- a/net/unbound/Makefile +++ b/net/unbound/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=unbound -PKG_VERSION:=1.13.1 -PKG_RELEASE:=4 +PKG_VERSION:=1.16.3 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://nlnetlabs.nl/downloads/unbound/ -PKG_HASH:=8504d97b8fc5bd897345c95d116e0ee0ddf8c8ff99590ab2b4bd13278c9f50b8 +PKG_HASH:=ea0c6665e2c3325b769eac1dfccd60fe1828d5fcf662650039eccb3f67edb28e PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf @@ -86,6 +86,7 @@ define Package/libunbound SECTION:=libs CATEGORY:=Libraries TITLE+= (library) + DEPENDS+= +libevent2 +libpthread +libmnl endef define Package/libunbound/description @@ -99,7 +100,11 @@ CONFIGURE_ARGS += \ --enable-subnet \ --with-libexpat="$(STAGING_DIR)/usr" \ --with-ssl="$(STAGING_DIR)/usr" \ - --without-pthreads + --enable-event-api \ + --with-libevent="$(STAGING_DIR)/usr" \ + --enable-ipset \ + --with-libmnl="$(STAGING_DIR)/usr" \ + --with-pthreads # uClibc doesn't support TCP fast open -> --enable-tfo-{client,server} would fail ifneq ($(CONFIG_USE_UCLIBC),y) @@ -113,10 +118,11 @@ define Package/unbound/conffiles endef define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/unbound-event.h $(1)/usr/include/ endef define Package/unbound/install diff --git a/net/unbound/files/unbound-init b/net/unbound/files/unbound-init index 234a14bf13..3cc6ebce99 100755 --- a/net/unbound/files/unbound-init +++ b/net/unbound/files/unbound-init @@ -145,12 +145,12 @@ init_unbound() { # Test for resolv.conf.auto new location # https://github.com/openwrt/openwrt/commit/cd48d8d3420dd4df03daaa548227ceb487ba7104 - resolv_conf_path="$(ls -1 /etc/resolv.conf.vpn.* | head -n1)" - if [ \! -f "$resolv_conv_path" ]; then - if [ -f "/tmp/resolv.conf.auto" ]; then - resolv_conf_path="/tmp/resolv.conf.auto" - elif [ -f "/tmp/resolv.conf.d/resolv.conf.auto" ]; then + resolv_conf_path="$(ls -1 /etc/resolv.conf.d/resolv.conf.vpn.* 2>/dev/null | head -n1)" + if [ \! -f "$resolv_conf_path" ]; then + if [ -f "/tmp/resolv.conf.d/resolv.conf.auto" ]; then resolv_conf_path="/tmp/resolv.conf.d/resolv.conf.auto" + elif [ -f "/tmp/resolv.conf.auto" ]; then + resolv_conf_path="/tmp/resolv.conf.auto" else resolv_conf_path="" echo "Error! File resolv.conf.auto is missing" diff --git a/turris-defaults/Makefile b/turris-defaults/Makefile index 2bffcfc688..10806b5e47 100644 --- a/turris-defaults/Makefile +++ b/turris-defaults/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-defaults PKG_VERSION:=0.1.2 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/updater/cznic-repo-keys/Makefile b/updater/cznic-repo-keys/Makefile index 3d49466601..1529e13784 100644 --- a/updater/cznic-repo-keys/Makefile +++ b/updater/cznic-repo-keys/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2016 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2016-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,10 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cznic-repo-keys -PKG_VERSION:=4.1 -PKG_RELEASE:=1 +PKG_VERSION:=4.2 +PKG_RELEASE:=$(AUTORELEASE) -PKG_MAINTAINER:=Michal Hrusecky +PKG_MAINTAINER:=CZ.NIC + +PKG_BUILD_DEPENDS:=usign/host include $(INCLUDE_DIR)/package.mk @@ -31,9 +33,10 @@ define Package/cznic-repo-keys/install $(INSTALL_DIR) $(1)/etc/opkg/keys $(INSTALL_DIR) $(1)/etc/updater/keys/ for i in release standby; do \ - $(CP) files/$$$$i.pub $(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p files/$$$$i.pub`; \ - $(CP) files/$$$$i.pub $(1)/etc/updater/keys; \ - $(CP) files/$$$$i.pub.sig $(1)/etc/updater/keys; \ + USIGNNAME="$$$$($(STAGING_DIR_HOST)/bin/usign -F -p files/$$$$i.pub)"; \ + $(CP) files/$$$$i.pub $(1)/etc/opkg/keys/$$$$USIGNNAME; \ + $(CP) files/$$$$i.pub $(1)/etc/updater/keys/; \ + $(CP) files/$$$$i.pub.sig $(1)/etc/updater/keys/; \ done endef @@ -41,16 +44,17 @@ define Package/cznic-repo-keys-test/install $(INSTALL_DIR) $(1)/etc/opkg/keys $(INSTALL_DIR) $(1)/etc/updater/keys/ for i in test; do \ - $(CP) files/$$$$i.pub $(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p files/$$$$i.pub`; \ - $(CP) files/$$$$i.pub $(1)/etc/updater/keys; \ - $(CP) files/$$$$i.pub.sig $(1)/etc/updater/keys; \ + USIGNNAME="$$$$($(STAGING_DIR_HOST)/bin/usign -F -p files/$$$$i.pub)"; \ + $(CP) files/$$$$i.pub $(1)/etc/opkg/keys/$$$$USIGNNAME; \ + $(CP) files/$$$$i.pub $(1)/etc/updater/keys/; \ + $(CP) files/$$$$i.pub.sig $(1)/etc/updater/keys/; \ done endef define Package/cznic-repo-keys/postinst #!/bin/sh [ -n "$${IPKG_INSTROOT}" ] || { -# TODO: To remove files, use -r +# NOTE: To remove files, use -r /usr/sbin/cert-backup /etc/updater/keys/release.pub /etc/updater/keys/standby.pub } endef @@ -58,7 +62,7 @@ endef define Package/cznic-repo-keys-test/postinst #!/bin/sh [ -n "$${IPKG_INSTROOT}" ] || { -# TODO: To remove files, use -r +# NOTE: To remove files, use -r /usr/sbin/cert-backup /etc/updater/keys/test.pub } endef diff --git a/updater/fix/Makefile b/updater/fix/Makefile index bb91362091..6fd439fd39 100644 --- a/updater/fix/Makefile +++ b/updater/fix/Makefile @@ -13,7 +13,7 @@ PKG_NAME:=fix # immediately removed. If they are kept in system they are commonly expected to # be run only once. Because of that bump is prohibited! PKG_VERSION:=1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC @@ -154,18 +154,88 @@ define Package/fix-nextcloud-conf/description If there is empty config.php, which exists then it removes it. endef -define Package/sentinel-nikola-to-fwlogs/description +define Package/fix-sentinel-nikola-to-fwlogs/description Sentinel Nikola is being replaced by Sentinel FWLogs. They are pretty much compatible with exception of one UCI section name. This renames this UCI config (sentinel.nikola -> sentinel.fwlogs). This way Nikola configuration is migrated to FWLogs and Nikola can be removed. endef -define Package/pkglists-nikola-to-fwlogs/description +define Package/fix-pkglists-nikola-to-fwlogs/description Sentinel Nikola is being replaced by Sentinel FWLogs. This fixes rename of option in datacollect package list. endef +define Package/fix-lighttpd-sync-with-upstream/description + We are getting close to dropping our maintained package lighttpd in favor of + upstream variant, but before we are able to do it, we need to move + files from /etc/lighttpd/modules.d/ to /etc/lighttpd/conf.d/ + and rename their suffix from .load to .conf. If we don't do it, then + UI is not accessible and it wants to download file with name download, + because lighttpd in OpenWrt does not use the first mentioned folder + modules.d +endef + +define Package/fix-firewall-zone-limit/description + The OpenWrt 21.02 introduced the limit for 11 characters for firewall zone + names. The reason is that they are used in iptables as chain names and 11 + characters is maximum possible legth (plus the characters the firewall3 adds + on its own automatically). + This fix trims all zone names to 11 characters. +endef + +define Package/fix-network-devices/description + The OpenWrt 21.02 introduced the new way for configuring network devices. They + are now configured separatelly and only referenced in network interfaces. +endef + +define Package/fix-turris1x-btrfs-sdcard/description + The fix for Turris 1.x SD card going to read only mode. + This adds command that forces SD card controller to the RW mode as part of the + boot process (U-Boot environment). +endef + +define Package/fix-i-agree-with-eula-1/description + The Sentinel EULA agreement. This is used in combination with removal of + sentinel-i_agree_with_eula and thus switch from forced enable to optional. + It reenables agreement after package that forced it is removed. +endef + +define Package/fix-remote-access-ca-permissions/description + The fix for incorrect permissions of remote access CA files. + Mosquitto now runs under it's own dedicated user and fails to start with + CA files owner by root. + Change owner of CA files so that mosquitto is able to operate again. +endef + +define Package/fix-omnia-leds-migrate/description + Migrating LED names on Turris Omnia routers from old names to new upstream + names. Updates both Rainbow and OpenWrt LED config. +endef + +define Package/fix-turris1x-leds-migrate/description + Migrating LED names on Turris 1.x routers from old names to new upstream + names. Updates both Rainbow and OpenWrt LED config. +endef + +define Package/fix-firewall-doublesafe/description + Under some circumstances, wan ruleset might disappear from firewall. Try + restarting the firewall to get it back or in worst case, block all incoming + connections. Better safe then sorry. +endef + +define Package/fix-firewall-check-reboot/description + Under some circumstances, wan ruleset might disappear from firewall. Previous + fix prevents anybody from exploiting it but also limits the access to the router. + This one tries restarting the router but make sure that Turris 1.X kernel is + deployed correctly beforehand. +endef + +define Package/fix-turris1x-kernel-install/description + Ensure that kernel is installed properly on Turris 1.x. +endef + + $(eval $(call FIX,sentinel-remove-invalid-firewall-rules,+firewall +uci)) $(eval $(call FIX,samba-migrate-to-samba4,+samba4-server +uci)) $(eval $(call FIX,updater-v65.0-alternatives-update,+updater-ng +uci,prerm)) @@ -184,3 +254,14 @@ $(eval $(call FIX,nor-update,+turris-nor-update +turris-nor-update-firmware)) $(eval $(call FIX,nextcloud-conf,+nextcloud)) $(eval $(call FIX,sentinel-nikola-to-fwlogs,+sentinel-proxy)) $(eval $(call FIX,pkglists-nikola-to-fwlogs,+pkglists)) +$(eval $(call FIX,lighttpd-sync-with-upstream,+lighttpd)) +$(eval $(call FIX,firewall-zone-limit,+firewall)) +$(eval $(call FIX,network-devices,+netifd)) +$(eval $(call FIX,turris1x-btrfs-sdcard,+pkglists)) +$(eval $(call FIX,i-agree-with-eula-1,+uci,prerm)) +$(eval $(call FIX,remote-access-ca-permissions,+turris-cagen +foris-controller)) +$(eval $(call FIX,omnia-leds-migrate,+rainbow @TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia)) +$(eval $(call FIX,turris1x-leds-migrate,+rainbow @TARGET_mpc85xx_p2020_DEVICE_cznic_turris1x)) +$(eval $(call FIX,firewall-doublesafe)) +$(eval $(call FIX,firewall-check-reboot)) +$(eval $(call FIX,turris1x-kernel-install)) diff --git a/updater/fix/files/firewall-check-reboot b/updater/fix/files/firewall-check-reboot new file mode 100644 index 0000000000..2c8f4bb679 --- /dev/null +++ b/updater/fix/files/firewall-check-reboot @@ -0,0 +1,5 @@ +#!/bin/sh +echo 'if ! iptables -S | grep -q " -j zone_wan_input"; then + [ ! -x /etc/updater/hook_postupdate/10_kernel-install ] || /etc/updater/hook_postupdate/10_kernel-install + reboot +fi' | at now + 5min diff --git a/updater/fix/files/firewall-doublesafe b/updater/fix/files/firewall-doublesafe new file mode 100644 index 0000000000..7a328d79ad --- /dev/null +++ b/updater/fix/files/firewall-doublesafe @@ -0,0 +1,3 @@ +#!/bin/sh +iptables -S | grep -q ' -j zone_wan_input' || /etc/init.d/firewall restart +iptables -S | grep -q ' -j zone_wan_input' || iptables -P INPUT DROP diff --git a/updater/fix/files/firewall-zone-limit b/updater/fix/files/firewall-zone-limit new file mode 100755 index 0000000000..594471207a --- /dev/null +++ b/updater/fix/files/firewall-zone-limit @@ -0,0 +1,61 @@ +#!/bin/sh +set -e +. /lib/functions.sh +config_load firewall + +zones_map="$(mktemp -d)" +cleanup() { + rm -rf "$zones_map" +} +trap cleanup EXIT TERM INT QUIT ABRT + + +for_zones() { + local cnf="$1" + local name + config_get name "$cnf" "name" + if [ "${#name}" -gt 11 ]; then + new_name="${name:0:11}" + case "$name" in + guest_turris) + new_name="tr_guest" + ;; + esac + echo "$new_name" > "$zones_map/$name" + uci set "firewall.$cnf.name=$new_name" + fi +} +config_foreach for_zones "zone" + + +for_forwardings_rules_redirects() { + local cnf="$1" + local src dest + config_get src "$cnf" "src" "" + config_get dest "$cnf" "dest" "" + if [ -f "$zones_map/$src" ]; then + uci set "firewall.$cnf.src=$(cat "$zones_map/$src")" + fi + if [ -f "$zones_map/$dest" ]; then + uci set "firewall.$dest.src=$(cat "$zones_map/$dest")" + fi +} +config_foreach for_forwardings_rules_redirects "forwarding" +config_foreach for_forwardings_rules_redirects "rule" +config_foreach for_forwardings_rules_redirects "redirect" + +for_redirects_reflection() { + local zone="$1" + if [ -f "$zones_map/$zone" ]; then + uci del_list "firewall.$cnf.reflection_zone=$zone" + uci add_list "firewall.$cnf.reflection_zone=$(cat "$zones_map/$zone")" + fi +} +for_redirects() { + local cnf="$1" + config_list_foreach "$cnf" "reflection_zone" for_redirects_reflection +} +config_foreach for_redirects "redirect" + + +uci commit firewall diff --git a/updater/fix/files/i-agree-with-eula-1 b/updater/fix/files/i-agree-with-eula-1 new file mode 100755 index 0000000000..aba8c66f9a --- /dev/null +++ b/updater/fix/files/i-agree-with-eula-1 @@ -0,0 +1,10 @@ +#!/bin/sh +uci -q batch </dev/null || true diff --git a/updater/fix/files/network-devices b/updater/fix/files/network-devices new file mode 100755 index 0000000000..65e40436d8 --- /dev/null +++ b/updater/fix/files/network-devices @@ -0,0 +1,106 @@ +#!/bin/sh + +echo '#!/bin/sh +set -e +. /lib/functions.sh +# netifd provides default network overlay with current runtime configuration. We +# are not interested in that. We need to work with real content of /etc/config so +# we disable state loading. +LOAD_STATE= +config_load network + +config_network="/etc/config/network" +config_network_backup="$config_network.backup" +cp "$config_network" "$config_network_backup" +lanports="$(mktemp -d)" +lanmerge="$(mktemp -d)" +devmerged="$(mktemp -d)" +cleanup() { + local ec=$? + if [ $ec -ne 0 ]; then + mv "$config_network_backup" "$config_network" + echo "The network migration failed. Reverting to the original state. Please migrate the network configuration manually!" >&2 + exit $ec + else + rm -f "$config_network_backup" + fi + rm -rf "$lanports" "$lanmerge" "$devmerged" +} +trap cleanup EXIT TERM INT QUIT ABRT + + +device_attrs=" +type macaddr mtu mtu6 +" +bridge_attrs=" +bridge_empty igmp_snooping multicast_querier query_interval +query_response_interval last_member_interval hash_max robustness stp +forward_delay hello_time priority ageing_time max_age +" + + +# This splits off the new device sections from existing interfaces. +for_interfaces() { + local name="$1" + local type ifname + config_get type "$name" "type" + config_get ifname "$name" "ifname" + + # (1) Create new "device" section and migrate ifaces to new device. + local devname dcnf empty="y" + if [ "$type" = "bridge" ]; then + devname="br-$name" + dcnf=${devname//[-]/_} + empty="n" # we always create device for bridge + # create new named section + uci set "network.$dcnf=device" + uci set "network.$dcnf.name=$devname" + for attr in $bridge_attrs; do + local value + config_get value "$name" "$attr" + [ -n "$value" ] && uci set "network.$dcnf.$attr=$value" + uci -q del "network.$name.$attr" || true + done + for ifnm in $ifname; do + uci add_list "network.$dcnf.ports=$ifnm" + done + else + devname="$ifname" + # We do not create device for interfaces if it references some other + # interface or if is just empty + if [ -n "$ifname" ] && [ "${ifname:0:1}" != "@" ]; then + # Use prefix for section name to avoid named section collisions + # in case of non-bridged interface (e.g. wan) during migration. + dcnf="dev_$name" + uci set "network.$dcnf=device" + uci set "network.$dcnf.name=$devname" + fi + fi + + # (2) Migrate device related attributes to the new device. + if [ -n "$dcnf" ]; then + for attr in $device_attrs; do + local value + config_get value "$name" "$attr" + if [ -n "$value" ]; then + uci set "network.$dcnf.$attr=$value" + empty="n" + fi + uci -q del "network.$name.$attr" || true + done + # Remove the section if it is empty + [ "$empty" = "y" ] && uci -q delete "network.$dcnf" + fi + + # (3) migrate interfaces `ifname` to new `device` section + uci -q del "network.$name.ifname" || true + [ -z "$devname" ] \ + || uci set "network.$name.device=$devname" +} +config_foreach for_interfaces "interface" + +uci commit network +/etc/init.d/network restart +' > /etc/uci-defaults/network-migrate +create_notification -s restart 'Your network settings will be automatically migrated on next reboot, please refrain from changes in the configuration until then.' +chmod a+rx /etc/uci-defaults/network-migrate diff --git a/updater/fix/files/omnia-leds-migrate b/updater/fix/files/omnia-leds-migrate new file mode 100644 index 0000000000..9a187dd8c8 --- /dev/null +++ b/updater/fix/files/omnia-leds-migrate @@ -0,0 +1,12 @@ +#!/bin/sh +sed -i -e 's|pwr|power|g' \ + -e 's|lan\([0-9]\)|lan_\1|g' \ + -e 's|pci\([0-9]\)|wlan_\1|g' \ + -e 's|usr\([0-9]\)|indicator_\1|g' /etc/config/rainbow +sed -i -e 's|omnia-led:pwr|rgb:power|g' \ + -e 's|omnia-led:lan\([0-9]\)|rgb:lan-\1|g' \ + -e 's|omnia-led:wan|rgb:wan|g' \ + -e 's|omnia-led:pci\([0-9]\)|rgb:wlan-\1|g' \ + -e 's|omnia-led:usr\([0-9]\)|rgb:indicator-\1|g' /etc/config/system +/etc/init.d/rainbow restart || true 2> /dev/null +/etc/init.d/led restart || true diff --git a/updater/fix/files/remote-access-ca-permissions b/updater/fix/files/remote-access-ca-permissions new file mode 100644 index 0000000000..ae20de61d5 --- /dev/null +++ b/updater/fix/files/remote-access-ca-permissions @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +if [ -d /etc/ssl/ca/remote ]; then + chown mosquitto:mosquitto /etc/ssl/ca/remote/* + /etc/init.d/fosquitto restart + /etc/init.d/foris-controller restart +fi diff --git a/updater/fix/files/turris1x-btrfs-sdcard b/updater/fix/files/turris1x-btrfs-sdcard new file mode 100755 index 0000000000..9ea34ea4d6 --- /dev/null +++ b/updater/fix/files/turris1x-btrfs-sdcard @@ -0,0 +1,13 @@ +#!/bin/sh +set -eu +. /etc/os-release + +[ "$OPENWRT_DEVICE_PRODUCT" = "Turris 1.x" ] || exit 0 + +arg="mw ffee0060 40000000;" + +current="$(fw_printenv 'bootcmd')" +value="${current#bootcmd=}" +if ! echo "$value" | grep -qF "$arg"; then + fw_setenv 'bootcmd' "$arg $value" +fi diff --git a/updater/fix/files/turris1x-kernel-install b/updater/fix/files/turris1x-kernel-install new file mode 100644 index 0000000000..4f7803dbe4 --- /dev/null +++ b/updater/fix/files/turris1x-kernel-install @@ -0,0 +1,2 @@ +#!/bin/sh +[ ! -x /etc/updater/hook_postupdate/10_kernel-install ] || /etc/updater/hook_postupdate/10_kernel-install diff --git a/updater/fix/files/turris1x-leds-migrate b/updater/fix/files/turris1x-leds-migrate new file mode 100755 index 0000000000..91deec3b21 --- /dev/null +++ b/updater/fix/files/turris1x-leds-migrate @@ -0,0 +1,67 @@ +#!/bin/sh + +print_config() { + led=$1 + color=$2 + status=$3 + brightness=$4 + echo + echo "config led '$led'" + [ -n "$color" ] && echo " option color '$color'" + [ -n "$status" ] && echo " option status '$status'" + [ -n "$brightness" ] && echo " option brightness '$brightness'" +} + +uci_get() { + out=$(uci get $1 2>/dev/null) + if [ $? = 0 ]; then + echo $out + fi +} + +migrate_led() { + led=$1 + if [ -z "$(uci_get rainbow.$led)" ]; then + return + fi + color=$(uci_get rainbow.$led.color) + status=$(uci_get rainbow.$led.status) + brightness=$(uci_get rainbow.$led.brightness) + [ $led = pwr ] && led=power + [ $led = wifi ] && led=wlan + [ $led = lan1 ] && led=lan-1 + [ $led = lan2 ] && led=lan-2 + [ $led = lan3 ] && led=lan-3 + [ $led = lan4 ] && led=lan-4 + [ $led = lan5 ] && led=lan-5 + + print_config $led $color $status $brightness +} + +migrate() { + for led in all pwr wifi wan; do + migrate_led $led + done + + # if lan section was specified, it was used for all lan LEDs even if there was + # a section for a specific lan led. Current rainbow-ng doesn't use the lan + # section anymore and only supports setting specific lan-* LEDS + + if [ -n "$(uci_get rainbow.lan)" ]; then + color=$(uci_get rainbow.lan.color) + status=$(uci_get rainbow.lan.status) + print_config lan-1 $color $status + print_config lan-2 $color $status + print_config lan-3 $color $status + print_config lan-4 $color $status + print_config lan-5 $color $status + else + for led in lan1 lan2 lan3 lan4 lan5; do + migrate_led $led + done + fi +} + +cp /etc/config/rainbow /etc/config/rainbow.old +migrate > /etc/config/rainbow.new +mv /etc/config/rainbow.new /etc/config/rainbow diff --git a/updater/initial-config/Makefile b/updater/initial-config/Makefile index 7eae9c3421..8ca0e9f51d 100644 --- a/updater/initial-config/Makefile +++ b/updater/initial-config/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=initial-config PKG_VERSION:=0.2.3 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/updater/l10n-supported/Makefile b/updater/l10n-supported/Makefile index 9e0120485e..8ce5465e82 100644 --- a/updater/l10n-supported/Makefile +++ b/updater/l10n-supported/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=l10n-supported -PKG_VERSION:=1.3.1 -PKG_RELEASE:=1 +PKG_VERSION:=1.4.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/updater/l10n-supported/files/list b/updater/l10n-supported/files/list index 785aa8dd84..d0bdcef640 100644 --- a/updater/l10n-supported/files/list +++ b/updater/l10n-supported/files/list @@ -1,11 +1,11 @@ cs -da de +es fr -lt +hu +nb_NO +nl pl ru sk -hu -it -nb +sv diff --git a/updater/localrepo/Makefile b/updater/localrepo/Makefile index 90c1359d54..0d75f190a8 100644 --- a/updater/localrepo/Makefile +++ b/updater/localrepo/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=localrepo PKG_VERSION:=0.2.1 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/updater/localrepo.git diff --git a/updater/pkglists/Makefile b/updater/pkglists/Makefile index 68dfa64487..ed29828aec 100644 --- a/updater/pkglists/Makefile +++ b/updater/pkglists/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2016-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2016-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkglists -PKG_VERSION:=1.7.1 -PKG_RELEASE:=1 +PKG_VERSION:=1.8.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/updater/pkglists/files/definitions.json b/updater/pkglists/files/definitions.json index 86382c4fad..7d285029ea 100644 --- a/updater/pkglists/files/definitions.json +++ b/updater/pkglists/files/definitions.json @@ -164,6 +164,12 @@ "description": "Software for in depth monitoring of your traffic using Suricata.", "url": "https://docs.turris.cz/basics/apps/pakon/", "labels": ["experimental", "netload", "high_memory", "storage"] + }, + "morce": { + "title": "Morce", + "description": "Simple integration of Intrusion Detection System.", + "url": " https://docs.turris.cz/basics/apps/morce/", + "labels": ["experimental", "netload", "high_memory", "storage"] } } }, diff --git a/updater/sdio-no-tos6/Makefile b/updater/sdio-no-tos6/Makefile new file mode 100644 index 0000000000..16a042a4db --- /dev/null +++ b/updater/sdio-no-tos6/Makefile @@ -0,0 +1,46 @@ +# +## Copyright (C) 2022 CZ.NIC z.s.p.o. (http://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:=sdio-no-tos6 +PKG_VERSION:=0.1.0 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=CZ.NIC + +include $(INCLUDE_DIR)/package.mk + +define Package/sdio-no-tos6 + SECTION:=updater + CATEGORY:=Turris Updater + TITLE:=Turris OS 6.x missing SDIO support + DEPENDS:=@TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox +endef + +define Package/sdio-no-tos6/postinst +[ -n "$$IPKG_INSTROOT" ] || { + found= + for device in /sys/bus/sdio/devices/*; do + [ -d "$$device" ] || continue + if [ "$$(cat $$device/vendor)" = "0x02df" ] && [ "$$(cat $$device/device)" = "0x9141" ]; then + create_notification -s news 'Turris OS 6.0 is not available on systems with SDIO yet' + switch-branch --force hbs-sdio 2>/dev/null + found=y + break + fi + done + if [ -z "$$found" ]; then + switch-branch hbs 2>/dev/null + fi +} +endef + +Package/sdio-no-tos6/install:=: +Build/Compile:= + +$(eval $(call BuildPackage,sdio-no-tos6)) diff --git a/updater/switch-branch/Makefile b/updater/switch-branch/Makefile index 9bfeae0390..a77ee29d49 100644 --- a/updater/switch-branch/Makefile +++ b/updater/switch-branch/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=switch-branch -PKG_VERSION:=2.6.0 -PKG_RELEASE:=3 +PKG_VERSION:=2.7.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/updater/switch-branch/files/switch-branch b/updater/switch-branch/files/switch-branch index b56f8d535d..0a0b640f42 100755 --- a/updater/switch-branch/files/switch-branch +++ b/updater/switch-branch/files/switch-branch @@ -103,11 +103,31 @@ load_current_state() { fetch_existing_versions() { EXISTING_VERSIONS="$(curl "https://repo.turris.cz/archive/" | \ - sed -n 's|.*alt="\[DIR\]".*&2 + return 2 + ;; + esac + curl "https://repo.turris.cz/$1/$board/lists/turris-version" +) + # We allows some branch alternatives. This function replaces them with canonical variant branch_alts() { case "$target" in @@ -338,6 +358,22 @@ if [ "$mode" != "version" ]; then esac fi +# Verify that this is not a downgrade +if [ "$force" != "y" ]; then + target_version="$target" + [ "$mode" = "branch" ] \ + && target_version="$(fetch_target_version "$target")" + if [ "$(printf "%s\n%s" "$target_version" "$CUR_VERSION" | sort -V | head -1)" != "$CUR_VERSION" ]; then + cat <<-EOF + $CUR_VERSION -> $target_version + You are attempting to do downgrade while only upgrades are supported. + Downgrade can cause unexpected issues because of migration steps performed on upgrade. + You can use schnapps to rollback to a previous version or perform a factory reset. + EOF + exit 1 + fi +fi + ################################### set -x diff --git a/updater/tos3to4/Makefile b/updater/tos3to4/Makefile index d94180a5c9..0188feaaff 100644 --- a/updater/tos3to4/Makefile +++ b/updater/tos3to4/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tos3to4 -PKG_VERSION:=2.3.1 -PKG_RELEASE:=1 +PKG_VERSION:=2.4.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/updater/tos3to4/files/sfp-omnia b/updater/tos3to4/files/sfp-omnia index a0cb8a8c51..905626e15e 100755 --- a/updater/tos3to4/files/sfp-omnia +++ b/updater/tos3to4/files/sfp-omnia @@ -5,7 +5,7 @@ dev="/sys/class/gpio/gpio$detgpio" if ! [ -e "$dev/value" ]; then echo -n "$detgpio" > "/sys/class/gpio/export" - echo -n "out" > "$dev/direction" + echo -n "in" > "$dev/direction" fi if [ "$(cat "$dev/value")" = "0" ]; then diff --git a/updater/tos3to4/files/switch_and_vlans b/updater/tos3to4/files/switch_and_vlans index 9626b332f3..f8803c51a8 100755 --- a/updater/tos3to4/files/switch_and_vlans +++ b/updater/tos3to4/files/switch_and_vlans @@ -14,6 +14,9 @@ if [ "$(cat /tmp/sysinfo/model)" = "Turris" ]; then CPU_TRUNK_2="0" WAN="eth2" NEW_WAN="eth2" + maplan() { + echo "$((6 - $1))" + } else # Turris Omnia CPU_LAN_1="eth0" @@ -22,11 +25,15 @@ else CPU_TRUNK_2="6" WAN="eth1" NEW_WAN="eth2" + maplan() { + echo "$1" + } fi vlandir="$(mktemp -d)" +freevlandir="$(mktemp -d)" cleanup() { - rm -rf "$vlandir" + rm -rf "$vlandir" "$freelandir" } trap cleanup EXIT TERM INT QUIT ABRT @@ -34,51 +41,72 @@ vlan_handle() { local vlan="$1" local ports vid config_get ports "$vlan" ports - config_get vid "$vlan" vid 0 + config_get vid "$vlan" vlan 0 + config_get vid "$vlan" vid "$vid" + local freevlan="y" for port in $ports; do case "$port" in "$CPU_TRUNK_1") + freevlan="n" echo "$vlan" > "$vlandir/$CPU_LAN_1" ;; "${CPU_TRUNK_1}t") + freevlan="n" echo "$vlan" > "$vlandir/$CPU_LAN_1.$vid" ;; "$CPU_TRUNK_2") + freevlan="n" echo "$vlan" > "$vlandir/$CPU_LAN_2" ;; "${CPU_TRUNK_2}t") + freevlan="n" echo "$vlan" > "$vlandir/$CPU_LAN_2.$vid" ;; esac done - # Note: if there is no CPU port then creating new bridge can be solution but - # at the moment we do not do it as we have routers not smart switches. + if [ "$freevlan" = "y" ]; then + # The VLAN has no termination in CPU. This is sort of smart switch + # setup. We have to create a new bridge for such network. + touch "$freevlandir/$vlan" + fi } config_foreach vlan_handle switch_vlan append_lan_ports() { - [ -f "$vlandir/$ifn" ] || return # ignore VLANs that are not in switch - # Note: there can be tagged vlan going to switch but if switch is not - # configured for it it does not work anyway. - - local vlan ports vid - vlan="$(cat "$vlandir/$ifn")" + local vlan="$1" + local ports vid config_get ports "$vlan" ports - config_get vid "$vlan" vid + config_get vid "$vlan" vlan 0 + config_get vid "$vlan" vid "$vid" for port in $ports; do case "$port" in "$CPU_TRUNK_1"|"${CPU_TRUNK_1}t"|"$CPU_TRUNK_2"|"${CPU_TRUNK_2}t") # Ignore CPU ports those are managed by DSA ;; *t) - append new_ifname "lan${port%t}.${vid}" + append new_ifname "lan$(maplan "${port%t}").${vid}" ;; *) - append new_ifname "lan${port}" + append new_ifname "lan$(maplan "${port}")" ;; esac done } +set_new_ifname_ports() { + uci delete "network.$cnf.ifname" 2>/dev/null || true + case "$new_ifname" in + *\ *) + for ifn in $new_ifname; do + uci add_list "network.$cnf.ifname=$ifn" + done + ;; + *) + uci set "network.$cnf.ifname=$new_ifname" + ;; + esac +} + + interface_handle() { local cnf="$1" local ifnames new_ifname @@ -86,7 +114,10 @@ interface_handle() { for ifn in $ifnames; do case "$ifn" in "${CPU_LAN_1}"*|"${CPU_LAN_2}"*) - append_lan_ports + [ -f "$vlandir/$ifn" ] || continue # ignore VLANs that are not in switch + # Note: there can be tagged vlan going to switch but if switch is not + # configured for it it does not work anyway. + append_lan_ports "$(cat "$vlandir/$ifn")" ;; "${WAN}"*) # Replace new old wan with new one and keep any VLAN configuration @@ -97,21 +128,24 @@ interface_handle() { ;; esac done - - uci delete "network.$cnf.ifname" - case "$new_ifname" in - *\ *) - for ifn in $new_ifname; do - uci add_list "network.$cnf.ifname=$ifn" - done - ;; - *) - uci set "network.$cnf.ifname=$new_ifname" - ;; - esac + set_new_ifname_ports } config_foreach interface_handle interface +free_vlan_interface() { + local vlan="$1" + local cnf new_ifname + cnf="$(uci add network interface)" + uci set "network.$cnf.proto=none" + append_lan_ports "$vlan" + # Note: there are no CPU ports + set_new_ifname_ports +} +for freevlan in "$freevlandir"/*; do + [ -f "$freevlan" ] || continue + free_vlan_interface "${freevlan##*/}" +done + network_section_remove() { uci delete "network.$1" diff --git a/updater/updater-drivers/Makefile b/updater/updater-drivers/Makefile index 6459c7b077..94d85be476 100644 --- a/updater/updater-drivers/Makefile +++ b/updater/updater-drivers/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=updater-drivers PKG_VERSION:=0.1.2 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/updater/updater-drivers/files/updater.lua b/updater/updater-drivers/files/updater.lua index 0d403e10b4..09cfceb8e8 100644 --- a/updater/updater-drivers/files/updater.lua +++ b/updater/updater-drivers/files/updater.lua @@ -99,3 +99,17 @@ for name, _ in pairs(ls("/sys/bus/pci/devices")) do end end turris_list("drivers/pci.lua") + +-- SDIO +devices = {} +for name, _ in pairs(ls("/sys/bus/sdio/devices")) do + local vendor = cat_file("/sys/bus/sdio/devices/" .. name .. "/vendor") + local device = cat_file("/sys/bus/sdio/devices/" .. name .. "/device") + if vendor and device then + table.insert(devices, { + vendor = tonumber(vendor), + device = tonumber(device) + }) + end +end +turris_list("drivers/sdio.lua") diff --git a/updater/updater-ng/Makefile b/updater/updater-ng/Makefile index f52e7191e6..2d4239d172 100644 --- a/updater/updater-ng/Makefile +++ b/updater/updater-ng/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2016-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2016-2022 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. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=updater-ng -PKG_VERSION:=69.1.3 -PKG_RELEASE:=2 +PKG_VERSION:=70.0.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/updater/updater.git -PKG_MIRROR_HASH:=865b4472cb79daabaae8556ddc2ed201c200fdc13021150b43098fbe6f83f4fb +PKG_MIRROR_HASH:=32c751b0642da4b939d8e197df19af4209bb8c4c43eb733b01416a618a54f753 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -39,6 +39,7 @@ define Package/updater-ng +libcurl \ +liburiparser \ +libarchive \ + +base64c \ +ca-certificates endef diff --git a/updater/updater-ng/files/turris.lua b/updater/updater-ng/files/turris.lua index 0500def2b8..ae9b701569 100644 --- a/updater/updater-ng/files/turris.lua +++ b/updater/updater-ng/files/turris.lua @@ -40,6 +40,17 @@ else end Export('board') +-- Detect container +local env = io.open("/proc/1/environ", "rb") +for name, value in env:read("*a"):gmatch"([^=]+)=([^%z]+)%z?" do + if name == "container" then + container=value + Export("container") + end +end +env:close() + + -- Common connection settings for Turris OS scripts local script_options = { security = "Remote", diff --git a/updater/updater-ng/patches/0001-Add-FilesSignature-support.patch b/updater/updater-ng/patches/0001-Add-FilesSignature-support.patch deleted file mode 100644 index 0932638bd3..0000000000 --- a/updater/updater-ng/patches/0001-Add-FilesSignature-support.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 05bf057092c5dbb6fb78b1520deea408aed6d42e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= -Date: Wed, 9 Jun 2021 10:15:56 +0200 -Subject: [PATCH 1/2] Add FilesSignature support - -We need this to cover case when files change in package without anything -other changing. The issue this tries to cover is conflicts between -packages because two packages provide same file but in reality that is -only because local version is older than the one in repository. This -forces reinstall and thus resolved such collision. ---- - CHANGELOG.md | 6 +++++ - docs/opkg.adoc | 6 +++++ - src/lib/lua/planner.lua | 2 +- - tests/lua/planner.lua | 51 ++++++++++++++++++++++++++++++++++++++++- - 4 files changed, 63 insertions(+), 2 deletions(-) - -diff --git a/CHANGELOG.md b/CHANGELOG.md -index b0674a72..0de99945 100644 ---- a/CHANGELOG.md -+++ b/CHANGELOG.md -@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. - The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -+## [Unreleased] -+### Added -+- Support for `FilesSignature` field in packages. On mismatch it trigger -+ reinstall. -+ -+ - ## [69.1.3] - 2021-06-16 - ### Changed - - Error generated from Lua when URI is being finished now includes error message -diff --git a/docs/opkg.adoc b/docs/opkg.adoc -index 3c8cba6b..505d4d5d 100644 ---- a/docs/opkg.adoc -+++ b/docs/opkg.adoc -@@ -197,6 +197,12 @@ LinkSignature:: - This is Turris extension. This is used to identify link changes in package - without version change. This covers situation when library changes API and all - packages depending on it has to be reinstalled because of that. -+FilesSignature:: -+ This is also Turris extension. This is used to identify changes in packages. -+ This covers only list of files not their content and thus it won't trigger -+ reinstall of package if file is changed. This covers situation when -+ configuration changes and new file is added or moved between packages without -+ package bump. - - Compared to `/usr/lib/opkg/status` following fields are on the other hand not - present: -diff --git a/src/lib/lua/planner.lua b/src/lib/lua/planner.lua -index ddb6dae4..163f9ebf 100644 ---- a/src/lib/lua/planner.lua -+++ b/src/lib/lua/planner.lua -@@ -630,7 +630,7 @@ local function check_install_version(status, requests) - install[request.name] = request - else - local different = nil -- for _, field in ipairs({"Version", "Architecture", "LinkSignature", "Depends", "Conflicts", "Provides"}) do -+ for _, field in ipairs({"Version", "Architecture", "LinkSignature", "FilesSignature", "Depends", "Conflicts", "Provides"}) do - local installed_field = status[request.name][field] or "" - local requested_field = request.package[field] or "" - if installed_field ~= requested_field then -diff --git a/tests/lua/planner.lua b/tests/lua/planner.lua -index 382b0715..e28251c8 100644 ---- a/tests/lua/planner.lua -+++ b/tests/lua/planner.lua -@@ -1917,7 +1917,19 @@ function test_filter_required() - pkg7 = { - Version = "7", - LinkSignature = "xxxx" -- } -+ }, -+ pkg8 = { -+ Version = "8", -+ LinkSignature = "xxxx" -+ }, -+ pkg9 = { -+ Version = "9", -+ FilesSignature = "xxxx" -+ }, -+ pkg10 = { -+ Version = "10", -+ FilesSignature = "xxxx" -+ }, - } - local requests = { - { -@@ -1977,6 +1989,42 @@ function test_filter_required() - critical = false, - modifier = {} - }, -+ { -+ -- Installed with correct version and same LinkSignature -+ action = "require", -+ name = "pkg8", -+ package = { -+ Version = "8", -+ LinkSignature = "xxxx", -+ repo = def_repo -+ }, -+ critical = false, -+ modifier = {} -+ }, -+ { -+ -- Installed with correct version but different FilesSignature -+ action = "require", -+ name = "pkg9", -+ package = { -+ Version = "9", -+ FilesSignature = "XXXXXX", -+ repo = def_repo -+ }, -+ critical = false, -+ modifier = {} -+ }, -+ { -+ -- Installed with correct version and same FilesSignature -+ action = "require", -+ name = "pkg10", -+ package = { -+ Version = "10", -+ FilesSignature = "xxxx", -+ repo = def_repo -+ }, -+ critical = false, -+ modifier = {} -+ }, - } - local result = planner.filter_required(status, requests, true) - local expected = { -@@ -1993,6 +2041,7 @@ function test_filter_required() - }, - requests[4], - requests[5], -+ requests[7], - { - action = "remove", - name = "pkg4", --- -2.33.0 - diff --git a/updater/updater-ng/patches/0002-lib-subprocess-use-SIGCHLD-to-detect-child-terminati.patch b/updater/updater-ng/patches/0002-lib-subprocess-use-SIGCHLD-to-detect-child-terminati.patch deleted file mode 100644 index cc2de60599..0000000000 --- a/updater/updater-ng/patches/0002-lib-subprocess-use-SIGCHLD-to-detect-child-terminati.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 0c7a6601f8dd2c8675c029e0d17196e5a68beddc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= -Date: Tue, 3 Aug 2021 15:13:51 +0200 -Subject: [PATCH 2/2] lib/subprocess: use SIGCHLD to detect child termination - early - -The subprocess now handles SIGCHLD for faster subprocess termination. We -care about the original child and nothild else. If that dies we consider -it as termination of subprocess and abandon reading from pipes even when -there could be still process writing to them. - -This should prevent from scripts hanging. ---- - CHANGELOG.md | 5 +++++ - src/lib/subprocess.c | 27 +++++++++++++++++++++++++-- - tests/c/subprocess.c | 11 +++++++++++ - 3 files changed, 41 insertions(+), 2 deletions(-) - -diff --git a/CHANGELOG.md b/CHANGELOG.md -index 0de99945..de47372f 100644 ---- a/CHANGELOG.md -+++ b/CHANGELOG.md -@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - Support for `FilesSignature` field in packages. On mismatch it trigger - reinstall. - -+### Fixed -+- Subprocess call is now terminated way earlier thanks to `SIGCHLD` signal -+ handling. This improves update time for any scripts spawning "daemon" processes -+ that do not correctly redirect or close standard outputs. -+ - - ## [69.1.3] - 2021-06-16 - ### Changed -diff --git a/src/lib/subprocess.c b/src/lib/subprocess.c -index 208b4471..24a5f2dd 100644 ---- a/src/lib/subprocess.c -+++ b/src/lib/subprocess.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - static int kill_timeout = 60000; - -@@ -122,9 +123,18 @@ int subprocloc(int timeout, FILE *fd[2], subproc_callback callback, void *data, - ASSERT(close(p_out[1]) != -1); - ASSERT(close(p_err[1]) != -1); - -+ sigset_t sigset; -+ sigemptyset(&sigset); -+ sigaddset(&sigset, SIGCHLD); -+ sigset_t oldset; -+ ASSERT(sigprocmask(SIG_BLOCK, &sigset, &oldset) == 0); -+ int sigfd = signalfd(-1, &sigset, SFD_CLOEXEC); -+ ASSERT(sigfd >= 0); -+ - struct pollfd pfds[] = { - { .fd = p_out[0], .events = POLLIN }, -- { .fd = p_err[0], .events = POLLIN } -+ { .fd = p_err[0], .events = POLLIN }, -+ { .fd = sigfd, .events = POLLIN }, - }; - time_t t_start = time(NULL); - bool term_sent = false; -@@ -135,7 +145,9 @@ int subprocloc(int timeout, FILE *fd[2], subproc_callback callback, void *data, - poll_timeout = rem_t < 0 ? 0 : rem_t; - } - // We ignore interrupt errors as those are really not an errors -- ASSERT_MSG(poll(pfds, 2, poll_timeout) != -1 || errno == EINTR, "Subprocess poll failed with error: %s", strerror(errno)); -+ ASSERT_MSG( -+ poll(pfds, sizeof(pfds) / sizeof(*pfds), poll_timeout) != -1 || errno == EINTR, -+ "Subprocess poll failed with error: %s", strerror(errno)); - int dead = 0; - for (int i = 0; i < 2; i++) { - if (pfds[i].revents & POLLIN) { -@@ -148,6 +160,15 @@ int subprocloc(int timeout, FILE *fd[2], subproc_callback callback, void *data, - dead++; - ASSERT(!(pfds[i].revents & POLLERR) && !(pfds[i].revents & POLLNVAL)); - } -+ if (pfds[2].revents & POLLIN) { -+ struct signalfd_siginfo siginfo; -+ while (read(sigfd, &siginfo, sizeof(siginfo)) > 0) -+ if (siginfo.ssi_pid == pid) { -+ dead = 2; // process terminated, consider both pipes closed -+ break; -+ } -+ } -+ ASSERT(!(pfds[2].revents & POLLERR) && !(pfds[2].revents & POLLNVAL)); - if (dead >= 2) - break; // Both feeds are dead so break this loop - if (timeout >= 0 && 1000*(time(NULL) - t_start) >= timeout) { -@@ -166,6 +187,8 @@ int subprocloc(int timeout, FILE *fd[2], subproc_callback callback, void *data, - - ASSERT(close(p_out[0]) != -1); - ASSERT(close(p_err[0]) != -1); -+ ASSERT(close(sigfd) != -1); -+ ASSERT(sigprocmask(SIG_SETMASK, &oldset, NULL) == 0); - - int wstatus; - ASSERT(waitpid(pid, &wstatus, 0) != -1); -diff --git a/tests/c/subprocess.c b/tests/c/subprocess.c -index 88ce78dc..82fd19f3 100644 ---- a/tests/c/subprocess.c -+++ b/tests/c/subprocess.c -@@ -50,6 +50,16 @@ START_TEST(timeout) { - } - END_TEST - -+// Test that we detect process termination without waiting for timeout. -+START_TEST(termination) { -+ FILE *devnull = fopen("/dev/null", "w"); -+ FILE *fds[] = {devnull, devnull}; -+ subproc_kill_t(10000); -+ time_t prev = time(NULL); -+ ck_assert_int_eq(0, subprocvo(10000, fds, "sh", "-c", "nohup sleep 100 &", NULL)); -+ ck_assert_int_lt(time(NULL) - prev, 10); -+} -+ - struct buffs { - FILE *fds[2]; - char *b_out, *b_err; -@@ -129,6 +139,7 @@ Suite *gen_test_suite(void) { - tcase_set_timeout(subproc, 30); - tcase_add_test(subproc, exit_code); - tcase_add_test(subproc, timeout); -+ tcase_add_test(subproc, termination); - tcase_add_test(subproc, output); - tcase_add_test(subproc, callback); - suite_add_tcase( --- -2.33.0 - diff --git a/updater/updater-opkg-wrapper/Makefile b/updater/updater-opkg-wrapper/Makefile index 697a7431c8..68daebd346 100644 --- a/updater/updater-opkg-wrapper/Makefile +++ b/updater/updater-opkg-wrapper/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=updater-opkg-wrapper PKG_VERSION:=0.2.0 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/updater/opkg-wrapper.git diff --git a/updater/updater-supervisor/Makefile b/updater/updater-supervisor/Makefile index 4acee5c38b..3b544e4d33 100644 --- a/updater/updater-supervisor/Makefile +++ b/updater/updater-supervisor/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2019-2022 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. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=updater-supervisor -PKG_VERSION:=1.4.3 -PKG_RELEASE:=2 +PKG_VERSION:=1.5.3 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/updater/supervisor.git -PKG_MIRROR_HASH:=e4252dfcac1f68d654df09837a62ec61731cd8cf6c1b78819ef9ccb86310141a +PKG_MIRROR_HASH:=232ddf02231e34a87970441dde6d9ec4d11aee4f66a788808389cb80f5707d5c PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -28,9 +28,8 @@ define Package/updater-supervisor TITLE:=Updater supervisor and its library DEPENDS:= \ +updater-ng +pkglists +l10n-supported \ - +python3-light +python3-uci +python3-distro \ + +python3-light +python3-uci +python3-distro +python3-packaging +python3-crontab \ +cronie - VARIANT:=python3 endef define Package/updater-supervisor/description diff --git a/updater/updater-supervisor/patches/0001-notify-Do-not-send-full-stacktrace-in-notification.patch b/updater/updater-supervisor/patches/0001-notify-Do-not-send-full-stacktrace-in-notification.patch new file mode 100644 index 0000000000..173d5c534a --- /dev/null +++ b/updater/updater-supervisor/patches/0001-notify-Do-not-send-full-stacktrace-in-notification.patch @@ -0,0 +1,86 @@ +From 679b8bd05b49d75cc83f3afd9cfeddbdb75e4ff3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= +Date: Mon, 15 Aug 2022 16:04:51 +0200 +Subject: [PATCH] notify: Do not send full stacktrace in notification + +Supervisor just passes the updater error message without really knowing +what went wrong, just that something unexpected happened. + +This workaround is more or less hack to silence overly verbose trace +from Lua code. Instead of passing the full stacktrace, try to find line +with error message. + +Basically look for following pattern: + +``` + msg = string: "\ +" +``` + +Perhaps the root cause would be better handled in updater Lua code, +because updater has more context of what went wrong. + +Closes: #34 +--- + svupdater/notify.py | 31 +++++++++++++++++++++++++++---- + 1 file changed, 27 insertions(+), 4 deletions(-) + +diff --git a/svupdater/notify.py b/svupdater/notify.py +index cb32dc6..020b8bc 100644 +--- a/svupdater/notify.py ++++ b/svupdater/notify.py +@@ -3,7 +3,7 @@ + These are notifications send to user using notification system. + """ + import datetime +-import os ++import re + import subprocess + import typing + +@@ -18,6 +18,23 @@ def clear_logs(): + const.PKGUPDATE_CRASH_LOG.unlink() + + ++def parse_lua_stack_trace(stacktrace: str) -> typing.Optional[str]: ++ """Try to get meaningfull message from Lua stack trace""" ++ # Quick hack to silence overly verbose stack trace from Lua code ++ # We are trying to find pattern: ++ # ++ # ``` ++ # msg = string: "\ ++ # " ++ # ``` ++ # It may break anytime when logging of failures in Lua changes somehow... ++ m = re.search(r'(?<=msg = string: "\\\n)(.*)', stacktrace) ++ if m: ++ return m.group(0) ++ ++ return None ++ ++ + def crash(exit_code: int, trace: typing.Optional[str]): + """Send notification about updater's failure.""" + if exit_code == 0 or exit_code == 1 and not const.PKGUPDATE_CRASH_LOG.is_file(): +@@ -32,9 +49,15 @@ def crash(exit_code: int, trace: typing.Optional[str]): + # crashes. Anything else is package installation failure and crash log is not relevant. + return + with const.PKGUPDATE_CRASH_LOG.open("r") as file: +- content = "\n".join(file.readlines()) +- msg_en += content +- msg_cs += content ++ content = file.read() ++ ++ err_msg = parse_lua_stack_trace(content) ++ if not err_msg: ++ msg_en += f"Unknown error (Exit code: {exit_code})" ++ msg_cs += f"Neznámá chyba (Návratový kód: {exit_code})" ++ else: ++ msg_en += err_msg ++ msg_cs += err_msg + elif trace: + msg_en += trace + f"\n\nExit code: {exit_code}" + msg_cs += trace + f"\n\nNávratový kód: {exit_code}" +-- +2.37.0 + diff --git a/utils/c-rehash/Makefile b/utils/c-rehash/Makefile index d1f9b732d2..7230f6c9d5 100644 --- a/utils/c-rehash/Makefile +++ b/utils/c-rehash/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=c-rehash PKG_VERSION:=1.7 -PKG_RELEASE:=3 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/utils/christmas/Makefile b/utils/christmas/Makefile index dff0b20daa..77d27bcd43 100644 --- a/utils/christmas/Makefile +++ b/utils/christmas/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=christmas PKG_VERSION:=0.3 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/christmas.git @@ -28,7 +28,6 @@ define Package/christmas URL:=https://gitlab.nic.cz/turris/christmas DEPENDS:=+python3-light +python3-uci DEPENDS+=@(TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia||TARGET_mpc85xx_p2020_DEVICE_turris1x) - VARIANT:=python3 endef define Package/christmas/description diff --git a/utils/common_passwords/Makefile b/utils/common_passwords/Makefile index 59b7005452..226bf5af7a 100644 --- a/utils/common_passwords/Makefile +++ b/utils/common_passwords/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=common_passwords PKG_VERSION:=20181218 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_SUBDIR:=$(PKG_NAME) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/utils/compass/Makefile b/utils/compass/Makefile deleted file mode 100644 index 50b44a3200..0000000000 --- a/utils/compass/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -## Copyright (C) 2019 CZ.NIC z.s.p.o. (http://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:=compass -PKG_VERSION:=1.0.3 -PKG_RELEASE:=1 -PKG_MAINTAINER:=CZ.NIC - -HOST_BUILD_DEPENDS:=ruby/host - -include $(INCLUDE_DIR)/host-build.mk -include $(INCLUDE_DIR)/package.mk - -Build/Compile:=: -Host/Compile:=: - -define Host/Install - $(STAGING_DIR_HOSTPKG)/bin/gem install compass -v $(PKG_VERSION) -endef - -$(eval $(call HostBuild)) -$(eval $(call Build/DefaultTargets)) diff --git a/utils/ip_autoselector/Makefile b/utils/ip_autoselector/Makefile index 5d8fbab0ef..e9c8b78069 100644 --- a/utils/ip_autoselector/Makefile +++ b/utils/ip_autoselector/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ip_autoselector PKG_VERSION:=1.0.2 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=CZ.NIC diff --git a/utils/mariadb/Makefile b/utils/mariadb/Makefile deleted file mode 100644 index 4056482889..0000000000 --- a/utils/mariadb/Makefile +++ /dev/null @@ -1,559 +0,0 @@ -# -# Copyright (C) 2018 Sebastian Kemper -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=mariadb -PKG_VERSION:=10.4.20 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL := \ - https://mirror.netcologne.de/mariadb/$(PKG_NAME)-$(PKG_VERSION)/source \ - https://mirror.lstn.net/mariadb/$(PKG_NAME)-$(PKG_VERSION)/source \ - https://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/$(PKG_NAME)-$(PKG_VERSION)/source \ - https://downloads.mariadb.org/interstitial/$(PKG_NAME)-$(PKG_VERSION)/source - -PKG_HASH:=87d5e29ee1f18de153266ec658138607703ed2a05b3ffb1f89091d33f4abf545 - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-2.0-or-later -PKG_LICENSE_FILES:=COPYING - -HOST_BUILD_PARALLEL:=1 -PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 -PKG_ASLR_PIE:=0 - -HOST_BUILD_DEPENDS:=libxml2/host -# Without libevent2 tests/async_queries sporadically fails on the bots -PKG_BUILD_DEPENDS:=libevent2 mariadb/host - -CMAKE_INSTALL:=1 - -PLUGIN_DIR:=/usr/lib/mariadb/plugin - -MARIADB_COMMON_DEPENDS := \ - +libatomic \ - +libopenssl \ - +libstdcpp \ - +zlib - -MARIADB_DISABLE_ENGINES := \ - rocksdb \ - -MARIADB_SERVER_PLUGINS := \ - adt_null \ - auth_0x0100 \ - auth_ed25519 \ - auth_socket \ - auth_test_plugin \ - client_ed25519 \ - debug_key_management \ - dialog_examples \ - disks \ - example_key_management \ - feedback \ - file_key_management \ - ha_archive \ - ha_blackhole \ - ha_connect \ - ha_example \ - ha_federated \ - ha_federatedx \ - ha_sequence \ - ha_sphinx \ - ha_spider \ - ha_test_sql_discovery \ - handlersocket \ - libdaemon_example \ - locales \ - metadata_lock_info \ - mypluglib \ - qa_auth_client \ - qa_auth_interface \ - qa_auth_server \ - query_cache_info \ - query_response_time \ - server_audit \ - simple_password_check \ - sql_errlog \ - wsrep_info - -PKG_CONFIG_DEPENDS := \ - $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-server-plugin-%,$(subst _,-,$(MARIADB_SERVER_PLUGINS))) \ - CONFIG_PACKAGE_mariadb-server - -plugin-adt_null := PLUGIN_AUDIT_NULL -plugin-auth_0x0100 := PLUGIN_AUTH_0X0100 -plugin-auth_ed25519 := PLUGIN_AUTH_ED25519 -plugin-auth_socket := PLUGIN_AUTH_SOCKET -plugin-auth_test_plugin := PLUGIN_AUTH_TEST_PLUGIN -plugin-client_ed25519 := PLUGIN_CLIENT_ED25519 -plugin-debug_key_management := PLUGIN_DEBUG_KEY_MANAGEMENT -plugin-dialog_examples := PLUGIN_DIALOG_EXAMPLES -plugin-disks := PLUGIN_DISKS -plugin-example_key_management := PLUGIN_EXAMPLE_KEY_MANAGEMENT -plugin-feedback := PLUGIN_FEEDBACK -plugin-file_key_management := PLUGIN_FILE_KEY_MANAGEMENT -plugin-ha_archive := PLUGIN_ARCHIVE -plugin-ha_blackhole := PLUGIN_BLACKHOLE -plugin-ha_connect := PLUGIN_CONNECT -plugin-ha_example := PLUGIN_EXAMPLE -plugin-ha_federated := PLUGIN_FEDERATED -plugin-ha_federatedx := PLUGIN_FEDERATEDX -plugin-ha_sequence := PLUGIN_SEQUENCE -plugin-ha_sphinx := PLUGIN_SPHINX -plugin-ha_spider := PLUGIN_SPIDER -plugin-ha_test_sql_discovery := PLUGIN_TEST_SQL_DISCOVERY -plugin-handlersocket := PLUGIN_HANDLERSOCKET -plugin-libdaemon_example := PLUGIN_DAEMON_EXAMPLE -plugin-locales := PLUGIN_LOCALES -plugin-metadata_lock_info := PLUGIN_METADATA_LOCK_INFO -plugin-mypluglib := PLUGIN_FTEXAMPLE -plugin-qa_auth_client := PLUGIN_QA_AUTH_CLIENT -plugin-qa_auth_interface := PLUGIN_QA_AUTH_INTERFACE -plugin-qa_auth_server := PLUGIN_QA_AUTH_SERVER -plugin-query_cache_info := PLUGIN_QUERY_CACHE_INFO -plugin-query_response_time := PLUGIN_QUERY_RESPONSE_TIME -plugin-server_audit := PLUGIN_SERVER_AUDIT -plugin-simple_password_check := PLUGIN_SIMPLE_PASSWORD_CHECK -plugin-sql_errlog := PLUGIN_SQL_ERRLOG -plugin-wsrep_info := PLUGIN_WSREP_INFO - -MARIADB_CLIENT := \ - mysql \ - mysqlcheck - -MARIADB_CLIENT_EXTRA := \ - mysql_find_rows \ - mysql_waitpid \ - mysqlaccess \ - mysqladmin \ - mysqldump \ - mysqlimport \ - mysqlshow \ - mysqlslap \ - mytop - -MARIADB_SERVER := \ - innochecksum \ - my_print_defaults \ - mysql_install_db \ - mysql_upgrade \ - mysqld - -MARIADB_SERVER_EXTRA := \ - aria* \ - mariabackup \ - msql2mysql \ - myisam_ftdump \ - myisamchk \ - myisamlog \ - myisampack \ - mysql_convert_table_format \ - mysql_fix_extensions \ - mysql_plugin \ - mysql_secure_installation \ - mysql_setpermission \ - mysql_tzinfo_to_sql \ - mysqlbinlog \ - mysqld_multi \ - mysqld_safe \ - mysqld_safe_helper \ - mysqldumpslow \ - mysqlhotcopy \ - perror \ - replace \ - resolve_stack_dump - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/host-build.mk -include $(INCLUDE_DIR)/cmake.mk - -# Pass CPPFLAGS in the CFLAGS as otherwise the build system will -# ignore them. -TARGET_CFLAGS+=$(TARGET_CPPFLAGS) - -define Package/mariadb/install/bin - if [ -f $(PKG_INSTALL_DIR)/usr/bin/$(2) ]; then\ - $(INSTALL_DIR) $(1)/usr/bin;\ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin;\ - else \ - $(INSTALL_DIR) $(1)/usr/sbin;\ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(2) $(1)/usr/sbin;\ - fi -endef - -define Package/mariadb/description/Default -MariaDB is a fast, stable and true multi-user, multi-threaded SQL -database server. SQL (Structured Query Language) is the most popular -database query language in the world. The main goals of MariaDB are -speed, robustness and ease of use. -endef - -define Package/libmariadbclient - SECTION:=libs - CATEGORY:=Libraries - DEPENDS:=$(MARIADB_COMMON_DEPENDS) - TITLE:=MariaDB database client library - URL:=https://mariadb.org/ - PROVIDES:=libmysqlclient libmysqlclient-r -endef - -define Package/libmariadbclient/description -$(call Package/mariadb/description/Default) - -This package includes the client library. - -endef - -define Package/mariadb/Default - SECTION:=utils - CATEGORY:=Utilities - URL:=https://mariadb.org/ - SUBMENU:=database -endef - -define Package/mariadb-client - $(call Package/mariadb/Default) - TITLE:=MariaDB database core client binaries - DEPENDS:= \ - $(MARIADB_COMMON_DEPENDS) \ - +libncursesw \ - +libedit -endef - -define Package/mariadb-client/description -$(call Package/mariadb/description/Default) - -This package includes the following core client binaries: - -$(subst $(space),$(newline),$(MARIADB_CLIENT)) - -endef - -define Package/mariadb-client-extra - $(call Package/mariadb/Default) - TITLE:=MariaDB database extra client binaries - DEPENDS:=mariadb-client -endef - -define Package/mariadb-client-extra/description -$(call Package/mariadb/description/Default) - -This package includes the following extra client binaries: - -$(subst $(space),$(newline),$(MARIADB_CLIENT_EXTRA)) - -endef - -define Package/mariadb-extra-charsets - $(call Package/mariadb/Default) - TITLE:=MariaDB database extra character sets - DEPENDS:=mariadb-server -endef - -define Package/mariadb-extra-charsets/description -$(call Package/mariadb/description/Default) - -The MariaDB server packaged by OpenWrt only provides support for UTF-8. -This package contains single Byte character sets and collations that can -be added at run time. - -endef - -define Package/mariadb-server - $(call Package/mariadb/Default) - DEPENDS:= \ - $(MARIADB_COMMON_DEPENDS) \ - +!arc:libaio \ - +liblzma \ - +libbz2 \ - +liblzo \ - +liblz4 \ - +libpcre \ - +resolveip - TITLE:=MariaDB database core server binaries - MENU:=1 - PROVIDES:=mysql-server - USERID:=mysql=6446:mysql=6446 -endef - -define Package/mariadb-server/description -$(call Package/mariadb/description/Default) - -This package includes the following core server binaries: - -$(subst $(space),$(newline),$(MARIADB_SERVER)) - -endef - -define Package/mariadb-server-extra - $(call Package/mariadb/Default) - TITLE:=MariaDB database extra server binaries - DEPENDS:=mariadb-server -endef - -define Package/mariadb-server-extra/description -$(call Package/mariadb/description/Default) - -This package includes the following extra server binaries: - -$(subst $(space),$(newline),$(MARIADB_SERVER_EXTRA)) - -endef - -# We won't need unit tests -CMAKE_OPTIONS += -DWITH_UNIT_TESTS=0 - -# This value is determined automatically during straight compile by compiling -# and running a test code. You cannot do that during cross-compile. However the -# stack grows downward in most if not all modern systems. The only exception -# according to buildroot is PA-RISC which is not supported by OpenWrt as far as -# I know. Therefore it makes sense to hardcode the value. If an arch is added -# the stack of which grows up one should expect unpredictable behavior at run -# time. -CMAKE_OPTIONS += -DSTACK_DIRECTION=-1 - -# Jemalloc was added for TokuDB. Since its configure script seems somewhat broken -# when it comes to cross-compilation we shall disable it and also disable TokuDB. -CMAKE_OPTIONS += -DWITH_JEMALLOC=no -DWITHOUT_TOKUDB=1 - -# Make it explicit that we are cross-compiling -CMAKE_OPTIONS += -DCMAKE_CROSSCOMPILING=1 - -# Explicitly disable dtrace to avoid detection of a host version -CMAKE_OPTIONS += -DENABLE_DTRACE=0 - -# Prevent mariadb from messing with OpenWrt's C(XX)FLAGS -CMAKE_OPTIONS += -DSECURITY_HARDENED=OFF - -ifeq ($(CONFIG_PACKAGE_mariadb-server),) -CMAKE_OPTIONS += -DWITHOUT_SERVER=ON -else -CMAKE_OPTIONS += -DWITHOUT_SERVER=OFF -endif - -CMAKE_OPTIONS += \ - -DCONNECT_WITH_JDBC=NO \ - -DCONNECT_WITH_LIBXML2=system \ - -DCONNECT_WITH_ODBC=NO \ - -DDEFAULT_CHARSET=utf8 \ - -DDEFAULT_COLLATION=utf8_general_ci \ - -DDISABLE_SHARED=NO \ - -DENABLED_PROFILING=OFF \ - -DENABLE_STATIC_LIBS=OFF \ - -DINSTALL_MYSQLSHAREDIR=share/mariadb \ - -DINSTALL_LAYOUT=RPM \ - -DINSTALL_PLUGINDIR=lib/mariadb/plugin \ - -DINSTALL_MYSQLDATADIR=/srv/mysql \ - -DINSTALL_UNIX_ADDRDIR=/var/run/mysql/mysql.sock - -DSKIP_TESTS=ON \ - -DWITH_ASAN=OFF \ - -DWITH_EMBEDDED_SERVER=OFF \ - -DWITH_EXTRA_CHARSETS=none \ - -DWITH_INNODB_BZIP2=OFF \ - -DWITH_INNODB_LZ4=OFF \ - -DWITH_INNODB_LZMA=ON \ - -DWITH_INNODB_LZO=ON \ - -DWITH_INNODB_SNAPPY=OFF \ - -DWITH_LIBEDIT=OFF \ - -DWITH_LIBNUMA=NO \ - -DWITH_LIBWRAP=OFF \ - -DWITH_LIBWSEP=OFF \ - -DWITH_MARIABACKUP=ON \ - -DWITH_PCRE=system \ - -DWITH_READLINE=OFF \ - -DWITH_SAFEMALLOC=OFF \ - -DWITH_SSL=system \ - -DWITH_SYSTEMD=no \ - -DWITH_VALGRIND=OFF \ - -DWITH_ZLIB=system - -# Default-disable some modules -CMAKE_OPTIONS += \ - -DPLUGIN_CASSANDRA=OFF \ - -DPLUGIN_OQGRAPH=OFF \ - -DPLUGIN_TOKUDB=OFF \ - -DPLUGIN_AUTH_PAM=NO \ - -DPLUGIN_AUTH_GSSAPI=NO \ - -DPLUGIN_AUTH_GSSAPI_CLIENT=OFF \ - -DPLUGIN_CRACKLIB_PASSWORD_CHECK=OFF - -CMAKE_OPTIONS += \ - $(foreach p,$(MARIADB_SERVER_PLUGINS),-D$(plugin-$(p))=$(if $(CONFIG_PACKAGE_$(PKG_NAME)-server-plugin-$(subst _,-,$(p))),DYNAMIC,OFF)) - -# Set CMAKE_FIND_ROOT_PATH_MODE_INCLUDE and CMAKE_FIND_ROOT_PATH_MODE_LIBRARY -# to BOTH as otherwise the host build will not find some required dependencies -# installed on the host machine, like ncurses. -# -# Add "$(STAGING_DIR_HOSTPKG)/lib" to the RPATH of the host helpers, -# otherwise they might not find the location of a library at run time. -CMAKE_HOST_OPTIONS += \ - -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE \ - -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH \ - -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH \ - -DCMAKE_INSTALL_RPATH="$(STAGING_DIR_HOSTPKG)/lib" \ - -DCMAKE_SKIP_RPATH=FALSE \ - -DWITHOUT_SERVER=OFF \ - -DWITHOUT_TOKUDB=1 - -# Some helpers must be compiled for host in order to crosscompile mariadb for -# the target. They are then included by import_executables.cmake which is -# generated during the build of the host helpers. It is not necessary to build -# the whole host package, only the "import_executables" target. -# -DIMPORT_EXECUTABLES=$(HOST_BUILD_DIR)/import_executables.cmake -# must then be passed to cmake during target build. -# See also https://mariadb.com/kb/en/mariadb/cross-compiling-mariadb/ - -CMAKE_OPTIONS += -DIMPORT_EXECUTABLES=$(STAGING_DIR_HOSTPKG)/share/mariadb/import_executables.cmake - -define Host/Compile - $(call Host/Compile/Default,import_executables) -endef - -define Host/Install - $(SED) 's|$(HOST_BUILD_DIR)|$(STAGING_DIR_HOSTPKG)/share/mariadb|' $(HOST_BUILD_DIR)/import_executables.cmake - $(INSTALL_DIR) $(1)/share/mariadb/{dbug,extra,scripts,sql} - $(INSTALL_BIN) $(HOST_BUILD_DIR)/dbug/factorial $(1)/share/mariadb/dbug - $(INSTALL_BIN) $(HOST_BUILD_DIR)/extra/comp_err $(1)/share/mariadb/extra - $(INSTALL_BIN) $(HOST_BUILD_DIR)/scripts/comp_sql $(1)/share/mariadb/scripts - $(INSTALL_BIN) $(HOST_BUILD_DIR)/sql/{gen_lex_hash,gen_lex_token} $(1)/share/mariadb/sql - $(INSTALL_DATA) $(HOST_BUILD_DIR)/import_executables.cmake $(1)/share/mariadb -endef - -define Build/InstallDev - $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig $(1)/usr/share/aclocal - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin - $(LN) $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin - $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/lib*/libmysqlclient*.so* $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib*/libmaria*.so* $(1)/usr/lib - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib*/pkgconfig/*mariadb.pc $(1)/usr/lib/pkgconfig - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/mysql.m4 $(1)/usr/share/aclocal -endef - -define Package/libmariadbclient/install - $(INSTALL_DIR) $(1)$(PLUGIN_DIR) - $(CP) $(PKG_INSTALL_DIR)/usr/lib*/libmysqlclient*.so* $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib*/libmaria*.so* $(1)/usr/lib - - $(INSTALL_BIN) $(PKG_INSTALL_DIR)$(PLUGIN_DIR)/dialog.so $(1)$(PLUGIN_DIR) - $(INSTALL_BIN) $(PKG_INSTALL_DIR)$(PLUGIN_DIR)/mysql_clear_password.so $(1)$(PLUGIN_DIR) -endef - -define Package/mariadb-client/install - $(foreach b,$(MARIADB_CLIENT),$(call Package/mariadb/install/bin,$(1),$(b));) - # Install convenience links for mysqlcheck multi-call binary - cd $(1)/usr/bin; $(LN) mysqlcheck mysqlanalyze - cd $(1)/usr/bin; $(LN) mysqlcheck mysqlrepair - cd $(1)/usr/bin; $(LN) mysqlcheck mysqloptimize -endef - -define Package/mariadb-client-extra/install - $(foreach b,$(MARIADB_CLIENT_EXTRA),$(call Package/mariadb/install/bin,$(1),$(b));) -endef - -define Package/mariadb-extra-charsets/install - $(INSTALL_DIR) $(1)/usr/share/mariadb/charsets - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mariadb/charsets/* $(1)/usr/share/mariadb/charsets -endef - -define Package/mariadb-server/install - $(foreach b,$(MARIADB_SERVER),$(call Package/mariadb/install/bin,$(1),$(b));) - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld - # DATA because spomebody thought giving CONF 0600 rights is a good idea - $(INSTALL_DATA) files/my.cnf $(1)/etc/my.cnf - $(INSTALL_DIR) $(1)$(PLUGIN_DIR) - # DATA because spomebody thought giving CONF 0600 rights is a good idea - $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(PLUGIN_DIR)/daemon_example.ini $(1)$(PLUGIN_DIR) - $(INSTALL_DIR) $(1)/usr/share/mariadb/english - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mariadb/english/errmsg.sys $(1)/usr/share/mariadb/english - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mariadb/fill_help_tables.sql $(1)/usr/share/mariadb - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mariadb/maria_add_gis_sp_bootstrap.sql $(1)/usr/share/mariadb - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mariadb/mysql_performance_tables.sql $(1)/usr/share/mariadb - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mariadb/mysql_system_tables.sql $(1)/usr/share/mariadb - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mariadb/mysql_system_tables_data.sql $(1)/usr/share/mariadb - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/mariadb/mysql_test_db.sql $(1)/usr/share/mariadb -endef - -define Package/mariadb-server-extra/install - $(foreach b,$(MARIADB_SERVER_EXTRA),$(call Package/mariadb/install/bin,$(1),$(b));) -endef - -define Package/mariadb-server/conffiles -/etc/my.cnf -$(PLUGIN_DIR)/daemon_example.ini -endef - -define BuildPlugin - define Package/$(PKG_NAME)-server-plugin-$(subst _,-,$(1)) - $$(call Package/mariadb/Default) - TITLE:=MariaDB database plugin - DEPENDS:=mariadb-server $(patsubst +%,+PACKAGE_$(PKG_NAME)-server-plugin-$(subst _,-,$(1)):%,$(2)) - endef - define Package/$(PKG_NAME)-server-plugin-$(subst _,-,$(1))/description - $$(call Package/mariadb/description/Default) - -This package provides the $(1) plugin. - - endef - define Package/$(PKG_NAME)-server-plugin-$(subst _,-,$(1))/install - $(INSTALL_DIR) $$(1)$(PLUGIN_DIR) - $(INSTALL_BIN) \ - $(PKG_INSTALL_DIR)$(PLUGIN_DIR)/$(1).so \ - $$(1)$(PLUGIN_DIR) - endef - $$(eval $$(call BuildPackage,$(PKG_NAME)-server-plugin-$(subst _,-,$(1)))) -endef - -$(eval $(call HostBuild)) -$(eval $(call BuildPackage,libmariadbclient)) -$(eval $(call BuildPackage,mariadb-client)) -$(eval $(call BuildPackage,mariadb-client-extra)) -$(eval $(call BuildPackage,mariadb-extra-charsets)) -$(eval $(call BuildPackage,mariadb-server)) -$(eval $(call BuildPackage,mariadb-server-extra)) - -$(eval $(call BuildPlugin,adt_null,)) -$(eval $(call BuildPlugin,auth_0x0100,)) -$(eval $(call BuildPlugin,auth_ed25519,)) -$(eval $(call BuildPlugin,auth_socket,)) -$(eval $(call BuildPlugin,auth_test_plugin,)) -$(eval $(call BuildPlugin,client_ed25519,)) -$(eval $(call BuildPlugin,debug_key_management,)) -$(eval $(call BuildPlugin,dialog_examples,)) -$(eval $(call BuildPlugin,disks,)) -$(eval $(call BuildPlugin,example_key_management,)) -$(eval $(call BuildPlugin,feedback,)) -$(eval $(call BuildPlugin,file_key_management,)) -$(eval $(call BuildPlugin,ha_archive,)) -$(eval $(call BuildPlugin,ha_blackhole,)) -$(eval $(call BuildPlugin,ha_connect,+libxml2)) -$(eval $(call BuildPlugin,ha_example,)) -$(eval $(call BuildPlugin,ha_federated,)) -$(eval $(call BuildPlugin,ha_federatedx,)) -$(eval $(call BuildPlugin,ha_sequence,)) -$(eval $(call BuildPlugin,ha_sphinx,)) -$(eval $(call BuildPlugin,ha_spider,)) -$(eval $(call BuildPlugin,ha_test_sql_discovery,)) -$(eval $(call BuildPlugin,handlersocket,)) -$(eval $(call BuildPlugin,libdaemon_example,)) -$(eval $(call BuildPlugin,locales,)) -$(eval $(call BuildPlugin,metadata_lock_info,)) -$(eval $(call BuildPlugin,mypluglib,)) -$(eval $(call BuildPlugin,qa_auth_client,)) -$(eval $(call BuildPlugin,qa_auth_interface,)) -$(eval $(call BuildPlugin,qa_auth_server,)) -$(eval $(call BuildPlugin,query_cache_info,)) -$(eval $(call BuildPlugin,query_response_time,)) -$(eval $(call BuildPlugin,server_audit,)) -$(eval $(call BuildPlugin,simple_password_check,)) -$(eval $(call BuildPlugin,sql_errlog,)) -$(eval $(call BuildPlugin,wsrep_info,)) diff --git a/utils/mariadb/files/my.cnf b/utils/mariadb/files/my.cnf deleted file mode 100644 index b09486f857..0000000000 --- a/utils/mariadb/files/my.cnf +++ /dev/null @@ -1,99 +0,0 @@ -# Example MySQL config file for small systems. -# -# This is for a system with little memory (<= 64M) where MySQL is only used -# from time to time and it's important that the mysqld daemon -# doesn't use much resources. -# -# MySQL programs look for option files in a set of -# locations which depend on the deployment platform. -# You can copy this option file to one of those -# locations. For information about these locations, see: -# http://dev.mysql.com/doc/mysql/en/option-files.html -# -# In this file, you can use all long options that a program supports. -# If you want to know which options a program supports, run the program -# with the "--help" option. - -# The following options will be passed to all MySQL clients -[client] -#password = your_password -port = 3306 -socket = /var/run/mysql/mysql.sock -default-character-set = utf8mb4 - -# Here follows entries for some specific programs - -# The MySQL server -[mysqld] -bind-address = 127.0.0.1 -port = 3306 -socket = /var/run/mysql/mysql.sock -skip-external-locking -max_allowed_packet = 64M -transaction_isolation = READ-COMMITTED -skip-name-resolve -query_cache_type = 1 -query_cache_limit = 1M -query_cache_min_res_unit = 1k -query_cache_size = 32M -tmp_table_size= 32M -max_heap_table_size= 32M -character-set-server = utf8mb4 -collation-server = utf8mb4_general_ci - -# Don't listen on a TCP/IP port at all. This can be a security enhancement, -# if all processes that need to connect to mysqld run on the same host. -# All interaction with mysqld must be made via Unix sockets or named pipes. -# Note that using this option without enabling named pipes on Windows -# (using the "enable-named-pipe" option) will render mysqld useless! -# -#skip-networking -server-id = 1 - -# Uncomment the following if you want to log updates -#log-bin=mysql-bin - -# binary logging format - mixed recommended -#binlog_format=mixed - -# Causes updates to non-transactional engines using statement format to be -# written directly to binary log. Before using this option make sure that -# there are no dependencies between transactional and non-transactional -# tables such as in the statement INSERT INTO t_myisam SELECT * FROM -# t_innodb; otherwise, slaves may diverge from the master. -#binlog_direct_non_transactional_updates=TRUE - -# Additional InnoDB tweaks -innodb_file_per_table=1 -innodb_buffer_pool_size = 64M -innodb_buffer_pool_instances = 1 -innodb_flush_log_at_trx_commit = 2 -innodb_log_buffer_size = 32M -innodb_max_dirty_pages_pct = 90 -#innodb_data_home_dir = /srv/mysql -#innodb_data_file_path = ibdata1:10M:autoextend -#innodb_log_group_home_dir = /srv/mysql -# You can set .._buffer_pool_size up to 50 - 80 % -# of RAM but beware of setting memory usage too high -#innodb_buffer_pool_size = 16M -# Set .._log_file_size to 25 % of buffer pool size -#innodb_log_file_size = 5M -#innodb_log_buffer_size = 8M -#innodb_flush_log_at_trx_commit = 1 -#innodb_lock_wait_timeout = 50 - -[mysqldump] -quick -max_allowed_packet = 16M - -[mysql] -no-auto-rehash -# Remove the next comment character if you are not familiar with SQL -#safe-updates - -[myisamchk] -key_buffer_size = 8M -sort_buffer_size = 8M - -[mysqlhotcopy] -interactive-timeout diff --git a/utils/mariadb/files/mysqld.init b/utils/mariadb/files/mysqld.init deleted file mode 100644 index c26a12227b..0000000000 --- a/utils/mariadb/files/mysqld.init +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2010-2018 OpenWrt.org - -START=95 -STOP=10 - -USE_PROCD=1 - -#PROCD_DEBUG=1 - -MYSQLD=mysqld - -LOGGER="/usr/bin/logger -p user.err -s -t $MYSQLD" -[ -x /usr/bin/logger ] || LOGGER=echo -PROG=/usr/sbin/$MYSQLD - -my_user="mysql" -my_group="mysql" - -mysql_get_var() { - $PROG --help --verbose | sed -n 's|^'"$1"'[[:blank:]]\+||p' -} - -start_service() { - local datadir="$(mysql_get_var datadir)" - local tmpdir="$(mysql_get_var tmpdir)" - local pidfile="$(mysql_get_var pid-file)" - local socketfile="$(mysql_get_var socket)" - local version="$(mysqld --version | sed -n 's|.*Ver[[:blank:]]*\([0-9.]*\)-.*|\1|p')" - - # Auto installation - if [ \! -d "$datadir" ]; then - mysql_install_db --user=mysql --skip-name-resolve --skip-test-db - echo "$version" > "$datadir"/.version - fi - - for i in /var/lib/mysql "$tmpdir" "$(dirname "$pidfile")" "$(dirname "$socketfile")"; do - if [ \! -d "$i" ]; then - mkdir -p "$i" - chown "$my_user":"$my_group" "$i" - fi - done - - # Migration from old versions - if [ "`cat "$datadir"/.version 2> /dev/null`" \!= "$version" ]; then - sudo -u mysql mysqld --skip-networking --skip-grant-tables --socket=/tmp/mysql_upgrade.sock & - PID="$!" - i=0 - while [ "$i" -lt 15 ] && [ \! -S /tmp/mysql_upgrade.sock ]; do - sleep 1 - i="`expr $i + 1`" - done - [ -S /tmp/mysql_upgrade.sock ] || exit 1 - mysql_upgrade --upgrade-system-tables --socket=/tmp/mysql_upgrade.sock - echo "$version" > "$datadir"/.version - kill "$PID" - i=0 - while [ "$i" -lt 60 ] && [ -n "`grep mysql /proc/$PID/cmdline 2> /dev/null`" ]; do - sleep 1 - [ "$i" -lt 30 ] || kill "$PID" - i="`expr $i + 1`" - done - if [ -n "`grep mysql /proc/$PID/cmdline 2> /dev/null`" ]; then - kill -9 "$PID" - fi - fi - - procd_open_instance - - procd_set_param command $PROG $MY_ARGS - procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} - # forward stderr to logd - procd_set_param stderr 1 - procd_set_param user "$my_user" - - procd_close_instance -} diff --git a/utils/mariadb/patches/100-fix_hostname.patch b/utils/mariadb/patches/100-fix_hostname.patch deleted file mode 100644 index 0a64dc6f3b..0000000000 --- a/utils/mariadb/patches/100-fix_hostname.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/scripts/mysql_install_db.sh -+++ b/scripts/mysql_install_db.sh -@@ -418,7 +418,7 @@ fi - - - # Try to determine the hostname --hostname=`@HOSTNAME@` -+hostname=`cat /proc/sys/kernel/hostname` - - # Check if hostname is valid - if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0 diff --git a/utils/mariadb/patches/110-pcre.cmake.patch b/utils/mariadb/patches/110-pcre.cmake.patch deleted file mode 100644 index 6e1d0b2597..0000000000 --- a/utils/mariadb/patches/110-pcre.cmake.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/cmake/pcre.cmake -+++ b/cmake/pcre.cmake -@@ -14,6 +14,8 @@ MACRO (CHECK_PCRE) - return -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) < 256; - }" PCRE_STACK_SIZE_OK) - SET(CMAKE_REQUIRED_LIBRARIES) -+ ELSE() -+ SET(PCRE_STACK_SIZE_OK TRUE) - ENDIF() - ENDIF() - IF(NOT HAVE_PCRE_STACK_GUARD OR NOT PCRE_STACK_SIZE_OK OR diff --git a/utils/mariadb/patches/140-mips-connect-unaligned.patch b/utils/mariadb/patches/140-mips-connect-unaligned.patch deleted file mode 100644 index 9912c0e28b..0000000000 --- a/utils/mariadb/patches/140-mips-connect-unaligned.patch +++ /dev/null @@ -1,262 +0,0 @@ -Description: Handle unaligned buffers in connect's TYPBLK class - On MIPS platforms (and probably others) unaligned memory access results in a - bus error. In the connect storage engine, block data for some data formats is - stored packed in memory and the TYPBLK class is used to read values from it. - Since TYPBLK does not have special handling for this packed memory, it can - quite easily result in unaligned memory accesses. - . - The simple way to fix this is to perform all accesses to the main buffer - through memcpy. With GCC and optimizations turned on, this call to memcpy is - completely optimized away on architectures where unaligned accesses are ok - (like x86). -Author: James Cowgill ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/storage/connect/valblk.h -+++ b/storage/connect/valblk.h -@@ -139,6 +139,7 @@ class VALBLK : public BLOCK { - int Prec; // Precision of float values - }; // end of class VALBLK - -+ - /***********************************************************************/ - /* Class TYPBLK: represents a block of typed values. */ - /***********************************************************************/ -@@ -151,40 +152,41 @@ class TYPBLK : public VALBLK { - // Implementation - virtual bool Init(PGLOBAL g, bool check); - virtual int GetVlen(void) {return sizeof(TYPE);} -- virtual char GetTinyValue(int n) {return (char)Typp[n];} -- virtual uchar GetUTinyValue(int n) {return (uchar)Typp[n];} -- virtual short GetShortValue(int n) {return (short)Typp[n];} -- virtual ushort GetUShortValue(int n) {return (ushort)Typp[n];} -- virtual int GetIntValue(int n) {return (int)Typp[n];} -- virtual uint GetUIntValue(int n) {return (uint)Typp[n];} -- virtual longlong GetBigintValue(int n) {return (longlong)Typp[n];} -- virtual ulonglong GetUBigintValue(int n) {return (ulonglong)Typp[n];} -- virtual double GetFloatValue(int n) {return (double)Typp[n];} -+ -+ virtual char GetTinyValue(int n) {return (char)UnalignedRead(n);} -+ virtual uchar GetUTinyValue(int n) {return (uchar)UnalignedRead(n);} -+ virtual short GetShortValue(int n) {return (short)UnalignedRead(n);} -+ virtual ushort GetUShortValue(int n) {return (ushort)UnalignedRead(n);} -+ virtual int GetIntValue(int n) {return (int)UnalignedRead(n);} -+ virtual uint GetUIntValue(int n) {return (uint)UnalignedRead(n);} -+ virtual longlong GetBigintValue(int n) {return (longlong)UnalignedRead(n);} -+ virtual ulonglong GetUBigintValue(int n) {return (ulonglong)UnalignedRead(n);} -+ virtual double GetFloatValue(int n) {return (double)UnalignedRead(n);} - virtual char *GetCharString(char *p, int n); -- virtual void Reset(int n) {Typp[n] = 0;} -+ virtual void Reset(int n) {UnalignedWrite(n, 0);} - - // Methods - using VALBLK::SetValue; - virtual void SetValue(PCSZ sp, int n); - virtual void SetValue(const char *sp, uint len, int n); - virtual void SetValue(short sval, int n) -- {Typp[n] = (TYPE)sval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);} - virtual void SetValue(ushort sval, int n) -- {Typp[n] = (TYPE)sval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)sval); SetNull(n, false);} - virtual void SetValue(int lval, int n) -- {Typp[n] = (TYPE)lval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(uint lval, int n) -- {Typp[n] = (TYPE)lval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(longlong lval, int n) -- {Typp[n] = (TYPE)lval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(ulonglong lval, int n) -- {Typp[n] = (TYPE)lval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)lval); SetNull(n, false);} - virtual void SetValue(double fval, int n) -- {Typp[n] = (TYPE)fval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)fval); SetNull(n, false);} - virtual void SetValue(char cval, int n) -- {Typp[n] = (TYPE)cval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);} - virtual void SetValue(uchar cval, int n) -- {Typp[n] = (TYPE)cval; SetNull(n, false);} -+ {UnalignedWrite(n, (TYPE)cval); SetNull(n, false);} - virtual void SetValue(PVAL valp, int n); - virtual void SetValue(PVBLK pv, int n1, int n2); - virtual void SetMin(PVAL valp, int n); -@@ -206,6 +208,17 @@ class TYPBLK : public VALBLK { - // Members - TYPE* const &Typp; - const char *Fmt; -+ -+ // Unaligned access -+ TYPE UnalignedRead(int n) const { -+ TYPE result; -+ memcpy(&result, Typp + n, sizeof(TYPE)); -+ return result; -+ } -+ -+ void UnalignedWrite(int n, TYPE value) { -+ memcpy(Typp + n, &value, sizeof(TYPE)); -+ } - }; // end of class TYPBLK - - /***********************************************************************/ ---- a/storage/connect/valblk.cpp -+++ b/storage/connect/valblk.cpp -@@ -268,14 +268,14 @@ bool TYPBLK::Init(PGLOBAL g, bool - template - char *TYPBLK::GetCharString(char *p, int n) - { -- sprintf(p, Fmt, Typp[n]); -+ sprintf(p, Fmt, UnalignedRead(n)); - return p; - } // end of GetCharString - - template <> - char *TYPBLK::GetCharString(char *p, int n) - { -- sprintf(p, Fmt, Prec, Typp[n]); -+ sprintf(p, Fmt, Prec, UnalignedRead(n)); - return p; - } // end of GetCharString - -@@ -291,7 +291,7 @@ void TYPBLK::SetValue(PVAL valp, i - ChkTyp(valp); - - if (!(b = valp->IsNull())) -- Typp[n] = GetTypedValue(valp); -+ UnalignedWrite(n, GetTypedValue(valp)); - else - Reset(n); - -@@ -353,9 +353,9 @@ void TYPBLK::SetValue(PCSZ p, int - ulonglong val = CharToNumber(p, strlen(p), maxval, Unsigned, &minus); - - if (minus && val < maxval) -- Typp[n] = (TYPE)(-(signed)val); -+ UnalignedWrite(n, (TYPE)(-(signed)val)); - else -- Typp[n] = (TYPE)val; -+ UnalignedWrite(n, (TYPE)val); - - SetNull(n, false); - } // end of SetValue -@@ -398,7 +398,7 @@ void TYPBLK::SetValue(PCSZ p, in - throw Type; - } // endif Check - -- Typp[n] = atof(p); -+ UnalignedWrite(n, atof(p)); - SetNull(n, false); - } // end of SetValue - -@@ -430,7 +430,7 @@ void TYPBLK::SetValue(PVBLK pv, in - ChkTyp(pv); - - if (!(b = pv->IsNull(n2) && Nullable)) -- Typp[n1] = GetTypedValue(pv, n2); -+ UnalignedWrite(n1, GetTypedValue(pv, n2)); - else - Reset(n1); - -@@ -481,10 +481,10 @@ void TYPBLK::SetMin(PVAL valp, int - { - CheckParms(valp, n) - TYPE tval = GetTypedValue(valp); -- TYPE& tmin = Typp[n]; -+ TYPE tmin = UnalignedRead(n); - - if (tval < tmin) -- tmin = tval; -+ UnalignedWrite(n, tval); - - } // end of SetMin - -@@ -496,10 +496,10 @@ void TYPBLK::SetMax(PVAL valp, int - { - CheckParms(valp, n) - TYPE tval = GetTypedValue(valp); -- TYPE& tmin = Typp[n]; -+ TYPE tmin = UnalignedRead(n); - - if (tval > tmin) -- tmin = tval; -+ UnalignedWrite(n, tval); - - } // end of SetMax - -@@ -513,8 +513,7 @@ void TYPBLK::SetValues(PVBLK pv, i - CheckType(pv) - TYPE *lp = ((TYPBLK*)pv)->Typp; - -- for (int i = k; i < n; i++) // TODO -- Typp[i] = lp[i]; -+ memcpy(Typp + k, lp + k, sizeof(TYPE) * n); - - } // end of SetValues - #endif // 0 -@@ -525,7 +524,7 @@ void TYPBLK::SetValues(PVBLK pv, i - template - void TYPBLK::Move(int i, int j) - { -- Typp[j] = Typp[i]; -+ UnalignedWrite(j, UnalignedRead(i)); - MoveNull(i, j); - } // end of Move - -@@ -539,7 +538,7 @@ int TYPBLK::CompVal(PVAL vp, int n - ChkIndx(n); - ChkTyp(vp); - #endif // _DEBUG -- TYPE mlv = Typp[n]; -+ TYPE mlv = UnalignedRead(n); - TYPE vlv = GetTypedValue(vp); - - return (vlv > mlv) ? 1 : (vlv < mlv) ? (-1) : 0; -@@ -551,8 +550,8 @@ int TYPBLK::CompVal(PVAL vp, int n - template - int TYPBLK::CompVal(int i1, int i2) - { -- TYPE lv1 = Typp[i1]; -- TYPE lv2 = Typp[i2]; -+ TYPE lv1 = UnalignedRead(i1); -+ TYPE lv2 = UnalignedRead(i2); - - return (lv1 > lv2) ? 1 : (lv1 < lv2) ? (-1) : 0; - } // end of CompVal -@@ -589,7 +588,7 @@ int TYPBLK::Find(PVAL vp) - TYPE n = GetTypedValue(vp); - - for (i = 0; i < Nval; i++) -- if (n == Typp[i]) -+ if (n == UnalignedRead(i)) - break; - - return (i < Nval) ? i : (-1); -@@ -605,7 +604,7 @@ int TYPBLK::GetMaxLength(void) - int i, n, m; - - for (i = n = 0; i < Nval; i++) { -- m = sprintf(buf, Fmt, Typp[i]); -+ m = sprintf(buf, Fmt, UnalignedRead(i)); - n = MY_MAX(n, m); - } // endfor i - -@@ -1335,7 +1334,7 @@ char *DATBLK::GetCharString(char *p, int - char *vp; - - if (Dvalp) { -- Dvalp->SetValue(Typp[n]); -+ Dvalp->SetValue(UnalignedRead(n)); - vp = Dvalp->GetCharString(p); - } else - vp = TYPBLK::GetCharString(p, n); -@@ -1351,7 +1350,7 @@ void DATBLK::SetValue(PCSZ p, int n) - if (Dvalp) { - // Decode the string according to format - Dvalp->SetValue_psz(p); -- Typp[n] = Dvalp->GetIntValue(); -+ UnalignedWrite(n, Dvalp->GetIntValue()); - } else - TYPBLK::SetValue(p, n); - diff --git a/utils/mariadb/patches/160-mips-machine.patch b/utils/mariadb/patches/160-mips-machine.patch deleted file mode 100644 index ecd34a0eb9..0000000000 --- a/utils/mariadb/patches/160-mips-machine.patch +++ /dev/null @@ -1,25 +0,0 @@ -Description: Fix DEFAULT_MACHINE on mips - The DEFAULT_MACHINE constant is calculated from the CMAKE_SYSTEM_PROCESSOR - variable which contains the processor which built mariadb. Since most Debian - buildds run on 64-bit hardware even though they build 32-bit binaries, - DEFAULT_MACHINE previously contained "mips64" on 32-bit builds. This confuses - some mroonga tests which rely on DEFAULT_MACHINE to detect 64-bitness. - . - This patch fixes the value of DEFAULT_MACHINE so it always contains just "mips" - on 32-bit mips builds. -Author: James Cowgill ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/cmake/package_name.cmake -+++ b/cmake/package_name.cmake -@@ -34,6 +34,10 @@ IF(NOT VERSION) - SET(DEFAULT_MACHINE "mips") - ENDIF() - -+ IF(NOT 64BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "^mips64") -+ SET(DEFAULT_MACHINE "mips") -+ ENDIF() -+ - IF(CMAKE_SYSTEM_NAME MATCHES "Windows") - SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 0) - SET(DEFAULT_PLATFORM "win") diff --git a/utils/mariadb/patches/170-no-uint-in-pam.patch b/utils/mariadb/patches/170-no-uint-in-pam.patch deleted file mode 100644 index 378149bb32..0000000000 --- a/utils/mariadb/patches/170-no-uint-in-pam.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/plugin/auth_pam/testing/pam_mariadb_mtr.c -+++ b/plugin/auth_pam/testing/pam_mariadb_mtr.c -@@ -56,7 +56,7 @@ int pam_sm_authenticate(pam_handle_t *pa - if (strcmp(r1, "crash pam module") == 0 && atoi(r2) == 616) - abort(); - -- if (strlen(r1) == (size_t)atoi(r2) % 100) -+ if (strlen(r1) == (unsigned int)atoi(r2) % 100) - retval = PAM_SUCCESS; - else - retval = PAM_AUTH_ERR; diff --git a/utils/mariadb/patches/180-c11_atomics.patch b/utils/mariadb/patches/180-c11_atomics.patch deleted file mode 100644 index 11c834d692..0000000000 --- a/utils/mariadb/patches/180-c11_atomics.patch +++ /dev/null @@ -1,64 +0,0 @@ -Author: Vicențiu Ciorbaru -Date: Fri Dec 21 19:14:04 2018 +0200 - - Link with libatomic to enable C11 atomics support - - Some architectures (mips) require libatomic to support proper - atomic operations. Check first if support is available without - linking, otherwise use the library. - ---- a/configure.cmake -+++ b/configure.cmake -@@ -863,7 +863,25 @@ int main() - long long int *ptr= &var; - return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); - }" --HAVE_GCC_C11_ATOMICS) -+HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC) -+IF (HAVE_GCC_C11_ATOMICS_WITHOUT_LIBATOMIC) -+ SET(HAVE_GCC_C11_ATOMICS True) -+ELSE() -+ SET(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) -+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") -+ CHECK_CXX_SOURCE_COMPILES(" -+ int main() -+ { -+ long long int var= 1; -+ long long int *ptr= &var; -+ return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST); -+ }" -+ HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) -+ IF(HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) -+ SET(HAVE_GCC_C11_ATOMICS True) -+ ENDIF() -+ SET(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES}) -+ENDIF() - - IF(WITH_VALGRIND) - SET(HAVE_valgrind 1) ---- a/mysys/CMakeLists.txt -+++ b/mysys/CMakeLists.txt -@@ -78,6 +78,10 @@ TARGET_LINK_LIBRARIES(mysys dbug strings - ${LIBNSL} ${LIBM} ${LIBRT} ${CMAKE_DL_LIBS} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_LIBRARY}) - DTRACE_INSTRUMENT(mysys) - -+IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) -+ TARGET_LINK_LIBRARIES(mysys atomic) -+ENDIF() -+ - IF(HAVE_BFD_H) - TARGET_LINK_LIBRARIES(mysys bfd) - ENDIF(HAVE_BFD_H) ---- a/sql/CMakeLists.txt -+++ b/sql/CMakeLists.txt -@@ -191,6 +191,10 @@ ELSE() - SET(MYSQLD_SOURCE main.cc ${DTRACE_PROBES_ALL}) - ENDIF() - -+IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) -+ TARGET_LINK_LIBRARIES(sql atomic) -+ENDIF() -+ - - IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS) - diff --git a/utils/mariadb/patches/expand-localhost.patch b/utils/mariadb/patches/expand-localhost.patch deleted file mode 100644 index 6be4b83de5..0000000000 --- a/utils/mariadb/patches/expand-localhost.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/scripts/mysql_system_tables_fix.sql -+++ b/scripts/mysql_system_tables_fix.sql -@@ -814,3 +814,13 @@ IF 1 = (SELECT count(*) FROM information - END IF// - - DELIMITER ; -+ -+-- Expand localhost to 127.0.0.1 -+CREATE TEMPORARY TABLE localhost_expand SELECT * FROM global_priv WHERE host='localhost' AND user NOT IN (SELECT user FROM global_priv WHERE host='127.0.0.1'); -+UPDATE localhost_expand SET host='127.0.0.1'; -+INSERT INTO global_priv SELECT * from localhost_expand; -+DROP TABLE localhost_expand; -+CREATE TEMPORARY TABLE localhost_expand SELECT * FROM db WHERE host='localhost' AND user NOT IN (SELECT user FROM db WHERE host='127.0.0.1' OR host='%'); -+UPDATE localhost_expand SET host='127.0.0.1'; -+INSERT INTO db SELECT * from localhost_expand; -+DROP TABLE localhost_expand; diff --git a/utils/mariadb/patches/no-socket-auth.patch b/utils/mariadb/patches/no-socket-auth.patch deleted file mode 100644 index 1f412d0e48..0000000000 --- a/utils/mariadb/patches/no-socket-auth.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/scripts/mysql_system_tables_data.sql -+++ b/scripts/mysql_system_tables_data.sql -@@ -26,8 +26,6 @@ - -- a plain character - SELECT LOWER( REPLACE((SELECT REPLACE(@@hostname,'_','\_')),'%','\%') )INTO @current_hostname; - SELECT '{"access":18446744073709551615}' INTO @all_privileges; --SELECT '{"access":18446744073709551615,"plugin":"mysql_native_password","authentication_string":"invalid","auth_or":[{},{"plugin":"unix_socket"}]}' into @all_with_auth; -- - - -- Fill "global_priv" table with default users allowing root access - -- from local machine if "global_priv" table didn't exist before -@@ -38,16 +36,9 @@ INSERT INTO tmp_user_nopasswd VALUES ('l - REPLACE INTO tmp_user_nopasswd SELECT @current_hostname,'root',@all_privileges FROM dual WHERE @current_hostname != 'localhost'; - REPLACE INTO tmp_user_nopasswd VALUES ('127.0.0.1','root',@all_privileges); - REPLACE INTO tmp_user_nopasswd VALUES ('::1','root',@all_privileges); ---- More secure root account using unix socket auth. --INSERT INTO tmp_user_socket VALUES ('localhost', 'root',@all_with_auth); --REPLACE INTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root'),@all_with_auth); --IF @auth_root_socket is not null THEN -- IF not exists(select 1 from information_schema.plugins where plugin_name='unix_socket') THEN -- INSTALL SONAME 'auth_socket'; END IF; END IF; - --INSERT INTO global_priv SELECT * FROM tmp_user_nopasswd WHERE @had_user_table=0 AND @auth_root_socket IS NULL; --INSERT INTO global_priv SELECT * FROM tmp_user_socket WHERE @had_user_table=0 AND @auth_root_socket IS NOT NULL; --DROP TABLE tmp_user_nopasswd, tmp_user_socket; -+INSERT INTO global_priv SELECT * FROM tmp_user_nopasswd WHERE @had_user_table=0; -+DROP TABLE tmp_user_nopasswd; - - CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv; - INSERT INTO tmp_proxies_priv SELECT @current_hostname, 'root', '', '', TRUE, '', now() FROM DUAL WHERE @current_hostname != 'localhost'; diff --git a/utils/notification-system/Makefile b/utils/notification-system/Makefile index 450fa689e1..82bfc31fdb 100644 --- a/utils/notification-system/Makefile +++ b/utils/notification-system/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=notification-system PKG_VERSION:=0.2.2 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/notification-system.git @@ -36,7 +36,6 @@ define Package/notification-system +python3-logging PROVIDES:=user-notify CONFLICTS:=user-notify - VARIANT:=python3 endef define Package/notification-system/description diff --git a/utils/ouidb/Makefile b/utils/ouidb/Makefile index 3fb5bbcccf..c2171f9fa7 100644 --- a/utils/ouidb/Makefile +++ b/utils/ouidb/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2013-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2013-2020, 2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,13 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ouidb -PKG_VERSION:=20200531 +PKG_VERSION:=20220320 +PKG_RELEASE:=$(AUTORELEASE) -PKG_SOURCE_VERSION:=5e0ebc9fc05b1f0ad557136e748adc9088bfdca4 +PKG_SOURCE_VERSION:=6a97b2095c4c2a31b2099037a43814990c611648 PKG_SOURCE_URL:=https://github.com/wireshark/wireshark/raw/$(PKG_SOURCE_VERSION) PKG_SOURCE_URL_FILE:=manuf PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).txt -PKG_HASH:=3241416dcc37c9778a0bab500fd1154e89996d51105a982bb9c02c6714303c8d +PKG_HASH:=0737d8aaaa404f3d0606e34b4622c840535885fc899aecb2964a4b96f2db51d6 UNPACK_CMD:=: diff --git a/utils/ouidb/files/ouidb b/utils/ouidb/files/ouidb index 8ddc9f3aa9..b811075330 100755 --- a/utils/ouidb/files/ouidb +++ b/utils/ouidb/files/ouidb @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2015, CZ.NIC, z.s.p.o. (http://www.nic.cz/) +# Copyright (c) 2015, 2022, CZ.NIC, z.s.p.o. (http://www.nic.cz/) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # along with this program. If not, see . ## Settings -OUI_FILE="oui.db" +OUI_FILE="/usr/share/ouidb/oui.db" QRY="$1" diff --git a/utils/schnapps/Makefile b/utils/schnapps/Makefile index 254a5579f8..19f3cf9a30 100644 --- a/utils/schnapps/Makefile +++ b/utils/schnapps/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=schnapps -PKG_VERSION:=2.7.1 -PKG_RELEASE:=1 +PKG_VERSION:=2.10.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/schnapps.git -PKG_MIRROR_HASH:=72658e1b75e3286397a2340ae319be64ce4cfd956211f2d4d7299fa3286fc76b +PKG_MIRROR_HASH:=2bb4f9a847ab6ffca7625d3f4d634b7f58c33ece914e126fecbd4f9137cb17c5 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC diff --git a/utils/schnapps/patches/0001-Partial-revert-of-89952d49938aaa4ffdd0797ba347d8cc63.patch b/utils/schnapps/patches/0001-Partial-revert-of-89952d49938aaa4ffdd0797ba347d8cc63.patch new file mode 100644 index 0000000000..55ec30efb7 --- /dev/null +++ b/utils/schnapps/patches/0001-Partial-revert-of-89952d49938aaa4ffdd0797ba347d8cc63.patch @@ -0,0 +1,31 @@ +From 9fbeec3174a2cefb28f9a8c916b4333b7c7cbf66 Mon Sep 17 00:00:00 2001 +From: Michal Hrusecky +Date: Mon, 17 Jan 2022 23:32:46 +0100 +Subject: [PATCH] Partial revert of 89952d49938aaa4ffdd0797ba347d8cc63a6fd3d + +Let's keep broken json for a little longer as Foris Controller checks +for the type of number and breaks on type change and it doesn't support +remote snapshots as of yet. + +[rebased on schnapps 2.10.1] +Signed-off-by: Šimon Bořek +--- + schnapps.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/schnapps.sh b/schnapps.sh +index ea26a7c..36f9aac 100755 +--- a/schnapps.sh ++++ b/schnapps.sh +@@ -292,7 +292,7 @@ generic_list() { + ;; + json) + [ "$first" = "y" ] || echo ", " +- printf ' { "id": "%s", "type": "%s", "size": "%s", "created": "%s", "description": "%s" }' "$snapshot" "$TYPE" "$SIZE" "$CREATED" "$DESCRIPTION" ++ printf ' { "number": %s, "type": "%s", "size": "%s", "created": "%s", "description": "%s" }' "$snapshot" "$TYPE" "$SIZE" "$CREATED" "$DESCRIPTION" + first="" + ;; + csv) +-- +2.37.2 + diff --git a/utils/turris-cagen/Makefile b/utils/turris-cagen/Makefile index b7f93cc3eb..6d5bc3a577 100644 --- a/utils/turris-cagen/Makefile +++ b/utils/turris-cagen/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-cagen PKG_VERSION:=6 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/utils/turris-diagnostics/Makefile b/utils/turris-diagnostics/Makefile index c6713adb61..f13c2ad733 100644 --- a/utils/turris-diagnostics/Makefile +++ b/utils/turris-diagnostics/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2018-2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +## Copyright (C) 2018-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,25 +8,45 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-diagnostics -PKG_VERSION:=14.0.0 -PKG_RELEASE:=1 +PKG_VERSION:=16.0.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/diagnostics.git -PKG_MIRROR_HASH:=8682fb2c385f0cac0520361f186a893cb254fb1ae914640991a44edaa5658488 +PKG_MIRROR_HASH:=f2480259ed10954d3961a3bba40eca283bc3ac1be53d9943f4e96f8d7d879988 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE +LOCALES:=cs da de el es fi fo fr hr hu it ja ko lt nb_NO nl pl ro ru sk sv +WEB_LOCALES:=cs fr nb_NO ru sk +SNAPSHOTS_LOCALES:=cs ru sk nb_NO + include $(INCLUDE_DIR)/package.mk -define Package/turris-diagnostics +define Package/Common SECTION:=utils CATEGORY:=Utilities +endef + +define Package/turris-diagnostics + $(call Package/Common) TITLE:=Turris Diagnostics - DEPENDS:=+lsblk +socat +crypto-wrapper +gettext-tools + DEPENDS:=+lsblk +hwinfo +socat +crypto-wrapper +gettext-tools +file +endef + +define Package/turris-diagnostics-web + $(call Package/Common) + TITLE:=Turris Diagnostics Web + DEPENDS:=+turris-diagnostics +turris-bootstrap-theme +lighttpd-mod-fastcgi +lighttpd-mod-alias +lighttpd-mod-authn_pam +uci +endef + +define Package/turris-snapshots-web + $(call Package/Common) + TITLE:=Turris Schnapps Web + DEPENDS:=+schnapps +openssl-util +turris-bootstrap-theme +lighttpd-mod-fastcgi +lighttpd-mod-alias +lighttpd-mod-authn_pam +uci endef define Package/turris-diagnostics/description @@ -34,14 +54,17 @@ define Package/turris-diagnostics/description functionality. endef -Build/Compile:=: +define Package/turris-diagnostics-web/description + Simple web to obtain diagnostics from. +endef + +define Package/turris-snapshots-web/description + Simple web to manage schnapps's snapshots. +endef -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/usr/share/locale/ - $(CP) -r $(PKG_BUILD_DIR)/locale/* $(1)/usr/share/locale/ - $(RM) -rf $(1)/usr/share/locale/*.pot - $(RM) -rf $(1)/usr/share/locale/*/LC_MESSAGES/*.po* +Build/Compile:=: +define Package/turris-diagnostics/install $(INSTALL_DIR) $(1)/usr/bin/ $(INSTALL_BIN) ./files/diagnostics.sh $(1)/usr/bin/turris-diagnostics @@ -53,4 +76,53 @@ define Package/$(PKG_NAME)/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/*.module $(1)/usr/share/diagnostics/modules/ endef +define Package/turris-diagnostics-web/install + $(INSTALL_DIR) $(1)/usr/libexec/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/web/diagnostics.sh $(1)/usr/libexec/web-diagnostics.sh + + $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/ + $(INSTALL_DATA) ./files/lighttpd-diagnostics.conf $(1)/etc/lighttpd/conf.d/80-diagnostics.conf +endef + +define Package/turris-snapshots-web/install + $(INSTALL_DIR) $(1)/usr/libexec/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/web/snapshots.sh $(1)/usr/libexec/web-snapshots.sh + + $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/ + $(INSTALL_DATA) ./files/lighttpd-snapshots.conf $(1)/etc/lighttpd/conf.d/80-snapshots.conf +endef + +define Package/turris-diagnostics-web/postinst +#!/bin/sh +[ -n "$$IPKG_INSTROOT" ] || /etc/init.d/lighttpd restart +endef + +define Package/turris-snapshots-web/postinst +#!/bin/sh +[ -n "$$IPKG_INSTROOT" ] || /etc/init.d/lighttpd restart +endef + + +# $(1): name of the package +# $(2): translation name +define TRANSLATION + +define Package/$(1)-l10n-$(2) + TITLE:=Translation for package $(1): $(2) + DEPENDS:=+$(1) +endef + +define Package/$(1)-l10n-$(2)/install + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$$(1)" install-$(1)-$(2) +endef + +$$(eval $$(call BuildPackage,$(1)-l10n-$(2))) + +endef + $(eval $(call BuildPackage,turris-diagnostics)) +$(foreach LANG,$(LOCALES),$(eval $(call TRANSLATION,turris-diagnostics,$(LANG)))) +$(eval $(call BuildPackage,turris-diagnostics-web)) +$(foreach LANG,$(WEB_LOCALES),$(eval $(call TRANSLATION,turris-diagnostics-web,$(LANG)))) +$(eval $(call BuildPackage,turris-snapshots-web)) +$(foreach LANG,$(SNAPSHOTS_LOCALES),$(eval $(call TRANSLATION,turris-snapshots-web,$(LANG)))) diff --git a/utils/turris-diagnostics/files/lighttpd-diagnostics.conf b/utils/turris-diagnostics/files/lighttpd-diagnostics.conf new file mode 100644 index 0000000000..1f5fdba5dc --- /dev/null +++ b/utils/turris-diagnostics/files/lighttpd-diagnostics.conf @@ -0,0 +1,15 @@ +$HTTP["url"] =~ "^/diagnostics" { + fastcgi.server = ( "/" => ( turris_auth_scriptname => turris_auth )) + cgi.assign = ( "" => "" ) + alias.url = ( "" => "/usr/libexec/web-diagnostics.sh" ) +} +$HTTP["url"] =~ "^/baseauth/diagnostics" { + auth.backend = "pam" + auth.require = ( "" => ( + "method" => "basic", + "realm" => "turris-diagnostics", + "require" => "valid-user" + )) + cgi.assign = ( "" => "" ) + alias.url = ( "" => "/usr/libexec/web-diagnostics.sh" ) +} diff --git a/utils/turris-diagnostics/files/lighttpd-snapshots.conf b/utils/turris-diagnostics/files/lighttpd-snapshots.conf new file mode 100644 index 0000000000..fc94ea85f7 --- /dev/null +++ b/utils/turris-diagnostics/files/lighttpd-snapshots.conf @@ -0,0 +1,15 @@ +$HTTP["url"] =~ "^/snapshot" { + fastcgi.server = ( "/" => ( turris_auth_scriptname => turris_auth )) + cgi.assign = ( "" => "" ) + alias.url = ( "" => "/usr/libexec/web-snapshots.sh" ) +} +$HTTP["url"] =~ "^/baseauth/snapshot" { + auth.backend = "pam" + auth.require = ( "" => ( + "method" => "basic", + "realm" => "turris-diagnostics", + "require" => "valid-user" + )) + cgi.assign = ( "" => "" ) + alias.url = ( "" => "/usr/libexec/web-snapshots.sh" ) +} diff --git a/utils/turris-maintain/Makefile b/utils/turris-maintain/Makefile index ecd608842d..874c3b4ad8 100644 --- a/utils/turris-maintain/Makefile +++ b/utils/turris-maintain/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,41 +8,70 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-maintain -PKG_VERSION:=12 -PKG_RELEASE:=1 +PKG_VERSION:=14 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC include $(INCLUDE_DIR)/package.mk -define Package/turris-maintain +define Package/Common SECTION:=utils CATEGORY:=Utilities - TITLE:=Turris maintain scripts +endef + +define Package/turris-backup + $(call Package/Common) + TITLE:=Turris backup scripts + DEPENDS:=+uci +coreutils-base64 +bzip2 +tar +endef + +define Package/turris-restart + TITLE:=Turris restart utility scripts DEPENDS:=+uci +python3 +python3-uci +coreutils-base64 +bzip2 +crypto-wrapper endef -define Package/turris-maintain/description +define Package/turris-maintain + $(call Package/Common) + TITLE:=Turris maintain scripts + DEPENDS:=+turris-backup +turris-restart +endef + +define Package/turris-backup/description Contains a couple of scripts which are resposible for storing/restoring backups. endef -define Package/turris-maintain/conffiles +define Package/turris-restart/description + Scripts that are used to distribute notice about reboot and specific services + restart to Turris components. +endef + +define Package/turris-backup/conffiles /etc/config/backups endef -define Package/turris-maintain/install +define Package/turris-backup/install $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) files/config-backup.sh $(1)/usr/bin/maintain-config-backup - $(INSTALL_BIN) files/config-restore.sh $(1)/usr/bin/maintain-config-restore - $(INSTALL_BIN) files/reboot-needed.sh $(1)/usr/bin/maintain-reboot-needed - $(INSTALL_BIN) files/reboot.py $(1)/usr/bin/maintain-reboot - $(INSTALL_BIN) files/network-restart.py $(1)/usr/bin/maintain-network-restart - $(INSTALL_BIN) files/lighttpd-restart.py $(1)/usr/bin/maintain-lighttpd-restart + $(INSTALL_BIN) ./files/config-backup.sh $(1)/usr/bin/turris-backup + $(INSTALL_BIN) ./files/config-restore.sh $(1)/usr/bin/turris-backup-restore + ln -sf ./turris-backup $(1)/usr/bin/maintain-config-backup + ln -sf ./turris-backup-restore $(1)/usr/bin/maintain-config-restore $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/backups.conf $(1)/etc/config/backups + $(INSTALL_CONF) ./files/backups.uci $(1)/etc/config/backups +endef + +define Package/turris-restart/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/reboot-needed.sh $(1)/usr/bin/maintain-reboot-needed + $(INSTALL_BIN) ./files/reboot.py $(1)/usr/bin/maintain-reboot + $(INSTALL_BIN) ./files/network-restart.py $(1)/usr/bin/maintain-network-restart + $(INSTALL_BIN) ./files/lighttpd-restart.py $(1)/usr/bin/maintain-lighttpd-restart endef +Package/turris-maintain/install:=: Build/Compile:=: +$(eval $(call BuildPackage,turris-backup)) +$(eval $(call BuildPackage,turris-restart)) $(eval $(call BuildPackage,turris-maintain)) diff --git a/utils/turris-maintain/files/README.md b/utils/turris-maintain/files/README.md new file mode 100644 index 0000000000..09385d23d3 --- /dev/null +++ b/utils/turris-maintain/files/README.md @@ -0,0 +1,42 @@ +# Turris Backup scripts + +The `turris-backup` in an configuration backup tool. It integrates OpenWrt's +backup as well as Turris specific files. + +The important feature and protection is that it checks major version of +distribution in backup and compares it with current system. The default +behavior, unless forced, is to not allow restore of backup if major version is +not the same. The reason for this is because with major version of Turris OS the +OpenWrt version is updated and there are commonly incompatible changes in the +configuration. These changes regularly result in invalid the configuration for +various software. In worst case scenario they can make the router inaccessible +due to invalid network configuration. + +The backup script backups only files and links. It never dereferences the links +and instead just includes links as they are. The backup is tar archive +compressed with bzip2. + +## UCI configuration + +The backup script reads `/etc/config/backups` file and expects the following +options in the `generate` section: + +* `include_sysupgrade`: boolean option if sysupgrade files should be included in + backup. This is OpenWrt's native list of files that should be backed up. + Various packages ship with additions to this list. The directories and files + to be backed up are collected from file `/etc/sysupgrade.conf` and files in + directory `/lib/upgrade/keep.d/`. Sysupgrade files are automatically included + in default unless explicitly disabled. +* `include_modified_configs`: boolean option signaling that any modified + configuration file should be included. The packages can set some of their + files as configuration files and that way they are protected from updates if + they were modified. This includes any such modified configuration file in + backup. The modified files are NOT included automatically unless enabled + explicitly. +* `include_default`: boolean option if default Turris files should be included. + This includes UCI files in `/etc/config/` and non-standard updater + configuration files from directory `/etc/updater/conf.d/`. The default is to + include these files unless explicitly disabled. +* `dirs`: list with additional paths to files or directories that should be + included in backup. Feel free to add any additional directories you want to + include in the backup this way. diff --git a/utils/turris-maintain/files/backups.conf b/utils/turris-maintain/files/backups.conf deleted file mode 100644 index 2aa3e42e99..0000000000 --- a/utils/turris-maintain/files/backups.conf +++ /dev/null @@ -1,22 +0,0 @@ -package backups - -config generate generate - # custom firewall rules from LuCI config - list dirs "/etc/firewall.user" - ## Some extra files and directories for inspiration: - # - # if you want to backup startup services - #list dirs "/etc/rc.d" - # - # to backup root ssh config, authorized and private keys - #list dirs "/root/.ssh" - # - # if you want to backup system users as well - #list dirs "/etc/passwd" - #list dirs "/etc/shadow" - # - # if you want to backup OpenVPN Foris plugin certificates - #list dirs "/etc/ssl/ca/openvpn" - # - # if you have some custom crontabs - #list dirs "/etc/cron.d/my_crontab" diff --git a/utils/turris-maintain/files/backups.uci b/utils/turris-maintain/files/backups.uci new file mode 100644 index 0000000000..4b52186349 --- /dev/null +++ b/utils/turris-maintain/files/backups.uci @@ -0,0 +1,13 @@ + +config generate 'generate' + # This controls if files from /etc/sysupdate.conf and /lib/upgrade/keep.d/* + # should be included in backup. + #option include_sysupgrade '1' + # This controls if any configuration file that was modified should be + # included as well. + #option include_modified_configs '0' + # This controls if Turris default file set should be included in the backup. + #option include_default '1' + # You can specify additonal files and directories to backup using: + #list dirs '/root/.ssh' + diff --git a/utils/turris-maintain/files/config-backup.sh b/utils/turris-maintain/files/config-backup.sh index f76913ab61..cd5e60cb8e 100644 --- a/utils/turris-maintain/files/config-backup.sh +++ b/utils/turris-maintain/files/config-backup.sh @@ -1,7 +1,7 @@ #!/bin/sh # Turris OS configuration backup utility # -# Copyright 2014-2018 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# Copyright 2014-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,29 +15,135 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . - set -e +. /lib/functions.sh +turris_version="/etc/turris-version" -DIR=/tmp/backup-$$ -SRC=/etc/config -mkdir -p "$DIR"/etc -trap 'rm -rf "$DIR"' EXIT INT QUIT TERM ABRT -cd "$DIR"/etc -cp -a "$SRC" config -cd .. -uci -q -c "$DIR"/etc/config delete foris.auth.password || true -uci -c "$DIR"/etc/config commit -if [ -d /etc/updater ] ; then - # Back up the updater options (mostly lists of packages) - cp -a /etc/updater "$DIR"/etc - # But exclude things coming from packages not marked as configs - rm -rf "$DIR"/etc/updater/keys - rm -rf "$DIR"/etc/updater/hook_* -fi -uci -q -d ' -' get backups.generate.dirs | while read dir ; do - DNAME=$(dirname "$dir") - mkdir -p "$DIR"/"$DNAME" - cp -a "$dir" "$DIR"/"$DNAME"/ +config_load "backups" + +# These are files requested to be backed up by OpenWrt packages +sysupgrade_files() { + # Note: this is taken from sysupgrade script + # https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/base-files/files/sbin/sysupgrade;h=7e0a00e13b8ee4be7163936fd01a7beff0ce5c99;hb=HEAD#l116 + sed -ne '/^[[:space:]]*$/d; /^#/d; p' /etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null \ + | while read -r path; do + [ -e "$path" ] || continue + find -H "$path" -type f -o -type l + done +} + +# These are configuration files that were modified +modified_configs_files() { + # Note: this is taken from sysupgrade script as well (see link in sysupgrade_files) + awk ' + BEGIN { conffiles = 0 } + /^Conffiles:/ { conffiles = 1; next } + !/^ / { conffiles = 0; next } + conffiles == 1 { print } + ' /usr/lib/opkg/status \ + | while read -r file csum; do + [ -r "$file" ] || continue + echo "${csum} ${file}" | busybox sha256sum -sc - || echo "$file" + done +} + +# These are files we want automatically include on Turris +default_files() { + # UCI configuration + find -H /etc/config -type f \( -name "*-opkg" -o -name ".*" -o -print \) + # Updater configuration (the Turris ones contain warning that they should + # not be edited and that way we can filter them out) + find -H /etc/updater/conf.d -type f \( -exec grep -qF "Don't edit it." \{\} \; -o -print \) +} + +# Files/directories configured in backups UCI +uci_files() { + config_list_foreach "generate" "dirs" _uci_files_dirs +} +_uci_files_dirs() { + find -H "$1" -type f -o -type l +} + +# This provides list of all files configured for backup and available in system +files() { + local include_sysupgrade include_modified_configs include_default + config_get_bool include_sysupgrade "generate" "include_sysupgrade" "1" + config_get_bool include_modified_configs "generate" "include_modified_configs" "0" + config_get_bool include_default "generate" "include_default" "1" + { + [ -f "$turris_version" ] \ + && echo "$turris_version" + [ "$include_sysupgrade" = "1" ] \ + && sysupgrade_files + [ "$include_modified_configs" = "1" ] \ + && modified_configs_files + [ "$include_default" = "1" ] \ + && default_files + uci_files + } | sort -u +} + + + +usage() { + echo "Usage: $0 [OPTION].. [OUTPUT]" >&2 +} +help() { + usage + cat >&2 <<-"EOF" + + In default the output is generated to stdout in base64 encoding. + Optionally you can specify OUTPUT where raw backup should be stored. + The backup is simply tar.bz2 archive with files. + + Options: + -l List all files and links that would be backed up + -h Print this help text + EOF +} + +while getopts "lh" opt; do + case "$opt" in + l) + files + exit 0 + ;; + h) + help + exit 0 + ;; + *) + usage + exit 1 + ;; + esac done -tar c . | bzip2 -9c | base64 +shift $((OPTIND - 1)) +[ "$#" -le 1 ] || { + usage + exit 1 +} +output="${1:-}" +if [ -z "$output" ] || [ "$output" = "-" ]; then + archive="/tmp/backup-$$.tar" + trap 'rm -f "$archive"' INT QUIT TERM ABRT EXIT +else + archive="${1%.bz2}" # This prevents bzip2 compain about suffix +fi + +files | sed 's|^/||' | xargs /usr/bin/tar -rf "$archive" -C / + +bzip2 -z -f -9 "$archive" +archive="$archive.bz2" + +case "$output" in + "") + base64 "$archive" + ;; + "-") + cat "$archive" + ;; + *) + mv "$archive" "$output" + ;; +esac diff --git a/utils/turris-maintain/files/config-restore.sh b/utils/turris-maintain/files/config-restore.sh index 14232db926..a515c7bb95 100644 --- a/utils/turris-maintain/files/config-restore.sh +++ b/utils/turris-maintain/files/config-restore.sh @@ -1,7 +1,7 @@ #!/bin/sh # Turris OS configuration backup utility # -# Copyright 2014-2018 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# Copyright 2014-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,21 +15,126 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . - set -e +. /lib/functions.sh + + +usage() { + echo "Usage: $0 [OPTION].. [INPUT]" >&2 +} +help() { + usage + cat >&2 <<-"EOF" + + In default the input is expected on stdin and to be base64 encoded. + Optionally you can specify raw INPUT (not base64 encoded). + + Options: + -v Print system version backup was created on instead of backup restoration + -f Force backup restoration even when it is from different major version of OS + -p Preserve the Turris password + -n Do not send notification about need to restart the router + -h Print this help text + EOF +} + +force="n" +only_version="n" +preserve_passwords="n" +send_notification="y" +while getopts "vfpnh" opt; do + case "$opt" in + v) + only_version="y" + ;; + f) + force="y" + ;; + p) + preserve_passwords="y" + ;; + n) + send_notification="n" + ;; + h) + help + exit 0 + ;; + *) + usage + exit 1 + ;; + esac +done +shift $((OPTIND - 1)) +[ "$#" -le 1 ] || { + usage + exit 1 +} +input="${1:-}" +if [ -f "$input" ]; then + archive="$1" +else + archive="/tmp/backup-$$.tar" + case "$input" in + "") + base64 -d >"$archive" + ;; + "-") + cat >"$archive" + ;; + *) + cat <"$input" >"$archive" + ;; + esac + trap 'rm -f "$archive"' INT QUIT TERM ABRT EXIT +fi + +version="$(tar -xOf backup.tar.bz2 etc/turris-version || echo "unknown")" +if [ "$only_version" = "y" ]; then + echo "$version" + exit 0 +fi + +if [ "$force" = "n" ]; then + current="$(cat /etc/turris-version)" + if [ "${version%%.*}" != "${current%%.*}" ]; then + cat >&2 <<-EOF + You are trying to recover backup from a different major version of OS. + This is protection against possibly dangerous recoveries. The major OS + version commonly update system configuration in the incompatible way and + recovery of obsolete configuration can make device unaccessible. + The current versions is '$current' while backup was created on '$version'. + You can use -f option to force recovery anyway. + EOF + exit 1 + fi +fi + +if [ "$preserve_passwords" = "y" ]; then + foris_password="$(uci -q get foris.auth.password || true)" + auth_password="$(uci -q get turris-auth.auth.password || true)" + root_password="$(sed -n 's/^root:\([^:]\+\):.*/\1/p' /etc/shadow || true)" +fi + +tar -xjf "$archive" -C / + +if [ "$preserve_passwords" = "y" ]; then + if [ -n "$foris_password" ]; then + uci set "foris.auth.password=$foris_password" + uci commit foris.auth.password + fi + if [ -n "$auth_password" ]; then + uci set "turris-auth.auth.password=$auth_password" + uci commit turris-auth.auth.password + fi + if [ -n "$auth_password" ]; then + sed -i "s/^root:\([^:]\+\):/root:$root_password:/" /etc/shadow + fi +fi + -DIR=/tmp/restore-$$ -mkdir -p "$DIR" -trap 'rm -rf "$DIR"' EXIT INT QUIT TERM ABRT -cd "$DIR" -base64 -d | bzip2 -cd | tar xp -# Here we have a special-case/hack for foris password. It was requested NOT to restore the -# password, as potentially confusing action. So we unpack the backed-up configuration, -# extract the current password and implant it into the configuration. Then we just copy -# the configs and overwrite the current ones. -PASSWD="$(uci -q -c "/etc/config" get foris.auth.password || echo -n)" -[ -z "$PASSWD" ] || uci -c "$DIR/etc/config" set foris.auth.password="$PASSWD" -uci -c "$DIR/etc/config" commit -cp -rf "$DIR/"* "/" -cd / -rm -rf "$DIR" +if [ "$send_notification" = "y" ]; then + create_notification -t -s restart \ + 'Configuration backup was restored. To fully apply all configuration changes the router has to be restarted.' +fi diff --git a/utils/turris-maintain/files/network-restart.py b/utils/turris-maintain/files/network-restart.py index 87aeb688b4..ac52a1e4df 100644 --- a/utils/turris-maintain/files/network-restart.py +++ b/utils/turris-maintain/files/network-restart.py @@ -32,13 +32,13 @@ ips = [] # try to detect ips from uci # parse ips as if they were in CIDR notation -ips += [e.split("/")[0] for e in uci.get("network", "wan", "ipaddr", list=True, default=()) if e] -ips += [e.split("/")[0] for e in uci.get("network", "wan", "ip6addr", list=True, default=()) if e] ips += [e.split("/")[0] for e in uci.get("network", "lan", "ipaddr", list=True, default=()) if e] ips += [e.split("/")[0] for e in uci.get("network", "lan", "ip6addr", list=True, default=()) if e] +ips += [e.split("/")[0] for e in uci.get("network", "wan", "ipaddr", list=True, default=()) if e] +ips += [e.split("/")[0] for e in uci.get("network", "wan", "ip6addr", list=True, default=()) if e] # try to detect_ips from ubus -for network in ["wan", "lan"]: +for network in ["lan", "wan"]: try: output = subprocess.check_output(["ifstatus", network]) data = json.loads(output) @@ -48,17 +48,21 @@ pass +# Set would be almost fine for this, but it does not preserve insertion order. +# Lets use this trick with dictionary, which are ordered by default since Python 3.7, to maintain original list order. +unique_ips = list(dict.fromkeys(ips)) + remains = TIME while remains > 0: sender.notify( - "maintain", "network-restart", {"ips": list(set(ips)), "remains": remains}, + "maintain", "network-restart", {"ips": unique_ips, "remains": remains}, controller_id=controller_id, ) time.sleep(float(STEP) / 1000) remains -= STEP sender.notify( - "maintain", "network-restart", {"ips": ips, "remains": 0}, controller_id=controller_id, + "maintain", "network-restart", {"ips": unique_ips, "remains": 0}, controller_id=controller_id, ) subprocess.call(["/etc/init.d/network", "reload"]) diff --git a/utils/turris-maintain/files/reboot.py b/utils/turris-maintain/files/reboot.py index 553ceaaeef..ec2a360d9c 100644 --- a/utils/turris-maintain/files/reboot.py +++ b/utils/turris-maintain/files/reboot.py @@ -32,13 +32,13 @@ ips = [] # try to detect ips from uci # parse ips as if they were in CIDR notation -ips += [e.split("/")[0] for e in uci.get("network", "wan", "ipaddr", list=True, default=()) if e] -ips += [e.split("/")[0] for e in uci.get("network", "wan", "ip6addr", list=True, default=()) if e] ips += [e.split("/")[0] for e in uci.get("network", "lan", "ipaddr", list=True, default=()) if e] ips += [e.split("/")[0] for e in uci.get("network", "lan", "ip6addr", list=True, default=()) if e] +ips += [e.split("/")[0] for e in uci.get("network", "wan", "ipaddr", list=True, default=()) if e] +ips += [e.split("/")[0] for e in uci.get("network", "wan", "ip6addr", list=True, default=()) if e] # try to detect_ips from ubus -for network in ["wan", "lan"]: +for network in ["lan", "wan"]: try: output = subprocess.check_output(["ifstatus", network]) data = json.loads(output) @@ -47,18 +47,21 @@ except (subprocess.CalledProcessError, ): pass +# Set would be almost fine for this, but it does not preserve insertion order. +# Lets use this trick with dictionary, which are ordered by default since Python 3.7, to maintain original list order. +unique_ips = list(dict.fromkeys(ips)) remains = TIME while remains > 0: sender.notify( - "maintain", "reboot", {"ips": list(set(ips)), "remains": remains}, + "maintain", "reboot", {"ips": unique_ips, "remains": remains}, controller_id=controller_id, ) time.sleep(float(STEP) / 1000) remains -= STEP sender.notify( - "maintain", "reboot", {"ips": ips, "remains": 0}, controller_id=controller_id, + "maintain", "reboot", {"ips": unique_ips, "remains": 0}, controller_id=controller_id, ) subprocess.call("reboot") diff --git a/utils/turris-motd/Makefile b/utils/turris-motd/Makefile index b07cd235ac..ea62c3486c 100644 --- a/utils/turris-motd/Makefile +++ b/utils/turris-motd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-motd PKG_VERSION:=0.1.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/utils/turris-netboot/Makefile b/utils/turris-netboot/Makefile index ffce2dd1c6..1f9301a9e8 100644 --- a/utils/turris-netboot/Makefile +++ b/utils/turris-netboot/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2016-2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2016-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-netboot -PKG_VERSION:=0.6.2 -PKG_RELEASE:=2 +PKG_VERSION:=0.7.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/turris-netboot.git -PKG_MIRROR_HASH:=0e115d474eacd4394e08b748e3e8641d68d77d0e9b8cf5a5898b1f7e451029cb +PKG_MIRROR_HASH:=6eae57a9b30157d004dd40a0e290885e00f7fef6fcb1c427aff7d49ac728b888 BB_VERSION:=1.29.3 PKG_BB_SOURCE:=busybox-$(BB_VERSION).tar.bz2 @@ -36,7 +36,7 @@ endef define Package/turris-netboot-tools TITLE:=Turris Netboot tools - DEPENDS:=+dnsmasq +dtc +uboot-mkimage +openssh-server +python3-cryptography +wget +foris-client +python3-uci + DEPENDS:=+dnsmasq +dtc +uboot-mkimage +openssh-server +python3-cryptography +wget +foris-client +python3-uci +sudo endef define Build/Prepare @@ -85,10 +85,10 @@ endef define Package/turris-netboot-data/install $(INSTALL_DIR) $(1)/usr/share/turris-netboot - cd $(LINUX_DIR); ./scripts/gen_initramfs_list.sh \ + cd $(LINUX_DIR); ./usr/gen_initramfs.sh \ -o $(1)/usr/share/turris-netboot/initrd-$(CONFIG_ARCH).gz -u squash -g squash \ "$(PKG_BUILD_DIR)/rootfs" "$(PKG_BUILD_DIR)/rootfs.extra" - gzip -d $(1)/usr/share/turris-netboot/initrd-$(CONFIG_ARCH).gz + cp $(1)/usr/share/turris-netboot/initrd-$(CONFIG_ARCH).gz $(1)/usr/share/turris-netboot/initrd-$(CONFIG_ARCH) $(INSTALL_DATA) ./files/mox.its $(1)/usr/share/turris-netboot endef @@ -104,6 +104,7 @@ define Package/turris-netboot-tools/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/etc/config $(INSTALL_DIR) $(1)/etc/cron.d + $(INSTALL_DIR) $(1)/etc/sudoers.d $(INSTALL_DATA) $(PKG_BUILD_DIR)/netboot $(1)/etc/config/netboot $(INSTALL_DATA) ./files/netboot-update.cron $(1)/etc/cron.d/netboot-update $(INSTALL_BIN) $(PKG_BUILD_DIR)/server.sh $(1)/usr/bin/netboot-server @@ -113,6 +114,7 @@ define Package/turris-netboot-tools/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/set-static-lease.py $(1)/usr/bin/netboot-set-static-lease $(INSTALL_DIR) $(1)/usr/share/turris-netboot $(INSTALL_BIN) $(PKG_BUILD_DIR)/network-setup.sh $(1)/usr/share/turris-netboot/setup.sh + $(INSTALL_DATA) -m 0600 $(PKG_BUILD_DIR)/netboot.sudoers $(1)/etc/sudoers.d/netboot endef $(eval $(call BuildPackage,turris-netboot-data)) diff --git a/utils/turris-timezone/Makefile b/utils/turris-timezone/Makefile index b10ffecb84..1ca964e2df 100644 --- a/utils/turris-timezone/Makefile +++ b/utils/turris-timezone/Makefile @@ -9,12 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-timezone PKG_VERSION:=0.2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/$(PKG_NAME)/-/archive/v$(PKG_VERSION)/ PKG_HASH:=0042a108d81b56c414e229638d432c15acc75ed1591a68ab213ad21db657441c PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION) +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=l18n PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later @@ -29,11 +30,10 @@ define Package/turris-timezone TITLE:=Turris timezone URL:=https://gitlab.nic.cz/turris/foris-controller/turris-timezone/ DEPENDS:=+python3-light - VARIANT:=python3 endef define Package/turris-timezone/description - Due to missing /usr/share/zoneinfo on OpenWrt, this package should + Due to missing /usr/share/zoneinfo on OpenWrt, this package should provide some basic data extracted from /usr/share/zoneinfo of build machnine. endef diff --git a/utils/turris-utils/Makefile b/utils/turris-utils/Makefile index ec5ac59b31..ab715906b7 100644 --- a/utils/turris-utils/Makefile +++ b/utils/turris-utils/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-utils PKG_VERSION:=2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/utils/user-notify/Makefile b/utils/user-notify/Makefile index 9a33cd4632..ef862a8c01 100644 --- a/utils/user-notify/Makefile +++ b/utils/user-notify/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2018-2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +## Copyright (C) 2018-2020, 2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=user-notify -PKG_VERSION:=61.5 -PKG_RELEASE:=1 +PKG_VERSION:=61.5.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/user-notify.git -PKG_MIRROR_HASH:=b280f0653853b1976012f9c1fd907523a532057aab7e58ed8f5e5f6d55e16952 +PKG_MIRROR_HASH:=9d07c895efec9770b6e5c35555edcef4251e014101f4938d52d8f4198b1edabc PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC diff --git a/web/foris-controller/follectd/Makefile b/web/foris-controller/follectd/Makefile index 8caf726025..fb62bbee74 100644 --- a/web/foris-controller/follectd/Makefile +++ b/web/foris-controller/follectd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=follectd PKG_VERSION:=5 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/web/foris-controller/foris-client/Makefile b/web/foris-controller/foris-client/Makefile index 93bccfa891..a13801e8e2 100644 --- a/web/foris-controller/foris-client/Makefile +++ b/web/foris-controller/foris-client/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-client -PKG_VERSION:=1.0.3 -PKG_RELEASE:=4 +PKG_VERSION:=1.0.4 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-client.git -PKG_MIRROR_HASH:=715f5c40d7950fb781ea5df477396ade63deb99812ccc80690278eb337c8ada3 +PKG_MIRROR_HASH:=761775de882c6ef66d5a05ce81a04ebbcd99f7114d9d39b6d8b2375542e7740c PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -35,7 +35,6 @@ define Package/foris-client +python3-ubus \ +python3-setuptools \ +crypto-wrapper - VARIANT:=python3 endef define Package/foris-client/description diff --git a/web/foris-controller/foris-controller-collectd-module/Makefile b/web/foris-controller/foris-controller-collectd-module/Makefile index b1f858ce85..ce2be7de4f 100644 --- a/web/foris-controller/foris-controller-collectd-module/Makefile +++ b/web/foris-controller/foris-controller-collectd-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-collectd-module PKG_VERSION:=0.2 -PKG_RELEASE:=3 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-collectd-module.git @@ -32,7 +32,6 @@ define Package/foris-controller-collectd-module DEPENDS:= \ +foris-controller \ +follectd - VARIANT:=python3 endef define Package/foris-controller-collectd-module/description diff --git a/web/foris-controller/foris-controller-data_collect-module/Makefile b/web/foris-controller/foris-controller-data_collect-module/Makefile index 31fc86a249..a3fab89c2c 100644 --- a/web/foris-controller/foris-controller-data_collect-module/Makefile +++ b/web/foris-controller/foris-controller-data_collect-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-data_collect-module PKG_VERSION:=1.1 -PKG_RELEASE:=7 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-data_collect-module.git @@ -30,7 +30,6 @@ define Package/foris-controller-data_collect-module SUBMENU:=Foris Controller TITLE:=Foris controller data collect module DEPENDS:=+foris-controller - VARIANT:=python3 endef define Package/foris-controller-data_collect-module/description diff --git a/web/foris-controller/foris-controller-diagnostics-module/Makefile b/web/foris-controller/foris-controller-diagnostics-module/Makefile index 90a89b9fbe..7ca2af668e 100644 --- a/web/foris-controller/foris-controller-diagnostics-module/Makefile +++ b/web/foris-controller/foris-controller-diagnostics-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-diagnostics-module PKG_VERSION:=1.0.5 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-diagnostics-module.git @@ -32,7 +32,6 @@ define Package/foris-controller-diagnostics-module DEPENDS:= \ +foris-controller \ +turris-diagnostics - VARIANT:=python3 endef define Package/foris-controller-diagnostics-module/description diff --git a/web/foris-controller/foris-controller-haas-module/Makefile b/web/foris-controller/foris-controller-haas-module/Makefile index 868cb59970..534a95c1a5 100644 --- a/web/foris-controller/foris-controller-haas-module/Makefile +++ b/web/foris-controller/foris-controller-haas-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-haas-module PKG_VERSION:=0.1.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-haas-module.git @@ -32,7 +32,6 @@ define Package/foris-controller-haas-module DEPENDS:=\ +foris-controller \ +haas-proxy - VARIANT:=python3 endef define Package/foris-controller-haas-module/description diff --git a/web/foris-controller/foris-controller-netboot-module/Makefile b/web/foris-controller/foris-controller-netboot-module/Makefile index 66970ac643..407cfe24d6 100644 --- a/web/foris-controller/foris-controller-netboot-module/Makefile +++ b/web/foris-controller/foris-controller-netboot-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-netboot-module PKG_VERSION:=0.4.1 -PKG_RELEASE:=6 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-netboot-module.git @@ -32,7 +32,6 @@ define Package/foris-controller-netboot-module DEPENDS:=\ +foris-controller \ +turris-netboot-tools - VARIANT:=python3 endef define Package/foris-controller-netboot-module/description diff --git a/web/foris-controller/foris-controller-netmetr-module/Makefile b/web/foris-controller/foris-controller-netmetr-module/Makefile index a7e9be03f8..9686951007 100644 --- a/web/foris-controller/foris-controller-netmetr-module/Makefile +++ b/web/foris-controller/foris-controller-netmetr-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-netmetr-module PKG_VERSION:=0.4.2 -PKG_RELEASE:=4 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-netmetr-module.git @@ -32,7 +32,6 @@ define Package/foris-controller-netmetr-module DEPENDS:=\ +foris-controller \ +netmetr - VARIANT:=python3 endef define Package/foris-controller-netmetr-module/description diff --git a/web/foris-controller/foris-controller-nextcloud-module/Makefile b/web/foris-controller/foris-controller-nextcloud-module/Makefile index 6c6924e38a..680f3dc075 100644 --- a/web/foris-controller/foris-controller-nextcloud-module/Makefile +++ b/web/foris-controller/foris-controller-nextcloud-module/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2020 CZ.NIC, z. s. p. o. (https://www.nic.cz/) +# Copyright (C) 2020, 2022 CZ.NIC, z. s. p. o. (https://www.nic.cz/) # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-nextcloud-module -PKG_VERSION:=0.1 -PKG_RELEASE:=2 +PKG_VERSION:=0.2.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-nextcloud-module.git -PKG_MIRROR_HASH:=09b595dd4744c993e622ef744cfd9074d7e454bd5aca303c6ea10007416730e7 +PKG_MIRROR_HASH:=c73fb5d0778c21bfed99d13f68bf17a707a6d75376bef7a8272dc7a979bc0405 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -33,7 +33,6 @@ define Package/foris-controller-nextcloud-module +foris-controller \ +foris-controller-storage-module \ +nextcloud-install - VARIANT:=python3 endef define Package/foris-controller-nextcloud-module/description diff --git a/web/foris-controller/foris-controller-openvpn-module/Makefile b/web/foris-controller/foris-controller-openvpn-module/Makefile index 6ba4b178da..73e2045985 100644 --- a/web/foris-controller/foris-controller-openvpn-module/Makefile +++ b/web/foris-controller/foris-controller-openvpn-module/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-openvpn-module -PKG_VERSION:=0.7.0 -PKG_RELEASE:=1 +PKG_VERSION:=0.8.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-openvpn-module.git -PKG_MIRROR_HASH:=7e5b6e75c4fa9569c89dc230b0dba033cf23479de4e3fa1fcc819607b89995dd +PKG_MIRROR_HASH:=994d55c0748fa0852fded21a93736d22468cfa9c57c09014ab9592bb95f6e174 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -33,7 +33,6 @@ define Package/foris-controller-openvpn-module +foris-controller \ +turris-cagen \ +openvpn-openssl - VARIANT:=python3 endef define Package/foris-controller-openvpn-module/description diff --git a/web/foris-controller/foris-controller-openvpn_client-module/Makefile b/web/foris-controller/foris-controller-openvpn_client-module/Makefile index 7f166f209b..a23bfbe7dc 100644 --- a/web/foris-controller/foris-controller-openvpn_client-module/Makefile +++ b/web/foris-controller/foris-controller-openvpn_client-module/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2020 CZ.NIC z. s. p. o. (https://www.nic.cz/) +# Copyright (C) 2019-2020, 2022 CZ.NIC z. s. p. o. (https://www.nic.cz/) # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-openvpn_client-module -PKG_VERSION:=0.5.1 -PKG_RELEASE:=1 +PKG_VERSION:=0.6.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-openvpn_client-module.git -PKG_MIRROR_HASH:=ff2378f8804225f1c34c02e1d17e83e7f1dea26706d0ae9109d89997dc4be0f2 +PKG_MIRROR_HASH:=e0ed82fab528d72b290444b024da1ccbe1dc449f4d4d199db6353f481f168041 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -33,7 +33,6 @@ define Package/foris-controller-openvpn_client-module +foris-controller \ +turris-cagen \ +openvpn-openssl - VARIANT:=python3 endef define Package/foris-controller-openvpn_client-module/description diff --git a/web/foris-controller/foris-controller-pakon-module/Makefile b/web/foris-controller/foris-controller-pakon-module/Makefile index 19d2587f46..637140c5ed 100644 --- a/web/foris-controller/foris-controller-pakon-module/Makefile +++ b/web/foris-controller/foris-controller-pakon-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-pakon-module PKG_VERSION:=0.2.1 -PKG_RELEASE:=4 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-pakon-module.git @@ -32,7 +32,6 @@ define Package/foris-controller-pakon-module DEPENDS:= \ +foris-controller \ +pakon - VARIANT:=python3 endef define Package/foris-controller-pakon-module/description diff --git a/web/foris-controller/foris-controller-schnapps-module/Makefile b/web/foris-controller/foris-controller-schnapps-module/Makefile index e45494d3e2..5021c6fbe1 100644 --- a/web/foris-controller/foris-controller-schnapps-module/Makefile +++ b/web/foris-controller/foris-controller-schnapps-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-schnapps-module PKG_VERSION:=0.5 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-schnapps-module.git @@ -32,7 +32,6 @@ define Package/foris-controller-schnapps-module DEPENDS:= \ +foris-controller \ +schnapps - VARIANT:=python3 endef define Package/foris-controller-schnapps-module/description diff --git a/web/foris-controller/foris-controller-sentinel-module/Makefile b/web/foris-controller/foris-controller-sentinel-module/Makefile index 41e41c1dcd..dd1e0ae539 100644 --- a/web/foris-controller/foris-controller-sentinel-module/Makefile +++ b/web/foris-controller/foris-controller-sentinel-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-sentinel-module PKG_VERSION:=0.3.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-sentinel-module.git @@ -33,7 +33,6 @@ define Package/foris-controller-sentinel-module +foris-controller \ +sentinel-eula \ +sentinel-proxy - VARIANT:=python3 endef define Package/foris-controller-sentinel-module/description diff --git a/web/foris-controller/foris-controller-storage-module/Makefile b/web/foris-controller/foris-controller-storage-module/Makefile index c3942cb44b..f4216596b0 100644 --- a/web/foris-controller/foris-controller-storage-module/Makefile +++ b/web/foris-controller/foris-controller-storage-module/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2017-2021 CZ.NIC z. s. p. o. (https://www.nic.cz/) +# Copyright (C) 2017-2022 CZ.NIC z. s. p. o. (https://www.nic.cz/) # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-storage-module -PKG_VERSION:=0.10.0 -PKG_RELEASE:=2 +PKG_VERSION:=0.10.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-storage-module.git @@ -37,7 +37,6 @@ define Package/foris-controller-storage-module +rsync \ +partx-utils \ +blkid - VARIANT:=python3 endef define Package/foris-controller-storage-module/description @@ -67,7 +66,7 @@ define ForisControllerModule/foris-controller-storage-module/install $(CP) $(PKG_BUILD_DIR)/scripts/syslog-ng-logrotate.conf $(1)/etc/logrotate.d/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/syslog-ng.sh $(1)/usr/libexec/syslog-ng-srv.sh $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/lighttpd_srv_setting.sh $(1)/usr/libexec/lighttpd_srv_setting.sh - $(INSTALL_CONF) $(PKG_BUILD_DIR)/scripts/lighttpd.conf $(1)/etc/lighttpd/conf.d/srv.conf + $(INSTALL_CONF) $(PKG_BUILD_DIR)/scripts/lighttpd.conf $(1)/etc/lighttpd/conf.d/45-srv.conf $(INSTALL_DATA) ./files/storage.uci $(1)/etc/config/storage diff --git a/web/foris-controller/foris-controller-storage-module/patches/init-behave-correctly.patch b/web/foris-controller/foris-controller-storage-module/patches/init-behave-correctly.patch deleted file mode 100644 index a7181c18cd..0000000000 --- a/web/foris-controller/foris-controller-storage-module/patches/init-behave-correctly.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 4c79be944b98c6775f224e013a41d0960b65ee5a Mon Sep 17 00:00:00 2001 -From: Michal Hrusecky -Date: Fri, 5 Nov 2021 17:02:54 +0100 -Subject: [PATCH] init: Behave correctly when encountering error - -Fix the condition so people with problems wouldn't end up with tmpfs on -top of btrfs. ---- - scripts/srv.init | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/srv.init b/scripts/srv.init -index 329eb6b..4d6e868 100644 ---- a/scripts/srv.init -+++ b/scripts/srv.init -@@ -9,7 +9,7 @@ status() { - - die() { - create_notification -n error "$1" -- if grep -q '^[^[:blank:]]\+[[:blank:]]\+/srv[[:blank:]]' /proc/mounts && [ -d /srv ]; then -+ if ! grep -q '^[^[:blank:]]\+[[:blank:]]\+/srv[[:blank:]]' /proc/mounts && [ -d /srv ]; then - mount -t tmpfs -o size=50M none /srv - fi - exit 1 --- -GitLab - diff --git a/web/foris-controller/foris-controller-subordinates-module/Makefile b/web/foris-controller/foris-controller-subordinates-module/Makefile index 02ed7791ed..651c788e78 100644 --- a/web/foris-controller/foris-controller-subordinates-module/Makefile +++ b/web/foris-controller/foris-controller-subordinates-module/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller-subordinates-module PKG_VERSION:=0.2.1 -PKG_RELEASE:=3 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller-subordinates-module.git @@ -33,7 +33,6 @@ define Package/foris-controller-subordinates-module +foris-controller \ +foris-forwarder \ +fosquitto - VARIANT:=python3 endef define Package/foris-controller-subordinates-module/description diff --git a/web/foris-controller/foris-controller/Makefile b/web/foris-controller/foris-controller/Makefile index 676c0739a3..a5ea99ae73 100644 --- a/web/foris-controller/foris-controller/Makefile +++ b/web/foris-controller/foris-controller/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-controller -PKG_VERSION:=2.1.1 -PKG_RELEASE:=2 +PKG_VERSION:=5.2.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-controller.git -PKG_MIRROR_HASH:=ccd7e8ec4308e559e421d128a94bc9c4822b580b990edd3bd88160a21998c565 +PKG_MIRROR_HASH:=b5fd73db5db91d60414f50168046e6d594c0328bb298f7fa77fd0d11b4976ca2 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -43,8 +43,7 @@ define Package/foris-controller-app +foris-schema +python3-setuptools +turrishw \ +turris-maintain +updater-supervisor +user-notify \ +l10n-supported +sqm-scripts +fosquitto +python3-paho-mqtt +turris-cagen \ - +crypto-wrapper +python3-slugify - VARIANT:=python3 + +crypto-wrapper +python3-slugify +turris-timezone endef define Package/foris-controller/description @@ -63,7 +62,7 @@ define Py3Package/foris-controller-app/install $(INSTALL_DIR) $(1)/etc/config/ $(INSTALL_CONF) ./files/foris-controller.conf $(1)/etc/config/foris-controller touch $(1)/etc/config/foris -ifeq ($(CONFIG_TARGET_mvebu_cortexa53_DEVICE_cznic-mox),y) +ifeq ($(CONFIG_TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox),y) sed -i 's|#\(option single true\)|\1|' $(1)/etc/config/foris-controller endif $(INSTALL_CONF) ./files/foris-controller-subordinates.conf $(1)/etc/config/foris-controller-subordinates diff --git a/web/foris-controller/foris-controller/patches/0001-quickfix-detect-reForis-translations-instead-of-Fori.patch b/web/foris-controller/foris-controller/patches/0001-quickfix-detect-reForis-translations-instead-of-Fori.patch deleted file mode 100644 index cb14266820..0000000000 --- a/web/foris-controller/foris-controller/patches/0001-quickfix-detect-reForis-translations-instead-of-Fori.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 09bc7002130f72adc08daf300a40694ed44ef115 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= -Date: Thu, 21 Oct 2021 01:25:01 +0200 -Subject: [PATCH] quickfix: detect reForis translations instead of Foris ones - -Foris is no longer present in TOS 5.3.0 and was superseded by reForis -Use reForis translations to determine available localization for reForis - -This is mostly quick fix - i.e. just replace Foris with reForis - until -we figure out better long term solution, so foris-controller could -become even more loosely coupled with the current and future web UIs -shipped with Turris OS ---- - foris_controller_backends/web/__init__.py | 28 +++++++++++++++-------- - tests/blackbox/test_web.py | 17 ++++++++------ - 2 files changed, 28 insertions(+), 17 deletions(-) - -diff --git a/foris_controller_backends/web/__init__.py b/foris_controller_backends/web/__init__.py -index 0aec7a8..2d7c72f 100644 ---- a/foris_controller_backends/web/__init__.py -+++ b/foris_controller_backends/web/__init__.py -@@ -1,6 +1,6 @@ - # - # foris-controller --# Copyright (C) 2020 CZ.NIC, z.s.p.o. (http://www.nic.cz/) -+# Copyright (C) 2020-2021 CZ.NIC, z.s.p.o. (http://www.nic.cz/) - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License as published by -@@ -20,16 +20,23 @@ - import logging - import os - import sys -+import typing - - import turrishw -+ - from foris_controller import profiles - from foris_controller.exceptions import UciException, UciRecordNotFound - from foris_controller_backends.about import SystemInfoFiles - from foris_controller_backends.files import BaseMatch --from foris_controller_backends.password import ForisPasswordUci - from foris_controller_backends.maintain import MaintainCommands -+from foris_controller_backends.password import ForisPasswordUci -+from foris_controller_backends.uci import ( -+ UciBackend, -+ get_option_named, -+ parse_bool, -+ store_bool, -+) - from foris_controller_backends.wan import WanUci --from foris_controller_backends.uci import UciBackend, get_option_named, parse_bool, store_bool - - logger = logging.getLogger(__name__) - -@@ -207,20 +214,21 @@ class WebUciCommands: - return True - - --class Languages(object): -- LANG_DIR = "/usr/lib/python%s.%s/site-packages/foris/langs/" % ( -+class Languages(): -+ # reForis is the only web UI of Turris OS at the moment, so only look for reForis translations -+ LANG_DIR = "/usr/lib/python%s.%s/site-packages/reforis/translations" % ( - sys.version_info.major, - sys.version_info.minor, - ) -- INSTALLED_LANG_MATCHES = [os.path.join(LANG_DIR, "??.py"), os.path.join(LANG_DIR, "??_??.py")] -+ INSTALLED_LANG_MATCHES = [os.path.join(LANG_DIR, "??"), os.path.join(LANG_DIR, "??_??")] - - @staticmethod -- def list_languages(): -+ def list_languages() -> typing.List[str]: - """ List installed languages - :returns: list of installed languages - :rtype: list of str - """ - -- return [DEFAULT_LANGUAGE] + [ -- os.path.basename(e)[:-3] for e in BaseMatch.list_files(Languages.INSTALLED_LANG_MATCHES) -- ] -+ return list({DEFAULT_LANGUAGE} | { -+ os.path.basename(e) for e in BaseMatch.list_files(Languages.INSTALLED_LANG_MATCHES) -+ }) -diff --git a/tests/blackbox/test_web.py b/tests/blackbox/test_web.py -index 3e4df31..2ea94b4 100644 ---- a/tests/blackbox/test_web.py -+++ b/tests/blackbox/test_web.py -@@ -21,8 +21,6 @@ import os - import sys - - import pytest --from foris_controller import profiles --from foris_controller.exceptions import UciRecordNotFound - from foris_controller_testtools.fixtures import ( - FILE_ROOT_PATH, - UCI_CONFIG_DIR_PATH, -@@ -38,11 +36,14 @@ from foris_controller_testtools.fixtures import ( - from foris_controller_testtools.utils import ( - FileFaker, - get_uci_module, -+ network_restart_was_called, - prepare_turrishw, - prepare_turrishw_root, -- network_restart_was_called, - ) - -+from foris_controller import profiles -+from foris_controller.exceptions import UciRecordNotFound -+ - NEW_WORKFLOWS = [ - e for e in profiles.WORKFLOWS if e not in (profiles.WORKFLOW_OLD, profiles.WORKFLOW_SHIELD) - ] -@@ -70,13 +71,15 @@ RECOMMENDED_WORKFLOWS = { - - @pytest.fixture(scope="function") - def installed_languages(request): -- trans_dir = "/usr/lib/python%s.%s/site-packages/foris/langs/" % ( -+ trans_dir = "/usr/lib/python%s.%s/site-packages/reforis/translations/" % ( - sys.version_info.major, - sys.version_info.minor, - ) -- with FileFaker(FILE_ROOT_PATH, os.path.join(trans_dir, "cs.py"), False, "") as f1, FileFaker( -- FILE_ROOT_PATH, os.path.join(trans_dir, "de.py"), False, "" -- ) as f2, FileFaker(FILE_ROOT_PATH, os.path.join(trans_dir, "nb_NO.py"), False, "") as f3: -+ mo_file = "LC_MESSAGES/messages.mo" -+ -+ with FileFaker(FILE_ROOT_PATH, os.path.join(trans_dir, "cs", mo_file), False, "") as f1, FileFaker( -+ FILE_ROOT_PATH, os.path.join(trans_dir, "de", mo_file), False, "" -+ ) as f2, FileFaker(FILE_ROOT_PATH, os.path.join(trans_dir, "nb_NO", mo_file), False, "") as f3: - yield f1, f2, f3 - - --- -2.30.2 - diff --git a/web/foris-controller/foris-controller/patches/0001-treewide-change-ubus-socket-path.patch b/web/foris-controller/foris-controller/patches/0001-treewide-change-ubus-socket-path.patch new file mode 100644 index 0000000000..fba39fc962 --- /dev/null +++ b/web/foris-controller/foris-controller/patches/0001-treewide-change-ubus-socket-path.patch @@ -0,0 +1,41 @@ +From a6e53e211665d800749ee12e5e4fa6b6882216a0 Mon Sep 17 00:00:00 2001 +From: Josef Schlehofer +Date: Wed, 21 Jul 2021 14:53:59 +0200 +Subject: [PATCH 1/2] treewide: change ubus socket path + +OpenWrt developers in upcoming version of OpenWrt 21.02 and newer +decided that the will run ubusd as non-root user and because of that, +they moved it from /var/run/ubus.sock to +/var/run/ubus/ubus.sock + +Reference: +- https://github.com/openwrt/openwrt/commit/2dffadece9a7243a236ce7d91719787a671e23d4#diff-9536a91ee901a062b8e38e62fe624247e76fa4c268c9be6ba68af284ff0f641e + +- https://git.openwrt.org/?p=project/ubus.git;a=commit;h=13a4438b4ebdf85d301999e0a615640ac4c9b0a8 +--- + foris_controller/controller/__main__.py | 2 +- + foris_controller/notify/__main__.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/foris_controller/controller/__main__.py ++++ b/foris_controller/controller/__main__.py +@@ -88,7 +88,7 @@ def main(): + + if "ubus" in available_buses: + ubus_parser = subparsers.add_parser("ubus", help="use ubus to recieve commands") +- ubus_parser.add_argument("--path", default="/var/run/ubus.sock") ++ ubus_parser.add_argument("--path", default="/var/run/ubus/ubus.sock") + ubus_parser.add_argument( + "--single", + default=False, +--- a/foris_controller/notify/__main__.py ++++ b/foris_controller/notify/__main__.py +@@ -72,7 +72,7 @@ def main(): + unix_parser.add_argument("--path", default="/tmp/foris-controller.soc") + if "ubus" in available_buses: + ubus_parser = subparsers.add_parser("ubus", help="use ubus to send notifications") +- ubus_parser.add_argument("--path", default="/var/run/ubus.sock") ++ ubus_parser.add_argument("--path", default="/var/run/ubus/ubus.sock") + + if "mqtt" in available_buses: + mqtt_parser = subparsers.add_parser("mqtt", help="use mqtt to send notification") diff --git a/web/foris-controller/foris-controller/patches/0002-remote-Create-remote-CA-files-with-owner-mosquitto.patch b/web/foris-controller/foris-controller/patches/0002-remote-Create-remote-CA-files-with-owner-mosquitto.patch new file mode 100644 index 0000000000..ddfd9c7fd0 --- /dev/null +++ b/web/foris-controller/foris-controller/patches/0002-remote-Create-remote-CA-files-with-owner-mosquitto.patch @@ -0,0 +1,131 @@ +From 2402364344b4c7d45a59a44f1f99e111d157d8dc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= +Date: Thu, 18 Aug 2022 22:59:03 +0200 +Subject: [PATCH 1/2] remote: Create remote CA files with owner mosquitto + +From OpenWrt 21.02 on, mosquitto runs under it's own user (mosquitto), +but CA files are created by foris-controller with owner root. + +Mosquitto fails with following error: + +``` +Error: Unable to load server key file "/etc/ssl/ca/remote/01.key". Check keyfile. +``` + +Which in turn breaks other services using `mosquitto` as message bus. +For example: foris-controller & reforis + +This is quick hack to change owner of particular files, so that +mosquitto is able to start and in turn the rest of the services will +start too. + +This could probably be fixed in `turis-cagen` script, but I'd consider +this Remote Access CA as special case and do not want to somehow mess up +CA file permission for every other CA generated via `turris-cagen`. + +Closes: #211 +--- + foris_controller_backends/remote/__init__.py | 53 ++++++++++++++++---- + 1 file changed, 42 insertions(+), 11 deletions(-) + +diff --git a/foris_controller_backends/remote/__init__.py b/foris_controller_backends/remote/__init__.py +index 975626b..bd0cca2 100644 +--- a/foris_controller_backends/remote/__init__.py ++++ b/foris_controller_backends/remote/__init__.py +@@ -17,30 +17,34 @@ + # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + # + ++import base64 ++import json ++import logging + import os + import re +-import logging ++import shutil + import tarfile +-import base64 +-import json +- +-from io import BytesIO + from collections import OrderedDict ++from io import BytesIO + + from foris_controller.app import app_info +- + from foris_controller_backends.cmdline import AsyncCommand, BaseCmdLine +-from foris_controller_backends.files import BaseFile, path_exists, makedirs ++from foris_controller_backends.files import ( ++ BaseFile, ++ inject_file_root, ++ makedirs, ++ path_exists, ++) ++from foris_controller_backends.networks import NetworksCmd ++from foris_controller_backends.services import OpenwrtServices + from foris_controller_backends.uci import ( + UciBackend, ++ UciException, ++ get_option_anonymous, + get_option_named, + parse_bool, +- UciException, + store_bool, +- get_option_anonymous, + ) +-from foris_controller_backends.networks import NetworksCmd +-from foris_controller_backends.services import OpenwrtServices + + logger = logging.getLogger(__name__) + +@@ -50,6 +54,8 @@ NETBOOT_CONFIGURED_PATH = "/tmp/netboot-configured" + class RemoteAsync(AsyncCommand): + def generate_ca(self, notify_function, exit_notify_function, reset_notify_function): + def handler_exit(process_data): ++ # The first certificate should be server certificate for the device ++ RemoteAsync._fix_remote_ca_file_permissions("01") + exit_notify_function( + { + "task_id": process_data.id, +@@ -105,6 +111,25 @@ class RemoteAsync(AsyncCommand): + + return task_id + ++ @staticmethod ++ def _fix_remote_ca_file_permissions(client_id: str) -> None: ++ """Set correct owners to .key file so that mosquitto can access client keys. ++ ++ Quick hack to do not let mosquitto crash on ++ ++ `Error: Unable to load server key file "/etc/ssl/ca/remote/01.key". Check keyfile.` ++ ++ Since OpenWrt 21.02, mosquitto is running under it's own user (mosquitto) and cannot access clients files, ++ which are owned by root:root. ++ E.g.: `01.key`, `02.key`, etc. ++ ++ Ideally we should be able to set permissions by invocation of `turris-cagen` script (optional parameters?), ++ but right now this is special case for remote access CA. ++ So for the sake of not breaking even more things that relies on `turris-cagen`, lets resort to this quickhack. ++ """ ++ filename = os.path.join(RemoteFiles.BASE_CERT_PATH, f"{client_id}.key") ++ shutil.chown(inject_file_root(filename), "mosquitto", "mosquitto") ++ + + class RemoteCmds(BaseCmdLine): + def get_status(self): +@@ -134,6 +159,12 @@ class RemoteCmds(BaseCmdLine): + + return {"status": ca_status, "tokens": clients} + ++ def get_latest_token_id(self) -> str: ++ """Helper function to get latest generated client token ID.""" ++ tokens = self.get_status()["tokens"] ++ last_token = tokens[-1] ++ return last_token["id"] ++ + def revoke(self, cert_id): + retval, _, _ = self._run_command( + "/usr/bin/turris-cagen", "switch", "remote", "revoke", cert_id +-- +2.37.0 + diff --git a/web/foris-controller/foris-controller/patches/0002-wan-store-wan-interface-L2-options-in-device-section.patch b/web/foris-controller/foris-controller/patches/0002-wan-store-wan-interface-L2-options-in-device-section.patch new file mode 100644 index 0000000000..4e0b737979 --- /dev/null +++ b/web/foris-controller/foris-controller/patches/0002-wan-store-wan-interface-L2-options-in-device-section.patch @@ -0,0 +1,147 @@ +From eb304a5f6f07efcdc92693e2c11c35943adbbbcc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= +Date: Sat, 20 Aug 2022 22:55:08 +0200 +Subject: [PATCH 1/2] wan: store wan interface L2 options in device section + +Since OpenWrt 21.02, L2 interface options should be stored in +interface's `device` section instead of `interface` section. + +OpenWrt 19.07 + +``` +config interface 'wan' + option iface 'eth0' + option macaddr '11:22:33:44:55:66' +``` + +OpenWrt 21.02 + +``` +config interface 'wan' + option device 'eth0' + +config device + option name 'eth0' + option macaddr '11:22:33:44:55:66' +``` +--- + foris_controller_backends/wan/__init__.py | 64 ++++++++++++++++++++--- + 1 file changed, 56 insertions(+), 8 deletions(-) + +diff --git a/foris_controller_backends/wan/__init__.py b/foris_controller_backends/wan/__init__.py +index 0e9d93a..6ef8c98 100644 +--- a/foris_controller_backends/wan/__init__.py ++++ b/foris_controller_backends/wan/__init__.py +@@ -1,6 +1,6 @@ + # + # foris-controller +-# Copyright (C) 2020-2021 CZ.NIC, z.s.p.o. (http://www.nic.cz/) ++# Copyright (C) 2020-2022 CZ.NIC, z.s.p.o. (http://www.nic.cz/) + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -19,13 +19,19 @@ + + import logging + +-from foris_controller_backends.uci import UciBackend, get_option_named, parse_bool, store_bool +-from foris_controller.exceptions import UciException, GenericError ++from foris_controller.exceptions import GenericError, UciException ++from foris_controller.utils import parse_to_list, unwrap_list + from foris_controller_backends.cmdline import AsyncCommand, BaseCmdLine +-from foris_controller_backends.maintain import MaintainCommands + from foris_controller_backends.files import BaseFile ++from foris_controller_backends.maintain import MaintainCommands + from foris_controller_backends.networks import NetworksCmd, NetworksUci +-from foris_controller.utils import unwrap_list, parse_to_list ++from foris_controller_backends.uci import ( ++ UciBackend, ++ get_option_named, ++ parse_bool, ++ section_exists, ++ store_bool, ++) + + logger = logging.getLogger(__name__) + +@@ -106,7 +112,7 @@ class WanUci: + else: + wan6_settings["wan6_6in4"]["dynamic_ipv4"]["enabled"] = False + +- custom_mac = get_option_named(network_data, "network", "wan", "macaddr", "") ++ custom_mac = WanUci._fetch_mac_address(network_data) + + networks = NetworksUci() + networks_settings = networks.get_settings() +@@ -144,6 +150,18 @@ class WanUci: + "qos": qos + } + ++ @staticmethod ++ def _fetch_mac_address(network_data: dict) -> str: ++ """Backward compatible reading of both OpenWrt 19.07 and 21.02 config style. ++ ++ Prefer the new way (21.02) and try that first. ++ """ ++ if section_exists(network_data, "network", "dev_wan"): ++ return get_option_named(network_data, "network", "dev_wan", "macaddr", "") ++ ++ # try to fallback on `inteface 'wan'`, i.e. OpenWrt 19.07 style config syntax ++ return get_option_named(network_data, "network", "wan", "macaddr", "") ++ + def update_settings(self, wan_settings, wan6_settings, mac_settings, qos=None): + with UciBackend() as backend: + # WAN +@@ -301,10 +319,17 @@ class WanUci: + backend.set_option("resolver", "common", "net_ipv6", store_bool(True)) + + # MAC ++ WanUci._migrate_old_config(backend) ++ # create new `device` section in case there is none and wasn't created through migration ++ # TODO: what if there is no 'option device ' set? ++ network_data = backend.read("network") ++ wan_device = get_option_named(network_data, "network", "wan", "device") ++ backend.add_section("network", "device", "dev_wan") ++ backend.set_option("network", "dev_wan", "name", wan_device) + if mac_settings["custom_mac_enabled"]: +- backend.set_option("network", "wan", "macaddr", mac_settings["custom_mac"]) ++ backend.set_option("network", "dev_wan", "macaddr", mac_settings["custom_mac"]) + else: +- backend.del_option("network", "wan", "macaddr", fail_on_error=False) ++ backend.del_option("network", "dev_wan", "macaddr", fail_on_error=False) + + if qos: + network_data = backend.read("network") +@@ -331,6 +356,29 @@ class WanUci: + + return True + ++ @staticmethod ++ def _migrate_old_config(backend: UciBackend) -> None: ++ """Try to migrate device config to OpenWrt 21.02 style config. ++ ++ Create new `device` section for L2 option if needed. ++ """ ++ network_data = backend.read("network") ++ ifname = get_option_named(network_data, "network", "wan", "ifname", "") ++ if not ifname: ++ return ++ ++ backend.del_option("network", "wan", "ifname", fail_on_error=False) ++ backend.set_option("network", "wan", "device", ifname) ++ ++ backend.add_section("network", "device", "dev_wan") ++ backend.set_option("network", "dev_wan", "name", ifname) ++ ++ # move the `macaddr` to correct location ++ macaddr = get_option_named(network_data, "network", "wan", "macaddr", "") ++ if macaddr: ++ backend.del_option("network", "wan", "macaddr", fail_on_error=False) ++ backend.set_option("network", "dev_wan", "macaddr", macaddr) ++ + def update_uncofigured_wan_to_default(self) -> bool: + """ + Updates wan if it was not configured to get IP address via DHCP +-- +2.34.1 + diff --git a/web/foris-controller/foris-forwarder/Makefile b/web/foris-controller/foris-forwarder/Makefile index 44f68a56b9..3cde9089d4 100644 --- a/web/foris-controller/foris-forwarder/Makefile +++ b/web/foris-controller/foris-forwarder/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2020 CZ.NIC, z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2020-2022 CZ.NIC, z.s.p.o. (https://www.nic.cz/) # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-forwarder -PKG_VERSION:=0.2.0 -PKG_RELEASE:=1 +PKG_VERSION:=0.3.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-forwarder.git -PKG_MIRROR_HASH:=ae04e755280406ccc56430225839f9771d2684fb659e9a91a15cee3f86e4a254 +PKG_MIRROR_HASH:=355051e70092f4fbdaef7950f704e94b19b28db752b90c7d2a4037d3fb22767a PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -34,7 +34,6 @@ define Package/foris-forwarder +fosquitto \ +python3-paho-mqtt \ +python3-zeroconf - VARIANT:=python3 endef define Package/foris-forwarder/description diff --git a/web/foris-controller/foris-schema/Makefile b/web/foris-controller/foris-schema/Makefile index abe942076e..a256c4d00d 100644 --- a/web/foris-controller/foris-schema/Makefile +++ b/web/foris-controller/foris-schema/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-schema PKG_VERSION:=0.8.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-schema.git @@ -30,7 +30,6 @@ define Package/foris-schema TITLE:=Foris schema URL:=https://gitlab.nic.cz/turris/foris-controller/foris-schema DEPENDS:=+python3-jsonschema - VARIANT:=python3 endef define Package/foris-schema/description diff --git a/web/foris-controller/foris-ws/Makefile b/web/foris-controller/foris-ws/Makefile index 0523cf08be..40dfa6cb17 100644 --- a/web/foris-controller/foris-ws/Makefile +++ b/web/foris-controller/foris-ws/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=foris-ws -PKG_VERSION:=1.6.1 -PKG_RELEASE:=5 +PKG_VERSION:=1.6.2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris-controller/foris-ws.git -PKG_MIRROR_HASH:=ea9d5c059f0198d34cdde1eda1e4bd4ffd2d0e43e2676c732f65bc0c5ecd2f3f +PKG_MIRROR_HASH:=9ed6c5ce90b0a11bacb9cd57a26a9fcf4ffa768bb4a58f5f221fb3627ea5e1e2 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -37,10 +37,10 @@ define Package/foris-ws +foris-client \ +python3-ubus \ +lighttpd-mod-proxy \ + +turris-auth \ +fosquitto \ +python3-cachelib \ +python3-paho-mqtt - VARIANT:=python3 endef define Package/foris-ws/description @@ -64,7 +64,7 @@ define Py3Package/foris-ws/install $(INSTALL_DIR) $(1)/usr/share/foris-ws/bin/ $(INSTALL_BIN) ./files/socat.sh $(1)/usr/share/foris-ws/bin/socat.sh $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/ - $(INSTALL_DATA) ./files/lighttpd-foris-ws.conf $(1)/etc/lighttpd/conf.d/foris-ws.conf + $(INSTALL_DATA) ./files/lighttpd-foris-ws.conf $(1)/etc/lighttpd/conf.d/70-foris-ws.conf endef define Package/foris-ws/postinst diff --git a/web/foris-controller/foris-ws/files/foris-ws.init b/web/foris-controller/foris-ws/files/foris-ws.init index 91fe462161..321761428e 100755 --- a/web/foris-controller/foris-ws/files/foris-ws.init +++ b/web/foris-controller/foris-ws/files/foris-ws.init @@ -38,7 +38,7 @@ start_service() { config_get mqtt_host mqtt host "localhost" config_get mqtt_port mqtt port "11883" config_get credentials_file mqtt credentials_file "/etc/fosquitto/credentials.plain" - procd_set_param command "$PROG" ${debug_arg:-} -a ubus filesystem --host "127.0.0.1" --port "$port" mqtt --mqtt-host "${mqtt_host}" --mqtt-port "${mqtt_port}" --mqtt-passwd-file "${credentials_file}" + procd_set_param command "$PROG" ${debug_arg:-} -a none --host "127.0.0.1" --port "$port" mqtt --mqtt-host "${mqtt_host}" --mqtt-port "${mqtt_port}" --mqtt-passwd-file "${credentials_file}" procd_set_param respawn procd_close_instance } diff --git a/web/foris-controller/foris-ws/files/lighttpd-foris-ws.conf b/web/foris-controller/foris-ws/files/lighttpd-foris-ws.conf index 65525928a2..e299d90941 100644 --- a/web/foris-controller/foris-ws/files/lighttpd-foris-ws.conf +++ b/web/foris-controller/foris-ws/files/lighttpd-foris-ws.conf @@ -1,4 +1,5 @@ $HTTP["url"] =~ "^/foris-ws$" { + fastcgi.server = ( "/" => ( turris_auth_scriptname => turris_auth )) proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "9080" ) ) ) proxy.header = ( "upgrade" => "enable" ) } diff --git a/web/foris-controller/fosquitto/Makefile b/web/foris-controller/fosquitto/Makefile index 7195a912ce..e6a2a0fcb5 100644 --- a/web/foris-controller/fosquitto/Makefile +++ b/web/foris-controller/fosquitto/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fosquitto -PKG_VERSION:=21 -PKG_RELEASE:=1 +PKG_VERSION:=22.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC diff --git a/web/foris-controller/fosquitto/files/fosquitto.init b/web/foris-controller/fosquitto/files/fosquitto.init index ffaf800cf9..594fd5c848 100644 --- a/web/foris-controller/fosquitto/files/fosquitto.init +++ b/web/foris-controller/fosquitto/files/fosquitto.init @@ -19,6 +19,8 @@ generate_password() { echo "local:${new_password}" > "${PLAIN_PASSWORD}" cp "${PLAIN_PASSWORD}" "${HASHED_PASSWORD}" mosquitto_passwd -U "${HASHED_PASSWORD}" + chown mosquitto "${HASHED_PASSWORDS}" + chown mosquitto "${PLAIN_PASSWORDS}" umask ${stored_umask} # Sync these files just to make sure that content is written to disk. @@ -120,6 +122,16 @@ check_credentials_files() { [ -e "$PLAIN_PASSWORD" -a -e "$HASHED_PASSWORD" ] } +check_credentials_files_owner() { + local hash_owner="$(stat -c '%U' $HASHED_PASSWORD)" + local plain_owner="$(stat -c '%U' $PLAIN_PASSWORD)" + + if [ "$hash_owner" != "mosquitto" -o "$plain_owner" != "mosquitto" ]; then + chown mosquitto "${HASHED_PASSWORD}" + chown mosquitto "${PLAIN_PASSWORD}" + fi +} + start_service() { mkdir -p "/var/etc" generate_config @@ -128,6 +140,10 @@ start_service() { generate_password fi try_chown_dirs + check_credentials_files_owner + + config_get_bool remote_enabled remote enabled "0" + config_get remote_port remote port "11884" procd_open_instance procd_set_param command mosquitto @@ -136,7 +152,12 @@ start_service() { procd_set_param pidfile /var/run/fosquitto.pid procd_set_param stdout 1 # forward stdout of the command to logd procd_set_param stderr 1 # same for stderr - procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-0.2} ${respawn_retry:-25} + procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-2} ${respawn_retry:-25} + if [ "$remote_enabled" = "1" ]; then + if serial_number=$(crypto-wrapper serial-number); then + procd_add_mdns fosquitto tcp "${remote_port}" id=${serial_number} + fi + fi procd_close_instance } diff --git a/web/foris/foris-diagnostics-plugin/Makefile b/web/foris/foris-diagnostics-plugin/Makefile deleted file mode 100644 index 2a694488e4..0000000000 --- a/web/foris/foris-diagnostics-plugin/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -# -# 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 v3. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=foris-diagnostics-plugin -PKG_VERSION:=12.2 -PKG_RELEASE:=2 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris/foris-diagnostics-plugin.git -PKG_MIRROR_HASH:=803dec04355bd8b380c49b1ab3c6d750f3f582cbeb4acbb3b4297076eb7f10ba -PKG_SOURCE_VERSION:=package-v$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=LICENSE - -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=libsass==0.14.5 -PKG_BUILD_DEPENDS:=foris-plugins-distutils/host - -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk -include ../foris/files/foris-translations.mk -include ../foris/files/foris-plugin.mk - -define Package/foris-diagnostics-plugin - SECTION:=web - CATEGORY:=Web - SUBMENU:=Foris - TITLE:=Foris Diagnostics plugin - DEPENDS:= \ - +foris +foris-controller-diagnostics-module - VARIANT:=python3 -endef - -define Package/foris-diagnostics-plugin/description - Foris plugin for generating diagnostics. -endef - -FORIS_TRANSLATIONS:=cs de sk pl fr ru lt hu it nb - -$(eval $(call ForisPlugin,foris-diagnostics-plugin,diagnostics)) -# call BuildPackage <= assures OWR build system that this is package diff --git a/web/foris/foris-netmetr-plugin/Makefile b/web/foris/foris-netmetr-plugin/Makefile deleted file mode 100644 index 326cb9fde4..0000000000 --- a/web/foris/foris-netmetr-plugin/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -# -# 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 v3. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=foris-netmetr-plugin -PKG_VERSION:=4.6.2 -PKG_RELEASE:=2 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris/foris-netmetr-plugin.git -PKG_MIRROR_HASH:=e4e47d79185c805e0e56bfe76c1829f18ce7b6053bf28afe0cf4ce6d24240816 -PKG_SOURCE_VERSION:=package-v$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=LICENSE - -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=libsass==0.14.5 -PKG_BUILD_DEPENDS:=foris-plugins-distutils/host - -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk -include ../foris/files/foris-translations.mk -include ../foris/files/foris-plugin.mk - -define Package/foris-netmetr-plugin - SECTION:=web - CATEGORY:=Web - SUBMENU:=Foris - TITLE:=Foris Netmetr plugin - DEPENDS:= \ - +foris \ - +foris-controller-netmetr-module - VARIANT:=python3 -endef - -define Package/foris-netmetr-plugin/description - Foris plugin for Netmetr. -endef - -FORIS_TRANSLATIONS:=cs it de sk ru pl it hu fr nb - -$(eval $(call ForisPlugin,foris-netmetr-plugin,netmetr)) -# call BuildPackage <= assures OWR build system that this is package diff --git a/web/foris/foris-openvpn-plugin/Makefile b/web/foris/foris-openvpn-plugin/Makefile deleted file mode 100644 index 529eb1bf70..0000000000 --- a/web/foris/foris-openvpn-plugin/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -# -# 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 v3. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=foris-openvpn-plugin -PKG_VERSION:=16.7 -PKG_RELEASE:=2 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris/foris-openvpn-plugin.git -PKG_MIRROR_HASH:=2a3de648cacfccd9a8a59fa6498c86c0d260d72f401ed76d8c96fee95cbef2ee -PKG_SOURCE_VERSION:=package-v$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=LICENSE - -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=libsass==0.14.5 -PKG_BUILD_DEPENDS:=foris-plugins-distutils/host - -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk -include ../foris/files/foris-translations.mk -include ../foris/files/foris-plugin.mk - -define Package/foris-openvpn-plugin - SECTION:=web - CATEGORY:=Web - SUBMENU:=Foris - TITLE:=Foris OpenVPN plugin - DEPENDS:= \ - +foris +foris-controller-openvpn-module - VARIANT:=python3 -endef - -define Package/foris-openvpn-plugin/description - Foris plugin for OpenVPN server configuration. -endef - -FORIS_TRANSLATIONS:=cs de sk pl fr ru hu it nb - -$(eval $(call ForisPlugin,foris-openvpn-plugin,openvpn)) -# call BuildPackage <= assures OWR build system that this is package diff --git a/web/foris/foris-pakon-plugin/Makefile b/web/foris/foris-pakon-plugin/Makefile deleted file mode 100644 index ebe16baa7f..0000000000 --- a/web/foris/foris-pakon-plugin/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright (C) 2018-2019 CZ.NIC z. s. p. o. (https://www.nic.cz/) -# -# This is free software, licensed under the GNU General Public License v3. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=foris-pakon-plugin -PKG_VERSION:=2.6.1 -PKG_RELEASE:=3 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris/foris-pakon-plugin.git -PKG_MIRROR_HASH:=f30177ca0a204927bf1f4ff142fb356c89688668b11709a98ccbffe1e08261eb -PKG_SOURCE_VERSION:=package-v$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=LICENSE - -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=libsass==0.14.5 -PKG_BUILD_DEPENDS:=foris-plugins-distutils/host - -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk -include ../foris/files/foris-translations.mk -include ../foris/files/foris-plugin.mk - -define Package/foris-pakon-plugin - SECTION:=web - CATEGORY:=Web - SUBMENU:=Foris - TITLE:=Fors Pakon plugin - DEPENDS:=\ - +foris +foris-controller-pakon-module - VARIANT:=python3 -endef - -define Package/foris-pakon-plugin/description - Foris plugin for Pakon. -endef - -FORIS_TRANSLATIONS:=cs nb pl sk - -$(eval $(call ForisPlugin,foris-pakon-plugin,pakon)) -# call BuildPackage <= assures OWR build system that this is package diff --git a/web/foris/foris-plugins-distutils/Makefile b/web/foris/foris-plugins-distutils/Makefile deleted file mode 100644 index 3328523908..0000000000 --- a/web/foris/foris-plugins-distutils/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright (C) 2018-2019 CZ.NIC z. s. p. o. (https://www.nic.cz/) -# -# This is free software, licensed under the GNU General Public License v3. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=foris-plugins-distutils -PKG_VERSION:=0.3 -PKG_RELEASE:=3 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris/foris-plugins-distutils -PKG_MIRROR_HASH:=529556a48a07df10b02aced0c8541af85c1c4c0ac0975d9b5eabff7791ef396f -PKG_SOURCE_VERSION:=v$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=LICENSE -PKG_LICENSE_FILES:=GPL-3.0-or-later - -PKG_BUILD_DEPENDS:=python-libsass -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=libsass==0.14.5 -HOST_BUILD_DEPENDS:=python3/host - -include $(INCLUDE_DIR)/host-build.mk -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk - -define Package/foris-plugins-distutils - SECTION:=web - CATEGORY:=Web - SUBMENU:=Foris - TITLE:=Foris Distutils plugins - URL:=https://gitlab.nic.cz/turris/foris/foris-plugins-distutils - DEPENDS:=+python3-light - VARIANT:=python3 -endef - -define Package/foris-plugins-distutils/description - Distutils to build foris plugins. -endef - -define Host/Compile - $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)") -endef - -Host/Install:= - -$(eval $(call HostBuild)) - -$(eval $(call Py3Package,foris-plugins-distutils)) -$(eval $(call BuildPackage,foris-plugins-distutils)) -$(eval $(call BuildPackage,foris-plugins-distutils-src)) diff --git a/web/foris/foris-storage-plugin/Makefile b/web/foris/foris-storage-plugin/Makefile deleted file mode 100644 index ec693b6a03..0000000000 --- a/web/foris/foris-storage-plugin/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright (C) 2018-2021 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:=foris-storage-plugin -PKG_VERSION:=3.0.1 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris/foris-storage-plugin.git -PKG_MIRROR_HASH:=0043d7d553bf605d26595d3fa61570de6dbd3a5bfba57a9102df13ba25ba6463 -PKG_SOURCE_VERSION:=v$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=LICENSE -PKG_LICENSE_FILES:=GPL-3.0-or-later - -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=libsass==0.14.5 -PKG_BUILD_DEPENDS:=foris-plugins-distutils/host - -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk -include ../foris/files/foris-translations.mk -include ../foris/files/foris-plugin.mk - -define Package/foris-storage-plugin - SECTION:=web - CATEGORY:=Web - SUBMENU:=Foris - TITLE:=Foris Storage plugin - DEPENDS:=\ - +foris +foris-controller-storage-module - VARIANT:=python3 -endef - -define Package/foris-storage-plugin/description - Foris plugin for storage management. -endef - -FORIS_TRANSLATIONS:=cs nb pl sk - -$(eval $(call ForisPlugin,foris-storage-plugin,storage)) -# call BuildPackage <= assures OWR build system that this is package diff --git a/web/foris/foris-subordinates-plugin/Makefile b/web/foris/foris-subordinates-plugin/Makefile deleted file mode 100644 index 1ccea87808..0000000000 --- a/web/foris/foris-subordinates-plugin/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright (C) 2019-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:=foris-subordinates-plugin -PKG_VERSION:=0.6 -PKG_RELEASE:=2 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris/foris-subordinates-plugin.git -PKG_MIRROR_HASH:=1d9b457e5a2e17a2c3e0188a62c424193d11bb74f32ca0b6faa44102c26663e3 -PKG_SOURCE_VERSION:=package-v$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=LICENSE -PKG_LICENSE_FILES:=GPL-3.0-or-later - -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=libsass==0.14.5 -PKG_BUILD_DEPENDS:=foris-plugins-distutils/host - -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk -include ../foris/files/foris-translations.mk -include ../foris/files/foris-plugin.mk - -define Package/foris-subordinates-plugin - SECTION:=web - CATEGORY:=Web - SUBMENU:=Foris - TITLE:=Foris Subordinates plugin - DEPENDS:= \ - +foris +foris-controller-netboot-module +foris-controller-subordinates-module - VARIANT:=python3 -endef - -define Package/foris-subordinates-plugin/description - Foris plugin for managing subordinates devices. -endef - -FORIS_TRANSLATIONS:=cs de pl ru sk - -$(eval $(call ForisPlugin,foris-subordinates-plugin,subordinates)) -# call BuildPackage <= assures OWR build system that this is package diff --git a/web/foris/foris/Makefile b/web/foris/foris/Makefile deleted file mode 100644 index 8477f70e26..0000000000 --- a/web/foris/foris/Makefile +++ /dev/null @@ -1,140 +0,0 @@ -# -# Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) -# -# This is free software, licensed under the GNU General Public License v3. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=foris -PKG_VERSION:=101.1.1 -PKG_RELEASE:=5 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/foris/foris.git -PKG_MIRROR_HASH:=d9e8ba96063a32f59eede8daaf46a9dd70c263a6dd0b098356a940696d0b7ef4 -PKG_SOURCE_VERSION:=package-v$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=LICENSE -PKG_LICENSE_FILES:=GPL-3.0-or-later - -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:= \ - pytz==2018.9 \ - Babel==2.6.0 \ - libsass==0.14.5 \ - MarkupSafe==1.1.1 \ - Jinja2==2.10 -PKG_BUILD_DEPENDS:= \ - compass/host \ - ruby-breakpoint/host - -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk -include ./files/foris-translations.mk - -define Package/foris - SECTION:=web - CATEGORY:=Web - SUBMENU:=Foris - TITLE:=Foris - DEPENDS:= \ - +python3-light +python3-bottle +python3-bottle-i18n +python3-setuptools \ - +python3-flup +python3-ubus +python3-jinja2 +lighttpd +lighttpd-mod-fastcgi \ - +lighttpd-mod-redirect +lighttpd-mod-setenv +lighttpd-mod-alias +foris-ws \ - +foris-client +luci +fosquitto +python3-paho-mqtt \ - +crypto-wrapper - VARIANT:=python3 -endef - -define Package/foris/description - Turris Web administration interface. -endef - -define run_foris_makefile - $(call Build/Compile/Default) -endef -Hooks/Compile/Pre += run_foris_makefile - -define Py3Package/foris/filespec -+|$(PYTHON3_PKG_DIR) --|$(PYTHON3_PKG_DIR)/foris/locale/* --|$(PYTHON3_PKG_DIR)/foris/langs/??.py --|$(PYTHON3_PKG_DIR)/foris/langs/??.pyc -endef - -define Py3Package/foris/install - $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ - - $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)/foris/locale - touch $(1)$(PYTHON3_PKG_DIR)/foris/locale/.keep - - $(INSTALL_DIR) $(1)/usr/share/turris-webapps - $(INSTALL_DATA) ./files/00_foris.conf $(1)/usr/share/turris-webapps/ - $(INSTALL_DIR) $(1)/www/webapps-icons - $(INSTALL_DATA) ./files/turris.svg $(1)/www/webapps-icons - - $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/ - $(INSTALL_DATA) ./files/foris-config.lighttpd-conf $(1)/etc/lighttpd/conf.d/foris-config.conf - - $(INSTALL_DIR) $(1)/usr/share/foris - $(INSTALL_BIN) ./files/lighttpd-dynamic-conf $(1)/usr/share/foris/lighttpd-dynamic-conf - $(INSTALL_BIN) ./files/foris-config-cgi $(1)/usr/share/foris/foris-config-cgi - $(SED) 's%/usr/lib/python...%/usr/lib/python$(PYTHON3_VERSION)%g' $(1)/usr/share/foris/lighttpd-dynamic-conf -endef - -define Package/foris/postinst -#!/bin/sh -[ -n "$$IPKG_INSTROOT" ] || { - /etc/init.d/lighttpd enable - /usr/bin/maintain-lighttpd-restart -} -endef - -define Package/foris/prerm -#!/bin/sh -[ -n "$$IPKG_INSTROOT" ] || /usr/bin/maintain-lighttpd-restart -endef - -# $1 = translation name -define ForisTranslation - define Package/foris-l10n-$(1) - TITLE:=foris-l10n-$(1) - DEPENDS:=\ - +foris - MAINTAINER:=CZ.NIC - VARIANT:=python3 - endef - - define Package/foris-l10n-$(1)/install - $(INSTALL_DIR) $$(1)$(PYTHON3_PKG_DIR)/foris/locale/$(1)/LC_MESSAGES - $(CP) \ - $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/foris/locale/$(1)/LC_MESSAGES/*.mo \ - $$(1)$(PYTHON3_PKG_DIR)/foris/locale/$(1)/LC_MESSAGES/ - $(INSTALL_DIR) $$(1)$(PYTHON3_PKG_DIR)/foris/langs/ - $(CP) \ - $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/foris/langs/$(1).py* \ - $$(1)$(PYTHON3_PKG_DIR)/foris/langs/ - endef - - define Package/foris-l10n-$(1)/postrm -#!/bin/sh -[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/lighttpd restart - endef - - define Package/foris-l10n-$(1)/postinst -#!/bin/sh -[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/lighttpd restart - endef - -endef - -$(eval $(call Py3Package,foris)) -$(eval $(call BuildPackage,foris)) -$(eval $(call BuildPackage,foris-src)) - -# Translation definitions -$(foreach trans,$(FORIS_TRANSLATIONS),$(eval $(call ForisTranslation,$(trans)))) -$(foreach trans,$(FORIS_TRANSLATIONS),$(eval $(call BuildPackage,foris-l10n-$(trans)))) diff --git a/web/foris/foris/files/00_foris.conf b/web/foris/foris/files/00_foris.conf deleted file mode 100644 index f9adf921a0..0000000000 --- a/web/foris/foris/files/00_foris.conf +++ /dev/null @@ -1,3 +0,0 @@ -URL="$(uci -q get foris.server.scriptname || echo /foris)/config/" -NAME="Foris - Simple configuration interface for Turris OS" -ICON="turris.svg" diff --git a/web/foris/foris/files/foris-config-cgi b/web/foris/foris/files/foris-config-cgi deleted file mode 100755 index 7500b99801..0000000000 --- a/web/foris/foris/files/foris-config-cgi +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh - -config_load foris -config_get_bool DEBUG server debug "0" -config_get_bool NOAUTH auth noauth "0" -config_get SESSION_TIMEOUT auth session_timeout "" -config_get SCRIPTNAME server scriptname "/foris" -config_get SENTRY_DSN sentry dsn "" - -if [ -n "$SENTRY_DSN" ]; then - export SENTRY_DSN="$SENTRY_DSN" -fi - -EXTRA_FLAGS="" -[ "$DEBUG" = "1" ] && EXTRA_FLAGS="$EXTRA_FLAGS -d" -[ "$NOAUTH" = "1" ] && EXTRA_FLAGS="$EXTRA_FLAGS --noauth" -[ "$SESSION_TIMEOUT" != "" ] && EXTRA_FLAGS="$EXTRA_FLAGS --session-timeout $SESSION_TIMEOUT" - -if [ -z "$SCRIPTNAME" ]; then - export PATH_INFO="/" -fi - -config_load foris-controller -config_get HOST mqtt host "localhost" -config_get PORT mqtt port "11883" -config_get credentials_file mqtt credentials_file "/etc/fosquitto/credentials.plain" -if serial_number=$(crypto-wrapper serial-number); then - controller_id="--mqtt-controller-id $serial_number" -fi - -exec /usr/bin/foris -s cgi $EXTRA_FLAGS -b "$BUS" --mqtt-host "$HOST" --mqtt-port "$PORT" --mqtt-passwd-file "$credentials_file" $controller_id -a config diff --git a/web/foris/foris/files/foris-config.lighttpd-conf b/web/foris/foris/files/foris-config.lighttpd-conf deleted file mode 100644 index adbbe8ee68..0000000000 --- a/web/foris/foris/files/foris-config.lighttpd-conf +++ /dev/null @@ -1,3 +0,0 @@ -# lighttpd include file for Foris - it just calls the script -# that generates lighttpd config from UCI settings -include_shell "sh /usr/share/foris/lighttpd-dynamic-conf config" diff --git a/web/foris/foris/files/foris-plugin.mk b/web/foris/foris/files/foris-plugin.mk deleted file mode 100644 index 6ba3a9405c..0000000000 --- a/web/foris/foris/files/foris-plugin.mk +++ /dev/null @@ -1,78 +0,0 @@ -# $1 = package name -# $2 = plugin name -# $3 = plugin translation name -define ForisPluginTranslation - - define Package/$(1)-l10n-$(3) - SECTION:=web - CATEGORY:=Web - SUBMENU:=Foris - TITLE:=$(1)-l10n-$(3) - DEPENDS:=\ - +foris +foris-l10n-$(3) - MAINTAINER:=CZ.NIC - endef - - define Package/$(1)-l10n-$(3)/install - $(INSTALL_DIR) $$(1)$(PYTHON3_PKG_DIR)/foris_plugins/$(2)/locale/$(3)/LC_MESSAGES - $(CP) \ - $$(PKG_BUILD_DIR)/foris_plugins/$(2)/locale/$(3)/LC_MESSAGES/*.mo \ - $$(1)$(PYTHON3_PKG_DIR)/foris_plugins/$(2)/locale/$(3)/LC_MESSAGES/ - endef - - define Package/$(1)-l10n-$(3)/postrm -#!/bin/sh -[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/lighttpd restart - endef - - define Package/$(1)-l10n-$(3)/postinst -#!/bin/sh -[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/lighttpd restart - endef - - $$(eval $$(call BuildPackage,$(1)-l10n-$(3))) -endef - -# $1 = package name -# $2 = plugin name -define ForisPlugin - - ifndef ForisPlugin/$(1)/install - ForisPlugin/$(1)/install:=: - endif - - define Py3Package/$(1)/filespec -+|$(PYTHON3_PKG_DIR) --|$(PYTHON3_PKG_DIR)/foris_plugins/__init__.py --|$(PYTHON3_PKG_DIR)/foris_plugins/*/locale/ - endef - - define Py3Package/$(1)/install - if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \ - $(INSTALL_DIR) $$(1)/usr/bin ; \ - $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \ - fi - $$(call ForisPlugin/$(1)/install,$$(1)) - endef - - ifndef Package/$(1)/postrm - define Package/$(1)/postrm -#!/bin/sh -[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/lighttpd restart - endef - endif - - ifndef Package/$(1)/postinst - define Package/$(1)/postinst -#!/bin/sh -[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/lighttpd restart - endef - endif - - $$(eval $$(call Py3Package,$(1))) - $$(eval $$(call BuildPackage,$(1))) - $$(eval $$(call BuildPackage,$(1)-src)) - $(foreach trans,$(FORIS_TRANSLATIONS),$(call ForisPluginTranslation,$(1),$(2),$(trans))) - -endef - diff --git a/web/foris/foris/files/foris-root.lighttpd-conf b/web/foris/foris/files/foris-root.lighttpd-conf deleted file mode 100644 index 81ccd1df78..0000000000 --- a/web/foris/foris/files/foris-root.lighttpd-conf +++ /dev/null @@ -1,3 +0,0 @@ -# Make sure that wirzard passes during a migration from older image -url.redirect += ( "^/wizard/.*$" => "/foris/config/" ) -url.redirect += ( "^/foris/wizard/.*$" => "/foris/config/" ) diff --git a/web/foris/foris/files/foris-translations.mk b/web/foris/foris/files/foris-translations.mk deleted file mode 100644 index cdbffbd959..0000000000 --- a/web/foris/foris/files/foris-translations.mk +++ /dev/null @@ -1 +0,0 @@ -FORIS_TRANSLATIONS:=cs de sk pl fr ru lt da it hu nb diff --git a/web/foris/foris/files/foris.jpg b/web/foris/foris/files/foris.jpg deleted file mode 100644 index e0b8e88ca1..0000000000 Binary files a/web/foris/foris/files/foris.jpg and /dev/null differ diff --git a/web/foris/foris/files/foris.wrapper b/web/foris/foris/files/foris.wrapper deleted file mode 100644 index 10b3370940..0000000000 --- a/web/foris/foris/files/foris.wrapper +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python - -from foris.__main__ import main -main() diff --git a/web/foris/foris/files/lighttpd-dynamic-conf b/web/foris/foris/files/lighttpd-dynamic-conf deleted file mode 100644 index 8439589f81..0000000000 --- a/web/foris/foris/files/lighttpd-dynamic-conf +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh - -config_load foris -config_get SCRIPTNAME server scriptname "/foris" -config_get_bool DEBUG server debug "0" -config_get_bool NOAUTH auth noauth "0" -config_get SESSION_TIMEOUT auth session_timeout "" -config_get SERVER server server "flup" -config_get SENTRY_DSN sentry dsn "" - -APP="$1" - -# scriptname must not contain escape codes (avoid CRLF injection in sed later) -# and for the sake of UX, trailing and leading slashes are trimmed -SCRIPTNAME=$(echo "$SCRIPTNAME" | sed -e 's;\\;\\\\;g' | sed -e 's;/*$;;g' | sed -e 's;^/*;;g' | sed -e 's;/+;/;g') -[ "$SCRIPTNAME" != "" ] && SCRIPTNAME="/$SCRIPTNAME" - -EXTRA_FLAGS="" -[ "$DEBUG" = "1" ] && EXTRA_FLAGS="$EXTRA_FLAGS -d" -[ "$NOAUTH" = "1" ] && EXTRA_FLAGS="$EXTRA_FLAGS --noauth" -[ "$SESSION_TIMEOUT" != "" ] && EXTRA_FLAGS="$EXTRA_FLAGS --session-timeout $SESSION_TIMEOUT" -EXTRA_FLAGS="$EXTRA_FLAGS -s $SERVER" - -FORIS_PATHS="" -tmp_out=$(eval /usr/bin/foris -R $EXTRA_FLAGS -a $APP) -for path in $tmp_out; do - FORIS_PATHS="$FORIS_PATHS|${path:1}" # remove first '/' character -done - -# get bus config -config_load foris-controller -config_get BUS_HOST mqtt host "localhost" -config_get BUS_PORT mqtt port "11883" -config_get CREDENTIALS_FILE mqtt credentials_file "/etc/fosquitto/credentials.plain" -if serial_number=$(crypto-wrapper serial-number); then - CONTROLLER_ID=" --mqtt-controller-id $serial_number" -fi - -echo "var.foris-$APP.bin = \"/usr/bin/foris\"" -echo "var.foris-$APP.cgi = \"/usr/share/foris/foris-$APP-cgi\"" -echo "var.foris-$APP.scriptname = \"$SCRIPTNAME/$APP\"" -echo "var.foris-$APP.flags = \"$EXTRA_FLAGS -a $APP -b mqtt --mqtt-host $BUS_HOST --mqtt-port $BUS_PORT --mqtt-passwd-file ${CREDENTIALS_FILE}${CONTROLLER_ID}\"" -echo "var.foris-$APP.paths = \"$FORIS_PATHS\"" -echo -echo "\$HTTP[\"url\"] =~ \"^\" + var.foris-$APP.scriptname + \"/(\" + var.foris-$APP.paths + \")$\" {" -echo " server.max-read-idle = 90" -case $SERVER in - flup) - echo ' fastcgi.debug = 0' - echo ' fastcgi.server = (' - echo " var.foris-$APP.scriptname => (" - echo ' "python-fcgi" => (' - echo " \"socket\" => \"/tmp/fastcgi.foris-$APP.socket\"," - echo " \"bin-path\" => var.foris-$APP.bin + var.foris-$APP.flags," - echo ' "check-local" => "disable",' - echo ' "idle-timeout" => 180,' - echo ' "min-procs" => 0,' - echo ' "max-procs" => 1,' -if [ -n "$SENTRY_DSN" ]; then - echo ' "bin-environment" => (' - echo " \"SENTRY_DSN\" => \"$SENTRY_DSN\"," - - echo ' ),' -fi - echo ' )' - echo ' )' - echo ' )' - ;; - cgi) - echo " alias.url = ( var.foris-$APP.scriptname => var.foris-$APP.cgi )" - echo ' cgi.assign = ( "" => "" )' - ;; -esac -echo "}" - - -PLUGINS_DIR=/usr/lib/pythonX.X/site-packages/foris_plugins/ - -for PLUGIN_PATH in $PLUGINS_DIR/*; do - PLUGIN_NAME=$(basename $PLUGIN_PATH) - [ -d "$PLUGIN_PATH/static" ] && { - echo "alias.url += ( var.foris-$APP.scriptname + \"/static/plugins/$PLUGIN_NAME/\" => \"$PLUGIN_PATH/static/\" )" - } -done - -echo "alias.url += ( var.foris-$APP.scriptname + \"/static/generated/\" => \"/tmp/.foris_workdir/dynamic_assets/$APP/\" )" -echo "alias.url += ( var.foris-$APP.scriptname + \"/static/\" => \"/usr/lib/pythonX.X/site-packages/foris/static/\" )" diff --git a/web/foris/foris/files/turris.svg b/web/foris/foris/files/turris.svg deleted file mode 100644 index 047b5a4bda..0000000000 --- a/web/foris/foris/files/turris.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/web/luci-app-rainbow/Makefile b/web/luci-app-rainbow/Makefile index 275c6bb49a..f53353afa1 100644 --- a/web/luci-app-rainbow/Makefile +++ b/web/luci-app-rainbow/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-rainbow -PKG_VERSION:=2.1 -PKG_RELEASE:=4 +PKG_VERSION:=2.2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/luci-rainbow.git -PKG_MIRROR_HASH:=f9a8ec872bf5159ace837d44928285eebca443f27cafd926b929c26bdc6f851c -PKG_SOURCE_VERSION:=7f11144cd32ad8c0c96cf2b69910ba63b3ef7d63 +PKG_MIRROR_HASH:=f397a4af621739f3cc9ad3195b3d5207211567cc213cdefdefe8c9d9a0fa1a3c +PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC diff --git a/web/luci-app-rainbow/patches/0001-Translate-new-colors.patch b/web/luci-app-rainbow/patches/0001-Translate-new-colors.patch new file mode 100644 index 0000000000..7e3071dc27 --- /dev/null +++ b/web/luci-app-rainbow/patches/0001-Translate-new-colors.patch @@ -0,0 +1,30 @@ +From e4fc2b5e01eb19cbf4025d18a0345b90490ee564 Mon Sep 17 00:00:00 2001 +From: Michal Vasilek +Date: Mon, 17 Oct 2022 15:14:50 +0200 +Subject: [PATCH] Translate new colors + +4f87f1e471d71b53249304cc14261a9bef0d4312 and a4639b35137c7461e08b3a1544b26727e5c0eeb7 +added new colors, but didn't translate them to Czech +--- + rainbow.po | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/rainbow.po b/rainbow.po +index 46dbfeb..af3b3a9 100644 +--- a/rainbow.po ++++ b/rainbow.po +@@ -55,3 +55,11 @@ msgstr "Nástroj Rainbow umožňuje ovládání LED diod routeru Omnia." + msgid "White %s" + msgstr "Bílá %s" + ++msgid "Cyan %s" ++msgstr "Tyrkysová %s" ++ ++msgid "Magenta %s" ++msgstr "Purpurová %s" ++ ++msgid "Yellow %s" ++msgstr "Žlutá %s" +-- +2.38.0 + diff --git a/web/reforis/reforis-data-collection-plugin/Makefile b/web/reforis/reforis-data-collection-plugin/Makefile index 22a3bc3e3c..5bdf59d85b 100644 --- a/web/reforis/reforis-data-collection-plugin/Makefile +++ b/web/reforis/reforis-data-collection-plugin/Makefile @@ -8,21 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-data-collection-plugin -PKG_VERSION:=0.3.2 -PKG_RELEASE:=1 +PKG_VERSION:=0.4.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-data-collection -PKG_MIRROR_HASH:=c66c95b4d533aa00e200000ddcac6732eac4e63996703bd9d1f6e7a2811fc942 +PKG_MIRROR_HASH:=65e1012ac13f097f208b119387bb10b229488120883dc99e024e287e6fa7fb20 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -38,7 +37,6 @@ define Package/reforis-data-collection-plugin DEPENDS:=\ +reforis \ +foris-controller-sentinel-module - VARIANT:=python3 endef define Package/reforis-data-collection-plugin/description diff --git a/web/reforis/reforis-diagnostics-plugin/Makefile b/web/reforis/reforis-diagnostics-plugin/Makefile index a3a833cbf2..424014633b 100644 --- a/web/reforis/reforis-diagnostics-plugin/Makefile +++ b/web/reforis/reforis-diagnostics-plugin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-diagnostics-plugin PKG_VERSION:=2.5.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-diagnostics @@ -20,9 +20,8 @@ PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -38,7 +37,6 @@ define Package/reforis-diagnostics-plugin DEPENDS:= \ +reforis \ +foris-controller-diagnostics-module - VARIANT:=python3 endef define Package/reforis-diagnostics-plugin/description diff --git a/web/reforis/reforis-distutils/Makefile b/web/reforis/reforis-distutils/Makefile deleted file mode 100644 index 6701f518e7..0000000000 --- a/web/reforis/reforis-distutils/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# -# Copyright (C) 2018-2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) -# -# This is free software, licensed under the GNU General Public License v3. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=reforis-distutils -PKG_VERSION:=0.1.0 -PKG_RELEASE:=3 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-distutils.git -PKG_MIRROR_HASH:=1bd8b65a9528bbdaac356c618577fde46f6cb62d83cdce3f160e9372413b9c50 -PKG_SOURCE_VERSION:=v$(PKG_VERSION) - -PKG_MAINTAINER:=CZ.NIC -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=LICENSE - -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:= \ - Babel \ - -HOST_BUILD_DEPENDS:= \ - python3/host \ - node/host \ - -include $(INCLUDE_DIR)/host-build.mk -include $(INCLUDE_DIR)/package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk - -define Package/reforis-distutils - SECTION:=web - CATEGORY:=Web - SUBMENU:=reForis - TITLE:=reForis distutils - URL:=https://gitlab.nic.cz/turris/reforis/reforis-distutils - DEPENDS:=\ - +python3-light \ - +python3-babel - VARIANT:=python3 -endef - -define Package/reforis-distutils/description - Distutils to build reforis and its plugins. -endef - -define Host/Compile - $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)") -endef - -Host/Install:= - -$(eval $(call HostBuild)) - -$(eval $(call Py3Package,reforis-distutils)) -$(eval $(call BuildPackage,reforis-distutils)) -$(eval $(call BuildPackage,reforis-distutils-src)) diff --git a/web/reforis/reforis-haas-plugin/Makefile b/web/reforis/reforis-haas-plugin/Makefile index 8e08720f08..cd541aae06 100644 --- a/web/reforis/reforis-haas-plugin/Makefile +++ b/web/reforis/reforis-haas-plugin/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2020-2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2020-2022 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. @@ -8,21 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-haas-plugin -PKG_VERSION:=0.1.3 -PKG_RELEASE:=1 +PKG_VERSION:=0.1.4 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-haas -PKG_MIRROR_HASH:=c27d45f42744953eb006c0860540ee13fd13698652b7f97ff75e331766ad1273 +PKG_MIRROR_HASH:=95a619f32c1c0bdf3ab9697907a41d917858cf299df9bed26075890814a8ade5 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -39,7 +38,6 @@ define Package/reforis-haas-plugin +reforis \ +reforis-data-collection-plugin \ +foris-controller-haas-module - VARIANT:=python3 endef define Package/reforis-haas-plugin/description diff --git a/web/reforis/reforis-netboot-plugin/Makefile b/web/reforis/reforis-netboot-plugin/Makefile index b97d7a3b18..1d0797e5e5 100644 --- a/web/reforis/reforis-netboot-plugin/Makefile +++ b/web/reforis/reforis-netboot-plugin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-netboot-plugin PKG_VERSION:=0.4.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-netboot @@ -20,9 +20,8 @@ PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -39,7 +38,6 @@ define Package/reforis-netboot-plugin +reforis \ +reforis-remote-devices-plugin \ +foris-controller-netboot-module - VARIANT:=python3 endef define Package/reforis-netboot-plugin/description diff --git a/web/reforis/reforis-netmetr-plugin/Makefile b/web/reforis/reforis-netmetr-plugin/Makefile index d5f7cb13ce..48ec8f566e 100644 --- a/web/reforis/reforis-netmetr-plugin/Makefile +++ b/web/reforis/reforis-netmetr-plugin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-netmetr-plugin PKG_VERSION:=0.3.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-netmetr @@ -20,9 +20,8 @@ PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -38,7 +37,6 @@ define Package/reforis-netmetr-plugin DEPENDS:=\ +reforis \ +foris-controller-netmetr-module - VARIANT:=python3 endef define Package/reforis-netmetr-plugin/description diff --git a/web/reforis/reforis-nextcloud-plugin/Makefile b/web/reforis/reforis-nextcloud-plugin/Makefile new file mode 100644 index 0000000000..d677b14693 --- /dev/null +++ b/web/reforis/reforis-nextcloud-plugin/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2022 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:=reforis-nextcloud-plugin +PKG_VERSION:=0.0.1 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-nextcloud +PKG_MIRROR_HASH:=331eec475d06e73f69dd16a522fa5d5e88641083deb7845b8b7fc70d924ce650 +PKG_SOURCE_VERSION:=v$(PKG_VERSION) + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=LICENSE + +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host + +include $(INCLUDE_DIR)/package.mk +include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk +include ../reforis/files/reforis-plugin.mk +include ../reforis/files/reforis-translations.mk + +define Package/reforis-nextcloud-plugin + SECTION:=web + CATEGORY:=Web + SUBMENU:=reForis + TITLE:=reForis Nextcloud plugin + URL:=https://gitlab.nic.cz/turris/reforis/reforis-nextcloud + DEPENDS:=\ + +reforis \ + +foris-controller-nextcloud-module +endef + +define Package/reforis-nextcloud-plugin/description + reForis Nextcloud plugin +endef + +REFORIS_TRANSLATIONS:=cs + +$(eval $(call ReForisPlugin,reforis-nextcloud-plugin,reforis_nextcloud)) +# call BuildPackage <= assures OWR build system that this is package diff --git a/web/reforis/reforis-openvpn-plugin/Makefile b/web/reforis/reforis-openvpn-plugin/Makefile index 28a0e8166f..d3fcb128f1 100644 --- a/web/reforis/reforis-openvpn-plugin/Makefile +++ b/web/reforis/reforis-openvpn-plugin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-openvpn-plugin PKG_VERSION:=1.5.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-openvpn @@ -20,9 +20,8 @@ PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -39,7 +38,6 @@ define Package/reforis-openvpn-plugin +reforis \ +foris-controller-openvpn-module \ +foris-controller-openvpn_client-module - VARIANT:=python3 endef define Package/reforis-openvpn-plugin/description diff --git a/web/reforis/reforis-remote-access-plugin/Makefile b/web/reforis/reforis-remote-access-plugin/Makefile index 52c25acd7a..9672df1e4a 100644 --- a/web/reforis/reforis-remote-access-plugin/Makefile +++ b/web/reforis/reforis-remote-access-plugin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-remote-access-plugin PKG_VERSION:=1.3.0 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-remote-access @@ -20,9 +20,8 @@ PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -37,7 +36,6 @@ define Package/reforis-remote-access-plugin URL:=https://gitlab.nic.cz/turris/reforis/reforis-remote-access DEPENDS:=\ +reforis - VARIANT:=python3 endef define Package/reforis-remote-access-plugin/description diff --git a/web/reforis/reforis-remote-devices-plugin/Makefile b/web/reforis/reforis-remote-devices-plugin/Makefile index f8696d0f37..bfcfc87f60 100644 --- a/web/reforis/reforis-remote-devices-plugin/Makefile +++ b/web/reforis/reforis-remote-devices-plugin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-remote-devices-plugin PKG_VERSION:=1.4.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-remote-devices @@ -20,9 +20,8 @@ PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -38,7 +37,6 @@ define Package/reforis-remote-devices-plugin DEPENDS:= \ +reforis \ +foris-controller-subordinates-module - VARIANT:=python3 endef define Package/reforis-remote-devices-plugin/description diff --git a/web/reforis/reforis-remote-wifi-settings-plugin/Makefile b/web/reforis/reforis-remote-wifi-settings-plugin/Makefile index 99c6ff2ed6..597f395a43 100644 --- a/web/reforis/reforis-remote-wifi-settings-plugin/Makefile +++ b/web/reforis/reforis-remote-wifi-settings-plugin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-remote-wifi-settings-plugin PKG_VERSION:=0.2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-remote-wifi-settings @@ -20,9 +20,8 @@ PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -39,7 +38,6 @@ define Package/reforis-remote-wifi-settings-plugin +reforis \ +reforis-remote-devices-plugin \ +foris-controller-subordinates-module - VARIANT:=python3 endef define Package/reforis-remote-wifi-settings-plugin/description diff --git a/web/reforis/reforis-snapshots-plugin/Makefile b/web/reforis/reforis-snapshots-plugin/Makefile index 565001f978..6e9d9ada4b 100644 --- a/web/reforis/reforis-snapshots-plugin/Makefile +++ b/web/reforis/reforis-snapshots-plugin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-snapshots-plugin PKG_VERSION:=1.2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-snapshots @@ -20,9 +20,8 @@ PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -38,7 +37,6 @@ define Package/reforis-snapshots-plugin DEPENDS:=\ +reforis \ +foris-controller-schnapps-module - VARIANT:=python3 endef define Package/reforis-netboot-plugin/description diff --git a/web/reforis/reforis-storage-plugin/Makefile b/web/reforis/reforis-storage-plugin/Makefile index 5a084278af..35b280cc64 100644 --- a/web/reforis/reforis-storage-plugin/Makefile +++ b/web/reforis/reforis-storage-plugin/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis-storage-plugin PKG_VERSION:=0.2.2 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis-storage @@ -20,9 +20,8 @@ PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -38,7 +37,6 @@ define Package/reforis-storage-plugin DEPENDS:=\ +reforis \ +foris-controller-storage-module - VARIANT:=python3 endef define Package/reforis-storage-plugin/description diff --git a/web/reforis/reforis/Makefile b/web/reforis/reforis/Makefile index ca4853a26f..ef1a6a0989 100644 --- a/web/reforis/reforis/Makefile +++ b/web/reforis/reforis/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,21 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=reforis -PKG_VERSION:=1.1.2 -PKG_RELEASE:=1 +PKG_VERSION:=1.3.1 +PKG_RELEASE:=$(AUTORELEASE).1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/reforis/reforis -PKG_MIRROR_HASH:=03d835b3863051777b5a6e5437b87ff9bb51d14b4b18402af7d062b5a70b0a26 +PKG_MIRROR_HASH:=8e40eb6bf00d443e3d679822da70b8334f328d3e9bbe919e416f7a8c8a786588 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=\ - node/host \ - reforis-distutils/host \ +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=reforis-distutils +PKG_BUILD_DEPENDS:=node/host include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk @@ -45,15 +44,14 @@ define Package/reforis +lighttpd-mod-fastcgi \ +lighttpd-mod-redirect \ +lighttpd-mod-setenv \ + +turris-auth \ +python3-flask \ +python3-flask-babel \ +python3-flask-seasurf \ +python3-flup \ +python3-light \ +python3-paho-mqtt \ - +python3-simplejson \ +turris-maintain - VARIANT:=python3 endef define Package/reforis/description @@ -80,7 +78,7 @@ define Py3Package/reforis/install $(INSTALL_DATA) ./files/reforis.svg $(1)/www/webapps-icons/ $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/ - $(INSTALL_DATA) ./files/reforis-lighttpd.conf $(1)/etc/lighttpd/conf.d/reforis.conf + $(INSTALL_DATA) ./files/reforis-lighttpd.conf $(1)/etc/lighttpd/conf.d/80-reforis.conf $(INSTALL_DIR) $(1)/usr/libexec/reforis $(INSTALL_BIN) ./files/reforis-lighttpd-dynamic.sh $(1)/usr/libexec/reforis/lighttpd-dynamic diff --git a/web/reforis/reforis/files/reforis-lighttpd-dynamic.sh b/web/reforis/reforis/files/reforis-lighttpd-dynamic.sh index 25c754a696..053e8cd31c 100644 --- a/web/reforis/reforis/files/reforis-lighttpd-dynamic.sh +++ b/web/reforis/reforis/files/reforis-lighttpd-dynamic.sh @@ -7,7 +7,6 @@ config_get SCRIPTNAME server scriptname "/reforis" # config_get_bool DEBUG server debug "0" # config_get_bool NOAUTH auth noauth "0" config_get SESSION_TIMEOUT auth session_timeout "" -config_get SERVER server server "flup" config_get SENTRY_DSN sentry dsn "" # scriptname must not contain escape codes (avoid CRLF injection in sed later) @@ -23,39 +22,35 @@ config_get CREDENTIALS_FILE mqtt credentials_file "/etc/fosquitto/credentials.pl CONTROLLER_ID=$(crypto-wrapper serial-number) echo "var.reforis.bin = \"/usr/bin/reforis\"" -echo "var.reforis.scriptname = \"/reforis\"" +echo "var.reforis.scriptname = \"$SCRIPTNAME\"" echo -echo "\$HTTP[\"url\"] =~ \"^\" + var.reforis.scriptname + \"/(.*)$\" {" +echo "\$HTTP[\"url\"] =~ \"^\" + var.reforis.scriptname + \"/\" {" +echo " \$HTTP[\"url\"] =~ \"^\" + var.reforis.scriptname + \"/static/\" {" +echo " alias.url += ( var.reforis.scriptname + \"/static/\" => \"/usr/lib/pythonX.X/site-packages/reforis_static/\" )" +echo " } else {" echo " server.max-read-idle = 90" -case $SERVER in - flup) - echo ' fastcgi.debug = 0' - echo ' fastcgi.server = (' - echo " var.reforis.scriptname => (" - echo ' "python-fcgi" => (' - echo " \"socket\" => \"/tmp/fastcgi.reforis.socket\"," - echo " \"bin-path\" => var.reforis.bin," - echo ' "check-local" => "disable",' - echo ' "idle-timeout" => 180,' - echo ' "min-procs" => 0,' - echo ' "max-procs" => 1,' - echo ' "bin-environment" => (' +echo ' fastcgi.debug = 0' +echo ' fastcgi.server = (' +echo " var.reforis.scriptname => (" +echo ' "python-fcgi" => (' +echo " \"socket\" => \"/tmp/fastcgi.reforis.socket\"," +echo " \"bin-path\" => var.reforis.bin," +echo ' "check-local" => "disable",' +echo ' "idle-timeout" => 180,' +echo ' "min-procs" => 0,' +echo ' "max-procs" => 1,' +echo ' "bin-environment" => (' if [ -n "$SENTRY_DSN" ]; then - echo " \"SENTRY_DSN\" => \"$SENTRY_DSN\"," + echo " \"SENTRY_DSN\" => \"$SENTRY_DSN\"," fi - echo " \"CONTROLLER_ID\" => \"$CONTROLLER_ID\"," - echo ' ),' - echo ' )' - echo ' )' - echo ' )' - ;; - cgi) - echo " alias.url = ( var.reforis.scriptname => var.reforis.cgi )" - echo ' cgi.assign = ( "" => "" )' - ;; -esac +echo " \"CONTROLLER_ID\" => \"$CONTROLLER_ID\"," +echo ' ),' +echo ' ),' +echo ' turris_auth_scriptname => turris_auth' +echo ' )' +echo ')' +echo " }" echo "}" -echo "alias.url += ( var.reforis.scriptname + \"/static/\" => \"/usr/lib/pythonX.X/site-packages/reforis_static/\" )" diff --git a/web/reforis/reforis/files/reforis-translations.mk b/web/reforis/reforis/files/reforis-translations.mk index f8cc9a4920..1ae98366f0 100644 --- a/web/reforis/reforis/files/reforis-translations.mk +++ b/web/reforis/reforis/files/reforis-translations.mk @@ -1,4 +1,4 @@ -REFORIS_TRANSLATIONS:=cs da de el en es fi fo fr hr hu it ja ko lt nb_NO nl pl ro ru sk sv +REFORIS_TRANSLATIONS:=cs da de el es fi fo fr hr hu it ja ko lt nb_NO nl pl ro ru sk sv # $1 = translation name define ReForisTranslation diff --git a/web/reforis/reforis/patches/allow-to-get-through-Interfaces-WAN-tab-without-WS.patch b/web/reforis/reforis/patches/allow-to-get-through-Interfaces-WAN-tab-without-WS.patch new file mode 100644 index 0000000000..7be2e94b66 --- /dev/null +++ b/web/reforis/reforis/patches/allow-to-get-through-Interfaces-WAN-tab-without-WS.patch @@ -0,0 +1,74 @@ +From 9794b67edd3486e8ec081ca3367facbf14275ffc Mon Sep 17 00:00:00 2001 +From: Aleksandr Gumroian +Date: Wed, 10 Aug 2022 14:36:59 +0200 +Subject: [PATCH] Allow to get through Interfaces & WAN tab without WS + +For now, there is a bug in Chromium-based browsers +that fails on HTTPS + WSS connection for no reason: +https://bugs.chromium.org/p/chromium/issues/detail?id=1346579. + +This fix will allow users to get through the onboarding wizard. +--- + js/src/interfaces/Interfaces.js | 8 +++++++- + js/src/wan/WAN.js | 8 +++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/js/src/interfaces/Interfaces.js b/js/src/interfaces/Interfaces.js +index 863d56fa..2a1616b7 100644 +--- a/js/src/interfaces/Interfaces.js ++++ b/js/src/interfaces/Interfaces.js +@@ -19,9 +19,14 @@ import "./Interfaces.css"; + + Interfaces.propTypes = { + ws: PropTypes.object.isRequired, ++ postCallback: PropTypes.func, + }; + +-export default function Interfaces({ ws }) { ++Interfaces.defaultProps = { ++ postCallback: () => undefined, ++}; ++ ++export default function Interfaces({ ws, postCallback }) { + return ( + <> +

{_("Network Interfaces")}

+@@ -36,6 +41,7 @@ export default function Interfaces({ ws }) { + endpoint: API_URLs.interfaces, + wsModule: "networks", + }} ++ postCallback={postCallback} + prepDataToSubmit={prepDataToSubmit} + validator={validateInterfaces} + > +diff --git a/js/src/wan/WAN.js b/js/src/wan/WAN.js +index 4321d6b7..3e2dadd6 100644 +--- a/js/src/wan/WAN.js ++++ b/js/src/wan/WAN.js +@@ -20,9 +20,14 @@ import WANForm, { validateWANForm } from "./WANForm"; + + WAN.propTypes = { + ws: PropTypes.object.isRequired, ++ postCallback: PropTypes.func, + }; + +-export default function WAN({ ws }) { ++WAN.defaultProps = { ++ postCallback: () => undefined, ++}; ++ ++export default function WAN({ ws, postCallback }) { + return ( + <> +

{_("WAN")}

+@@ -40,6 +45,7 @@ export default function WAN({ ws }) { + prepData={prepData} + prepDataToSubmit={prepDataToSubmit} + validator={validator} ++ postCallback={postCallback} + > + + +-- +2.34.1 + diff --git a/web/turris-auth/Makefile b/web/turris-auth/Makefile new file mode 100644 index 0000000000..6abad29fa2 --- /dev/null +++ b/web/turris-auth/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2021-2022 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:=turris-auth +PKG_VERSION:=0.4.2 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/turris-auth.git +PKG_MIRROR_HASH:=2372e48bb38b86b6ae1860d335f31257727b402cd11462351bdbb3573b9aa7da +PKG_SOURCE_VERSION:=v$(PKG_VERSION) + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING + +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=MarkupSafe + +include $(INCLUDE_DIR)/package.mk +include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk + +define Package/turris-auth + SECTION:=web + CATEGORY:=Web + TITLE:=Turris Authentication + URL:=https://gitlab.nic.cz/turris/turris-auth + DEPENDS:=\ + +lighttpd-mod-fastcgi \ + +lighttpd-mod-alias \ + +turris-bootstrap-theme \ + +python3-pbkdf2 \ + +python3-flup \ + +python3-jinja2 \ + +python3-uci +endef + +define Package/turris-auth/description + Turris Authentication for web applications. This is login gateway that can be + optionally added to any web application. +endef + +define Py3Package/turris-auth/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d + $(INSTALL_CONF) ./files/lighttpd.conf $(1)/etc/lighttpd/conf.d/50-turris-auth.conf + $(INSTALL_DIR) $(1)/etc/config + touch $(1)/etc/config/turris-auth +endef + +define Package/turris-auth/conffiles +/etc/config/turris-auth +endef + +define Package/turris-auth/postinst +#!/bin/sh +[ -n "$$IPKG_INSTROOT" ] || /etc/init.d/lighttpd restart +endef + +$(eval $(call Py3Package,turris-auth)) +$(eval $(call BuildPackage,turris-auth)) +$(eval $(call BuildPackage,turris-auth-src)) diff --git a/web/turris-auth/files/lighttpd.conf b/web/turris-auth/files/lighttpd.conf new file mode 100644 index 0000000000..1c1d32f8e4 --- /dev/null +++ b/web/turris-auth/files/lighttpd.conf @@ -0,0 +1 @@ +include_shell "turris-auth-server --lighttpd-config --luci-login" diff --git a/web/turris-bootstrap-theme/Makefile b/web/turris-bootstrap-theme/Makefile new file mode 100644 index 0000000000..62f9ab286e --- /dev/null +++ b/web/turris-bootstrap-theme/Makefile @@ -0,0 +1,51 @@ +# +## Copyright (C) 2021-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# +## This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=turris-bootstrap-theme +PKG_VERSION:=0.3.2 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/bootstrap-theme.git +PKG_MIRROR_HASH:=8efd99ba9fd7010b4c915d929816dee885a9c7041e15eb81d73a417387609633 +PKG_SOURCE_VERSION:=v$(PKG_VERSION) + +PKG_MAINTAINER:=CZ.NIC +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/turris-bootstrap-theme + SECTION:=web + CATEGORY:=Web + TITLE:=Turris Bootstrap Theme + DEPENDS:=+lighttpd +lighttpd-mod-alias +endef + +define Package/turris-bootstrap-theme/description + Common Turris-specific bootstrap theme. +endef + +Build/Compile:=: + +define Package/turris-bootstrap-theme/install + $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d + $(INSTALL_CONF) ./files/lighttpd.conf $(1)/etc/lighttpd/conf.d/70-theme.conf + + $(INSTALL_DIR) $(1)/www/turris-theme + $(MAKE) -C $(PKG_BUILD_DIR) install NO_BUILD=y INSTALL_DIR=$(1)/www/turris-theme +endef + +define Package/turris-bootstrap-theme/postinst +#!/bin/sh +[ -n "$$IPKG_INSTROOT" ] || /etc/init.d/lighttpd restart +endef + +$(eval $(call BuildPackage,turris-bootstrap-theme)) diff --git a/web/turris-bootstrap-theme/files/lighttpd.conf b/web/turris-bootstrap-theme/files/lighttpd.conf new file mode 100644 index 0000000000..12fc6771c8 --- /dev/null +++ b/web/turris-bootstrap-theme/files/lighttpd.conf @@ -0,0 +1,3 @@ +alias.url += ( + "/turris-theme" => "/www/turris-theme" +) diff --git a/web/turris-translations/Makefile b/web/turris-translations/Makefile index 830253edb0..7cd935321f 100644 --- a/web/turris-translations/Makefile +++ b/web/turris-translations/Makefile @@ -1,5 +1,5 @@ # -## Copyright (C) 2018-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) +## Copyright (C) 2018-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/) # ## This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-translations -PKG_VERSION:=1.4.1 -PKG_RELEASE:=1 +PKG_VERSION:=1.6.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/turris-translations.git -PKG_MIRROR_HASH:=d16b8581d8b6a7ae9b9761c63a94147a4edd8c1e350c6560adddef23002fe623 +PKG_MIRROR_HASH:=a843ca2a1ca4b43e065848aa7d92e6b2865e42fe0c000b0bdf5e49267f5b499c PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -46,5 +46,5 @@ define TRANSLATION $$(foreach LANG,$(2),$$(eval $$(call TRANSLATION_LANG,$(1),$$(LANG)))) endef -$(eval $(call TRANSLATION,pkglists,cs da de el es fi fo fr hr hu it ja ko lt nb nl pl ro ru sk sv)) -$(eval $(call TRANSLATION,user-notify,cs da de el es fi fo fr hr hu it ja ko lt nb nl pl ro ru sk sv)) +$(eval $(call TRANSLATION,pkglists,cs da de el es fi fo fr hr hu it ja ko lt nb_NO nl pl ro ru sk sv)) +$(eval $(call TRANSLATION,user-notify,cs da de el es fi fo fr hr hu it ja ko lt nb_NO nl pl ro ru sk sv tr)) diff --git a/web/turris-webapps/turris-webapps-luci/Makefile b/web/turris-webapps/turris-webapps-luci/Makefile index 5a849c88bb..0a46cc95bf 100644 --- a/web/turris-webapps/turris-webapps-luci/Makefile +++ b/web/turris-webapps/turris-webapps-luci/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2020-2022 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. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-webapps-luci PKG_VERSION:=1.1 -PKG_RELEASE:=1 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later @@ -22,7 +22,7 @@ define Package/turris-webapps-luci SUBMENU:=WebApps TITLE:=LuCI integration DEPENDS:=+luci-base \ - +turris-webapps + +turris-webapps +lighttpd-mod-setenv PROVIDES:=luci-lighttpd URL:=https://gitlab.nic.cz/turris/webapps endef @@ -36,7 +36,7 @@ endef define Package/turris-webapps-luci/install $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d - $(CP) ./files/luci.lighttpd $(1)/etc/lighttpd/conf.d/luci.conf + $(CP) ./files/luci.lighttpd $(1)/etc/lighttpd/conf.d/80-luci.conf $(INSTALL_DIR) $(1)/www/webapps-icons $(CP) ./files/luci.svg $(1)/www/webapps-icons/luci.svg $(INSTALL_DIR) $(1)/usr/share/turris-webapps diff --git a/web/turris-webapps/turris-webapps-netdata/Makefile b/web/turris-webapps/turris-webapps-netdata/Makefile index 80073017ba..7910a9dbcb 100644 --- a/web/turris-webapps/turris-webapps-netdata/Makefile +++ b/web/turris-webapps/turris-webapps-netdata/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2020-2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2020-2022 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. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-webapps-netdata PKG_VERSION:=1.1 -PKG_RELEASE:=2 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later @@ -23,8 +23,9 @@ define Package/turris-webapps-netdata TITLE:=Netdata integration DEPENDS:=+netdata \ +turris-webapps \ - +lighttpd-mod-authn_pam +lighttpd-mod-auth +lighttpd-mod-authn_file \ - +lighttpd-mod-proxy + +turris-auth \ + +lighttpd-mod-proxy \ + +lighttpd-mod-setenv URL:=https://gitlab.nic.cz/turris/webapps endef @@ -33,12 +34,11 @@ define Package/turris-webapps-netdata/description See https://www.netdata.cloud/ endef -define Build/Compile -endef +Build/Compile:=: define Package/turris-webapps-netdata/install $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d - $(CP) ./files/netdata.lighttpd $(1)/etc/lighttpd/conf.d/netdata.conf + $(CP) ./files/netdata.lighttpd $(1)/etc/lighttpd/conf.d/80-netdata.conf $(INSTALL_DIR) $(1)/www/webapps-icons $(CP) ./files/netdata.svg $(1)/www/webapps-icons/netdata.svg $(INSTALL_DIR) $(1)/usr/share/turris-webapps diff --git a/web/turris-webapps/turris-webapps-netdata/files/netdata.lighttpd b/web/turris-webapps/turris-webapps-netdata/files/netdata.lighttpd index 348f52f9b4..7aa5c7231b 100644 --- a/web/turris-webapps/turris-webapps-netdata/files/netdata.lighttpd +++ b/web/turris-webapps/turris-webapps-netdata/files/netdata.lighttpd @@ -1,21 +1,12 @@ -server.modules += ( "mod_proxy" ) -server.modules += ( "mod_authn_pam", "mod_auth" ) - $HTTP["url"] =~ "^/netdata/" { - auth.backend = "pam" - auth.require = ( "" => - ( - "method" => "basic", - "realm" => "Netdata", - "require" => "valid-user" - ) - ) + fastcgi.server = ( "/" => ( turris_auth_scriptname => turris_auth )) proxy.header = ( "map-host-request" => ( "-" => "127.0.0.1" ), "map-urlpath" => ( "/netdata" => "", "/netdata/" => "/" ), "https-remap" => "enable" ) proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "19999") ) ) + setenv.add-response-header = ("Cache-Control" => "must-revalidate, proxy-revalidate, max-age=0") } $HTTP["url"] =~ "^/netdata$" { diff --git a/web/turris-webapps/turris-webapps-nextcloud/Makefile b/web/turris-webapps/turris-webapps-nextcloud/Makefile index 4a274842b9..7e9f43f9ee 100644 --- a/web/turris-webapps/turris-webapps-nextcloud/Makefile +++ b/web/turris-webapps/turris-webapps-nextcloud/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-webapps-nextcloud PKG_VERSION:=1.0 -PKG_RELEASE:=4 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later diff --git a/web/turris-webapps/turris-webapps-nextcloud/files/30_nextcloud.json b/web/turris-webapps/turris-webapps-nextcloud/files/30_nextcloud.json index db30683fa3..abe33bbe94 100644 --- a/web/turris-webapps/turris-webapps-nextcloud/files/30_nextcloud.json +++ b/web/turris-webapps/turris-webapps-nextcloud/files/30_nextcloud.json @@ -1,6 +1,6 @@ { "id": "nextcloud", - "title": "nextcloud", + "title": "Nextcloud", "url": "/nextcloud", "icon": "/icons/nextcloud.svg", "description": { diff --git a/web/turris-webapps/turris-webapps-transmission/Makefile b/web/turris-webapps/turris-webapps-transmission/Makefile index ca66f78cf8..7db49123ab 100644 --- a/web/turris-webapps/turris-webapps-transmission/Makefile +++ b/web/turris-webapps/turris-webapps-transmission/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2020-2022 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. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-webapps-transmission PKG_VERSION:=1.0 -PKG_RELEASE:=5 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later @@ -23,7 +23,7 @@ define Package/turris-webapps-transmission TITLE:=Transmission integration DEPENDS:=+transmission-daemon +transmission-web \ +turris-webapps \ - +lighttpd-mod-authn_pam +lighttpd-mod-auth +lighttpd-mod-authn_file + +lighttpd-mod-authn_pam +lighttpd-mod-proxy URL:=https://gitlab.nic.cz/turris/webapps endef @@ -43,7 +43,7 @@ define Package/turris-webapps-transmission/install $(INSTALL_DATA) ./files/transmission.svg $(1)/www/webapps-icons $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d - $(CP) ./files/transmission.lighttpd $(1)/etc/lighttpd/conf.d/transmission.conf + $(CP) ./files/transmission.lighttpd $(1)/etc/lighttpd/conf.d/80-transmission.conf endef $(eval $(call BuildPackage,turris-webapps-transmission)) diff --git a/web/turris-webapps/turris-webapps-transmission/files/transmission.lighttpd b/web/turris-webapps/turris-webapps-transmission/files/transmission.lighttpd index 474fe3ce36..247a756990 100644 --- a/web/turris-webapps/turris-webapps-transmission/files/transmission.lighttpd +++ b/web/turris-webapps/turris-webapps-transmission/files/transmission.lighttpd @@ -1,6 +1,3 @@ -server.modules += ( "mod_proxy" ) -server.modules += ( "mod_authn_pam", "mod_auth" ) - $HTTP["url"] =~ "^/transmission" { auth.backend = "pam" auth.require = ( "" => diff --git a/web/turris-webapps/turris-webapps-tvheadend/Makefile b/web/turris-webapps/turris-webapps-tvheadend/Makefile index ff70421fc9..48f71f3733 100644 --- a/web/turris-webapps/turris-webapps-tvheadend/Makefile +++ b/web/turris-webapps/turris-webapps-tvheadend/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2020 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2020-2022 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. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-webapps-tvheadend PKG_VERSION:=1.0 -PKG_RELEASE:=4 +PKG_RELEASE:=$(AUTORELEASE) PKG_MAINTAINER:=CZ.NIC PKG_LICENSE:=GPL-3.0-or-later @@ -22,7 +22,8 @@ define Package/turris-webapps-tvheadend SUBMENU:=WebApps TITLE:=Tvheadend integration DEPENDS:=+tvheadend \ - +turris-webapps + +turris-webapps \ + +lighttpd-mod-proxy URL:=https://gitlab.nic.cz/turris/webapps endef @@ -42,7 +43,7 @@ define Package/turris-webapps-tvheadend/install $(INSTALL_DATA) ./files/tvheadend.svg $(1)/www/webapps-icons $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d - $(CP) ./files/tvheadend.lighttpd $(1)/etc/lighttpd/conf.d/tvheadend.conf + $(CP) ./files/tvheadend.lighttpd $(1)/etc/lighttpd/conf.d/80-tvheadend.conf endef $(eval $(call BuildPackage,turris-webapps-tvheadend)) diff --git a/web/turris-webapps/turris-webapps-tvheadend/files/tvheadend.lighttpd b/web/turris-webapps/turris-webapps-tvheadend/files/tvheadend.lighttpd index 89778136a4..bd98f32425 100644 --- a/web/turris-webapps/turris-webapps-tvheadend/files/tvheadend.lighttpd +++ b/web/turris-webapps/turris-webapps-tvheadend/files/tvheadend.lighttpd @@ -1,5 +1,3 @@ -server.modules += ( "mod_proxy" ) - $HTTP["url"] =~ "^/tvheadend" { proxy.header = ( "map-host-request" => ( "-" => "127.0.0.1" ), diff --git a/web/turris-webapps/turris-webapps/Makefile b/web/turris-webapps/turris-webapps/Makefile index a34df79c23..424b460f89 100644 --- a/web/turris-webapps/turris-webapps/Makefile +++ b/web/turris-webapps/turris-webapps/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2018-2021 CZ.NIC z.s.p.o. (https://www.nic.cz/) +# Copyright (C) 2018-2022 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. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=turris-webapps -PKG_VERSION:=3.7 -PKG_RELEASE:=1 +PKG_VERSION:=3.7.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/webapps -PKG_MIRROR_HASH:=07b77160d251e4f0fecf3b41988ac949720e5f3e1894052559c7defaff6f5bcd +PKG_MIRROR_HASH:=67e355dd98edd09df77dfc7c2c41655e0d6b40e89c364ac861d108b2d6b287f6 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=CZ.NIC @@ -26,7 +26,7 @@ define Package/turris-webapps CATEGORY:=Web SUBMENU:=WebApps TITLE:=Turris WebApps - DEPENDS:=+lighttpd +lighttpd-mod-alias +lighttpd-mod-cgi + DEPENDS:=+lighttpd +lighttpd-mod-alias +lighttpd-mod-cgi +lighttpd-mod-setenv URL:=https://gitlab.nic.cz/turris/webapps endef @@ -38,7 +38,7 @@ Build/Compile:=: define Package/turris-webapps/install $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d/ - $(INSTALL_DATA) $(PKG_BUILD_DIR)/turris-root.conf $(1)/etc/lighttpd/conf.d/turris-root.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/turris-root.conf $(1)/etc/lighttpd/conf.d/90-turris-root.conf $(INSTALL_DIR) $(1)/usr/share/turris-webapps $(INSTALL_BIN) $(PKG_BUILD_DIR)/turris-webapps-json-cgi $(1)/usr/share/turris-webapps