]> git.ipfire.org Git - thirdparty/systemd.git/blame - tools/make-autosuspend-rules.py
firstboot: Update help string with --root-shell options
[thirdparty/systemd.git] / tools / make-autosuspend-rules.py
CommitLineData
b61d777a
ML
1#!/usr/bin/env python3
2# SPDX-License-Identifier: LGPL-2.1+
3
7b33ff73
ZJS
4# Generate autosuspend rules for devices that have been tested to work properly
5# with autosuspend by the Chromium OS team. Based on
b61d777a
ML
6# https://chromium.googlesource.com/chromiumos/platform2/+/master/power_manager/udev/gen_autosuspend_rules.py
7
0490b440 8import chromiumos.gen_autosuspend_rules
b61d777a 9
79dc5d35
ZJS
10print('# pci:v<00VENDOR>d<00DEVICE> (8 uppercase hexadecimal digits twice)')
11for entry in chromiumos.gen_autosuspend_rules.PCI_IDS:
12 vendor, device = entry.split(':')
13 vendor = int(vendor, 16)
14 device = int(device, 16)
87d25bde 15 print('pci:v{:08X}d{:08X}*'.format(vendor, device))
79dc5d35 16
19b48643 17print('# usb:v<VEND>p<PROD> (4 uppercase hexadecimal digits twice)')
79dc5d35
ZJS
18for entry in chromiumos.gen_autosuspend_rules.USB_IDS:
19 vendor, product = entry.split(':')
20 vendor = int(vendor, 16)
21 product = int(product, 16)
87d25bde 22 print('usb:v{:04X}p{:04X}*'.format(vendor, product))
79dc5d35
ZJS
23
24print(' ID_AUTOSUSPEND=1')