distribution/packages/jelos/sources/autostart/common/001-setup

58 lines
1.5 KiB
Text
Raw Normal View History

2022-02-05 14:23:32 +00:00
#!/bin/sh
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
### Migrate distribution, and split games.
if [ -d "/storage/.config/distribution" ]
then
mv /storage/.config/distribution /storage/.config/system
mv /storage/.config/system/distribution.conf /storage/.config/system/system.cfg
fi
if [ ! -d "/storage/.config/game/configs" ]
then
mkdir -p /storage/.config/game/configs
for dir in $(find /storage/.config/system/configs/ -type d -maxdepth 1)
do
if [ "${dir}" = "all" ]
then
continue
fi
mv ${dir} /storage/.config/game/configs
done
fi
### Resume normal startup stuff.
if [ -d "/storage/.config/system/configs" ]
2022-02-05 14:23:32 +00:00
then
EXCLUDE="--exclude=configs"
fi
rsync -a --delete ${EXCLUDE} /usr/config/system/ /storage/.config/system/
rsync -a /usr/config/modules /storage/.config/
rsync -a /usr/config/game /storage/.config/
2022-02-05 14:23:32 +00:00
rsync -a --delete /usr/config/locale/ /storage/.config/emulationstation/locale/
cp -f /usr/config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt
cp -f /usr/config/ppsspp/PSP/SYSTEM/controls.ini /storage/.config/ppsspp/PSP/SYSTEM/controls.ini
if [ ! -L "/storage/.emulationstation" ]
then
ln -sf /storage/.config/emulationstation /storage/.emulationstation
fi
if [ -d "/storage/cache/.cores" ]
then
rm -rf /storage/cache/.cores
fi
if [ ! -d "/tmp/cache" ]
then
mkdir /tmp/cache
fi
ln -sf /tmp/cache /storage/cache/.cores