distribution/packages/sysutils/systemd/scripts/userconfig-setup
fewtarius c83cd844b1
* Complete SyncThing integration.
* Switch on in ES under Network Settings.
  * Connect via browser to http://device:8384.
  * Username: root, Password: System Settings Menu
* A bit of startup optimization.
2023-02-09 19:17:29 -05:00

47 lines
2.2 KiB
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2022-present Fewtarius
. /etc/profile
if [ ! -e "/storage/.configured" ]
then
# 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/ 2>&1 >/var/log/configure.log
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
mkdir -p /storage/.config/modprobe.d 2>&1 >>/var/log/configure.log
touch /storage/.configured 2>&1 >>/var/log/configure.log
fi
if [ ! -e "/storage/.cache/ld.so.cache" ]
then
### Create library cache
ldconfig -X 2>&1 >>/var/log/configure.log
fi
if [ ! -d "/storage/.config/emulationstation/locale" ]
then
rsync -a --delete /usr/config/locale/ /storage/.config/emulationstation/locale/ 2>&1 >>/var/log/configure.log
fi