summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordankm <dan.mcgregor@usask.ca>2023-04-28 15:10:34 -0600
committerGitHub <noreply@github.com>2023-04-28 16:10:34 -0500
commit5abf5f5f2cf93c57ac74220251d2a2acce5f7099 (patch)
tree7b5793cc82d537714e369b5f800d504e282599fb
parent7ffd0bcd8379ae6ece096e7014444978efa5f7c8 (diff)
downloadcloud-init-git-5abf5f5f2cf93c57ac74220251d2a2acce5f7099.tar.gz
setup.py: use pkg-config for udev/rules path (#2137)
Distributions other than RHEL also use /usr/lib/udev for the rules path. Instead of hardcoding the udev rules path for RedHat, check pkg-config for the proper location.
-rw-r--r--setup.py14
-rw-r--r--tools/.github-cla-signers1
2 files changed, 9 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 8919c384..d0b1c996 100644
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,10 @@ def pkg_config_read(library, var):
"systemdsystemconfdir": "/etc/systemd/system",
"systemdsystemunitdir": "/lib/systemd/system",
"systemdsystemgeneratordir": "/lib/systemd/system-generators",
- }
+ },
+ "udev": {
+ "udevdir": "/lib/udev",
+ },
}
cmd = ["pkg-config", "--variable=%s" % var, library]
try:
@@ -307,14 +310,13 @@ data_files = [
),
]
if not platform.system().endswith("BSD"):
-
- RULES_PATH = LIB
- if os.path.isfile("/etc/redhat-release"):
- RULES_PATH = "/usr/lib"
+ RULES_PATH = pkg_config_read("udev", "udevdir")
+ if not in_virtualenv():
+ RULES_PATH = "/" + RULES_PATH
data_files.extend(
[
- (RULES_PATH + "/udev/rules.d", [f for f in glob("udev/*.rules")]),
+ (RULES_PATH + "/rules.d", [f for f in glob("udev/*.rules")]),
(
ETC + "/systemd/system/sshd-keygen@.service.d/",
["systemd/disable-sshd-keygen-if-cloud-init-active.conf"],
diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers
index 5d3cf7ac..7615f0fb 100644
--- a/tools/.github-cla-signers
+++ b/tools/.github-cla-signers
@@ -33,6 +33,7 @@ cjp256
Conan-Kudo
cvstealth
dankenigsberg
+dankm
david-caro
dbungert
ddymko