Skip to content

Commit

Permalink
Merge branch 'libremesh:master' into lime_curtigghio
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbrk authored Jan 5, 2025
2 parents b8dc52f + 7345673 commit 7da529d
Show file tree
Hide file tree
Showing 99 changed files with 1,336 additions and 448 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
- uses: actions/checkout@v2

- name: Build packages
uses: openwrt/gh-action-sdk@v5
uses: openwrt/gh-action-sdk@v7
env:
ARCH: "x86_64"
ARCH: "x86_64-openwrt-23.05"
FEEDNAME: "libremesh"
IGNORE_ERRORS: "n m y"
KEY_BUILD: "${{ secrets.KEY_BUILD }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/multi-arch-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Build packages ${{ matrix.arch }}
uses: openwrt/gh-action-sdk@v7
env:
ARCH: "${{ matrix.arch }}"
ARCH: "${{ matrix.arch }}-openwrt-23.05"
FEEDNAME: "libremesh"
IGNORE_ERRORS: "n m y"
KEY_BUILD: "${{ secrets.KEY_BUILD }}"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ build
luacov.stats.out
tools/ansible/files/generic-rootfs.tar.gz
tools/ansible/files/ramfs.bzImage

deploy-pirania.sh
updatepkg.sh
# Vim text editor swap files
**/*~

Expand Down
87 changes: 86 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,89 @@
All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
Logs are shown from newest to oldest.

## Unreleased: branch master (2024-12-07)
https://github.com/libremesh/lime-packages/compare/v2024.1-rc1...master

### Full changelog since 2024.1-rc1

- [`35471b0`](https://github.com/libremesh/lime-packages/commit/35471b0f046132e1848836521900e74f1ed7d9e5)
New full documentation for shared-state
(merge [#1142](https://github.com/libremesh/lime-packages/pull/1142),
fix [#492](https://github.com/libremesh/lime-packages/issues/492))
- [`0878431`](https://github.com/libremesh/lime-packages/commit/08784318f4e9fd4269675bd9dbc8ebf6962ce5da)
fixed typo ubus-lime-groundrouting in lime-app's Makefile
(merge [#1141](https://github.com/libremesh/lime-packages/pull/1141))
- [`4781491`](https://github.com/libremesh/lime-packages/commit/4781491d2cad47177229291f838f776cec1af5cd)
fix: ci build packages failed
(merge [#1140](https://github.com/libremesh/lime-packages/pull/1140))
- [`06609f6`](https://github.com/libremesh/lime-packages/commit/06609f685af2fbf14e6366cce12ce7af27202b9d)
Pirania New Release - Issue/1077
(merge [#1133](https://github.com/libremesh/lime-packages/pull/1133))
- [`08a3948`](https://github.com/libremesh/lime-packages/commit/08a3948a5a80f6e26318c96227e02466bd09345e)
Ensure that wan interface gets configured on DSA devices, where wan could be the name of the interface
(merge [#1131](https://github.com/libremesh/lime-packages/pull/1131))
- [`527c1eb`](https://github.com/libremesh/lime-packages/commit/527c1ebc44dcd3bd6edf44087ca645e5989aedeb)
Shared-state mesh information packages async implmentation and reference state
(merge [#1112](https://github.com/libremesh/lime-packages/pull/1112))
- [`a3d751c`](https://github.com/libremesh/lime-packages/commit/a3d751c1d3a5842b2104ef9b801c5d47e46440b0)
Stop using random-numgen, not needed in recent OpenWrt
(merge [#1117](https://github.com/libremesh/lime-packages/pull/1117),
fix [#800](https://github.com/libremesh/lime-packages/issues/800) [#1075](https://github.com/libremesh/lime-packages/issues/1075))
- [`4bdd010`](https://github.com/libremesh/lime-packages/commit/4bdd010ef8d7182467bb86035e83f922b70d83d5)
readme: added network-profiles repository to ImageBuilder instructions
(merge [#1113](https://github.com/libremesh/lime-packages/pull/1113))
- [`3ef0a4a`](https://github.com/libremesh/lime-packages/commit/3ef0a4ac2988a6013ed7b7364ff9c94d9c910367)
Readme: update OpenWrt version in Docker instructions
(merge [#1116](https://github.com/libremesh/lime-packages/pull/1116))
- [`070d518`](https://github.com/libremesh/lime-packages/commit/070d5182b184702030335f17125cf5b18389df34)
lime-example: specify that the gateway line in the static proto is optional
(merge [#1114](https://github.com/libremesh/lime-packages/pull/1114))
- [`88b4fdd`](https://github.com/libremesh/lime-packages/commit/88b4fdde3e758fafd26bbc60f06a8a63b83b4bdb)
shared-state-async bump for late bleach fixup
(merge [#1111](https://github.com/libremesh/lime-packages/pull/1111))
- [`cc6af11`](https://github.com/libremesh/lime-packages/commit/cc6af1119bd72d9eea91845046d5aafc1d6b716d)
shared-state-async: expose publish all
(merge [#1108](https://github.com/libremesh/lime-packages/pull/1108))
- [`58bbd4d`](https://github.com/libremesh/lime-packages/commit/58bbd4debaa9dd9f3e2e42b1196348c207f97e7c)
fix broken profiles
(merge [#1115](https://github.com/libremesh/lime-packages/pull/1115))
- [`727af91`](https://github.com/libremesh/lime-packages/commit/727af91f23d7fb8d7a598605f2b6e012c0b11c2d)
Shared state async intial publish
(merge [#1104](https://github.com/libremesh/lime-packages/pull/1104))
- [`f326ad8`](https://github.com/libremesh/lime-packages/commit/f326ad84cddda7f399145e790676e94e2e2fbc32)
A few cleanups to packages
(merge [#1097](https://github.com/libremesh/lime-packages/pull/1097))
- [`70b08a6`](https://github.com/libremesh/lime-packages/commit/70b08a691c860b55f47f4c0913fa2b472b0d99b5)
safe-upgrade: update calibration data partition name
(merge [#1098](https://github.com/libremesh/lime-packages/pull/1098))
- [`75f5d50`](https://github.com/libremesh/lime-packages/commit/75f5d508e8308e1ae7a8af047276600e94ded1d1)
Adds shared-state rpcd data,error output format and shared-state-async rpcd reimplementation
(merge [#1103](https://github.com/libremesh/lime-packages/pull/1103))


## Unreleased: branch 2024.1 (2024-12-07)
These merge requests with different hashes were also ported from branch master to 2024.1
https://github.com/libremesh/lime-packages/compare/v2024.1-rc1...2024.1

- [`06609f6`](https://github.com/libremesh/lime-packages/commit/06609f685af2fbf14e6366cce12ce7af27202b9d)
Pirania New Release - Issue/1077
(merge [#1133](https://github.com/libremesh/lime-packages/pull/1133))
- [`08a3948`](https://github.com/libremesh/lime-packages/commit/08a3948a5a80f6e26318c96227e02466bd09345e)
Ensure that wan interface gets configured on DSA devices, where wan could be the name of the interface
(merge [#1131](https://github.com/libremesh/lime-packages/pull/1131))
- [`a3d751c`](https://github.com/libremesh/lime-packages/commit/a3d751c1d3a5842b2104ef9b801c5d47e46440b0)
Stop using random-numgen, not needed in recent OpenWrt
(merge [#1117](https://github.com/libremesh/lime-packages/pull/1117),
fix [#800](https://github.com/libremesh/lime-packages/issues/800) [#1075](https://github.com/libremesh/lime-packages/issues/1075))
- [`88b4fdd`](https://github.com/libremesh/lime-packages/commit/88b4fdde3e758fafd26bbc60f06a8a63b83b4bdb)
shared-state-async bump for late bleach fixup
(merge [#1111](https://github.com/libremesh/lime-packages/pull/1111))
- [`f326ad8`](https://github.com/libremesh/lime-packages/commit/f326ad84cddda7f399145e790676e94e2e2fbc32)
A few cleanups to packages
(merge [#1097](https://github.com/libremesh/lime-packages/pull/1097))
- [`58bbd4d`](https://github.com/libremesh/lime-packages/commit/58bbd4debaa9dd9f3e2e42b1196348c207f97e7c)
fix broken profiles
(merge [#1115](https://github.com/libremesh/lime-packages/pull/1115))

## 2024.1-rc1 - Release candidate 1 (2024-04-03)

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Start an ImageBuilder of your choice, for example ath79-generic if your device i

```shell
mkdir ./images/
docker run -it -v $(pwd)/images:/images/ ghcr.io/openwrt/imagebuilder:ath79-generic-v22.03.5
docker run -it -v $(pwd)/images:/images/ ghcr.io/openwrt/imagebuilder:ath79-generic-v23.05.3
```

If your device is not part of ath79-generic profiles, you can replace it with another <target>-<subtarget> combination. For knowing which target and subtarget is best suited for your router, check out the page about it in the [OpenWrt's Table of Hardware][OpenWrt-ToH].
Expand All @@ -65,6 +65,7 @@ Within the container, add the `lime-packages` feeds:

```shell
echo "src/gz libremesh https://feed.libremesh.org/master" >> repositories.conf
echo "src/gz libremesh_profiles https://feed.libremesh.org/profiles" >> repositories.conf
echo "src/gz libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/mips_24kc" >> repositories.conf
echo "untrusted comment: signed by libremesh.org key a71b3c8285abd28b" > keys/a71b3c8285abd28b
echo "RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" >> keys/a71b3c8285abd28b
Expand Down Expand Up @@ -95,6 +96,7 @@ Go to <https://firmware-selector.openwrt.org/>. Find your device. Click on the f

```shell
echo "src/gz libremesh https://feed.libremesh.org/master" >> repositories.conf
echo "src/gz libremesh_profiles https://feed.libremesh.org/profiles" >> repositories.conf
echo "src/gz libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/mips_24kc" >> repositories.conf
echo "untrusted comment: signed by libremesh.org key a71b3c8285abd28b" > keys/a71b3c8285abd28b
echo "RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" >> keys/a71b3c8285abd28b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bw_test() {
while [ -z "$bw" -a $try -lt $TRIES ]; do
test=$({ wget -T5 -q $1 -O- | pv -n -b -t >/dev/null; } 2>&1)
bw=$(echo $test | awk '{printf "%.0f",$NF/$(NF-1)*8}')
try=$(($try+1))
try=$((try+1))
done
echo $bw
}
Expand Down
2 changes: 1 addition & 1 deletion packages/check-date-http/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Gioacchino Mazzurco <[email protected]>
URL:=http://libremesh.org
DEPENDS:=+libuci-lua +lua +random-numgen \
DEPENDS:=+libuci-lua +lua \
+luci-lib-httpclient
PKGARCH:=all
endef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'*/20 * * * * ((sleep $(($(random-numgen) % 600)); check-date-http &> /dev/null)&)'\
'*/20 * * * * ((sleep $((RANDOM % 600)); check-date-http &> /dev/null)&)'\
/etc/crontabs/root
3 changes: 0 additions & 3 deletions packages/deferable-reboot/files/etc/config/deferable-reboot

