[+] update platform

1. update udev for air 2012;
  2. update commands for air 2012;
This commit is contained in:
Siarhei Siniak 2025-04-04 12:40:09 +03:00
parent fa732867c3
commit 7fa2a8a83c
7 changed files with 125 additions and 38 deletions

@ -1 +1 @@
Subproject commit 56af6d17019cef5bd52bd47a64697de7245b7a2d Subproject commit e52e1c22071d49ff23768dfefd1b33b94552ff6d

@ -7,5 +7,5 @@ ACTION=="add|change", SUBSYSTEM=="leds", DEVPATH=="/devices/platform/applesmc.76
ACTION=="add|change", KERNEL=="applesmc.768", SUBSYSTEM=="platform", DRIVER=="applesmc", TAG+="systemd", ENV{SYSTEMD_WANTS}="online.fxreader.pr34.udev@$devnode.service", OPTIONS="log_level=debug" ACTION=="add|change", KERNEL=="applesmc.768", SUBSYSTEM=="platform", DRIVER=="applesmc", TAG+="systemd", ENV{SYSTEMD_WANTS}="online.fxreader.pr34.udev@$devnode.service", OPTIONS="log_level=debug"
#KERNEL=="applesmc.768", SUBSYSTEM=="platform", DRIVER=="applesmc", MODE="0660", TAG+="uaccess", OPTIONS="log_level=debug", OPTIONS+="watch" #KERNEL=="applesmc.768", SUBSYSTEM=="platform", DRIVER=="applesmc", MODE="0660", TAG+="uaccess", OPTIONS="log_level=debug", OPTIONS+="watch"
ACTION=="add|change", DEVPATH=="/class/backlight/intel_backlight", RUN{program}+="/usr/bin/chmod 666 /sys$devpath/brightness" ACTION=="add|change", DEVPATH=="/class/backlight/intel_backlight", RUN{program}+="/usr/bin/chmod 666 /sys$devpath/brightness"
ACTION=="add|change", DEVPATH=="/devices/system/cpu/", RUN{program}+="/usr/bin/chmod 666 /sys$devpath/cpufreq/scaling_governor" ACTION=="add|change", KERNEL=="cpu0", SUBSYSTEM=="cpu", TAG+="systemd", ENV{SYSTEMD_WANTS}="online.fxreader.pr34.udev@$devnode.service", OPTIONS="log_level=debug"
ACTION=="add|change", KERNEL=="cpu[0-9]", SUBSYSTEM=="cpu", RUN{program}+="/usr/bin/chmod 666 /sys$devpath/cpufreq/scaling_governor" ACTION=="add|change", KERNEL=="cpu[0-9]", SUBSYSTEM=="cpu", TAG+="systemd", ENV{SYSTEMD_WANTS}="online.fxreader.pr34.udev@$devnode.service", OPTIONS="log_level=debug"

@ -2,36 +2,102 @@
# vi: filetype=python # vi: filetype=python
import re
import sys import sys
import os import os
import subprocess import subprocess
import argparse import argparse
import logging
from typing import (Any,) from typing import (Any,)
logger = logging.getLogger(__name__)
parser = argparse.ArgumentParser()
parser.add_argument( def run() -> None:
logging.basicConfig(level=logging.INFO)
parser = argparse.ArgumentParser()
parser.add_argument(
'--device', '--device',
) )
options = parser.parse_args() options = parser.parse_args()
DEVICES : dict[str, Any] = dict( DEVICES : dict[str, Any] = dict(
applesmc=dict( applesmc=dict(
devpath='sys/devices/platform/applesmc.768', devpath='sys/devices/platform/applesmc.768',
fan_node='/sys/devices/platform/applesmc.768/fan1_manual', node='/sys/devices/platform/applesmc.768/fan1_manual',
cmd=r''' cmd=r'''
chown root:fan /sys/devices/platform/applesmc.768/fan1_* chown root:fan /sys/devices/platform/applesmc.768/fan1_*
chmod g+w /sys/devices/platform/applesmc.768/fan1_* chmod g+w /sys/devices/platform/applesmc.768/fan1_*
''', ''',
), ),
) intel_pstate=dict(
devpath=r'/?sys/devices/system/cpu/cpu0',
node='/sys/devices/system/cpu/intel_pstate/no_turbo',
cmd=r'''
chown root:fan /sys/devices/system/cpu/intel_pstate/no_turbo
chown root:fan /sys/devices/system/cpu/intel_pstate/max_perf_pct
#chown root:fan /sys/devices/system/cpu/intel_pstate/status
chmod g+w /sys/devices/system/cpu/intel_pstate/no_turbo
chmod g+w /sys/devices/system/cpu/intel_pstate/max_perf_pct
#chmod g+w /sys/devices/system/cpu/intel_pstate/status
echo passive > /sys/devices/system/cpu/intel_pstate/status
chown root:fan /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
chown root:fan /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
chmod g+w /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
chmod g+w /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
''',
),
#governor=dict(
# devpath=r'/?sys/devices/system/cpu/cpu(\d+)',
# node=r'/sys/devices/system/cpu/cpu{0}/cpufreq/scaling_governor',
# cmd=r'''
# chown root:fan /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_governor
# chown root:fan /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_max_freq
# chmod g+w /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_governor
# chmod g+w /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_max_freq
# ''',
#),
)
if options.device == DEVICES['applesmc']['devpath']: processed : int = 0
while True:
if os.path.exists(DEVICES['applesmc']['fan_node']): logger.info(dict(device=options.device))
subprocess.check_call(DEVICES['applesmc']['cmd'], shell=True)
break for k, v in DEVICES.items():
else: devpath = re.compile(v['devpath'])
devpath_m = devpath.match(options.device)
if devpath_m is None:
continue
node_2 = v['node'].format(*devpath_m.groups())
# logger.info(dict(devpath_m=devpath_m, node=node_2))
while not os.path.exists(node_2):
#continue
time.sleep(1)
cmd_2 = v['cmd'].format(*devpath_m.groups())
subprocess.check_call(cmd_2, shell=True)
logger.info(dict(
devpath_m=devpath_m,
node_2=node_2,
cmd_2=cmd_2,
msg='processed',
label=k,
))
processed += 1
if processed == 0:
raise NotImplementedError raise NotImplementedError
if __name__ == '__main__':
run()

