rename unneeded workaround and updates

This commit is contained in:
graysky 2015-01-03 10:03:16 -05:00
parent 181026cbf5
commit cb6e8d8e84
5 changed files with 8 additions and 76 deletions

View File

@ -8,11 +8,11 @@
# Contributor: Maxime Gauduin <alucryd@gmail.com> # Contributor: Maxime Gauduin <alucryd@gmail.com>
pkgname=kodi-standalone-service pkgname=kodi-standalone-service
pkgver=1.5 pkgver=1.6
pkgrel=2 pkgrel=1
pkgdesc="Systemd service and user to autostart kodi at boot" pkgdesc="Systemd service and user to autostart kodi at boot"
arch=('any') arch=('any')
url="https://wiki.archlinux.org/index.php/Xbmc#Autostarting_at_boot" url="https://wiki.archlinux.org/index.php/Kodi#Kodi-standalone-service"
license=('GPL') license=('GPL')
depends=('systemd' 'xorg-server' 'xorg-xinit' 'kodi') depends=('systemd' 'xorg-server' 'xorg-xinit' 'kodi')
replaces=('xbmc-standalone-service') replaces=('xbmc-standalone-service')
@ -21,8 +21,8 @@ source=("https://github.com/graysky2/$pkgname/archive/v$pkgver.tar.gz")
sha256sums=('10d3077b99d9a2511c3fc38e3ce73436d9de05c765ea4c9c44ca7b8bcd607f85') sha256sums=('10d3077b99d9a2511c3fc38e3ce73436d9de05c765ea4c9c44ca7b8bcd607f85')
package() { package() {
install -Dm644 "$srcdir/$pkgname-$pkgver/init/kodi.service" "$pkgdir/usr/lib/systemd/system/kodi.service" install -Dm755 "$srcdir/$pkgname-$pkgver/common/kodi-standalone2" \
install -Dm755 "$srcdir/$pkgname-$pkgver/common/kodi-standalone2" "$pkgdir/usr/bin/kodi-standalone2" "$pkgdir/usr/bin/kodi-standalone2"
install -dm 700 "$pkgdir"/var/lib/kodi install -dm 700 "$pkgdir"/var/lib/kodi
chown 420:420 "$pkgdir"/var/lib/kodi chown 420:420 "$pkgdir"/var/lib/kodi

View File

@ -6,10 +6,9 @@ A simple systemd service file to run kodi in standalone mode.
* xorg-server with xorg-xinit * xorg-server with xorg-xinit
## Post-install instructions ## Post-install instructions
If using xorg version >=1.16 then create /etc/X11/Xwrapper.config containing these two lines: If using xorg version >=1.16 then create /etc/X11/Xwrapper.config containing this line:
allowed_users = anybody allowed_users = anybody
needs_root_rights = yes
Note that the systemd service requires /var/lib/kodi to be user kodi's homedir. See the readme.install which contains scriptlets used by the Arch Linux package system. Users of other distros can adapt the code therein. Note that the systemd service requires /var/lib/kodi to be user kodi's homedir. See the readme.install which contains scriptlets used by the Arch Linux package system. Users of other distros can adapt the code therein.

View File

@ -1,66 +0,0 @@
#!/bin/sh
# Copyright (C) 2009-2013 Team XBMC
# http://xbmc.org
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with XBMC; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
APP=Kodi
prefix="/usr"
exec_prefix="/usr"
bindir="${exec_prefix}/bin"
bin_name=kodi
APP="${bindir}/${bin_name} --standalone $@"
PULSE_START="$(which start-pulseaudio-x11)"
if [ -n "$PULSE_START" ]; then
# delay needed to allow PA to initialize for kodi
# to detect all audio sources
$PULSE_START
sleep 6s
else
PULSE_SESSION="$(which pulse-session)"
if [ -n "$PULSE_SESSION" ]; then
XBMC="$PULSE_SESSION $XBMC"
fi
fi
LOOP=1
CRASHCOUNT=0
LASTSUCCESSFULSTART=$(date +%s)
while [ $(( $LOOP )) = "1" ]
do
$APP
RET=$?
NOW=$(date +%s)
if [ $(( ($RET >= 64 && $RET <=66) || $RET == 0 )) = "1" ]; then # clean exit
LOOP=0
else # crash
DIFF=$((NOW-LASTSUCCESSFULSTART))
if [ $(($DIFF > 60 )) = "1" ]; then # Not on startup, ignore
LASTSUCESSFULSTART=$NOW
CRASHCOUNT=0
else # at startup, look sharp
CRASHCOUNT=$((CRASHCOUNT+1))
if [ $(($CRASHCOUNT >= 3)) = "1" ]; then # Too many, bail out
LOOP=0
echo "${APP} has exited uncleanly 3 times in the last ${DIFF} seconds."
echo "Something is probably wrong"
fi
fi
fi
done

View File

@ -9,7 +9,7 @@ Group = kodi
PAMName=login PAMName=login
Type = simple Type = simple
TTYPath=/dev/tty7 TTYPath=/dev/tty7
ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/kodi-standalone2 -- :0 -nolisten tcp vt7 ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/kodi-standalone -- :0 -nolisten tcp vt7
Restart = on-abort Restart = on-abort
[Install] [Install]

View File

@ -43,8 +43,7 @@ post_remove() {
post_message() { post_message() {
echo "Users of Xorg >=1.16 wishing to autostart kodi standalone" echo "Users of Xorg >=1.16 wishing to autostart kodi standalone"
echo "must create or modify /etc/X11/Xwrapper.config to contain" echo "must create or modify /etc/X11/Xwrapper.config to contain"
echo "the following 2 lines:" echo "the following:"
echo echo
echo "allowed_users = anybody" echo "allowed_users = anybody"
echo "needs_root_rights = yes"
} }