This file was deleted.

10 changes: 0 additions & 10 deletions packages/deferable-reboot/files/usr/bin/deferable-reboot

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ 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:=deferable-reboot
PKG_NAME:=deferrable-reboot
PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP)

include $(INCLUDE_DIR)/package.mk

define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
TITLE:=$(PKG_NAME) provides a deferable reboot.
TITLE:=$(PKG_NAME) provides a deferrable reboot.
MAINTAINER:=Santiago Piccinini <[email protected]>
DEPENDS:=+lua +lime-system
PKGARCH:=all
endef

define Package/$(PKG_NAME)/description
This $(PKG_NAME) provides a deferable reboot mechanism. The system
This $(PKG_NAME) provides a deferrable reboot mechanism. The system
will be rebooted when the uptime of the system reach a specified amount
of seconds and if /tmp/deferable-reboot.defer file does not contain a
of seconds and if /tmp/deferrable-reboot.defer file does not contain a
number that is greater than the current uptime.
This way if anyone wants to postpone the reboot, the way is to store the
next checkpoint in seconds. For example if the system must not reboot from
now and up to 120 seconds in the future then something like this can be donde
awk '{print $1 + 120}' /proc/uptime > /tmp/deferable-reboot.defer
awk '{print $1 + 120}' /proc/uptime > /tmp/deferrable-reboot.defer
endef

