From caec8f9d4d26387303171712e9810c9c64e37944 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Mon, 27 Nov 2023 13:17:55 +0000 Subject: [PATCH] Resequence thread and gpu setting as it was being excuted too early on some devices. --- packages/jelos/autostart/001-setup | 39 ++------------------------ packages/jelos/autostart/008-perfmode | 33 ++++++++++++++++++++++ packages/jelos/autostart/009-sleepmode | 17 +++++++++++ 3 files changed, 53 insertions(+), 36 deletions(-) create mode 100755 packages/jelos/autostart/008-perfmode create mode 100755 packages/jelos/autostart/009-sleepmode diff --git a/packages/jelos/autostart/001-setup b/packages/jelos/autostart/001-setup index 470177f18..72d369c5c 100755 --- a/packages/jelos/autostart/001-setup +++ b/packages/jelos/autostart/001-setup @@ -25,42 +25,9 @@ fi ### to last known good state if corrupt. /usr/bin/chksysconfig verify +### Clean up settings +sort_settings + ### 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}" ] -then - onlinethreads ${NUMTHREADS} 0 -else - onlinethreads all 1 -fi - -### If we don't have a default governor set, set it -### to schedutil. -if [ -z "$(get_setting system.cpugovernor)" ] -then - set_setting system.cpugovernor schedutil -fi - -### 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/suspendmode ${MYSLEEPMODE} -else - /usr/bin/suspendmode mem -fi - -### Clean up settings -sort_settings diff --git a/packages/jelos/autostart/008-perfmode b/packages/jelos/autostart/008-perfmode new file mode 100755 index 000000000..71d6770be --- /dev/null +++ b/packages/jelos/autostart/008-perfmode @@ -0,0 +1,33 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS) + +# Minimal OS variable loading for performance +. /etc/profile.d/001-functions +. /etc/profile.d/099-freqfunctions + +tocon "Setting performance mode..." + +### Enable the desired number of threads. +tocon "Restoring cpu threads..." +NUMTHREADS=$(get_setting "system.threads") +if [ -n "${NUMTHREADS}" ] +then + onlinethreads ${NUMTHREADS} 0 +else + onlinethreads all 1 +fi + +### If we don't have a default governor set, set it +### to schedutil but don't enable it. +if [ -z "$(get_setting system.cpugovernor)" ] +then + set_setting system.cpugovernor schedutil +fi + +### Set the default GPU performance mode +GPUPERF=$(get_setting system.gpuperf) +if [ -n "${GPUPERF}" ] +then + gpu_performance_level ${GPUPERF} +fi diff --git a/packages/jelos/autostart/009-sleepmode b/packages/jelos/autostart/009-sleepmode new file mode 100755 index 000000000..74482f941 --- /dev/null +++ b/packages/jelos/autostart/009-sleepmode @@ -0,0 +1,17 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS) + +# Minimal OS variable loading for performance +. /etc/profile.d/001-functions + +tocon "Configure suspend mode..." + +### Configure suspend mode. +MYSLEEPMODE=$(get_setting system.suspendmode) +if [ -n "${MYSLEEPMODE}" ] +then + /usr/bin/suspendmode ${MYSLEEPMODE} +else + /usr/bin/suspendmode mem +fi