-
Notifications
You must be signed in to change notification settings - Fork 12
Integrate network-manager with openthread-br plus miscellaneous updates #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ksperling-apple
wants to merge
8
commits into
project-chip:main
Choose a base branch
from
ksperling-apple:netman-tbrm-integration-etc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fb4288e
Add a git-with-metadata download method that can capture metadata fro…
ksperling-apple d746883
Move overlay.{sh,mk} into include directory
ksperling-apple 6fd8e2e
Use git-with-metadata for the gn build
ksperling-apple 46f5056
Update mDNSReponder package to 2881.0.25
ksperling-apple 1ae3c34
Update openthread-br to 07fc9adf and add a patch for an enhanced ubus…
ksperling-apple 89de0d6
Update network-manager app to 8f221d80
ksperling-apple fe5c5c9
Move CI to OpenWrt 24.10.4
ksperling-apple c3efc89
Fix error handling in git-with-metadata hook
ksperling-apple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Copyright (c) 2025 Project CHIP Authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| GWM_SH:=$(patsubst %.mk,%.sh,$(abspath $(lastword $(MAKEFILE_LIST)))) | ||
|
|
||
| # Hook function that gathers git metadata; it can be overridden by the | ||
| # package Makefile. The output of this shell command (or commands) is | ||
| # captured into a .git-metadata file located at the root of the source tree. | ||
| define GitWithMetadata/gather | ||
| git show -s --format="COMMIT_TIMESTAMP=%ct" HEAD | ||
| endef | ||
|
|
||
| # Expands into a shell expression that resolves a variable from | ||
| # .git-metadata at build time, usually for passing as an argument | ||
| # to configure or cmake. | ||
| # Example: $(call GitWithMetadata/resolve,COMMIT_HASH) | ||
| define GitWithMetadata/resolve | ||
| "`. .git-metadata && echo "$$$$$(1)"`" | ||
| endef | ||
|
|
||
| ifndef DownloadMethod/default | ||
| $(error git-with-metadata.mk must be included after package.mk) | ||
| endif | ||
|
|
||
| # Set up hooks and delegate to the 'git' download method. | ||
| $(eval dl_tar_pack=true dl_tar_pack && $(value dl_tar_pack)) | ||
| define DownloadMethod/git-with-metadata | ||
| gwm_gather_$(if $(filter skip,$(SUBMODULES)),checkout,submodules)() { $(GitWithMetadata/gather) ; } && \ | ||
| SUBDIR=$(SUBDIR) && . $(GWM_SH) && $(call DownloadMethod/git,$(1),$(2)) | ||
| endef | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Copyright (c) 2025 Project CHIP Authors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # This script is sourced at the start of a git download command sequence. | ||
| # It intercepts `git` and `true` commands so additional work can be | ||
| # performed at these injection points. | ||
|
|
||
| GWM_IN_HOOK= | ||
| GWM_META="$(mktemp -t gwm-meta.XXXXXX)" | ||
|
|
||
| git() { command git "$@" && { [ -n "$GWM_IN_HOOK" ] || gwm_hook git "$@"; }; } | ||
| true() { [ -n "$GWM_IN_HOOK" ] || gwm_hook true "$@"; } | ||
|
|
||
| gwm_gather() { | ||
| local func="gwm_gather_$1" | ||
| if type "$func" >/dev/null; then | ||
| echo "Gathering meta-data..." | ||
| "$func" | tee "$GWM_META" | ||
| fi | ||
| } | ||
|
|
||
| gwm_hook() { | ||
| local GWM_IN_HOOK=1 | ||
| if [ "$1 $2" = "git checkout" ]; then | ||
| gwm_gather checkout | ||
| elif [ "$1 $2 $3" = "git submodule update" ]; then | ||
| gwm_gather submodules | ||
| elif [ "$1 $2" = "true dl_tar_pack" ]; then | ||
| [ -s "$GWM_META" ] && mv "$GWM_META" "$SUBDIR/.git-metadata" | ||
| fi | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "user": "matter", | ||
| "access": { | ||
| "otbr": { | ||
| "methods": ["*"] | ||
| } | ||
| }, | ||
| "subscribe": [ "otbr" ], | ||
| "listen": [ "ubus.object.*" ] | ||
| } |
122 changes: 122 additions & 0 deletions
122
service/matter-netman/patches/020-dont-overwrite-factory-config.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| commit e6307a048248556109e6c054cc72f99a67914ac4 | ||
| Author: Karsten Sperling <[email protected]> | ||
| Date: Thu Oct 16 14:35:23 2025 +1300 | ||
|
|
||
| Linux PosixConfig: Don't commit factory storage changes to disk | ||
|
|
||
| The factory namespace would ideally be entirely read-only, but there are some | ||
| code paths that write default values there. Keep these in memory only instead | ||
| of writing to disk. | ||
|
|
||
| diff --git a/src/platform/Linux/PosixConfig.cpp b/src/platform/Linux/PosixConfig.cpp | ||
| index 052203a312..7b69e3575c 100644 | ||
| --- a/src/platform/Linux/PosixConfig.cpp | ||
| +++ b/src/platform/Linux/PosixConfig.cpp | ||
| @@ -272,9 +272,14 @@ CHIP_ERROR PosixConfig::WriteConfigValue(Key key, bool val) | ||
| err = storage->WriteValue(key.Name, val); | ||
| SuccessOrExit(err); | ||
|
|
||
| - // Commit the value to the persistent store. | ||
| - err = storage->Commit(); | ||
| - SuccessOrExit(err); | ||
| + // Commit the value to the persistent store, unless it's in the factory namespace. | ||
| + // Technically the factory namespace should not be written to at all, but there | ||
| + // are some code paths that write default values into it at startup. | ||
| + if (storage != &gChipLinuxFactoryStorage) | ||
| + { | ||
| + err = storage->Commit(); | ||
| + SuccessOrExit(err); | ||
| + } | ||
|
|
||
| ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %s", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name), | ||
| val ? "true" : "false"); | ||
| @@ -294,9 +299,11 @@ CHIP_ERROR PosixConfig::WriteConfigValue(Key key, uint16_t val) | ||
| err = storage->WriteValue(key.Name, val); | ||
| SuccessOrExit(err); | ||
|
|
||
| - // Commit the value to the persistent store. | ||
| - err = storage->Commit(); | ||
| - SuccessOrExit(err); | ||
| + if (storage != &gChipLinuxFactoryStorage) | ||
| + { | ||
| + err = storage->Commit(); | ||
| + SuccessOrExit(err); | ||
| + } | ||
|
|
||
| ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %u (0x%X)", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name), val, | ||
| val); | ||
| @@ -316,9 +323,11 @@ CHIP_ERROR PosixConfig::WriteConfigValue(Key key, uint32_t val) | ||
| err = storage->WriteValue(key.Name, val); | ||
| SuccessOrExit(err); | ||
|
|
||
| - // Commit the value to the persistent store. | ||
| - err = storage->Commit(); | ||
| - SuccessOrExit(err); | ||
| + if (storage != &gChipLinuxFactoryStorage) | ||
| + { | ||
| + err = storage->Commit(); | ||
| + SuccessOrExit(err); | ||
| + } | ||
|
|
||
| ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %" PRIu32 " (0x%" PRIX32 ")", StringOrNullMarker(key.Namespace), | ||
| StringOrNullMarker(key.Name), val, val); | ||
| @@ -338,9 +347,11 @@ CHIP_ERROR PosixConfig::WriteConfigValue(Key key, uint64_t val) | ||
| err = storage->WriteValue(key.Name, val); | ||
| SuccessOrExit(err); | ||
|
|
||
| - // Commit the value to the persistent store. | ||
| - err = storage->Commit(); | ||
| - SuccessOrExit(err); | ||
| + if (storage != &gChipLinuxFactoryStorage) | ||
| + { | ||
| + err = storage->Commit(); | ||
| + SuccessOrExit(err); | ||
| + } | ||
|
|
||
| ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %" PRIu64 " (0x%" PRIX64 ")", StringOrNullMarker(key.Namespace), | ||
| StringOrNullMarker(key.Name), val, val); | ||
| @@ -362,9 +373,11 @@ CHIP_ERROR PosixConfig::WriteConfigValueStr(Key key, const char * str) | ||
| err = storage->WriteValueStr(key.Name, str); | ||
| SuccessOrExit(err); | ||
|
|
||
| - // Commit the value to the persistent store. | ||
| - err = storage->Commit(); | ||
| - SuccessOrExit(err); | ||
| + if (storage != &gChipLinuxFactoryStorage) | ||
| + { | ||
| + err = storage->Commit(); | ||
| + SuccessOrExit(err); | ||
| + } | ||
|
|
||
| ChipLogProgress(DeviceLayer, "NVS set: %s/%s = \"%s\"", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name), | ||
| str); | ||
| @@ -418,9 +431,11 @@ CHIP_ERROR PosixConfig::WriteConfigValueBin(Key key, const uint8_t * data, size_ | ||
| err = storage->WriteValueBin(key.Name, data, dataLen); | ||
| SuccessOrExit(err); | ||
|
|
||
| - // Commit the value to the persistent store. | ||
| - err = storage->Commit(); | ||
| - SuccessOrExit(err); | ||
| + if (storage != &gChipLinuxFactoryStorage) | ||
| + { | ||
| + err = storage->Commit(); | ||
| + SuccessOrExit(err); | ||
| + } | ||
|
|
||
| ChipLogProgress(DeviceLayer, "NVS set: %s/%s = (blob length %u)", StringOrNullMarker(key.Namespace), | ||
| StringOrNullMarker(key.Name), static_cast<unsigned int>(dataLen)); | ||
| @@ -450,9 +465,11 @@ CHIP_ERROR PosixConfig::ClearConfigValue(Key key) | ||
| } | ||
| SuccessOrExit(err); | ||
|
|
||
| - // Commit the value to the persistent store. | ||
| - err = storage->Commit(); | ||
| - SuccessOrExit(err); | ||
| + if (storage != &gChipLinuxFactoryStorage) | ||
| + { | ||
| + err = storage->Commit(); | ||
| + SuccessOrExit(err); | ||
| + } | ||
|
|
||
| ChipLogProgress(DeviceLayer, "NVS erase: %s/%s", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name)); | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.