#945934 false positive udev-rule-missing-subsystem

#945934#5
Date:
2019-12-01 11:20:56 UTC
From:
To:
Hi,

the latest version of systemd (v244) ship a udev rule file
/lib/udev/rules.d/60-autosuspend-chromiumos.rules which triggers the
lintian warning:

W: udev: udev-rule-missing-subsystem lib/udev/rules.d/60-autosuspend-chromiumos.rules:100 vendor/product matching missing SUBSYSTEM specifier

This seems to be a false positive, as the rules file does indeed check
the SUBSYSTEM:

ACTION!="add", GOTO="autosuspend_end"
SUBSYSTEM!="i2c|pci|usb", GOTO="autosuspend_end"

SUBSYSTEM=="i2c", GOTO="autosuspend_i2c"
SUBSYSTEM=="pci", GOTO="autosuspend_pci"
SUBSYSTEM=="usb", GOTO="autosuspend_usb"

# I2C rules
LABEL="autosuspend_i2c"
...
GOTO="autosuspend_end"


# PCI rules
LABEL="autosuspend_pci"
...
GOTO="autosuspend_end"

# USB rules
LABEL="autosuspend_usb"
...
GOTO="autosuspend_end"

...

LABEL="autosuspend_end"


This udev rules and its use of labels and gotos is maybe a bit
unconventional but totally valid.
I think #894356 already tried to address this to some part but it fails
for more complicated cases like this one.

Tbh, I'm not sure how to fix this without lintian becoming a udev rules
parsers which understands how those labels are resolved.

Regards,
Michael

#945934#10
Date:
2019-12-01 12:21:25 UTC
From:
To:
Afaics, libmtp-common is affected by this as well. Hi maintainer decided
to override lintian.


SUBSYSTEM=="usb", GOTO="libmtp_usb_rules"
GOTO="libmtp_rules_end"

LABEL="libmtp_usb_rules"
...

LABEL="libmtp_rules_end"

#945934#15
Date:
2020-06-05 01:16:22 UTC
From:
To:
Hi Michael,

I noticed you eventually decided to override Lintian, as well.
validation capabilities?

Alternatively, would it be okay to close this bug?

We will soon have ways to monitor overrides in the archive (and yours
are annotated with this bug number).

N: False positive: SUBSYSTEM is tested at the beginning of the rules file.
N: See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=945934
O: udev: udev-rule-missing-subsystem
lib/udev/rules.d/60-autosuspend-chromiumos.rules:100 vendor/product
matching missing SUBSYSTEM specifier

Kind regards
Felix Lechner

#945934#20
Date:
2021-10-12 20:27:51 UTC
From:
To:
Hi Felix


On Thu, 4 Jun 2020 18:16:22 -0700 Felix Lechner <felix.lechner@lease-up.com> wrote:
decided
Looks like in systemd v246, the .rules file was turned into a .hwdb file:
https://github.com/systemd/systemd/commit/aa549ff3972b067c4225db0a845f5c638842fba3

So, systemd no longer triggers this lintian error and as far as I'm
concerned, this issue can be closed.

Parsing udev rules files is tricky and I don't think lintian should start
doing that. If such false positives are rare enough I guess it's ok to add
package specific overrides.

Regards,
Michael