Skip to content

Commit

Permalink
silabs-multiprotocol: Use native zigbeed on amd64 (home-assistant#3040)
Browse files Browse the repository at this point in the history
* Use native x86-64/amd64 support and remove amd64 specific Dockerfile

The latest Gecko SDK supports x86-64 natively and in production quality.
Let's use the native zigbeed support instead of our QEMU emulated
aarch64 workaround.

* Avoid disabling otbr-web service twice

When the otbr-agent is already disabled, the script tries to disable
otbr-web twice which is confusing.

* Update CHANGELOG.md/config.yaml

* Add missing debian-amd64.cmake

* Fix aarch64 build

* Apply suggestions from code review

Co-authored-by: Pascal Vizeli <[email protected]>
  • Loading branch information
agners and pvizeli authored May 15, 2023
1 parent ae2107b commit a34b551
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 291 deletions.
5 changes: 5 additions & 0 deletions silabs-multiprotocol/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.1.3

- Use native zigbeed on x86-64/amd64 architecture
- Avoid deleting otbr-web user content twice

## 1.1.2

- Use Silicon Labs Gecko SDK 4.2.3
Expand Down
15 changes: 15 additions & 0 deletions silabs-multiprotocol/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ RUN \
&& apt-get install -y --no-install-recommends \
crossbuild-essential-arm64

FROM --platform=linux/amd64 cross-builder-base AS cross-builder-amd64

COPY debian-amd64.cmake /usr/src/debian.cmake

ENV DEBIAN_ARCH=amd64 \
DEBIAN_CROSS_PREFIX=x86_64-linux-gnu \
SLC_ARCH=zigbee_x86_64

RUN \
set -x \
&& dpkg --add-architecture amd64 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
crossbuild-essential-amd64


FROM --platform=linux/amd64 cross-builder-${BUILD_ARCH} AS cpcd-builder

Expand Down
274 changes: 0 additions & 274 deletions silabs-multiprotocol/Dockerfile.amd64

This file was deleted.

2 changes: 1 addition & 1 deletion silabs-multiprotocol/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 1.1.2
version: 1.1.3
slug: silabs_multiprotocol
name: Silicon Labs Multiprotocol
description: Zigbee and OpenThread multiprotocol add-on
Expand Down
14 changes: 14 additions & 0 deletions silabs-multiprotocol/debian-amd64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
SET(CMAKE_SYSTEM_VERSION 1)

# Specify the cross compiler
SET(CMAKE_C_COMPILER /usr/bin/x86_64-linux-gnu-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-linux-gnu-g++)

# Search for programs only in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# Search for libraries and headers only in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
12 changes: 0 additions & 12 deletions silabs-multiprotocol/execvp-aarch64.patch

This file was deleted.

4 changes: 0 additions & 4 deletions silabs-multiprotocol/rootfs.amd64/usr/local/bin/zigbeed

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if bashio::config.false 'otbr_enable'; then
rm /etc/s6-overlay/s6-rc.d/user/contents.d/otbr-agent-rest-discovery
rm /etc/s6-overlay/s6-rc.d/user/contents.d/mdns
bashio::log.info "The otbr-agent is disabled."
bashio::exit.ok
fi

if bashio::var.has_value "$(bashio::addon.port 8080)" \
Expand Down

0 comments on commit a34b551

Please sign in to comment.