diff --git a/Dockerfile b/Dockerfile index e344cef..d63abf4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM ghcr.io/linuxserver/baseimage-alpine:3.21 +FROM ghcr.io/linuxserver/baseimage-alpine:3.22 # set version label ARG BUILD_DATE @@ -13,7 +13,8 @@ ENV \ S6_SERVICES_GRACETIME=240000 \ UV_SYSTEM_PYTHON=true \ UV_NO_CACHE=true \ - UV_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/" + UV_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/" \ + ATTACHED_DEVICES_PERMS="/dev/ttyACM* /dev/ttyUSB* -type c" COPY root/etc/pip.conf /etc/ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 6a7b50f..357bc40 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.21 +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.22 # set version label ARG BUILD_DATE @@ -13,7 +13,8 @@ ENV \ S6_SERVICES_GRACETIME=240000 \ UV_SYSTEM_PYTHON=true \ UV_NO_CACHE=true \ - UV_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/" + UV_EXTRA_INDEX_URL="https://wheels.home-assistant.io/musllinux-index/" \ + ATTACHED_DEVICES_PERMS="/dev/ttyACM* /dev/ttyUSB* -type c" COPY root/etc/pip.conf /etc/ diff --git a/README.md b/README.md index daf328c..b2a8631 100644 --- a/README.md +++ b/README.md @@ -318,6 +318,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **02.10.25:** - Rebase to alpine 3.22, rely on baseimage service for usb device permission fixing. * **19.09.25:** - Add the necessary capabilities in the container to allow the unprivileged user access to bluetooth stack. * **03.01.25:** - Rebase to alpine 3.21. * **04.12.24:** - Make setcap target dynamic. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 3473b85..7f01bec 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -6,7 +6,6 @@ external_type: pip_version release_type: stable release_tag: latest ls_branch: main -build_armhf: false repo_vars: - EXT_RELEASE_TYPE = 'pip_version' - EXT_PIP = 'homeassistant' diff --git a/readme-vars.yml b/readme-vars.yml index f2a279f..309447f 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -116,6 +116,7 @@ init_diagram: | "homeassistant:latest" <- Base Images # changelog changelogs: + - {date: "02.10.25:", desc: "Rebase to alpine 3.22, rely on baseimage service for usb device permission fixing."} - {date: "19.09.25:", desc: "Add the necessary capabilities in the container to allow the unprivileged user access to bluetooth stack."} - {date: "03.01.25:", desc: "Rebase to alpine 3.21."} - {date: "04.12.24:", desc: "Make setcap target dynamic."} diff --git a/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/dependencies.d/init-config-homeassistant b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-config-homeassistant similarity index 100% rename from root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/dependencies.d/init-config-homeassistant rename to root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-config-homeassistant diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-usb-homeassistant b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-usb-homeassistant deleted file mode 100644 index e69de29..0000000 diff --git a/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/run b/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/run deleted file mode 100755 index ef4ac1c..0000000 --- a/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/run +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -FILES=$(find /dev/ttyACM* /dev/ttyUSB* -type c -print 2>/dev/null) - -for i in $FILES; do - USB_GID=$(stat -c '%g' "${i}") - USB_UID=$(stat -c '%u' "${i}") - # check if user matches device - if id -u abc | grep -qw "${USB_UID}"; then - echo "**** permissions for ${i} are good ****" - else - # check if group matches and that device has group rw - if id -G abc | grep -qw "${USB_GID}" && [ $(stat -c '%A' "${i}" | cut -b 5,6) = "rw" ]; then - echo "**** permissions for ${i} are good ****" - # check if device needs to be added to USB group - elif ! id -G abc | grep -qw "${USB_GID}"; then - # check if USB group needs to be created - USB_NAME=$(getent group "${USB_GID}" | awk -F: '{print $1}') - if [ -z "${USB_NAME}" ]; then - USB_NAME="usb$(head /dev/urandom | tr -dc 'a-z0-9' | head -c4)" - groupadd "${USB_NAME}" - groupmod -g "${USB_GID}" "${USB_NAME}" - echo "**** creating USB group ${USB_NAME} with id ${USB_GID} ****" - fi - echo "**** adding ${i} to USB group ${USB_NAME} with id ${USB_GID} ****" - usermod -a -G "${USB_NAME}" abc - fi - # check if device has group rw - if [ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]; then - echo -e "**** The device ${i} does not have group read/write permissions, attempting to fix inside the container. ****" - chmod g+rw "${i}" - fi - fi -done diff --git a/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/type b/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/type deleted file mode 100644 index bdd22a1..0000000 --- a/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/up b/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/up deleted file mode 100644 index b28446d..0000000 --- a/root/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/up +++ /dev/null @@ -1 +0,0 @@ -/etc/s6-overlay/s6-rc.d/init-usb-homeassistant/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-homeassistant/dependencies.d/init-usb-homeassistant b/root/etc/s6-overlay/s6-rc.d/svc-homeassistant/dependencies.d/init-usb-homeassistant deleted file mode 100644 index e69de29..0000000 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-usb-homeassistant b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-usb-homeassistant deleted file mode 100644 index e69de29..0000000