Skip to content

Disable UDev Rule for Radxa Display 10 FHD#9503

Open
FlorianKohn wants to merge 3 commits intoarmbian:mainfrom
FlorianKohn:main
Open

Disable UDev Rule for Radxa Display 10 FHD#9503
FlorianKohn wants to merge 3 commits intoarmbian:mainfrom
FlorianKohn:main

Conversation

@FlorianKohn
Copy link

@FlorianKohn FlorianKohn commented Mar 8, 2026

Description

The change is needed to ensure compatibility with the Radxa-Display-10-FHD, which does not require a calibration matrix.
As of now, this udev rule also applies to the 10-inch display, since it only matched the goodix-ts driver, which is the same for both the Radxa-Display-8-HD and the Radxa-Display-10-FHD.

Documentation summary for the change

The rule now includes a PROGRAM directive that uses grep to only apply this rule when the Radxa-Display-8-HD overlay is loaded.

How Has This Been Tested?

I tested this fix on my Radxa 5B Plus with the Radxa Display 10 FHD and verified that the udev rule no longer applies.
However, as I do not own the Radxa Display 8 HD, I am unable to test whether it still works as before. Maybe @HeyMeco can help with this, as they originally added this rule in Pull Request 8972.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • Bug Fixes
    • Touchscreen calibration for Rock 5B+ now only activates when the specific display module is detected, thanks to an added runtime check. This prevents incorrect calibration on alternative displays and improves touch accuracy for the intended hardware configuration.

@FlorianKohn FlorianKohn requested a review from HeyMeco as a code owner March 8, 2026 17:01
@github-actions github-actions bot added 05 Milestone: Second quarter release size/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels Mar 8, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 8, 2026

📝 Walkthrough

Walkthrough

A udev rule for the Goodix touchscreen in the Rock 5B Plus board configuration was modified to include a PROGRAM check condition. The rule now verifies a specific display configuration exists in the boot environment before applying the touchscreen calibration matrix assignment.

Changes

Cohort / File(s) Summary
Board Configuration
config/boards/rock-5b-plus.conf
Modified udev rule in post_family_tweaks__rock5bplus_udev_rules to add PROGRAM=="\/bin\/grep -q '^[[:space:]]*overlays=.*rock-5b-plus-radxa-display-8hd'" /boot/armbianEnv.txt condition for Goodix touchscreen calibration, making calibration conditional on boot config presence.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A touchscreen rule hops into place,
With a program check to set the pace,
Boot config checked with careful care,
The display settings now declare,
Calibration flows just right ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title mentions 'Radxa Display 10 FHD' but the actual change disables the rule for Radxa Display 10 FHD by adding a PROGRAM check for 'rock-5b-plus-radxa-display-8hd', making it apply only to the 8 HD display. Clarify the title to accurately reflect that the rule now applies only to Radxa Display 8 HD, not that it disables the rule for 10 FHD entirely.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config/boards/rock-5b-plus.conf`:
- Line 28: The udev rule written into 99-radxa-display8hd-touch.rules currently
uses a bare grep against /boot/armbianEnv.txt which will match commented or
partial strings; change the PROGRAM check to only return true when the active
overlay assignment explicitly contains the exact token
rock-5b-plus-radxa-display-8hd (uncommented and as a full token), e.g. by
matching the overlays= (or overlay=) assignment line and verifying the token is
present as a comma/space-delimited item; update the echo that creates the rule
so PROGRAM== uses that stricter test against /boot/armbianEnv.txt.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1efb14df-170b-4dc1-8172-62729452b20f

📥 Commits

Reviewing files that changed from the base of the PR and between 335f01e and 0885d82.

📒 Files selected for processing (1)
  • config/boards/rock-5b-plus.conf

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
config/boards/rock-5b-plus.conf (1)

28-28: Good improvement: Pattern now correctly excludes commented overlay entries.

The ^[[:space:]]*overlays= anchor ensures that lines starting with # (comments) won't match, addressing the main concern from previous feedback.

For stricter full-token matching (preventing a hypothetical rock-5b-plus-radxa-display-8hd-extended from falsely matching), you could use extended regex with word boundaries:

-PROGRAM=="/bin/grep -q '^[[:space:]]*overlays=.*rock-5b-plus-radxa-display-8hd' /boot/armbianEnv.txt"
+PROGRAM=="/bin/grep -Eq '^[[:space:]]*overlays=.*(^|[[:space:]])rock-5b-plus-radxa-display-8hd([[:space:]]|$)' /boot/armbianEnv.txt"

However, given Armbian's overlay naming conventions, this edge case is unlikely to occur in practice—the current implementation should work correctly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/boards/rock-5b-plus.conf` at line 28, The current grep pattern in the
echo that writes to 99-radxa-display8hd-touch.rules (the PROGRAM=="/bin/grep -q
'^[[:space:]]*overlays=.*rock-5b-plus-radxa-display-8hd' /boot/armbianEnv.txt"
fragment) successfully avoids commented lines but could still false-positive
match longer tokens like rock-5b-plus-radxa-display-8hd-extended; tighten the
pattern used in PROGRAM== (or switch to an extended-regex grep invocation) so
the overlay name is matched as a full token (e.g., require end-of-token such as
end-of-line, comma, or whitespace after the exact overlay) while preserving the
existing ^[[:space:]]*overlays= anchor and leave the
ENV{LIBINPUT_CALIBRATION_MATRIX} assignment unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@config/boards/rock-5b-plus.conf`:
- Line 28: The current grep pattern in the echo that writes to
99-radxa-display8hd-touch.rules (the PROGRAM=="/bin/grep -q
'^[[:space:]]*overlays=.*rock-5b-plus-radxa-display-8hd' /boot/armbianEnv.txt"
fragment) successfully avoids commented lines but could still false-positive
match longer tokens like rock-5b-plus-radxa-display-8hd-extended; tighten the
pattern used in PROGRAM== (or switch to an extended-regex grep invocation) so
the overlay name is matched as a full token (e.g., require end-of-token such as
end-of-line, comma, or whitespace after the exact overlay) while preserving the
existing ^[[:space:]]*overlays= anchor and leave the
ENV{LIBINPUT_CALIBRATION_MATRIX} assignment unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2d735cbb-74cf-497d-af61-31c7419f525f

📥 Commits

Reviewing files that changed from the base of the PR and between 0885d82 and 5568354.

📒 Files selected for processing (1)
  • config/boards/rock-5b-plus.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

1 participant