diff --git a/main/postmarketos-ui-kodi/APKBUILD b/main/postmarketos-ui-kodi/APKBUILD index b8a630897..dce4905f7 100644 --- a/main/postmarketos-ui-kodi/APKBUILD +++ b/main/postmarketos-ui-kodi/APKBUILD @@ -1,29 +1,30 @@ # Reference: https://postmarketos.org/uipkg # Maintainer: Bart Ribbers pkgname=postmarketos-ui-kodi -pkgver=1 -pkgrel=7 -pkgdesc="(Wayland) 10-foot UI useful on TV's" +pkgver=2 +pkgrel=0 +pkgdesc="(GBM) 10-foot UI useful on TV's" url="https://kodi.tv" arch="x86 x86_64 aarch64" # flatbuffers missing on armhf and armv7 license="GPL-3.0-or-later" depends=" - cage elogind kodi - kodi-wayland + kodi-gbm + kodi-polkit postmarketos-base-ui pulseaudio - tinydm - tinydm-openrc upower + networkmanager " install="$pkgname.post-install $pkgname.post-upgrade" -source="kodi.desktop" options="!check pmb:gpu-accel" +source="automount-media.rules" package() { - install -Dm644 "$srcdir"/kodi.desktop \ - "$pkgdir"/usr/share/wayland-sessions/kodi-wayland.desktop + install -Dm 644 automount-media.rules \ + "$pkgdir"/usr/lib/udev/rules.d/99-automount-media.rules } -sha512sums="fc7d545310a77845af88638e95a72f8774be4fb91231554ac91a2dfcd65d11aed5e6cea550548df5e12c49963968a17a89429fc0fb3ebf4a6843d95dccad7eee kodi.desktop" +sha512sums=" +80de117c696854d45b5fca98a7ea975a103fedf483e1415c19060447673d15d3ee1fe7fcdb3f093821fdcb0fdb389af106638c7e6a39b33028dc4d176395f0e8 automount-media.rules +" diff --git a/main/postmarketos-ui-kodi/automount-media.rules b/main/postmarketos-ui-kodi/automount-media.rules new file mode 100644 index 000000000..c252f9fc9 --- /dev/null +++ b/main/postmarketos-ui-kodi/automount-media.rules @@ -0,0 +1,19 @@ +# Automount any media you plug into the device to make it accessible to Kodi +# Thanks to https://www.axllent.org/docs/auto-mounting-usb-storage/ + +KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end" +# Import FS infos +IMPORT{program}="/sbin/blkid -o udev -p %N" +# Get a label if present, otherwise specify one +ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}" +ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k" +# Global mount options +ACTION=="add", ENV{mount_options}="relatime" +# Filesystem-specific mount options +ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002" +# Mount the device +ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}" +# Clean up after removal +ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}" +# Exit +LABEL="media_by_label_auto_mount_end" diff --git a/main/postmarketos-ui-kodi/kodi.desktop b/main/postmarketos-ui-kodi/kodi.desktop deleted file mode 100644 index a7e5834ff..000000000 --- a/main/postmarketos-ui-kodi/kodi.desktop +++ /dev/null @@ -1,6 +0,0 @@ -[Desktop Entry] -Name=Kodi (Wayland) -Comment=This session will start Kodi media center -Exec=cage -- /usr/bin/kodi --windowing wayland --standalone -TryExec=/usr/lib/kodi/kodi-wayland -Type=Application diff --git a/main/postmarketos-ui-kodi/postmarketos-ui-kodi.post-install b/main/postmarketos-ui-kodi/postmarketos-ui-kodi.post-install index ece534821..b7e35437f 100644 --- a/main/postmarketos-ui-kodi/postmarketos-ui-kodi.post-install +++ b/main/postmarketos-ui-kodi/postmarketos-ui-kodi.post-install @@ -1,6 +1,5 @@ #!/bin/sh -rc-update add tinydm default +rc-update add elogind default rc-update add networkmanager default - -tinydm-set-session -s /usr/share/wayland-sessions/kodi-wayland.desktop +rc-update add kodi default