2022-03-28 23:53:26 +00:00
|
|
|
#!/bin/bash
|
2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
|
|
|
|
|
|
|
. /etc/profile
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-04-03 17:12:46 +00:00
|
|
|
### We do not want to mount the cloud drive on startup
|
|
|
|
### so we'll reset the mount option to 0.
|
|
|
|
set_setting clouddrive.mounted 0
|
2022-06-01 21:22:25 +00:00
|
|
|
|
2023-01-03 10:13:05 +00:00
|
|
|
### Enable the desired number of cores.
|
|
|
|
NUMCORES=$(get_setting "system.cores")
|
|
|
|
if [ -n "${NUMCORES}" ]
|
|
|
|
then
|
|
|
|
onlinecores ${NUMCORES} 0
|
|
|
|
else
|
|
|
|
onlinecores all 1
|
|
|
|
fi
|
|
|
|
|
2022-06-01 21:22:25 +00:00
|
|
|
### If we don't have a default governor set, set it
|
2022-12-21 22:24:01 +00:00
|
|
|
### to schedutil.
|
2022-06-01 21:22:25 +00:00
|
|
|
if [ -z "$(get_setting system.cpugovernor)" ]
|
|
|
|
then
|
2022-12-21 22:24:01 +00:00
|
|
|
set_setting system.cpugovernor schedutil
|
2022-06-01 21:22:25 +00:00
|
|
|
fi
|
2022-08-13 12:55:33 +00:00
|
|
|
|
2022-08-14 23:00:26 +00:00
|
|
|
### Test for binary data in system.cfg and clean it
|
|
|
|
### if it exists.
|
|
|
|
/usr/bin/clean_sysconfig
|
2022-10-21 21:23:25 +00:00
|
|
|
|
|
|
|
### Set up our controller variables.
|
|
|
|
/usr/bin/mkcontroller
|