From 834ea6ecb54a2df07cfefb470218e238ffd78684 Mon Sep 17 00:00:00 2001 From: Raul Marquez Date: Fri, 27 Feb 2026 16:04:34 -0800 Subject: [PATCH 1/3] skip raspi deps/config if not on raspi platform --- backend | 2 +- scripts/pi-setup/install-pi-dependencies.sh | 10 ++++ scripts/ubuntu/2-machine-cofiguration.sh | 53 +++++++++++++-------- scripts/utils.sh | 11 +++++ 4 files changed, 55 insertions(+), 21 deletions(-) diff --git a/backend b/backend index 9bf5d9f9..bc2e6bb2 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit 9bf5d9f9b978ad57feea68e9aa4be04daf2122ba +Subproject commit bc2e6bb2cb67d9923ad52cdaea301486bdc7eb19 diff --git a/scripts/pi-setup/install-pi-dependencies.sh b/scripts/pi-setup/install-pi-dependencies.sh index f15bb6ca..164902b6 100755 --- a/scripts/pi-setup/install-pi-dependencies.sh +++ b/scripts/pi-setup/install-pi-dependencies.sh @@ -23,6 +23,16 @@ source "$SCRIPT_DIR/utils.sh" print_start_of_script +if ! is_running_on_raspberry_pi; then + if is_running_in_wsl; then + print_script_step "Skipping Raspberry Pi dependencies (running in WSL)" + else + print_script_step "Skipping Raspberry Pi dependencies (not running on Raspberry Pi)" + fi + print_end_of_script + exit 0 +fi + print_script_step "Silence user prompts about reboot and service restart required (script will prompt user to reboot in the end)" sudo sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf sudo sed -i "s/#\$nrconf{restart} = 'i';/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf diff --git a/scripts/ubuntu/2-machine-cofiguration.sh b/scripts/ubuntu/2-machine-cofiguration.sh index 5bbde6ff..4fb099dc 100755 --- a/scripts/ubuntu/2-machine-cofiguration.sh +++ b/scripts/ubuntu/2-machine-cofiguration.sh @@ -33,10 +33,11 @@ sudo groupadd docker sudo usermod -a -G docker $USER sudo service docker restart -# Setup Wifi -print_script_step "Create System Service for wpa_suppliant" -printf "\n Writing: /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service" -cat << EOF | sudo tee /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service +# Setup Wifi (Raspberry Pi only) +if is_running_on_raspberry_pi; then + print_script_step "Create System Service for wpa_suppliant" + printf "\n Writing: /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service" + cat << EOF | sudo tee /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service [Unit] Description=WPA supplicant Before=network.target @@ -53,20 +54,25 @@ ExecStart=/sbin/wpa_supplicant -u -s -i $WLAN_INTERFACE -c /etc/wpa_supplicant/w WantedBy=multi-user.target Alias=dbus-fi.w1.wpa_supplicant1.service EOF -sudo systemctl daemon-reload -sudo systemctl enable dbus-fi.w1.wpa_supplicant1 - -WPA_SUPPLICANT_FILE=/etc/wpa_supplicant/wpa_supplicant.conf -WPA_SUPPLICANT_SETTINGS=( - "ctrl_interface=DIR=/run/wpa_supplicant" - "update_config=1" -) -printf "\n Updating: $WPA_SUPPLICANT_FILE\n" -sudo touch "$WPA_SUPPLICANT_FILE" -for setting in ${WPA_SUPPLICANT_SETTINGS[@]}; do - echo " setting: $setting" - grep -qxF "$setting" "$WPA_SUPPLICANT_FILE" || echo "$setting" | sudo tee -a "$WPA_SUPPLICANT_FILE" -done + sudo systemctl daemon-reload + sudo systemctl enable dbus-fi.w1.wpa_supplicant1 + + WPA_SUPPLICANT_FILE=/etc/wpa_supplicant/wpa_supplicant.conf + WPA_SUPPLICANT_SETTINGS=( + "ctrl_interface=DIR=/run/wpa_supplicant" + "update_config=1" + ) + printf "\n Updating: $WPA_SUPPLICANT_FILE\n" + sudo touch "$WPA_SUPPLICANT_FILE" + for setting in ${WPA_SUPPLICANT_SETTINGS[@]}; do + echo " setting: $setting" + grep -qxF "$setting" "$WPA_SUPPLICANT_FILE" || echo "$setting" | sudo tee -a "$WPA_SUPPLICANT_FILE" + done +elif is_running_in_wsl; then + print_script_step "Skipping WiFi configuration (running in WSL)" +else + print_script_step "Skipping WiFi configuration (not running on Raspberry Pi)" +fi # Setup Network print_script_step "Accept Router Advertisements on network interfaces" @@ -74,9 +80,16 @@ SYSCTL_FILE=/etc/sysctl.conf SYSCTL_SETTINGS=( "net.ipv6.conf.eth0.accept_ra=2" "net.ipv6.conf.eth0.accept_ra_rt_info_max_plen=64" - "net.ipv6.conf.$WLAN_INTERFACE.accept_ra=2" - "net.ipv6.conf.$WLAN_INTERFACE.accept_ra_rt_info_max_plen=64" ) + +# WLAN sysctl settings are only relevant on Raspberry Pi +if is_running_on_raspberry_pi; then + SYSCTL_SETTINGS+=( + "net.ipv6.conf.$WLAN_INTERFACE.accept_ra=2" + "net.ipv6.conf.$WLAN_INTERFACE.accept_ra_rt_info_max_plen=64" + ) +fi + printf "\n Updating: $SYSCTL_FILE\n" sudo touch "$SYSCTL_FILE" for setting in ${SYSCTL_SETTINGS[@]}; do diff --git a/scripts/utils.sh b/scripts/utils.sh index 610fda14..c81a64d8 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -112,3 +112,14 @@ check_installation_prerequisites() exit 1 fi } + +is_running_on_raspberry_pi() +{ + [ -f /sys/firmware/devicetree/base/model ] && \ + grep -qi "raspberry pi" /sys/firmware/devicetree/base/model 2>/dev/null +} + +is_running_in_wsl() +{ + grep -qi microsoft /proc/version 2>/dev/null +} From 80c6d6a83de4447bc89a96634b258131ff04083c Mon Sep 17 00:00:00 2001 From: Raul Marquez Date: Sat, 28 Feb 2026 14:18:31 -0800 Subject: [PATCH 2/3] skip reboot in wsl --- backend | 2 +- scripts/ubuntu/internal-auto-install.sh | 45 ++++++++++++++++++++----- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/backend b/backend index bc2e6bb2..ad0f259c 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit bc2e6bb2cb67d9923ad52cdaea301486bdc7eb19 +Subproject commit ad0f259c00a9e110aefac85c4441376371256264 diff --git a/scripts/ubuntu/internal-auto-install.sh b/scripts/ubuntu/internal-auto-install.sh index 47b23bde..14c866ba 100755 --- a/scripts/ubuntu/internal-auto-install.sh +++ b/scripts/ubuntu/internal-auto-install.sh @@ -47,11 +47,40 @@ print_end_of_script print_installation_success -print_script_step "You need to reboot to finish setup" -printf "Do you want to reboot now? (Press 1 to reboot now)\n" -select yn in "Yes" "No"; do - case $yn in - Yes ) sudo reboot; break;; - No ) exit;; - esac -done +if is_running_in_wsl; then + print_script_step "Applying configuration changes (WSL - no reboot needed)" + + echo "Applying sysctl settings..." + sudo sysctl -p + + echo "Loading ip6table_filter kernel module..." + sudo modprobe ip6table_filter 2>/dev/null || echo " (module not available in WSL kernel - this is OK)" + + echo "Refreshing docker group membership..." + newgrp docker << END + echo " Docker group active" +END + + echo "" + echo "********************************************************************************" + echo "Setup complete." + echo "" + echo "REMINDER: Sample apps were not installed for your architecture." + echo "You can build them manually from the Matter SDK source and copy the" + echo "resulting binaries to ~/apps/" + echo "Example: cp ~/connectedhomeip/out// ~/apps/" + echo "" + echo "To start the Test Harness, run:" + echo " cd $ROOT_DIR && ./scripts/start.sh" + echo "********************************************************************************" + echo "" +else + print_script_step "You need to reboot to finish setup" + printf "Do you want to reboot now? (Press 1 to reboot now)\n" + select yn in "Yes" "No"; do + case $yn in + Yes ) sudo reboot; break;; + No ) exit;; + esac + done +fi From ee7db9839cb618d54fc9f048a19b28d2a54c7494 Mon Sep 17 00:00:00 2001 From: Raul Marquez Date: Sat, 28 Feb 2026 20:42:06 -0800 Subject: [PATCH 3/3] build instr --- backend | 2 +- scripts/ubuntu/internal-auto-install.sh | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/backend b/backend index ad0f259c..1d164e9b 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit ad0f259c00a9e110aefac85c4441376371256264 +Subproject commit 1d164e9bf9c13f6c22d550fa167b4394e62e5eb1 diff --git a/scripts/ubuntu/internal-auto-install.sh b/scripts/ubuntu/internal-auto-install.sh index 14c866ba..66877d9b 100755 --- a/scripts/ubuntu/internal-auto-install.sh +++ b/scripts/ubuntu/internal-auto-install.sh @@ -61,14 +61,23 @@ if is_running_in_wsl; then echo " Docker group active" END + SDK_DOCKER_TAG=$(cat $ROOT_DIR/backend/test_collections/matter/config.py | grep SDK_DOCKER_TAG | cut -d'"' -f 2 | cut -d"'" -f 2) + echo "" echo "********************************************************************************" echo "Setup complete." echo "" echo "REMINDER: Sample apps were not installed for your architecture." - echo "You can build them manually from the Matter SDK source and copy the" - echo "resulting binaries to ~/apps/" - echo "Example: cp ~/connectedhomeip/out// ~/apps/" + echo "You can build them manually from the Matter SDK source" + echo "(commit: $SDK_DOCKER_TAG) and copy the resulting binaries to ~/apps/" + echo "" + echo " cd ~/connectedhomeip" + echo " git checkout $SDK_DOCKER_TAG" + echo " git submodule update --init --recursive" + echo " . scripts/bootstrap.sh" + echo " . scripts/activate.sh" + echo " ./scripts/build/build_examples.py --target linux-x64-all-clusters build" + echo " cp out/linux-x64-all-clusters/chip-all-clusters-app ~/apps/" echo "" echo "To start the Test Harness, run:" echo " cd $ROOT_DIR && ./scripts/start.sh"