From 804288d3b45e31b68fbf6bc6009f0387379be101 Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:02:28 -0500 Subject: [PATCH] openthread_border_router: Bump OTBR and and flasher versions (#3890) * Update DELETE patch * Update OTBR commit * Bump universal-silabs-flasher to 0.0.28 * Bump version to 2.13.0 * Drop the dataset deletion patch * Update changelog to mention dropping the patch --- .../0001-support-deleting-the-dataset.patch | 123 ------------------ openthread_border_router/CHANGELOG.md | 5 + openthread_border_router/Dockerfile | 2 - openthread_border_router/build.yaml | 4 +- openthread_border_router/config.yaml | 4 +- 5 files changed, 9 insertions(+), 129 deletions(-) delete mode 100644 openthread_border_router/0001-support-deleting-the-dataset.patch diff --git a/openthread_border_router/0001-support-deleting-the-dataset.patch b/openthread_border_router/0001-support-deleting-the-dataset.patch deleted file mode 100644 index 3804f5c76b8..00000000000 --- a/openthread_border_router/0001-support-deleting-the-dataset.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 2efa60f83b71402ce0c1ef176be8f88a9bfdefac Mon Sep 17 00:00:00 2001 -From: Stefan Agner -Date: Mon, 5 Jun 2023 23:41:50 +0200 -Subject: [PATCH] support deleting the dataset - -Add REST API to support deleting the active or pending operational -dataset. Deleting the active operational dataset requires the Thread -network to be disabled (just like modifying the active operational -dataset). Subsequent use of the PUT method allows to build entirly -new datasets with values generated by the stack (through -otDatasetCreateNewNetwork). ---- - src/rest/openapi.yaml | 21 +++++++++++++++++++++ - src/rest/resource.cpp | 35 +++++++++++++++++++++++++++++++++++ - src/rest/resource.hpp | 1 + - 3 files changed, 57 insertions(+) - -diff --git a/src/rest/openapi.yaml b/src/rest/openapi.yaml -index 2ba2a4dd56f..2edc4af29ad 100644 ---- a/src/rest/openapi.yaml -+++ b/src/rest/openapi.yaml -@@ -248,6 +248,18 @@ paths: - description: Invalid request body. - "409": - description: Writing active operational dataset rejected because Thread network is active. -+ delete: -+ tags: -+ - node -+ summary: Deletes the active operational dataset -+ description: |- -+ Deletes the the active operational dataset on the current node. Only allowed if the Thread node -+ is inactive. -+ responses: -+ "200": -+ description: Successfully deleted the active operational dataset. -+ "409": -+ description: Deleting active operational dataset rejected because Thread network is active. - /node/dataset/pending: - get: - tags: -@@ -291,6 +303,15 @@ paths: - description: Successfully created the pending operational dataset. - "400": - description: Invalid request body. -+ delete: -+ tags: -+ - node -+ summary: Deletes the pending operational dataset -+ description: |- -+ Deletes the the pending operational dataset on the current node. -+ responses: -+ "200": -+ description: Successfully deleted the active operational dataset. - components: - schemas: - LeaderData: -diff --git a/src/rest/resource.cpp b/src/rest/resource.cpp -index ce154c2e5b3..1708faf6abc 100644 ---- a/src/rest/resource.cpp -+++ b/src/rest/resource.cpp -@@ -767,12 +767,47 @@ exit: - } - } - -+void Resource::DeleteDataset(DatasetType aDatasetType, Response &aResponse) const -+{ -+ otbrError error = OTBR_ERROR_NONE; -+ std::string errorCode = GetHttpStatus(HttpStatusCode::kStatusOk); -+ otOperationalDatasetTlvs datasetTlvs = {}; -+ -+ if (aDatasetType == DatasetType::kActive) -+ { -+ VerifyOrExit(otThreadGetDeviceRole(mInstance) == OT_DEVICE_ROLE_DISABLED, error = OTBR_ERROR_INVALID_STATE); -+ } -+ -+ if (aDatasetType == DatasetType::kActive) -+ { -+ VerifyOrExit(otDatasetSetActiveTlvs(mInstance, &datasetTlvs) == OT_ERROR_NONE, error = OTBR_ERROR_REST); -+ } -+ else if (aDatasetType == DatasetType::kPending) -+ { -+ VerifyOrExit(otDatasetSetPendingTlvs(mInstance, &datasetTlvs) == OT_ERROR_NONE, error = OTBR_ERROR_REST); -+ } -+ aResponse.SetResponsCode(errorCode); -+ -+exit: -+ if (error == OTBR_ERROR_INVALID_STATE) -+ { -+ ErrorHandler(aResponse, HttpStatusCode::kStatusConflict); -+ } -+ else if (error != OTBR_ERROR_NONE) -+ { -+ ErrorHandler(aResponse, HttpStatusCode::kStatusInternalServerError); -+ } -+} -+ - void Resource::Dataset(DatasetType aDatasetType, const Request &aRequest, Response &aResponse) const - { - std::string errorCode; - - switch (aRequest.GetMethod()) - { -+ case HttpMethod::kDelete: -+ DeleteDataset(aDatasetType, aResponse); -+ break; - case HttpMethod::kGet: - GetDataset(aDatasetType, aRequest, aResponse); - break; -diff --git a/src/rest/resource.hpp b/src/rest/resource.hpp -index 0929dbcc50c..cbe1702f2fb 100644 ---- a/src/rest/resource.hpp -+++ b/src/rest/resource.hpp -@@ -150,6 +150,7 @@ private: - void GetDataRloc(Response &aResponse) const; - void GetDataset(DatasetType aDatasetType, const Request &aRequest, Response &aResponse) const; - void SetDataset(DatasetType aDatasetType, const Request &aRequest, Response &aResponse) const; -+ void DeleteDataset(DatasetType aDatasetType, Response &aResponse) const; - - void DeleteOutDatedDiagnostic(void); - void UpdateDiag(std::string aKey, std::vector &aDiag); --- -2.46.1 - diff --git a/openthread_border_router/CHANGELOG.md b/openthread_border_router/CHANGELOG.md index 0af51f637fc..0573b2df9ed 100644 --- a/openthread_border_router/CHANGELOG.md +++ b/openthread_border_router/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2.13.0 +- Bump to OTBR POSIX version b067e5ac (2025-01-13 22:32:22 -0500) +- Bump universal-silabs-flasher to 0.0.28 +- Remove dataset deletion REST API backwards compatibility patch. The minimum Core version for this add-on is now 2023.9.0 + ## 2.12.4 - Fix OTBR addon does not start after updating containerd.io to 1.7.24-1 diff --git a/openthread_border_router/Dockerfile b/openthread_border_router/Dockerfile index 0f53a6e63bb..a758d34377b 100644 --- a/openthread_border_router/Dockerfile +++ b/openthread_border_router/Dockerfile @@ -17,7 +17,6 @@ ENV REST_API 1 ENV DHCPV6_PD_REF 0 ENV DOCKER 1 -COPY 0001-support-deleting-the-dataset.patch /usr/src COPY 0001-channel-monitor-disable-by-default.patch /usr/src COPY openthread-core-ha-config-posix.h /usr/src # Required and installed (script/bootstrap) can be removed after build @@ -54,7 +53,6 @@ RUN \ && git checkout ${OTBR_VERSION} \ && git submodule update --init \ && ./script/bootstrap \ - && patch -p1 < /usr/src/0001-support-deleting-the-dataset.patch \ && ( \ cd third_party/openthread/repo \ && patch -p1 < /usr/src/0001-channel-monitor-disable-by-default.patch \ diff --git a/openthread_border_router/build.yaml b/openthread_border_router/build.yaml index 34d922dccea..8bf57d2054f 100644 --- a/openthread_border_router/build.yaml +++ b/openthread_border_router/build.yaml @@ -3,5 +3,5 @@ build_from: aarch64: ghcr.io/home-assistant/aarch64-base-debian:bookworm amd64: ghcr.io/home-assistant/amd64-base-debian:bookworm args: - OTBR_VERSION: b041fa52daaa4dfbf6aa4665d8925c1be0350ca5 - UNIVERSAL_SILABS_FLASHER: 0.0.25 + OTBR_VERSION: b067e5ac5f8b3e92750df24922017eee2bc0fa04 + UNIVERSAL_SILABS_FLASHER: 0.0.28 diff --git a/openthread_border_router/config.yaml b/openthread_border_router/config.yaml index aab7601b8c2..3e982a32837 100644 --- a/openthread_border_router/config.yaml +++ b/openthread_border_router/config.yaml @@ -1,5 +1,5 @@ --- -version: 2.12.4 +version: 2.13.0 slug: openthread_border_router name: OpenThread Border Router description: OpenThread Border Router add-on @@ -8,7 +8,7 @@ url: >- arch: - aarch64 - amd64 -homeassistant: 2023.6.0.dev20230531 +homeassistant: 2023.9.0 gpio: true hassio_api: true discovery: