From: Vladislav Zavjalov <slazav@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] Помогите разобраться с правилами udev
Date: Wed, 25 May 2022 19:31:40 +0300
Message-ID: <20220525163140.GA14349@imap.altlinux.org> (raw)
In-Reply-To: <d8dae07f-3145-59fb-51df-24180c83ca60@gmail.com>
On Wed, May 25, 2022 at 04:57:19PM +0300, Ruslandh wrote:
> Создаю такой файл udev (для отладки)
>
> # udev rules for setting correct configuration and pairing on tethered
> iPhones
> ATTR{idVendor}!="05ac", GOTO="ipheth_rules_end"
>
> # Execute pairing program when appropriate
> SUBSYSTEM=="usb", ENV{ID_V4L_PRODUCT}!="", ENV{COLORD_DEVICE}="0",\
> ENV{COLORD_KIND}="", RUN+="echo "Yes"> /tmp/yes"
> #ACTION=="add", SUBSYSTEM=="net", ENV{ID_USB_DRIVER}=="ipheth",\
> SYMLINK+="iphone", RUN+="ipheth-pair"
>
> LABEL="ipheth_rules_end"
Тут еще есть условие ENV{ID_V4L_PRODUCT}!="", а такого поля в
ваших логах я не вижу. Зачем это условие было добавлено?
Я не большой специалист по udev, но мне всегда казалось,
что он очень прямолинеен: пишешь условие, если оно выполняется,
то и правило исполняется.
Ну и еще пара общих вещей про правила udev rules (я плохо
чувствую, насколько такие вещи общеизвестны, прошу прощения, если пишу
тривиальное):
- При подключении у вас возникает целое дерево usb-устройств,
надо написать такие условия, чтобы выбрать нужное.
- Разные атрибуты устройств удобно смотреть командой
udevadm info -a -p /sys/bus/usb/devices/...
- ATTR и ATTRS это разные ключи (действуют на одно устройство
и на устройство со всеми его родителями)
- операторы == и = - это разные вещи (зачем, например, у
вас в этом тестовом примере есть =, если вы только хотите запустить
echo?)
next prev parent reply other threads:[~2022-05-25 16:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 21:03 ` Ruslandh
2022-05-25 13:57 ` Ruslandh
2022-05-25 14:32 ` Ruslandh
2022-05-25 16:31 ` Vladislav Zavjalov [this message]
2022-05-25 16:46 ` Vladislav Zavjalov
2022-05-25 17:21 ` P X
2022-05-25 18:22 ` Vladislav Zavjalov
2022-05-25 19:37 ` P X
2022-06-01 19:48 ` Leonid Krivoshein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220525163140.GA14349@imap.altlinux.org \
--to=slazav@altlinux.org \
--cc=devel@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git