Release Vulpes OS 2.7-preview.24
This commit is contained in:
parent
49572b6b45
commit
97ef99f827
135 changed files with 7717 additions and 2524 deletions
32
tundra/runtime/enable-cpuidle.py
Normal file
32
tundra/runtime/enable-cpuidle.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
"""Enable the Sargo Qualcomm low-power states when the kernel exposes them."""
|
||||
from pathlib import Path
|
||||
import time
|
||||
|
||||
|
||||
PARAMETER = Path('/sys/module/lpm_levels/parameters/sleep_disabled')
|
||||
|
||||
|
||||
def main():
|
||||
deadline = time.monotonic() + 8
|
||||
while time.monotonic() < deadline and not PARAMETER.exists():
|
||||
time.sleep(.1)
|
||||
if not PARAMETER.exists():
|
||||
print('Qualcomm lpm_levels parameter unavailable; leaving kernel defaults')
|
||||
return
|
||||
current = PARAMETER.read_text().strip()
|
||||
if current == 'N':
|
||||
print('Qualcomm low-power states are already enabled')
|
||||
return
|
||||
if current != 'Y':
|
||||
print('Unknown sleep_disabled value; leaving kernel setting unchanged:', current)
|
||||
return
|
||||
PARAMETER.write_text('N')
|
||||
if PARAMETER.read_text().strip() != 'N':
|
||||
raise RuntimeError('Could not enable Qualcomm CPU low-power states')
|
||||
print('Enabled Qualcomm CPU low-power states')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Loading…
Reference in a new issue