ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: P X <ruslandh@gmail.com>
To: devel@lists.altlinux.org
Subject: Re: [devel] Помогите разобраться с правилами udev
Date: Wed, 25 May 2022 20:21:11 +0300
Message-ID: <5a96c476-a156-b3af-5dd8-4bf86fc26673@gmail.com> (raw)
In-Reply-To: <20220525164652.GA14489@imap.altlinux.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 2802 bytes --]


25.05.2022 19:46, Vladislav Zavjalov пишет:
> On Wed, May 25, 2022 at 07:31:40PM +0300, Vladislav Zavjalov wrote:
>> 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?)
> >- А ENV{...} - это не атрибут устройства, а переменная окружения,
> >информации об устройстве она не должна нести, если только ее
> >специально кто-то не установил. Я такой экзотикой никогда не
> >пользовался, но, наверное, может быть полезно.
>
>
>
>

Спасибо, уже изучаю https://russianblogs.com/article/85191544984/ ;-)




[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15247 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

  reply	other threads:[~2022-05-25 17:21 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
2022-05-25 16:46         ` Vladislav Zavjalov
2022-05-25 17:21           ` P X [this message]
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=5a96c476-a156-b3af-5dd8-4bf86fc26673@gmail.com \
    --to=ruslandh@gmail.com \
    --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