Commit Graph

7 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 19b4864346 hwdb/autosuspend: add missing parenthesis 2020-07-16 18:06:35 +02:00
Luca Boccassi 87d25bdead make-autosuspend-rules: restore compatibility with Python3 < 3.6
The f'...' format was introduced in Python 3.6 ( https://www.python.org/dev/peps/pep-0498/ )
and returns an error when systemd is built on a system with an older Python3 version:

<...>
  File /home/bluca/git/systemd/tools/make-autosuspend-rules.py, line 15
    print(f'pci:v{vendor:08X}d{device:08X}*')
                                           ^
SyntaxError: invalid syntax
[2/388] Generating version.h with a custom command.
ninja: build stopped: subcommand failed.
$ python3 --version
Python 3.5.6

Use an older format to keep backward compatibility.
2020-06-23 21:02:15 +02:00
Zbigniew Jędrzejewski-Szmek 7b33ff7388 make-autosuspend-rules: remove one instance of "whitelist"
Let's be clear what we mean exactly. Also see https://lwn.net/Articles/823224/
for general justification.
2020-06-22 14:47:49 +02:00
Zbigniew Jędrzejewski-Szmek 79dc5d35dd tools: rewrite make-autosuspend-rules.py and add udev rules
Concatenating strings is not a very efficient approach. And in this case fully
unnecessary. We also need some rules to make use of those hwdb entries.

PCI needs to be 8 characters, not 4. And we need to use uppercase hexadecimal
for both. With udev rules this made no difference, but hwdb match is case
sensitive.

Fixes #16119.
2020-06-22 14:45:20 +02:00
Lennart Poettering b4564641be hwdb: generate a hwdb file instead of rules for autosuspend 2020-06-13 20:00:23 +02:00
Tim Teichmann 0490b44031 trivial: rename chromeos to chromiumos 2019-10-07 08:58:13 +09:00
Mario Limonciello b61d777abe rules: Add automatic suspend udev rules
The ChromeOS ecosystem has a large amount of testing, both automated
and manual across devices including measurement of power regressions.

It's safe to assume that any of these devices will handle USB
auto-suspend appropriately.  Use the script from ChromeOS
https://chromium.googlesource.com/chromiumos/platform2/+/master/power_manager/udev/gen_autosuspend_rules.py
to generate udev rules at build time.

This script in systemd `tools/chromeos/gen_autosuspend_rules.py` should be kept
in sync with the ChromeOS version of the script.

Manually added autosuspend devices should be placed in the new
template `rules/61-autosuspend-manual.rules`

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
2019-10-04 08:57:29 +02:00