define Build/Configure
Expand Down
3 changes: 3 additions & 0 deletions packages/deferrable-reboot/files/etc/config/deferrable-reboot
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config deferrable-reboot 'options'
#option deferrable_reboot_uptime '97200'

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

unique_append()
{
grep -qF "$1" "$2" || echo "$1" >> "$2"
}

unique_append \
"*/3 * * * * ((sleep $((RANDOM % 120)); /usr/bin/deferable-reboot-check )&)" /etc/crontabs/root

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'*/1 * * * * ((deferable-reboot &> /dev/null)&)'\
'*/1 * * * * ((deferrable-reboot &> /dev/null)&)'\
/etc/crontabs/root
10 changes: 10 additions & 0 deletions packages/deferrable-reboot/files/usr/bin/deferrable-reboot
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/lua

local defreboot = require 'deferrable_reboot'

defreboot.config()

if defreboot.should_reboot() then
os.execute('logger -t deferrable-reboot -p ALERT Rebooting in 30 seconds!')
defreboot.reboot()
end
17 changes: 17 additions & 0 deletions packages/deferrable-reboot/files/usr/bin/deferrable-reboot-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

uci_config_path="lime-autogen.system.deferrable_reboot_ping_target"
target=$(uci -q get $uci_config_path &> /dev/null)