@ -44,18 +44,22 @@ def run() -> None:
chmod g+w /sys/devices/system/cpu/intel_pstate/max_perf_pct chmod g+w /sys/devices/system/cpu/intel_pstate/max_perf_pct
#chmod g+w /sys/devices/system/cpu/intel_pstate/status #chmod g+w /sys/devices/system/cpu/intel_pstate/status
echo passive > /sys/devices/system/cpu/intel_pstate/status echo passive > /sys/devices/system/cpu/intel_pstate/status
chown root:fan /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
chown root:fan /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
chmod g+w /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
chmod g+w /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
''', ''',
), ),
governor=dict( #governor=dict(
devpath=r'/?sys/devices/system/cpu/cpu(\d+)', # devpath=r'/?sys/devices/system/cpu/cpu(\d+)',
node=r'/sys/devices/system/cpu/cpu{0}/cpufreq/scaling_governor', # node=r'/sys/devices/system/cpu/cpu{0}/cpufreq/scaling_governor',
cmd=r''' # cmd=r'''
chown root:fan /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_governor # chown root:fan /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_governor
chown root:fan /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_max_freq # chown root:fan /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_max_freq
chmod g+w /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_governor # chmod g+w /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_governor
chmod g+w /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_max_freq # chmod g+w /sys/devices/system/cpu/cpu{0}/cpufreq/scaling_max_freq
''', # ''',
), #),
) )
processed : int = 0 processed : int = 0

@ -2614,8 +2614,16 @@ def desktop_services(argv):
def powersave(cls): def powersave(cls):
if cls.profile() == 'applesmc.768': if cls.profile() == 'applesmc.768':
subprocess.check_call(r''' subprocess.check_call(r'''
#echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
#echo powersave | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
#echo 1 > /sys/bus/platform/devices/applesmc.768/fan1_manual;
#echo 2000 > /sys/bus/platform/devices/applesmc.768/fan1_output;
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
echo powersave | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; echo 30 > /sys/devices/system/cpu/intel_pstate/max_perf_pct;
echo 900000 | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq;
echo schedutil | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
echo 1 > /sys/bus/platform/devices/applesmc.768/fan1_manual; echo 1 > /sys/bus/platform/devices/applesmc.768/fan1_manual;
echo 2000 > /sys/bus/platform/devices/applesmc.768/fan1_output; echo 2000 > /sys/bus/platform/devices/applesmc.768/fan1_output;
''', shell=True) ''', shell=True)
@ -2633,8 +2641,14 @@ echo schedutil | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
def performance(cls): def performance(cls):
if cls.profile() == 'applesmc.768': if cls.profile() == 'applesmc.768':
subprocess.check_call(r''' subprocess.check_call(r'''
#echo powersave | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
#echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
echo powersave | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; echo powersave | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; echo 60 > /sys/devices/system/cpu/intel_pstate/max_perf_pct;
echo 1200000 | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq;
echo schedutil | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
echo 1 > /sys/bus/platform/devices/applesmc.768/fan1_manual; echo 1 > /sys/bus/platform/devices/applesmc.768/fan1_manual;
echo 6500 > /sys/bus/platform/devices/applesmc.768/fan1_output; echo 6500 > /sys/bus/platform/devices/applesmc.768/fan1_output;
''', shell=True) ''', shell=True)

@ -1,6 +1,6 @@
[project] [project]
name = 'online.fxreader.pr34' name = 'online.fxreader.pr34'
version = '0.1.5.8' version = '0.1.5.9'
dependencies = [ dependencies = [
#"-r requirements.txt", #"-r requirements.txt",

BIN
releases/whl/online_fxreader_pr34-0.1.5.9-py3-none-any.whl (Stored with Git LFS) Normal file

Binary file not shown.