2023-08-07 00:30:11 +00:00
|
|
|
#!/bin/sh
|
2023-10-23 22:44:47 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2023-09-19 10:57:33 +00:00
|
|
|
. /etc/profile
|
2023-04-22 20:01:07 +00:00
|
|
|
|
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
|
2023-09-04 14:54:35 +00:00
|
|
|
mkdir -p /tmp/cache
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
ln -sf /tmp/cache /storage/cache/.cores
|
|
|
|
|
2023-09-04 14:54:35 +00:00
|
|
|
if [ ! -d "/storage/.config/profile.d" ]
|
|
|
|
then
|
|
|
|
mkdir -p /storage/.config/profile.d
|
|
|
|
fi
|
|
|
|
|
2023-04-23 13:44:13 +00:00
|
|
|
### Inspect the system config and revert
|
|
|
|
### to last known good state if corrupt.
|
|
|
|
/usr/bin/chksysconfig verify
|
|
|
|
|
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-26 00:41:58 +00:00
|
|
|
### Enable the desired number of threads.
|
2023-04-22 20:01:07 +00:00
|
|
|
tocon "Restoring cpu threads..."
|
2023-01-26 00:41:58 +00:00
|
|
|
NUMTHREADS=$(get_setting "system.threads")
|
|
|
|
if [ -n "${NUMTHREADS}" ]
|
2023-01-03 10:13:05 +00:00
|
|
|
then
|
2023-01-26 00:41:58 +00:00
|
|
|
onlinethreads ${NUMTHREADS} 0
|
2023-01-03 10:13:05 +00:00
|
|
|
else
|
2023-01-26 00:41:58 +00:00
|
|
|
onlinethreads all 1
|
2023-01-03 10:13:05 +00:00
|
|
|
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
|
|
|
|
2023-06-23 10:57:57 +00:00
|
|
|
### Set the default GPU performance mode
|
|
|
|
GPUPERF=$(get_setting system.gpuperf)
|
|
|
|
if [ -n "${GPUPERF}" ]
|
|
|
|
then
|
|
|
|
gpu_performance_level ${GPUPERF}
|
|
|
|
fi
|
|
|
|
|
2023-06-02 20:58:46 +00:00
|
|
|
### Configure suspend mode.
|
|
|
|
MYSLEEPMODE=$(get_setting system.suspendmode)
|
|
|
|
if [ -n "${MYSLEEPMODE}" ]
|
|
|
|
then
|
2023-10-15 02:18:17 +00:00
|
|
|
/usr/bin/suspendmode ${MYSLEEPMODE}
|
2023-06-02 20:58:46 +00:00
|
|
|
else
|
2023-10-15 02:18:17 +00:00
|
|
|
/usr/bin/suspendmode mem
|
2023-06-02 20:58:46 +00:00
|
|
|
fi
|
2023-07-25 21:06:19 +00:00
|
|
|
|
|
|
|
### Clean up settings
|
|
|
|
sort_settings
|