if [ -n "$target" ]; then
if ping -c 10 -W 10 $target; then
action=defer
fi
else
echo "deferrable-reboot: Could not get the ping target from UCI $uci_config_path, deferring anyway"
action=defer
fi

if [ "$action" == "defer" ]; then
awk '{print $1 + 1800}' /proc/uptime > /tmp/deferrable-reboot.defer
fi
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ local defreboot = {}
defreboot.DEFAULT_REBOOT_UPTIME = 60*60*27
defreboot.SLEEP_BEFORE_REBOOT_S = 30

defreboot.POSTPONE_FILE_PATH = '/tmp/deferable-reboot.defer'
defreboot.POSTPONE_FILE_PATH = '/tmp/deferrable-reboot.defer'

function defreboot.config(min_uptime)
if min_uptime == nil then
local uci = config.get_uci_cursor()
local lime_min_uptime = config.get("system", "deferable_reboot_uptime_s", false)
local general_min_uptime = uci:get("deferable-reboot", "options", "deferable_reboot_uptime_s")
local lime_min_uptime = config.get("system", "deferrable_reboot_uptime_s", false)
local general_min_uptime = uci:get("deferrable-reboot", "options", "deferrable_reboot_uptime_s")
min_uptime = tonumber(lime_min_uptime or general_min_uptime or defreboot.DEFAULT_REBOOT_UPTIME)
end
assert(type(min_uptime) == "number", "min_uptime must be a number")
Expand All @@ -39,7 +39,7 @@ end


--! use this function to postpone the reboot, also the following command can be used
--! replacing SECONDS: # awk '{print $1 + SECONDS}' /proc/uptime > /tmp/deferable-reboot.defer
--! replacing SECONDS: # awk '{print $1 + SECONDS}' /proc/uptime > /tmp/deferrable-reboot.defer
function defreboot.read_postpone_file()
local f = io.open(defreboot.POSTPONE_FILE_PATH)
if f ~= nil then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
local config = require "lime.config"
local test_utils = require 'tests.utils'
local defreboot = require 'deferable_reboot'
local defreboot = require 'deferrable_reboot'

local uci = nil

