distribution/packages/jelos/autostart/001-setup

63 lines
1.3 KiB
Text
Raw Normal View History

#!/bin/sh
2022-02-05 14:23:32 +00:00
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
# Minimal OS variable loading for performance
. /etc/profile.d/02-distribution
2022-02-05 14:23:32 +00:00
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
### Inspect the system config and revert
### to last known good state if corrupt.
/usr/bin/chksysconfig verify
### 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
### Enable the desired number of threads.
tocon "Restoring cpu threads..."
NUMTHREADS=$(get_setting "system.threads")
if [ -n "${NUMTHREADS}" ]
2023-01-03 10:13:05 +00:00
then
onlinethreads ${NUMTHREADS} 0
2023-01-03 10:13:05 +00:00
else
onlinethreads all 1
2023-01-03 10:13:05 +00:00
fi
### If we don't have a default governor set, set it
2022-12-21 22:24:01 +00:00
### to schedutil.
if [ -z "$(get_setting system.cpugovernor)" ]
then
2022-12-21 22:24:01 +00:00
set_setting system.cpugovernor schedutil
fi
2022-08-13 12:55:33 +00:00
### Set the default GPU performance mode
GPUPERF=$(get_setting system.gpuperf)
if [ -n "${GPUPERF}" ]
then
gpu_performance_level ${GPUPERF}
fi
### Configure suspend mode.
MYSLEEPMODE=$(get_setting system.suspendmode)
if [ -n "${MYSLEEPMODE}" ]
then
/usr/bin/setsuspendmode ${MYSLEEPMODE}
else
/usr/bin/setsuspendmode mem
fi
### Clean up settings
sort_settings