Skip to content

Commit 4e0197e

Browse files
committed
Option to disable udev rules check
This introduces "disable_udev_rules_check" option in Linux environment. If set to True, udev rules are not checked. This allows to suppress annoying warnings when 99-platformio-udev.rules is not installed intentionally. If set to False (default), udev rules are checked as before.
1 parent 487a894 commit 4e0197e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

platformio/app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from platformio.package.lockfile import LockFile
2727
from platformio.project.config import ProjectConfig
2828
from platformio.project.helpers import get_default_projects_dir
29+
from platformio.util import get_systype
2930

3031

3132
def projects_dir_validate(projects_dir):
@@ -65,6 +66,12 @@ def projects_dir_validate(projects_dir):
6566
},
6667
}
6768

69+
if "linux" in get_systype():
70+
DEFAULT_SETTINGS["disable_udev_rules_check"] = {
71+
"description": "Disable udev rules check",
72+
"value": False
73+
}
74+
6875
SESSION_VARS = {
6976
"command_ctx": None,
7077
"caller_id": None,

platformio/fs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import click
2626

27-
from platformio import exception
27+
from platformio import exception, app
2828
from platformio.compat import IS_WINDOWS
2929

3030

@@ -120,7 +120,7 @@ def _rules_to_set(rules_path):
120120
result.add(line)
121121
return result
122122

123-
if "linux" not in get_systype():
123+
if "linux" not in get_systype() or app.get_setting("disable_udev_rules_check"):
124124
return None
125125
installed_rules = [
126126
"/etc/udev/rules.d/99-platformio-udev.rules",

0 commit comments

Comments
 (0)