From 7d97bd80e4fd5553fbd5ebda4bc0c254d99e9959 Mon Sep 17 00:00:00 2001 From: Ethan Dye Date: Fri, 25 Oct 2024 10:35:12 -0600 Subject: [PATCH] Add router advertisement support for Matter (#1922) Fixes #1919 Signed-off-by: Ethan Dye --- functions/openhabian.bash | 6 ++++++ functions/wifi.bash | 1 - includes/generic/50-timesyncd.conf | 19 ------------------- includes/interfaces | 7 ------- includes/openhab2logo | 14 -------------- 5 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 includes/generic/50-timesyncd.conf delete mode 100644 includes/interfaces delete mode 100644 includes/openhab2logo diff --git a/functions/openhabian.bash b/functions/openhabian.bash index 90cf49ed5..dcc51cfe2 100644 --- a/functions/openhabian.bash +++ b/functions/openhabian.bash @@ -440,6 +440,12 @@ config_ipv6() { local aptConf="/etc/apt/apt.conf.d/S90force-ipv4" local sysctlConf="/etc/sysctl.d/99-sysctl.conf" + echo -n "$(timestamp) [openHABian] Making sure router advertisements are available... " + if ! grep -qs "net.ipv6.conf.all.accept_ra = 1" "$sysctlConf"; then + echo -e "\\n# Enable IPv6 route advertisements\\n# This is needed for proper discovery with the Matter binding\\nnet.ipv6.conf.all.accept_ra = 1\\nnet.ipv6.conf.all.accept_ra_rt_info_max_plen = 64" >> "$sysctlConf" + fi + if cond_redirect sysctl --load; then echo "OK"; else echo "FAILED"; return 1; fi + if [[ "${1:-${ipv6:-enable}}" == "disable" ]]; then echo -n "$(timestamp) [openHABian] Disabling IPv6... " if ! grep -qs "^[[:space:]]*# Disable all IPv6 functionality" "$sysctlConf"; then diff --git a/functions/wifi.bash b/functions/wifi.bash index 6c2e61ad5..29e57203a 100644 --- a/functions/wifi.bash +++ b/functions/wifi.bash @@ -141,7 +141,6 @@ setup_hotspot() { DEBIAN_FRONTEND=noninteractive apt install --yes -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' comitup &>/dev/null systemctl enable --now comitup comitup-cli d - echo "denyinterfaces wlan0 eth0" >> /etc/dhcpcd.conf sed -i '3 i dhcp=internal' /etc/NetworkManager/NetworkManager.conf install -m 644 "${BASEDIR:-/opt/openhabian}/includes/generic/100-disable-wifi-mac-randomization.conf" /etc/NetworkManager/conf.d/ if [[ $(systemctl is-active comitup) == "active" ]]; then diff --git a/includes/generic/50-timesyncd.conf b/includes/generic/50-timesyncd.conf deleted file mode 100644 index ea8d5d7b9..000000000 --- a/includes/generic/50-timesyncd.conf +++ /dev/null @@ -1,19 +0,0 @@ -# Set NTP servers for systemd-timesyncd - -confd=/run/systemd/timesyncd.conf.d - -set_servers() { - mkdir -p "$confd" - ( - echo "# Created by dhcpcd hook" - echo "[Time]" - echo "NTP=$new_ntp_servers" - ) > "$confd/dhcp-ntp.conf" - - # Tell timesyncd it has an updated configuration - systemctl try-reload-or-restart systemd-timesyncd -} - -if $if_up; then - set_servers -fi diff --git a/includes/interfaces b/includes/interfaces deleted file mode 100644 index e46d1ee1a..000000000 --- a/includes/interfaces +++ /dev/null @@ -1,7 +0,0 @@ -# interfaces(5) file used by ifup(8) and ifdown(8) - -# Please note that this file is written to be used with dhcpcd -# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' - -# Include files from /etc/network/interfaces.d: -source-directory /etc/network/interfaces.d diff --git a/includes/openhab2logo b/includes/openhab2logo deleted file mode 100644 index 42d2f7c2c..000000000 --- a/includes/openhab2logo +++ /dev/null @@ -1,14 +0,0 @@ - - Welcome to __ _____ ____ _ - ____ ____ ___ ____ / / / / | / __ )(_)___ _____ - / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __ / / __ `/ __ \ - / /_/ / /_/ / __/ / / / __ / ___ |/ /_/ / / /_/ / / / / - \____/ .___/\___/_/ /_/_/ /_/_/ |_/_____/_/\__,_/_/ /_/ - /_/ - openHAB $OHVERSION ($OHBUILD) - - -Looking for a place to get started? Check out 'sudo openhabian-config' and the -documentation at https://www.openhab.org/docs/installation/openhabian.html -The openHAB dashboard can be reached at http://${HOSTNAME}:8080 -To interact with openHAB on the command line, execute: 'openhab-cli --help'