From 2115bee6b7958920e534ea040b57d02bb1e67d49 Mon Sep 17 00:00:00 2001 From: Aster Boese Date: Mon, 27 Oct 2025 00:09:20 -0400 Subject: [PATCH] ci: disallow installing to /etc/modprobe.d and /etc/modules-load.d Prevents having to occasionally fix packages installing to these directories instead of their `/usr/lib` counterparts on accident. Catches these issues in CI instead of manually. Part-of: --- .ci/grep.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.ci/grep.sh b/.ci/grep.sh index 73107182f..4209ab51b 100755 --- a/.ci/grep.sh +++ b/.ci/grep.sh @@ -94,4 +94,20 @@ if grep -qEr '^deviceinfo_kernel_cmdline.*[\"\s]console=null' -- device/; then exit_code=1 fi +# Disallow installation of files to /etc/modules-load.d and /etc/modprobe.d +if grep -qr '/etc/modules-load.d' --exclude-dir='device-samsung-golden-downstream' -- *; then + echo "ERROR: Please replace '/etc/modules-load.d' with '/usr/lib/modules-load.d' in the following files:" + grep --color=always -r '/etc/modules-load.d' --exclude-dir='device-samsung-golden-downstream' -- * + exit_code=1 +fi +# n900 is excluded because the string is in a comment linking to a repo. +# No other non-archived devices should be excluded. +if grep -qr '/etc/modprobe.d' --exclude-dir='archived' \ + --exclude-dir='device-nokia-n900' -- *; then + echo "ERROR: Please replace '/etc/modprobe.d' with '/usr/lib/modprobe.d' in the following files:" + grep --color=always -r '/etc/modprobe.d' --exclude-dir='device-nokia-n900' \ + --exclude-dir='archived' -- * + exit_code=1 +fi + exit "$exit_code"