mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
cpufreqscaling: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
d93cae0b23
commit
51fcb044f6
@ -30,7 +30,7 @@ After=multi-user.target
|
|||||||
User=root
|
User=root
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=30
|
RestartSec=30
|
||||||
ExecStart=/bin/ash /usr/sbin/scaler.sh
|
ExecStart=/usr/sbin/scaler.sh
|
||||||
|
|
||||||
[X-Synology]
|
[X-Synology]
|
||||||
Author=Virtualization Team
|
Author=Virtualization Team
|
||||||
@ -49,9 +49,11 @@ After=multi-user.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
Type=oneshot
|
Type=on-failure
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=/bin/ash /usr/sbin/rescaler.sh ${2}
|
ExecStart=/usr/sbin/rescaler.sh ${2}
|
||||||
|
|
||||||
[X-Synology]
|
[X-Synology]
|
||||||
Author=Virtualization Team
|
Author=Virtualization Team
|
||||||
@ -59,28 +61,6 @@ EOF
|
|||||||
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
||||||
ln -vsf /usr/lib/systemd/system/cpufreqscaling.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/cpufreqscaling.service
|
ln -vsf /usr/lib/systemd/system/cpufreqscaling.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/cpufreqscaling.service
|
||||||
fi
|
fi
|
||||||
if [ ! -f /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db ]; then
|
|
||||||
echo "copy esynoscheduler.db"
|
|
||||||
mkdir -p /tmpRoot/usr/syno/etc/esynoscheduler
|
|
||||||
cp -vf /addons/esynoscheduler.db /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db
|
|
||||||
fi
|
|
||||||
echo "insert scaling... task to esynoscheduler.db"
|
|
||||||
export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib
|
|
||||||
if [ "${2}" = "userspace" ]; then
|
|
||||||
/tmpRoot/bin/sqlite3 /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db <<EOF
|
|
||||||
DELETE FROM task WHERE task_name LIKE 'Rescaler';
|
|
||||||
INSERT INTO task VALUES('Rescaler', '', 'bootup', '', 1, 0, 0, 0, '', 0, '/usr/sbin/scaler.sh', 'script', '{}', '', '', '{}', '{}');
|
|
||||||
DELETE FROM task WHERE task_name LIKE 'Unscaler';
|
|
||||||
INSERT INTO task VALUES('Unscaler', '', 'shutdown', '', 0, 0, 0, 0, '', 0, '/usr/sbin/unscaler.sh', 'script', '{}', '', '', '{}', '{}');
|
|
||||||
EOF
|
|
||||||
else
|
|
||||||
/tmpRoot/bin/sqlite3 /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db <<EOF
|
|
||||||
DELETE FROM task WHERE task_name LIKE 'Rescaler';
|
|
||||||
INSERT INTO task VALUES('Rescaler', '', 'bootup', '', 1, 0, 0, 0, '', 0, '/usr/sbin/rescaler.sh ${2}', 'script', '{}', '', '', '{}', '{}');
|
|
||||||
DELETE FROM task WHERE task_name LIKE 'Unscaler';
|
|
||||||
INSERT INTO task VALUES('Unscaler', '', 'shutdown', '', 0, 0, 0, 0, '', 0, '/usr/sbin/unscaler.sh', 'script', '{}', '', '', '{}', '{}');
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
elif [ "${1}" = "uninstall" ]; then
|
elif [ "${1}" = "uninstall" ]; then
|
||||||
echo "Installing cpufreqscalingscaling - ${1}"
|
echo "Installing cpufreqscalingscaling - ${1}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user