meta-nilrt: udev-extraconf: update worldwritable permissions#965
Conversation
cb7e86b to
502b0af
Compare
amstewart
left a comment
There was a problem hiding this comment.
We should try to avoid just changing the permissions and should instead have some way to toggle the world-writable permissions back on if needed.
Why? Because of VISA? VISA has to run as a user that isn't root or a member of the dialout group?
Thanks for the comment. Indeed, the change was aimed at supporting VISA, since it often runs as a non‑root user without dialout membership and needs access to these device nodes. So, added a config/feature flag so the relaxed permissions are enabled only when needed. This will be controlled from front end Hwconfig. |
rajendra-desai-ni
left a comment
There was a problem hiding this comment.
Commit message changes:
- Change commit title to be more specific, something like:
udev-extraconf: update worldwritable permissions - Update commit message to have more info about the changes
- Signed-off tag should be at the end
1f34cce to
9cd41be
Compare
9cd41be to
1bca4ed
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a runtime-configurable toggle (worldwritable.enabled from /etc/natinst/share/ni-rt.ini via nirtcfg) to control whether VFAT mounts and USB serial TTY devices are world-writable, defaulting to a more restrictive mode.
Changes:
- Add a udev IMPORT helper script that exposes a
NI_WORLDWRITABLEenvironment variable derived fromworldwritable.enabled. - Update VFAT automount options to be restrictive by default (
fmask=0002,dmask=0002) with an opt-in to world-writable. - Update USB serial udev rules to set MODE based on
NI_WORLDWRITABLE.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| recipes-core/udev/udev-extraconf/scripts/ni-worldwritable.sh | New udev IMPORT helper that maps worldwritable.enabled to NI_WORLDWRITABLE=0/1. |
| recipes-core/udev/udev-extraconf/scripts/mount.sh | Makes VFAT mount permissions configurable at runtime instead of always world-writable. |
| recipes-core/udev/udev-extraconf/rules.d/usb-serial-permissions.rules | Makes ttyUSB*/ttyACM* device mode configurable at runtime via udev IMPORT. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
chaitu236
left a comment
There was a problem hiding this comment.
Other than copilot suggestions, looks good. I don't have any other feedback.
b73b75f to
4804b9f
Compare
This features is to toggle the world-writable permissions for block and Serial devices to prevent unauthorised access. This is done using by adding attribute in target_common.ini whcih should add a variable in - /etc/natinst/share/ni-rt.ini - worldwritable.enabled="true" or worldwritable.enabled="false" Controls whether VFAT/TTY mounts are world-writable. False = default restrictive (fmask=0002,dmask=0002) True = world-writable (fmask=0000,dmask=0000) Signed-off-by: Nasrulla Shariff <nasrulla.shariff@emerson.com>
4804b9f to
d0aac83
Compare
Summary of Changes
Currently NILRT will automatically mount block and TTY devices as world-writable and should be updated to no longer do this.
We should try to avoid just changing the permissions and should instead have some way to toggle the world-writable permissions back on if needed. Hence to do this - /etc/natinst/share/ni-rt.ini - worldwritable.enabled="true" or worldwritable.enabled="false" is appended as per information provided from hardware config team/
Justification
Please refer below feature
https://dev.azure.com/ni/DevCentral/_workitems/edit/3470239
Testing
Safemode:

VFAT and TTY:
- worldwritable.enabled="false"
worldwritable.enabled="true"

Runmode:

VFAT and TTY:
- worldwritable.enabled="false"
worldwritable.enabled="true"

bitbake packagefeed-ni-core)Procedure