-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathkodi-config
executable file
·53 lines (41 loc) · 1.79 KB
/
kodi-config
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
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
KODI_ROOT=$HOME/.kodi
BOOT_STATE="$(cat $HOME/.config/boot.status 2>/dev/null)"
# May not exist if testing a clean /storage/.kodi without rebooting
mkdir -p $KODI_ROOT/userdata
# hack: make addon-bins executable
# done in kodi on addon install. but just in case..
chmod +x $KODI_ROOT/addons/*/bin/* 2>/dev/null
# setup Kodi sources
if [ ! -f $KODI_ROOT/userdata/sources.xml ]; then
if [ -f /usr/share/kodi/config/sources.xml ]; then
cp /usr/share/kodi/config/sources.xml $KODI_ROOT/userdata
fi
fi
# common setup guisettings
if [ ! -f $KODI_ROOT/userdata/guisettings.xml ] ; then
if [ -f /usr/share/kodi/config/guisettings.xml ]; then
cp /usr/share/kodi/config/guisettings.xml $KODI_ROOT/userdata
fi
if [ "$BOOT_STATE" = "SAFE" ]; then
[ ! -f $KODI_ROOT/userdata/guisettings.xml ] && echo '<settings version="2"></settings>' > $KODI_ROOT/userdata/guisettings.xml
xmlstarlet ed --omit-decl --inplace -s settings -t elem -n setting -v "maroon" -i settings/setting -t attr -n id -v lookandfeel.skincolors $KODI_ROOT/userdata/guisettings.xml
fi
fi
KODI_ARGS=""
echo "KODI_ARGS=\"$KODI_ARGS\"" > /run/libreelec/kodi.conf
if [ "$(uname -m)" = "x86_64" ]; then
echo "MALLOC_MMAP_THRESHOLD_=524288" >> /run/libreelec/kodi.conf
else #arm
echo "MALLOC_MMAP_THRESHOLD_=8192" >> /run/libreelec/kodi.conf
fi
# required for inputstreamhelper to detect TLS 64-bytes support
if [ -n "$(uname -m | grep arm)" ] || [ "$(uname -m)" == "aarch64" ]; then
echo "LIBC_WIDEVINE_PATCHLEVEL=1" >> /run/libreelec/kodi.conf
fi
if [ -f /storage/.config/kodi.conf ] ; then
cat /storage/.config/kodi.conf >>/run/libreelec/kodi.conf
fi