Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid rule warning at startup #9

Open
wants to merge 1 commit into
base: webOS-ports/webOS-OSE
Choose a base branch
from

Conversation

ericblade
Copy link

"systemd-udevd[52]: /etc/udev/rules.d/90-storaged.rules:20 Invalid value "/etc/udev/scripts/storage.sh $ENV{G_ACTION} $ENV{G_MEDIA_LOADED}$ENV{G_HOST_CONNECTED}$ENV{G_MEDIA_REQUESTED}$ENV{G_BUS_SUSPENDED}" for RUN (char 30: invalid substitution type), ignoring."

It is not clear that this will actually make usb gadget functionality work, but it's a step there. We should get ahold of a legacy system and see how this is handled.

"systemd-udevd[52]: /etc/udev/rules.d/90-storaged.rules:20 Invalid value "/etc/udev/scripts/storage.sh $ENV{G_ACTION} $ENV{G_MEDIA_LOADED}$ENV{G_HOST_CONNECTED}$ENV{G_MEDIA_REQUESTED}$ENV{G_BUS_SUSPENDED}" for RUN (char 30: invalid substitution type), ignoring."
@ericblade ericblade marked this pull request as draft March 4, 2024 03:50
@@ -17,7 +17,7 @@
# LICENSE@@@


KERNEL=="usb_gadget", SUBSYSTEM=="platform", DRIVER=="usb_gadget", ENV{G_SUBSYSTEM}=="storage", ACTION=="change", RUN+="@WEBOS_INSTALL_SYSCONFDIR@/udev/scripts/storage.sh $ENV{G_ACTION} $ENV{G_MEDIA_LOADED}$ENV{G_HOST_CONNECTED}$ENV{G_MEDIA_REQUESTED}$ENV{G_BUS_SUSPENDED}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@WEBOS_INSTALL_SYSCONFDIR@ should be replaced by during build by /etc. So the actual issue might be just the missing /bin/sh somehow? Really not sure here. Seems legacy had the following:

# route mass storage events to storaged over lunaservice bus KERNEL=="usb_gadget", SUBSYSTEM=="platform", DRIVER=="usb_gadget", ENV{G_SUBSYSTEM}=="storage", ACTION=="change", RUN+="/etc/udev/scripts/storage.sh $ENV{G_ACTION} $ENV{G_MEDIA_LOADED}$ENV{G_HOST_CONNECTED}$ENV{G_MEDIA_REQUESTED}$ENV{G_BUS_SUSPENDED}"

Copy link
Author

@ericblade ericblade Mar 4, 2024

Choose a reason for hiding this comment

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

The syntax is just wrong. Per the manual page, https://man7.org/linux/man-pages/man7/udev.7.html

Search for "The RUN substitutions are performed after all rules", to find the correct syntax for substitution inside a field. The ENV{} syntax is correct for G_SUBSYSTEM but $env{key} is correct for inside the RUN. It is case-sensitive, $ENV is not $env

@ericblade ericblade marked this pull request as ready for review March 4, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants