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
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
# Remove those sample files that we manage
|
|
|
|
for sample in $(find /storage/.config -name '*.sample' 2>/dev/null); do
|
2022-02-28 21:36:40 +00:00
|
|
|
[ -f /usr/config/${sample:16} ] && rm -f ${sample}
|
2022-02-05 14:23:32 +00:00
|
|
|
done
|
|
|
|
|
2022-02-28 21:36:40 +00:00
|
|
|
if [ ! -e "/storage/.configured" ]
|
|
|
|
then
|
2022-06-20 01:03:49 +00:00
|
|
|
# Ensure that the boot images are configured properly (Resolves boot when charging issue on the RG503 and RG353P
|
|
|
|
/usr/share/bootloader/update.sh &>/dev/null
|
|
|
|
rm -f /storage/.config/boot.hint &>/dev/null
|
|
|
|
|
2022-02-28 21:36:40 +00:00
|
|
|
# Copy config files, but don't overwrite. Only run if /storage is fresh
|
|
|
|
## cp -iRp /usr/config/* /storage/.config/ &>/dev/null
|
|
|
|
## ignore es_systems.cfg and switch to rsync
|
|
|
|
rsync -a --ignore-existing --exclude=es_systems.cfg /usr/config/* /storage/.config/
|
2022-03-03 23:20:55 +00:00
|
|
|
mkdir -p /storage/.config/emulationstation/themes
|
2022-03-28 21:47:29 +00:00
|
|
|
ln -s /usr/share/themes/es-theme-art-book-next /storage/.config/emulationstation/themes/system-theme
|
|
|
|
|
2022-05-18 11:25:39 +00:00
|
|
|
### Link the game controller database so it is managed with OS updates.
|
|
|
|
rm -f /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt
|
|
|
|
ln -s /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt
|
|
|
|
|
|
|
|
### Remove and link es configs so they are managed with OS updates.
|
2022-07-13 21:59:42 +00:00
|
|
|
for es_cfg in es_features.cfg es_systems.cfg
|
2022-05-18 11:25:39 +00:00
|
|
|
do
|
|
|
|
rm -f /storage/.config/emulationstation/${es_cfg}
|
|
|
|
ln -s /usr/config/emulationstation/${es_cfg} /storage/.config/emulationstation/${es_cfg}
|
|
|
|
done
|
|
|
|
|
2022-03-28 21:47:29 +00:00
|
|
|
hres="$(fbset 2>/dev/null | awk '/geometry/ { print $2 }')"
|
2022-08-23 11:23:08 +00:00
|
|
|
cp -f /usr/config/splash/splash.png /storage/.config/emulationstation/resources/logo.png
|
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
|
|
|
|
ldconfig -X
|
|
|
|
fi
|
|
|
|
|
2022-04-14 09:59:09 +00:00
|
|
|
if [ ! -d "/storage/.config/emulationstation/locale/" ]
|
|
|
|
then
|
|
|
|
rsync -a --delete /usr/config/locale/ /storage/.config/emulationstation/locale/
|
|
|
|
fi
|