diff options
author | Marius Dinu <m95d+git@psihoexpert.ro> | 2021-08-27 10:21:53 +0300 |
---|---|---|
committer | Marius Dinu <m95d+git@psihoexpert.ro> | 2021-08-27 18:44:29 +0300 |
commit | 4a387bc568d25697c25575fdbd95d6d7d96bb9a8 (patch) | |
tree | 07100d65da797df6272f7c4297cbc32d6c2578af /multimedia/tvheadend/files | |
parent | 0be066d1c2d4fbdeba2f4241f430879c6f54c2fb (diff) |
tvheadend: multiple improvements
- Added menuconfig options:
- TV sources and protocols: SAT>IP, IPTV, HDHomeRun
- SoftCAM (3 options)
- Image cache (default changed to OFF)
- Trace debug option (default changed to OFF)
- Added menuconfig descriptions.
- Removed codecs.
- Made PIE option dependent on global OpenWRT PIE setting.
- Run as regular user, not root.
- Added USB hotplug script to change DVB tuners permissions.
- Fixed a first-start bug(?) that I encountered: admin account created but not saved.
Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
Diffstat (limited to 'multimedia/tvheadend/files')
-rw-r--r-- | multimedia/tvheadend/files/dvb.hotplug | 7 | ||||
-rw-r--r-- | multimedia/tvheadend/files/tvheadend.init | 19 |
2 files changed, 24 insertions, 2 deletions
diff --git a/multimedia/tvheadend/files/dvb.hotplug b/multimedia/tvheadend/files/dvb.hotplug new file mode 100644 index 000000000..8736aecd2 --- /dev/null +++ b/multimedia/tvheadend/files/dvb.hotplug @@ -0,0 +1,7 @@ +#!/bin/sh +case "$ACTION" in + add) + chown -R root:dvb /dev/dvb/*/* + chmod -R 660 /dev/dvb/*/* + ;; +esac diff --git a/multimedia/tvheadend/files/tvheadend.init b/multimedia/tvheadend/files/tvheadend.init index 31702e108..573ef33ad 100644 --- a/multimedia/tvheadend/files/tvheadend.init +++ b/multimedia/tvheadend/files/tvheadend.init @@ -9,8 +9,22 @@ PROG=/usr/bin/tvheadend TEMP_CONFIG=/tmp/tvheadend PERSISTENT_CONFIG=/etc/tvheadend +# If you change the user, update the owner of tvheadend configuration directory and files! +# If you change the group, update USB hotplug script for DVB devices in /dev/hotplug.d/usb/ +# otherwise, tvheadend won't have permissions to open newly connected tuners! +# Also update all other packages that use the dvb group. +TVH_USER=tvheadend +TVH_GROUP=dvb + + execute_first_run() { - "$PROG" -c "$1" -B -C -A >/dev/null 2>&1 + mkdir -p "$1" + chown -R $TVH_USER "$1" + # This should create a new configuration including an admin account with no name and no password, + # but it aborts (-A) without saving it: + #"$PROG" -c "$1" -B -C -A -u $TVH_USER -g $TVH_GROUP >/dev/null 2>&1 + # Instead, run it for 10s then kill it: + "$PROG" -c "$1" -B -C -u $TVH_USER -g $TVH_GROUP & TVH_PID=$! ; sleep 10 ; kill $TVH_PID ; sleep 2 } ensure_config_exists() { @@ -65,7 +79,8 @@ start_service() { ensure_config_exists procd_open_instance procd_set_param file /etc/config/tvheadend - procd_set_param command "$PROG" -B + chown -R root:$TVH_GROUP /dev/dvb/*/* + procd_set_param command "$PROG" -B -u $TVH_USER -g $TVH_GROUP load_uci_config procd_close_instance } |