describe('Deferable Reboot tests #defreboot', function()
describe('Deferrable Reboot tests #defreboot', function()

it('test load config from lime.config default value', function()
defreboot.config()
Expand All @@ -13,25 +13,25 @@ describe('Deferable Reboot tests #defreboot', function()

it('test load config from lime.config', function()
config.set('system', 'lime')
config.set('system', 'deferable_reboot_uptime_s', '120')
config.set('system', 'deferrable_reboot_uptime_s', '120')
defreboot.config()
assert.is.equal(120, defreboot.min_uptime)
end)

it('test load config from config/deferable-reboot', function()
uci:set('deferable-reboot', 'options', 'deferable-reboot')
uci:set('deferable-reboot', 'options', 'deferable_reboot_uptime_s', '99')
uci:commit('deferable-reboot')
it('test load config from config/deferrable-reboot', function()
uci:set('deferrable-reboot', 'options', 'deferrable-reboot')
uci:set('deferrable-reboot', 'options', 'deferrable_reboot_uptime_s', '99')
uci:commit('deferrable-reboot')
defreboot.config()
assert.is.equal(99, defreboot.min_uptime)
end)

it('test lime.config has precedence over config/deferable-reboot ', function()
it('test lime.config has precedence over config/deferrable-reboot ', function()
config.set('system', 'lime')
config.set('system', 'deferable_reboot_uptime_s', '120')
uci:set('deferable-reboot', 'options', 'deferable-reboot')
uci:set('deferable-reboot', 'options', 'deferable_reboot_uptime_s', '99')
uci:commit('deferable-reboot')
config.set('system', 'deferrable_reboot_uptime_s', '120')
uci:set('deferrable-reboot', 'options', 'deferrable-reboot')
uci:set('deferrable-reboot', 'options', 'deferrable_reboot_uptime_s', '99')
uci:commit('deferrable-reboot')
defreboot.config()
assert.is.equal(120, defreboot.min_uptime)
end)
Expand Down
2 changes: 1 addition & 1 deletion packages/eupgrade/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=$(PKG_NAME) provides semi automated firmware upgrades
MAINTAINER:=Santiago Piccinini <[email protected]>
DEPENDS:=+lua +lime-system +luci-lib-jsonc +luci-lib-nixio +libubus-lua +libuci-lua +random-numgen
DEPENDS:=+lua +lime-system +luci-lib-jsonc +luci-lib-nixio +libubus-lua +libuci-lua
PKGARCH:=all
endef

Expand Down
2 changes: 1 addition & 1 deletion packages/eupgrade/files/etc/uci-defaults/99-eupgrades-cron
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ unique_append()
}

unique_append \
'0 */6 * * * ((sleep $(($(random-numgen) % 120)); eupgrade-check &> /dev/null)&)'\
'0 */6 * * * ((sleep $((RANDOM % 120)); eupgrade-check &> /dev/null)&)'\
/etc/crontabs/root
2 changes: 1 addition & 1 deletion packages/hotplug-initd-services/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
MAINTAINER:=Gioacchino Mazzurco <[email protected]>
URL:=http://libremesh.org
DEPENDS:=+libubox-lua +libubus-lua +random-numgen \
DEPENDS:=+libubox-lua +libubus-lua \
+lua +luci-lib-nixio
PKGARCH:=all
endef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local function notifyHooks(evData, evName)
for hook in fs.dir(hooksDir) do
os.execute(
string.format( 'ACTION="%s" SERVICE="%s" %s/%s',
evName, evData.service, hooksDir, hook ) )
evName, evData.service or '', hooksDir, hook ) )
end
end

Expand Down
2 changes: 1 addition & 1 deletion packages/lime-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define Package/$(PKG_NAME)
URL:=http://github.com/libremesh/lime-app
DEPENDS:=+rpcd +uhttpd +uhttpd-mod-ubus +uhttpd-mod-lua \
+ubus-lime-location +ubus-lime-metrics +ubus-lime-utils \
+rpcd-mod-iwinfo +ubus-lime-grondrouting
+rpcd-mod-iwinfo +ubus-lime-groundrouting
PKGARCH:=all
endef

Expand Down
Loading

0 comments on commit 7da529d

Please sign in to comment.