2022-03-28 21:47:29 +00:00
|
|
|
#!/bin/bash
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
2022-05-18 11:25:39 +00:00
|
|
|
# Copyright (C) 2022-present Fewtarius
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-03-28 21:47:29 +00:00
|
|
|
. /etc/profile
|
2022-02-28 21:36:40 +00:00
|
|
|
|
|
|
|
if [ ! -e "/storage/.configured" ]
|
|
|
|
then
|
|
|
|
# Copy config files, but don't overwrite. Only run if /storage is fresh
|
2023-02-10 00:17:29 +00:00
|
|
|
rsync -a --ignore-existing --exclude=es_systems.cfg /usr/config/* /storage/.config/ 2>&1 >/var/log/configure.log
|
2022-08-31 21:50:23 +00:00
|
|
|
|
2023-04-21 21:40:02 +00:00
|
|
|
if [ -e "/usr/bin/emulationstation" ]
|
|
|
|
then
|
|
|
|
mkdir -p /storage/.config/emulationstation/themes 2>&1 >>/var/log/configure.log
|
|
|
|
ln -s /usr/share/themes/es-theme-art-book-next /storage/.config/emulationstation/themes/system-theme 2>&1 >>/var/log/configure.log
|
|
|
|
ln -s /usr/share/themes/es-theme-minielec /storage/.config/emulationstation/themes/es-theme-minielec 2>&1 >>/var/log/configure.log
|
|
|
|
ln -s /usr/share/themes/es-theme-minimal /storage/.config/emulationstation/themes/es-theme-minimal 2>&1 >>/var/log/configure.log
|
|
|
|
|
|
|
|
### Link the game controller database so it is managed with OS updates.
|
|
|
|
rm -f /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt 2>&1 >>/var/log/configure.log
|
|
|
|
ln -s /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt 2>&1 >>/var/log/configure.log
|
|
|
|
|
|
|
|
### Remove and link es configs so they are managed with OS updates.
|
|
|
|
for es_cfg in es_features.cfg es_systems.cfg
|
|
|
|
do
|
|
|
|
ln -s /usr/config/emulationstation/${es_cfg} /storage/.config/emulationstation/${es_cfg} 2>&1 >>/var/log/configure.log
|
|
|
|
done
|
|
|
|
|
|
|
|
### Link the ES splash to the distribution splash
|
|
|
|
rm -f /storage/.config/emulationstation/resources/logo.png 2>&1 >>/var/log/configure.log
|
|
|
|
ln -sf /usr/config/splash/splash.png /storage/.config/emulationstation/resources/logo.png 2>&1 >>/var/log/configure.log
|
|
|
|
fi
|
2023-02-10 00:17:29 +00:00
|
|
|
mkdir -p /storage/.config/modprobe.d 2>&1 >>/var/log/configure.log
|
|
|
|
touch /storage/.configured 2>&1 >>/var/log/configure.log
|
2022-02-28 21:36:40 +00:00
|
|
|
fi
|
2022-04-14 09:59:09 +00:00
|
|
|
|
2022-07-31 15:12:57 +00:00
|
|
|
if [ ! -e "/storage/.cache/ld.so.cache" ]
|
|
|
|
then
|
|
|
|
### Create library cache
|
2023-02-10 00:17:29 +00:00
|
|
|
ldconfig -X 2>&1 >>/var/log/configure.log
|
2022-07-31 15:12:57 +00:00
|
|
|
fi
|
|
|
|
|
2023-04-21 21:40:02 +00:00
|
|
|
if [ ! -d "/storage/.config/emulationstation/locale" ] && \
|
|
|
|
[ -e "/usr/bin/emulationstation" ]
|
2022-04-14 09:59:09 +00:00
|
|
|
then
|
2023-02-10 00:17:29 +00:00
|
|
|
rsync -a --delete /usr/config/locale/ /storage/.config/emulationstation/locale/ 2>&1 >>/var/log/configure.log
|
2022-04-14 09:59:09 +00:00
|
|
|
fi
|