From b40f9c4069d14f776dc198fb81b33fecbaf531c7 Mon Sep 17 00:00:00 2001 From: "TwentyOne.Life" Date: Wed, 7 Oct 2026 16:22:06 +0200 Subject: [PATCH] set up the webcam when /dev/video0 is a leftover regular file Without CAP_MKNOD the webcam block falls back to touch, which leaves a regular file at /dev/video0. Where /dev outlives a restart of the init, that file made the existence test skip the whole block on every later start. A regular file there is now treated as the placeholder it is. A character device is still left alone, so a real video device passed in from the host is not touched. closes #195 --- root/etc/s6-overlay/s6-rc.d/init-selkies-config/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-selkies-config/run b/root/etc/s6-overlay/s6-rc.d/init-selkies-config/run index 64430f39..5cda6a05 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-selkies-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-selkies-config/run @@ -372,8 +372,8 @@ for pad_file in "${PAD_FILES[@]}"; do fi done -# webcam setup -if [[ -z ${NO_WEBCAM+x} ]] && [[ ! -e /dev/video0 ]] && { mknod /dev/video0 c 81 0 2>/dev/null || touch /dev/video0 2>/dev/null; }; then +# webcam setup, a regular file at /dev/video0 is our own placeholder from an earlier init +if [[ -z ${NO_WEBCAM+x} ]] && { [[ -f /dev/video0 ]] || { [[ ! -e /dev/video0 ]] && { mknod /dev/video0 c 81 0 2>/dev/null || touch /dev/video0 2>/dev/null; }; }; }; then chmod 777 /dev/video0 printf "true" > /run/s6/container_environment/SELKIES_WEBCAM_ENABLED printf "true" > /run/s6/container_environment/SELKIES_UI_SIDEBAR_SHOW_WEBCAM