# udev 103 "invalid rule 30-svgalib.rul" [solved]

## rlholgate

Hi,

Yesterday I emerged udev 103, and right after upgraded the kernel from 2.6.17-gentoo-r8 to 2.6.18-gentoo-r6. In the boot messages I now get the error message as below. There are no other side effects I can identify.

The second line of the message is truncated at right due to the width of the screen, I have written it exactly as it appears (i.e. with truncation).

```

udevd[973]: add_to_rules: invalid KERNEL operation

udevd[973]: add_to_rules: invalid rule '/etc/udev/rules.d/30-svgalib.rul

```

Assume I have left something out of the kernel config. Can anyone pinpoint what?Last edited by rlholgate on Wed Jan 03, 2007 7:34 pm; edited 1 time in total

----------

## PaulBredbury

emerge svgalib. It's a kernel module, and so needs to be compiled for your current kernel.

----------

## rlholgate

Thanks, that has in fact done the trick. 

How come I needed it all of a sudden? Svgalib was not previously installed with 2.6.17, and emerge evidently doesn't believe udev 103 depends on it. Is this a portage bug?

----------

## PaulBredbury

 *rlholgate wrote:*   

> Svgalib was not previously installed with 2.6.17

 

I assume svgalib was previously installed with whatever kernel, for /etc/udev/rules.d/30-svgalib.rules to exist. And it needs to be recompiled with every kernel change, because it is a kernel module.

----------

## hogdarog

Hi rlholgate,

I don't think it's got anything to do with your kernel config.

I had the same problem plus some more with my udev-rules on three different computers.

It took me several hours to figure out what the problem was:

I had some "local.rules" defined for udev in order to mount special devices like usbsticks and -disks at plugin. These rules reside in /etc/udev/rules/10-local.rules. They looked like 

```
"BUS="usb", SYSFS{manufacturer}=="Macpower", NAME="%k", SYMLINK="usbdisk60"
```

 and they worked flawlessly and i was very happy with them - until udev began to complain about them and i think it must have been after the upgrade to udev-103. I could track down the problem by telling udev to be more informative: 

```
udevcontrol log_priority=debug
```

 Every time i reloaded the rules: 

```
udevcontrol reload_rules
```

 I got the error which you describe (plus some more like "add_to_rules: invalid rule '/etc/udev/rules.d/40-fuse.rules:1" and of course my own rules: "add_to_rules: invalid rule '/etc/udev/rules.d/10-local.rules:1'". So i figured i had to rewrite them: I had written mine according to the udev guide http://www.reactivated.net/writing_udev_rules.html and after carefully reading it again, i found out, that my problem was that i had too few '=': I had to change 

```
"BUS="usb", SYSFS{manufacturer}=="Macpower", NAME="%k", SYMLINK="usbdisk60"
```

 into 

```
"BUS=="usb", SYSFS{manufacturer}=="Macpower", NAME="%k", SYMLINK+="usbdisk60"
```

 Note that after BUS there are now two "=". Additonally i have added a "+" to the symlink...

I hope this helps you too. Please let me know..

I don't know why the baselayout rules are erroneous? Anyone any idea? Or whom to contact?

----------

## PaulBredbury

 *hogdarog wrote:*   

> I don't know why the baselayout rules are erroneous?

 

"==" is a comparison. "=" sets a value. Just like in Python.

----------

## rlholgate

Hmm I really don't know. I have done some package removal and depclean-ing several months ago, but have never been in the practice re-emerging svgalib with each new kernel. And indeed the svga module is not being used. Svgalib seems to be present purely for the satisfaction of udev at this point.

I have never needed to edit my own udev rules. The ones present are the ones placed there by emerge and/or udev itself.

Sounds like the 30-svgalib.rules is added conditionally? (On what condition?) 

If I remove 30-svgalib.rules and unmerge svgalib will that also fix things? (And is it a good idea?) 

Or will 30-svgalib.rules just come back at the next udev emerge?

In the worst case it works fine like this, so what me worry I guess...

----------

## hogdarog

@PaulBredbury:

 *Quote:*   

> "==" is a comparison. "=" sets a value. Just like in Python.

  This makes sense, of course. But it is intriguing that udev used to accept "=" as a comparison and now complains about it. At least that's what it looks like to me...

@rlholgate:

Just out of curiousity: what does your 30-svgalib.rules look like ("=" or "==")?. Why don't you try to change it? There's not much that can go wrong if you change it...

udev complained about my 30-svgalib.rules as well and i hadn't edited it, so it must have been placed there by emerge as well. But that doesn't mean it's error-proof...   :Wink: 

----------

## PaulBredbury

 *hogdarog wrote:*   

> udev used to accept "=" as a comparison and now complains about it.

 

Correct. It changed. Annoying to have to change, but it's a change for the better.

----------

## hogdarog

 *Quote:*   

> Correct. It changed. Annoying to have to change, but it's a change for the better.

 

Well it's sure a change for the better.   :Laughing:  But apparently not everyone knows that there's been a change at all   :Rolling Eyes: 

So, do you know more about it? Is this a known problem or should i file a bug report? At least I haven't found it on bugs.gentoo.org...

----------

## PaulBredbury

There's tons of moans about udev breaking, on bugzilla and the forums.

However, a "stale" configuration file which an ebuild has left behind, whose format becomes out-of-date, most likely isn't something that Gentoo is going to fix - it's up to the user to fix it or remove it.

----------

## hogdarog

Aaaah, and that's probably why you suggested to reinstall or better remove and install the svgalib package?

Now i see...  :Razz: 

However 

 *Quote:*   

> There's tons of moans about udev breaking, on bugzilla and the forums.

 

a search for "udev rule" at https://bugs.gentoo.org/ didn't result in anything i would connect to this problem...

I would like to know if rlholgate could solve his problem, one way or the other   :Wink: 

----------

## PaulBredbury

 *hogdarog wrote:*   

> I would like to know if rlholgate could solve his problem, one way or the other  

 

Certainly. He's already stated his options. It works now, and if svgalib isn't needed, it can be unmerged (and the stale udev file deleted).

----------

## rlholgate

Just looking at the file in question - there is no obvious problem with the format of it - i.e. '=' vs '=='. 

However I noticed it had a date of Jan 3, 0:10 - right when I emerged svgalib late last night. Then thought to do 'equery belongs' on it - and that says its part of svgalib i.e. and not part of udev. So I'm guessing that - as you suggested Paul - svgalib was installed at one point, and later got uninstalled, probably as a dependency of something else. 

To further test the theory I just emerged svgalib again and sure enough the file was dropped in there afresh. Then unmerged svgalib, and sure enough the file was left behind - NOT deleted. Now equery says it doesn't belong to anything. 

So I've removed it (know how to get it back now anyway), and rebooted - lo and behold there are no error messages; and after some quick testing and checking no other ill effects are evident. 

So problem solved from my pov - thanks to both of you for the help and advice!

----------

## Jim6

Perhaps a bug report should be filed to get this file removed when  svgalib is unmerged?

----------

