Re: [systemd-devel] Udev Regex

2020-05-06 Thread Lennart Poettering
On Mi, 06.05.20 12:15, Boyce, Kevin P [US] (AS) (kevin.bo...@ngc.com) wrote:

> Good Morning List,
>
> Does anyone know how complicated of a regular expression can be
> utilized in a udev rule?

udev supports shell-style globbing for matching, but no regular
expressions. The man page says that pretty clearly, no?

Lennart

--
Lennart Poettering, Berlin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Udev Regex

2020-05-06 Thread Andrei Borzenkov
On Wed, May 6, 2020 at 3:23 PM Boyce, Kevin P [US] (AS)
 wrote:
>
> Good Morning List,
>
>
>
> Does anyone know how complicated of a regular expression can be utilized in a 
> udev rule?
>

I would ask udev manual page :)

>
>
> For instance I have a system with a lot of drives (sda through z aren’t 
> enough) and I want to write a rule that will match the physical block devices 
> for one rule and then a separate rule for partitions.
>
>
>
> Something like this, however the rules don’t seem to fire except when I 
> remove the ‘+’ from the rules:
>
> ACTION==”add”, SUBSYSTEM==”block”, KERNEL==”sd[a-z]+”, 
> SYMLINK+=”some_device_%k”
>
> ACTION==”add”, SUBSYSTEM==”block”, KERNEL==”sd[a-z]+[0-9]+”, 
> SYMLINK+=”some_device_%k”
>
>
>
> I am running systemd version 219-67.
>
>
>
> Kind Regards,
>
> Kevin
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Udev Regex

2020-05-06 Thread Boyce, Kevin P [US] (AS)
Good Morning List,

Does anyone know how complicated of a regular expression can be utilized in a 
udev rule?

For instance I have a system with a lot of drives (sda through z aren't enough) 
and I want to write a rule that will match the physical block devices for one 
rule and then a separate rule for partitions.

Something like this, however the rules don't seem to fire except when I remove 
the '+' from the rules:
ACTION=="add", SUBSYSTEM=="block", KERNEL=="sd[a-z]+", SYMLINK+="some_device_%k"
ACTION=="add", SUBSYSTEM=="block", KERNEL=="sd[a-z]+[0-9]+", 
SYMLINK+="some_device_%k"

I am running systemd version 219-67.

Kind Regards,
Kevin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel