-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathkodi
71 lines (62 loc) · 2.38 KB
/
kodi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh -e
# Copyright (c) 2016 The crouton Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
if [ "${TARGETNOINSTALL:-c}" = 'c' ]; then
if release -le wheezy; then
error 99 "Kodi not supported on Debian Wheezy or older."
elif release -eq precise; then
error 99 "Kodi not supported on Precise Ubuntu."
fi
fi
REQUIRES='x11'
PROVIDES='xbmc'
DESCRIPTION='Installs the KODI media player. (Approx. 200MB)'
HOSTBIN='startkodi'
CHROOTETC='kodi-keyboard.xml kodi-cycle.py'
. "${TARGETSDIR:="$PWD"}/common"
### Append to prepare.sh:
## Debian Overrides
# Kodi wiki recommends using the Jessie Backports repository
if release -eq jessie; then
cat > '/etc/apt/sources.list.d/kodi.list' <<EOF
# Bring in Jessie Backports for newer Kodi
deb http://http.debian.net/debian jessie-backports main
EOF
# Update database
apt-get update || true
fi
## Ubuntu Overrides
# Kodi has an official ppa for the latest stable version
if [ "$DISTRO" = 'ubuntu' ] && [ "$ARCH" = 'amd64' -o "$ARCH" = 'i386' ]; then
# Pull in the signing key
apt-key adv --keyserver 'keyserver.ubuntu.com' \
--recv-keys '91E7EE5E'
# Add the software source
cat > '/etc/apt/sources.list.d/kodi.list' <<EOF
# Bring in Kodi PPA Repository
deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu $RELEASE main
deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu $RELEASE main
EOF
# Update database
apt-get update || true
fi
install kodi pulseaudio
# Configure keymaps kodi for the hotkeys ctr-shift-alt F1/F2 to
# cycle through chroots/chromeos. We use ~/.kodi/userdata/keymaps/keyboard.xml
# for this purpose, but the main user may not have been created yet, so we
# add a script in /etc/profile.d to link ~/.kodi/userdata/keymaps/keyboard.xml
# to /etc/crouton/kodi-keyboard.xml
profiledsh='/etc/profile.d/crouton-kodi-keymaps.sh'
# Make sure symbolic link is setup on login
echo '#!/bin/sh
keyboardxmldir="$HOME/.kodi/userdata/keymaps"
# Do not install if user is root, or $HOME does not exist
if [ "$(id -u)" -ne 0 -a -d "$HOME" -a ! -e "$keyboardxmldir/keyboard.xml" ]; then
mkdir -p "$keyboardxmldir"
ln -sfT /etc/crouton/kodi-keyboard.xml "$keyboardxmldir/keyboard.xml"
fi' > "$profiledsh"
chmod 755 "$profiledsh"
TIPS="$TIPS
You can start KODI via the startkodi host command: sudo startkodi
"