All of lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Lenglet <rlenglet@domain.hid>
To: xenomai@xenomai.org
Subject: Re: [Xenomai-help] A bug of udev rules?
Date: Tue, 9 May 2006 15:59:49 +0900	[thread overview]
Message-ID: <200605091559.50160.rlenglet@domain.hid> (raw)
In-Reply-To: <44603695.2020407@domain.hid>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 1691 bytes --]

Liu Zhenghui wrote:
> I installed xenomai on Debian Linux sid. For some reason, I
> recently changed to udev to manage the /dev. Then udev always
> report error on
>
> rules installed by xenomai at boot time like following:
> : add_to_rules: invalid KERNEL operation
> : add_to_rules: invalid rule
> : '/etc/udev/rules.d/udev.rules:100'
>
> As a result, the device rtheap and rtp* is not controlled by
> udev rules and always has default mode "0660".
>
> I found there is wrong with rules installed by xenomai, which
> source is located at ksrc/nucleus/udev/*.rules:
>
> # real-time heap device (Xenomai:rtheap)
> KERNEL="rtheap", 0„2NAME="rtheap", MODE="0666"
> 0„2 0„2 0„2 ~should be "==" here, not "="
>
> My udev version in debian is 0.091-2, kernel version is
> 2.6.15.7
>
> Is it a bug? Luckly, it works after I changed "=" to "=="

I also got such errors with my own rules and rules from other 
packages.
Debian's udev package applies an upstream patch which makes udev 
more strict about the syntax, since version 090 (21 April 2006).
See /usr/share/doc/udev/changelog.Debian.gz.

So, you are right, it should be:
KERNEL=="rtheap", 0„2NAME="rtheap", MODE="0666"
Key match and assignment are now strictly syntactically 
different, and KERNEL is a read-only key which can't be 
assigned.

I think that it is safe to change KERNEL= into KERNEL== in 
Xenomai's rules files, since the == syntax has been introduced 
since Udev version 055 (March 2005).

By the way, I think that the NAME= assignment is superfluous, 
because by default NAME is the kernel-assigned name in KERNEL.


Attached is the two-line patch.

-- 
Romain LENGLET

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: udev-rules-syntax_2006-05-09.patch --]
[-- Type: text/x-diff; charset="gb18030"; name="udev-rules-syntax_2006-05-09.patch", Size: 1307 bytes --]

Index: ChangeLog
===================================================================
--- ChangeLog	(révision 1037)
+++ ChangeLog	(copie de travail)
@@ -1,3 +1,10 @@
+2006-05-09  Romain Lenglet  <rlenglet@domain.hid>
+
+	* ksrc/nucleus/udev/rtpipe.rules, ksrc/nucleus/udev/rtheap.rules:
+	Modified key match KERNEL= into KERNEL==, to avoid errors with
+	recent versions of Udev which are stricter about the rules syntax.
+	Removed unuseful NAME= key assignments.
+
 2006-05-05  Jim Cromie <jim.cromie@domain.hid>
 
 	* scripts/prepare-kernel.sh (patch_append): Do not alter link
Index: ksrc/nucleus/udev/rtheap.rules
===================================================================
--- ksrc/nucleus/udev/rtheap.rules	(révision 1037)
+++ ksrc/nucleus/udev/rtheap.rules	(copie de travail)
@@ -1,2 +1,2 @@
 # real-time heap device (Xenomai:rtheap)
-KERNEL="rtheap",  NAME="rtheap", MODE="0666"
+KERNEL=="rtheap", MODE="0666"
Index: ksrc/nucleus/udev/rtpipe.rules
===================================================================
--- ksrc/nucleus/udev/rtpipe.rules	(révision 1037)
+++ ksrc/nucleus/udev/rtpipe.rules	(copie de travail)
@@ -1,2 +1,2 @@
 # real-time pipe devices (Xenomai:rtpipe)
-KERNEL="rtp[0-9]*",  NAME="%k", MODE="0666"
+KERNEL=="rtp[0-9]*", MODE="0666"

  reply	other threads:[~2006-05-09  6:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-09  6:28 [Xenomai-help] A bug of udev rules? Liu Zhenghui
2006-05-09  6:59 ` Romain Lenglet [this message]
2006-05-09  8:08   ` Philippe Gerum

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=200605091559.50160.rlenglet@domain.hid \
    --to=rlenglet@domain.hid \
    --cc=xenomai@xenomai.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.