From 3d443205d44f6a64b2519e78c30c36e9cdd47c21 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 15 Oct 2022 21:38:53 -0400 Subject: [PATCH] rebase plex to jammy, update to s6v3, remove opencl drivers --- Dockerfile | 10 +--------- Dockerfile.aarch64 | 2 +- Dockerfile.armhf | 2 +- README.md | 1 + readme-vars.yml | 1 + .../init-config-end/dependencies.d/init-plex-update | 0 .../s6-rc.d/init-plex-chown/dependencies.d/init-config | 0 .../s6-rc.d/init-plex-chown/run} | 5 +++-- root/etc/s6-overlay/s6-rc.d/init-plex-chown/type | 1 + root/etc/s6-overlay/s6-rc.d/init-plex-chown/up | 1 + .../init-plex-claim/dependencies.d/init-plex-chown | 0 .../s6-rc.d/init-plex-claim/run} | 8 ++++++-- root/etc/s6-overlay/s6-rc.d/init-plex-claim/type | 1 + root/etc/s6-overlay/s6-rc.d/init-plex-claim/up | 1 + .../init-plex-gid-video/dependencies.d/init-plex-claim | 0 .../s6-rc.d/init-plex-gid-video/run} | 0 root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/type | 1 + root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/up | 1 + .../dependencies.d/init-plex-gid-video | 0 .../s6-rc.d/init-plex-update/run} | 0 root/etc/s6-overlay/s6-rc.d/init-plex-update/type | 1 + root/etc/s6-overlay/s6-rc.d/init-plex-update/up | 1 + .../s6-rc.d/svc-plex/dependencies.d/init-services | 0 root/etc/s6-overlay/s6-rc.d/svc-plex/notification-fd | 1 + root/etc/s6-overlay/s6-rc.d/svc-plex/run | 8 ++++++++ root/etc/s6-overlay/s6-rc.d/svc-plex/type | 1 + .../s6-overlay/s6-rc.d/user/contents.d/init-plex-chown | 0 .../s6-overlay/s6-rc.d/user/contents.d/init-plex-claim | 0 .../s6-rc.d/user/contents.d/init-plex-gid-video | 0 .../s6-rc.d/user/contents.d/init-plex-update | 0 root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-plex | 0 root/etc/services.d/plex/run | 8 -------- 32 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-plex-update create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-chown/dependencies.d/init-config rename root/etc/{cont-init.d/40-chown-files => s6-overlay/s6-rc.d/init-plex-chown/run} (77%) mode change 100644 => 100755 create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-chown/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-chown/up create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-claim/dependencies.d/init-plex-chown rename root/etc/{cont-init.d/45-plex-claim => s6-overlay/s6-rc.d/init-plex-claim/run} (93%) mode change 100644 => 100755 create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-claim/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-claim/up create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/dependencies.d/init-plex-claim rename root/etc/{cont-init.d/50-gid-video => s6-overlay/s6-rc.d/init-plex-gid-video/run} (100%) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/up create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-update/dependencies.d/init-plex-gid-video rename root/etc/{cont-init.d/60-plex-update => s6-overlay/s6-rc.d/init-plex-update/run} (100%) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-update/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-plex-update/up create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-plex/dependencies.d/init-services create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-plex/notification-fd create mode 100755 root/etc/s6-overlay/s6-rc.d/svc-plex/run create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-plex/type create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-chown create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-claim create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-gid-video create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-update create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-plex delete mode 100644 root/etc/services.d/plex/run diff --git a/Dockerfile b/Dockerfile index 3204aed..26a889b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:focal +FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy # set version label ARG BUILD_DATE @@ -22,18 +22,10 @@ ENV DEBIAN_FRONTEND="noninteractive" \ PLEX_MEDIA_SERVER_INFO_DEVICE="Docker Container (LinuxServer.io)" RUN \ - echo "**** add Intel repo ****" && \ - curl -sL https://repositories.intel.com/graphics/intel-graphics.key | apt-key add - && \ - echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' > /etc/apt/sources.list.d/intel.list && \ echo "**** install runtime packages ****" && \ apt-get update && \ apt-get install -y \ jq \ - intel-igc-cm=1.0.128+i699.3~u20.04 \ - intel-opencl-icd=21.49.21786+i643~u20.04 \ - libigc1=1.0.10409+i699.3~u20.04 \ - libigdfcl1=1.0.10409+i699.3~u20.04 \ - libigdgmm11=21.3.3+i643~u20.04 \ udev \ unrar \ wget && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index ffe9a7a..a005fdd 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-focal +FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy # set version label ARG BUILD_DATE diff --git a/Dockerfile.armhf b/Dockerfile.armhf index e4ce32e..279bbe7 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-focal +FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-jammy # set version label ARG BUILD_DATE diff --git a/README.md b/README.md index b471958..f8578ce 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **16.10.22:** - Rebase to jammy. Update to s6v3. Remove opencl packages (bundled with plex). * **18.07.22:** - Pin all opencl related driver packages. * **16.05.22:** - Pin opencl version. * **04.03.22:** - Increase verbosity of video device permissions fix, attempt to fix missing group rw. diff --git a/readme-vars.yml b/readme-vars.yml index dc0718d..9a1e7e2 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -107,6 +107,7 @@ app_setup_block: | # changelog changelogs: + - { date: "16.10.22:", desc: "Rebase to jammy. Update to s6v3. Remove opencl packages (bundled with plex)." } - { date: "18.07.22:", desc: "Pin all opencl related driver packages." } - { date: "16.05.22:", desc: "Pin opencl version." } - { date: "04.03.22:", desc: "Increase verbosity of video device permissions fix, attempt to fix missing group rw." } diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-plex-update b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-plex-update new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-chown/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/40-chown-files b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run old mode 100644 new mode 100755 similarity index 77% rename from root/etc/cont-init.d/40-chown-files rename to root/etc/s6-overlay/s6-rc.d/init-plex-chown/run index b2e3c31..b64fe98 --- a/root/etc/cont-init.d/40-chown-files +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run @@ -16,8 +16,9 @@ if [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then fi # remove plex pid after unclean stop -[[ -f "/config/Library/Application Support/Plex Media Server/plexmediaserver.pid" ]] && \ -rm -f "/config/Library/Application Support/Plex Media Server/plexmediaserver.pid" +if [[ -f "/config/Library/Application Support/Plex Media Server/plexmediaserver.pid" ]]; then + rm -f "/config/Library/Application Support/Plex Media Server/plexmediaserver.pid" +fi # permissions (non-recursive) on config root and folders chown abc:abc \ diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-chown/type b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/type new file mode 100644 index 0000000..3d92b15 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-chown/up b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/up new file mode 100644 index 0000000..2d5ad2f --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-chown/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-plex-chown/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-claim/dependencies.d/init-plex-chown b/root/etc/s6-overlay/s6-rc.d/init-plex-claim/dependencies.d/init-plex-chown new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/45-plex-claim b/root/etc/s6-overlay/s6-rc.d/init-plex-claim/run old mode 100644 new mode 100755 similarity index 93% rename from root/etc/cont-init.d/45-plex-claim rename to root/etc/s6-overlay/s6-rc.d/init-plex-claim/run index 7841f54..c597876 --- a/root/etc/cont-init.d/45-plex-claim +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-claim/run @@ -1,6 +1,10 @@ #!/usr/bin/with-contenv bash -if grep -qs "PlexOnlineToken" "/config/Library/Application Support/Plex Media Server/Preferences.xml" || [ -z "$PLEX_CLAIM" ]; then +if grep -qs "PlexOnlineToken" "/config/Library/Application Support/Plex Media Server/Preferences.xml"; then + echo "**** Server already claimed ****" + exit 0 +elif [ -z "$PLEX_CLAIM" ]; then + echo "**** Server is unclaimed, but no claim token has been set ****" exit 0 fi PREFNAME="/config/Library/Application Support/Plex Media Server/Preferences.xml" @@ -76,4 +80,4 @@ if [ -n "$PlexOnlineToken" ]; then sed -i "s/\/>/ PlexOnlineToken=\"${PlexOnlineToken}\"\/>/g" "${PREFNAME}" else echo "Unable to claim Plex server. Either manually claim by connecting to http://serverip:32400/web from the same network subnet, or recreate container with a new claim token." -fi \ No newline at end of file +fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-claim/type b/root/etc/s6-overlay/s6-rc.d/init-plex-claim/type new file mode 100644 index 0000000..3d92b15 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-claim/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-claim/up b/root/etc/s6-overlay/s6-rc.d/init-plex-claim/up new file mode 100644 index 0000000..56750b8 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-claim/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-plex-claim/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/dependencies.d/init-plex-claim b/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/dependencies.d/init-plex-claim new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/50-gid-video b/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/run similarity index 100% rename from root/etc/cont-init.d/50-gid-video rename to root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/type b/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/type new file mode 100644 index 0000000..3d92b15 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/up b/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/up new file mode 100644 index 0000000..05f6fde --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-gid-video/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-plex-gid-video/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-update/dependencies.d/init-plex-gid-video b/root/etc/s6-overlay/s6-rc.d/init-plex-update/dependencies.d/init-plex-gid-video new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/60-plex-update b/root/etc/s6-overlay/s6-rc.d/init-plex-update/run similarity index 100% rename from root/etc/cont-init.d/60-plex-update rename to root/etc/s6-overlay/s6-rc.d/init-plex-update/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-update/type b/root/etc/s6-overlay/s6-rc.d/init-plex-update/type new file mode 100644 index 0000000..3d92b15 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-update/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-plex-update/up b/root/etc/s6-overlay/s6-rc.d/init-plex-update/up new file mode 100644 index 0000000..6b6b164 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-plex-update/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-plex-update/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/svc-plex/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-plex/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-plex/notification-fd b/root/etc/s6-overlay/s6-rc.d/svc-plex/notification-fd new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-plex/notification-fd @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/svc-plex/run b/root/etc/s6-overlay/s6-rc.d/svc-plex/run new file mode 100755 index 0000000..ba42c34 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-plex/run @@ -0,0 +1,8 @@ +#!/usr/bin/with-contenv bash + +echo "Starting Plex Media Server. . . (you can ignore the libusb_init error)" +export PLEX_MEDIA_SERVER_INFO_MODEL=$(uname -m) +export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=$(uname -r) +exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 32400" \ + s6-setuidgid abc "/usr/lib/plexmediaserver/Plex Media Server" diff --git a/root/etc/s6-overlay/s6-rc.d/svc-plex/type b/root/etc/s6-overlay/s6-rc.d/svc-plex/type new file mode 100644 index 0000000..1780f9f --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-plex/type @@ -0,0 +1 @@ +longrun \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-chown b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-chown new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-claim b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-claim new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-gid-video b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-gid-video new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-update b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-plex-update new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-plex b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-plex new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/services.d/plex/run b/root/etc/services.d/plex/run deleted file mode 100644 index 9db8cdc..0000000 --- a/root/etc/services.d/plex/run +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/with-contenv bash - -echo "Starting Plex Media Server." -export PLEX_MEDIA_SERVER_INFO_MODEL=$(uname -m) -export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=$(uname -r) -exec \ - s6-setuidgid abc \ - /usr/lib/plexmediaserver/Plex\ Media\ Server