From b37dc33e5cb9eaed87c34f8b836aeadea50abcb9 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 21 Nov 2023 09:54:06 +0100 Subject: [PATCH 1/6] Bump OS to pre-release version 11.2.rc1 --- buildroot-external/meta | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildroot-external/meta b/buildroot-external/meta index d938c423b..8c96c2455 100644 --- a/buildroot-external/meta +++ b/buildroot-external/meta @@ -1,8 +1,8 @@ VERSION_MAJOR="11" VERSION_MINOR="2" -VERSION_SUFFIX="dev0" +VERSION_SUFFIX="rc1" HASSOS_NAME="Home Assistant OS" HASSOS_ID="haos" -DEPLOYMENT="development" +DEPLOYMENT="staging" From 376e4f9296dee90188a1d9f628ee17af5a570188 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 28 Nov 2023 17:18:50 +0100 Subject: [PATCH 2/6] Do not start hciuart.service/bthelper@hci0.service if krnbt is used (#2947) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Do not start hciuart.service if krnbt is used Avoid starting (and failing to start) hciuart.service if krnbt is used. This avoid unnecessary failed services showing up. * Update buildroot-external/package/pi-bluetooth/hciuart.service Co-authored-by: Jan Čermák * Drop duplicate bluetooth in path * Avoid bthelper@hci0.service failing * Revert "Avoid bthelper@hci0.service failing" This reverts commit f79777e63ec83ab45f27fbecb2da8b0c97992c64. * Add ExecConditiono to bthelper@.service as well --------- Co-authored-by: Jan Čermák --- buildroot-external/package/pi-bluetooth/bthelper@.service | 1 + buildroot-external/package/pi-bluetooth/hciuart.service | 1 + 2 files changed, 2 insertions(+) diff --git a/buildroot-external/package/pi-bluetooth/bthelper@.service b/buildroot-external/package/pi-bluetooth/bthelper@.service index a7c278031..0d3cf5198 100644 --- a/buildroot-external/package/pi-bluetooth/bthelper@.service +++ b/buildroot-external/package/pi-bluetooth/bthelper@.service @@ -6,5 +6,6 @@ Before=bluetooth.service [Service] Type=oneshot +ExecCondition=/bin/sh -c '[ "$(cat /proc/device-tree/$(cat /proc/device-tree/aliases/bluetooth)/status)" != "okay" ]' ExecStart=/usr/bin/bthelper %I RemainAfterExit=yes diff --git a/buildroot-external/package/pi-bluetooth/hciuart.service b/buildroot-external/package/pi-bluetooth/hciuart.service index 80a8b538e..e2a69b013 100644 --- a/buildroot-external/package/pi-bluetooth/hciuart.service +++ b/buildroot-external/package/pi-bluetooth/hciuart.service @@ -5,6 +5,7 @@ After=dev-serial1.device [Service] Type=forking +ExecCondition=/bin/sh -c '[ "$(cat /proc/device-tree/$(cat /proc/device-tree/aliases/bluetooth)/status)" != "okay" ]' ExecStart=/usr/bin/btuart [Install] From eab18076ad7717ff4bce848b95fdb4e6c9f88f29 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 28 Nov 2023 17:23:08 +0100 Subject: [PATCH 3/6] Remove kernel HCI driver if no WiFi/Bluetooth module present (#2944) (#2948) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove kernel HCI driver if no WiFi/Bluetooth module present (#2944) If the WiFi/Bluetooth module is not present on the SDIO bus, remove the HCI driver. This avoids hci0 interface to be present. Current Home Assistant Core versions show a Bluetooth device as soon as a hci device is present. With this change there won't be a Bluetooth device shown. * Update buildroot-external/package/pi-bluetooth/hcidisable.service Co-authored-by: Jan Čermák --------- Co-authored-by: Jan Čermák --- .../package/pi-bluetooth/hcidisable.service | 10 ++++++++++ .../package/pi-bluetooth/pi-bluetooth.mk | 1 + 2 files changed, 11 insertions(+) create mode 100644 buildroot-external/package/pi-bluetooth/hcidisable.service diff --git a/buildroot-external/package/pi-bluetooth/hcidisable.service b/buildroot-external/package/pi-bluetooth/hcidisable.service new file mode 100644 index 000000000..2548d8f4c --- /dev/null +++ b/buildroot-external/package/pi-bluetooth/hcidisable.service @@ -0,0 +1,10 @@ +[Unit] +Description=Remove HCI kernel driver if WiFi/Bluetooth module is not present +ConditionPathExists=!/sys/bus/sdio/devices/mmc1:0001:1 + +[Service] +Type=forking +ExecStart=/usr/sbin/modprobe -r hci_uart + +[Install] +WantedBy=hassos-hardware.target diff --git a/buildroot-external/package/pi-bluetooth/pi-bluetooth.mk b/buildroot-external/package/pi-bluetooth/pi-bluetooth.mk index 5b244be6b..c0afd85d6 100644 --- a/buildroot-external/package/pi-bluetooth/pi-bluetooth.mk +++ b/buildroot-external/package/pi-bluetooth/pi-bluetooth.mk @@ -12,6 +12,7 @@ PI_BLUETOOTH_LICENSE_FILES = debian/copyright define PI_BLUETOOTH_INSTALL_TARGET_CMDS $(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/hassos-hardware.target.wants $(INSTALL) -m 0644 $(BR2_EXTERNAL_HASSOS_PATH)/package/pi-bluetooth/hciuart.service $(TARGET_DIR)/usr/lib/systemd/system/ + $(INSTALL) -m 0644 $(BR2_EXTERNAL_HASSOS_PATH)/package/pi-bluetooth/hcidisable.service $(TARGET_DIR)/usr/lib/systemd/system/ $(INSTALL) -m 0644 $(BR2_EXTERNAL_HASSOS_PATH)/package/pi-bluetooth/bthelper@.service $(TARGET_DIR)/usr/lib/systemd/system/ $(INSTALL) -d $(TARGET_DIR)/usr/bin From e524a5e03d4965fd1edc7812ed0501eadf7025ca Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 28 Nov 2023 17:24:46 +0100 Subject: [PATCH 4/6] Bump OS to pre-release version 11.2.rc2 --- buildroot-external/meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot-external/meta b/buildroot-external/meta index 8c96c2455..ab35108e0 100644 --- a/buildroot-external/meta +++ b/buildroot-external/meta @@ -1,6 +1,6 @@ VERSION_MAJOR="11" VERSION_MINOR="2" -VERSION_SUFFIX="rc1" +VERSION_SUFFIX="rc2" HASSOS_NAME="Home Assistant OS" HASSOS_ID="haos" From 1ffaec3acb74f1bd0db0a0b96d79b02cc2457f7c Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 30 Nov 2023 14:41:44 +0100 Subject: [PATCH 5/6] Fix Supervisor image corruption detection (#2953) * Fix Supervisor image corruption detection When multiple images match the reference, multiple IDs are passed as a single argument to docker image rm, leading to an error: Error response from daemon: page not found Make sure to pass the ids as separate argument to make the delete work in any case. * Cleanup reusing Supervisor from an old/unused reference As noted in #2113, we don't need this logic anymore after a major OS releases. So simply drop the logic to also make the image corruption detection work again. * Make sure image IDs are sorted to make them unique --- .../rootfs-overlay/usr/sbin/hassos-supervisor | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor b/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor index f10798bd6..b49817cb3 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor @@ -24,22 +24,20 @@ if [ -f "${SUPERVISOR_STARTUP_MARKER}" ]; then echo "[WARNING] Supervisor container did not remove the startup marker file. Assuming container image or container corruption." docker container rm --force hassio_supervisor || true SUPERVISOR_CONTAINER_ID="" + # Make sure we delete all supervisor images - SUPERVISOR_IMAGE_IDS=$(docker images --no-trunc --filter "reference=${SUPERVISOR_IMAGE}" --format "{{.ID}}" | uniq || echo "") - docker image rm --force "${SUPERVISOR_IMAGE_IDS}" || true + SUPERVISOR_IMAGE_IDS=$(docker images --no-trunc --filter "reference=${SUPERVISOR_IMAGE}" --format "{{.ID}}" | sort | uniq || echo "") + # Intended splitting of SUPERVISOR_IMAGE_IDS + # Busybox sh doesn't support arrays + # shellcheck disable=SC2086 + docker image rm --force ${SUPERVISOR_IMAGE_IDS} || true SUPERVISOR_IMAGE_ID="" fi -# If Supervisor image is missing, pull it mkdir -p "$(dirname ${SUPERVISOR_STARTUP_MARKER})" touch ${SUPERVISOR_STARTUP_MARKER} -if [ -z "${SUPERVISOR_IMAGE_ID}" ]; then - # Try tagging legacy image with current name and try get its ID - echo "[WARNING] Supervisor image missing, trying to use the legacy image name" - docker tag "homeassistant/${SUPERVISOR_ARCH}-hassio-supervisor:latest" "${SUPERVISOR_IMAGE}:latest" || true - SUPERVISOR_IMAGE_ID=$(docker images --no-trunc --filter "reference=${SUPERVISOR_IMAGE}:latest" --format "{{.ID}}" || echo "") -fi +# If Supervisor image is missing, pull it if [ -z "${SUPERVISOR_IMAGE_ID}" ]; then # Get the latest from update information # Using updater information instead of config. If the config version is From 6579b978d048f96f4feec917946643a9005d261c Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 4 Dec 2023 15:00:06 +0100 Subject: [PATCH 6/6] Bump OS to release version 11.2 --- buildroot-external/meta | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildroot-external/meta b/buildroot-external/meta index ab35108e0..427500597 100644 --- a/buildroot-external/meta +++ b/buildroot-external/meta @@ -1,8 +1,8 @@ VERSION_MAJOR="11" VERSION_MINOR="2" -VERSION_SUFFIX="rc2" +VERSION_SUFFIX="" HASSOS_NAME="Home Assistant OS" HASSOS_ID="haos" -DEPLOYMENT="staging" +DEPLOYMENT="production"