From 4e890599a5235a87f627d22ee2f528ae0560f2ae Mon Sep 17 00:00:00 2001 From: "javier.jorge" Date: Fri, 25 Aug 2023 10:51:29 -0300 Subject: [PATCH 1/2] Add new reference state data types to shared state --- .../shared-state-reference-state/Makefile | 38 +++++++++++++++++++ ...ared-state-reference_state_nodes_info_cron | 10 +++++ ...state-reference_state_wifi_links_info_cron | 10 +++++ 3 files changed, 58 insertions(+) create mode 100644 packages/shared-state-reference-state/Makefile create mode 100755 packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_nodes_info_cron create mode 100644 packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_wifi_links_info_cron diff --git a/packages/shared-state-reference-state/Makefile b/packages/shared-state-reference-state/Makefile new file mode 100644 index 000000000..9bf405a33 --- /dev/null +++ b/packages/shared-state-reference-state/Makefile @@ -0,0 +1,38 @@ +# +# Copyright (C) 2019 Gioacchino Mazzurco +# Copyright (C) 2023 Javier Jorge +# +# This is free software, licensed under the GNU Affero General Public License v3. +# + +include $(TOPDIR)/rules.mk + +GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) +GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) + +PKG_NAME:=shared-state-wifi_links_info +PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + TITLE:=Reference state datatypes module for shared-state + CATEGORY:=LibreMesh + URL:=http://libremesh.org + DEPENDS:= shared-state + PKGARCH:=all +endef + +define Package/$(PKG_NAME)/description + Syncronize Reference state datatypes using shared state multiwriter. +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/ + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_nodes_info_cron b/packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_nodes_info_cron new file mode 100755 index 000000000..5cba2a6fa --- /dev/null +++ b/packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_nodes_info_cron @@ -0,0 +1,10 @@ +#!/bin/sh + +unique_append() +{ + grep -qF "$1" "$2" || echo "$1" >> "$2" +} + +unique_append \ + '*/5 * * * * ((sleep $(($RANDOM % 120)); shared-state-multiwriter sync reference_state_nodes_info &> /dev/null)&)'\ + /etc/crontabs/root diff --git a/packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_wifi_links_info_cron b/packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_wifi_links_info_cron new file mode 100644 index 000000000..d71d2b4c5 --- /dev/null +++ b/packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_wifi_links_info_cron @@ -0,0 +1,10 @@ +#!/bin/sh + +unique_append() +{ + grep -qF "$1" "$2" || echo "$1" >> "$2" +} + +unique_append \ + '*/5 * * * * ((sleep $(($RANDOM % 120)); shared-state-multiwriter sync reference_state_wifi_links_info &> /dev/null)&)'\ + /etc/crontabs/root From b8450d6f9084cda03c56b51e68bd489d4cc2fe96 Mon Sep 17 00:00:00 2001 From: Javier Jorge Date: Mon, 28 Aug 2023 12:29:52 -0300 Subject: [PATCH 2/2] relocation of limeapp sepecific datatypes sinc script --- ...ared-state-reference_state_nodes_info_cron | 0 ...state-reference_state_wifi_links_info_cron | 0 .../shared-state-reference-state/Makefile | 38 ------------------- 3 files changed, 38 deletions(-) rename packages/{shared-state-reference-state => lime-app}/files/etc/uci-defaults/shared-state-reference_state_nodes_info_cron (100%) rename packages/{shared-state-reference-state => lime-app}/files/etc/uci-defaults/shared-state-reference_state_wifi_links_info_cron (100%) delete mode 100644 packages/shared-state-reference-state/Makefile diff --git a/packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_nodes_info_cron b/packages/lime-app/files/etc/uci-defaults/shared-state-reference_state_nodes_info_cron similarity index 100% rename from packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_nodes_info_cron rename to packages/lime-app/files/etc/uci-defaults/shared-state-reference_state_nodes_info_cron diff --git a/packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_wifi_links_info_cron b/packages/lime-app/files/etc/uci-defaults/shared-state-reference_state_wifi_links_info_cron similarity index 100% rename from packages/shared-state-reference-state/files/etc/uci-defaults/shared-state-reference_state_wifi_links_info_cron rename to packages/lime-app/files/etc/uci-defaults/shared-state-reference_state_wifi_links_info_cron diff --git a/packages/shared-state-reference-state/Makefile b/packages/shared-state-reference-state/Makefile deleted file mode 100644 index 9bf405a33..000000000 --- a/packages/shared-state-reference-state/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# -# Copyright (C) 2019 Gioacchino Mazzurco -# Copyright (C) 2023 Javier Jorge -# -# This is free software, licensed under the GNU Affero General Public License v3. -# - -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-wifi_links_info -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk - -define Package/$(PKG_NAME) - TITLE:=Reference state datatypes module for shared-state - CATEGORY:=LibreMesh - URL:=http://libremesh.org - DEPENDS:= shared-state - PKGARCH:=all -endef - -define Package/$(PKG_NAME)/description - Syncronize Reference state datatypes using shared state multiwriter. -endef - -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,$(PKG_NAME)))