fix(video): avoid timeout during check for v4l2 device #347
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At least on debian bookworm, the v4l2 devices are not managed by systemd (the udev rule does not add the systemd tag). By that, we cannot use systemd to wait for the device as this will always timeout. It is also not easily possible to check if a device is (or will be) managed by systemd. Hence, we simply check if the device is present. In this case, we do not add the systemd device dependency. In other cases, we add it as the device might be managed by systemd and show up later.
We also considered adding a udev rule to tag the devices, but this makes the mtda package less portable.
cc @bovi