Comment 149 for bug 445852

Revision history for this message
Andrew Simpson (andrew-simpson) wrote :

O.K., I think I have a better workaround for this bug.

The problem is that udev reads the udev rule files into memory and then uses inotify to watch for changes in the file. As soon as the rule file changes, udev is informed and re-reads the file. That means that when apt-get updates the rule file, damage can be done before you get a chance to patch it again.

What I have done is put a dummy file in for devkit-disks-probe-ata-smart and used dpkg-divert to make the system accept the dummy file.

Run the following command:

$ sudo dpkg-divert --divert --add --rename --divert /lib/udev/devkit-disks-probe-ata-smart.bak /lib/udev/devkit-disks-probe-ata-smart

This renames the existing file to devkit-disks-probe-ata-smart.bak and tells dpkg / apt-get to install any new updates to the _changed_ file name.

To see your divert (and others in the system):

$ sudo dpkg-divert --list

Now we create a dummy file:

$ sudo /lib/udev/nano devkit-disks-probe-ata-smart (or some other editor of your choice)

#!/bin/bash
#
exit 0

Save the file.

This dummy file does precisely nothing, but it allows udev to run it...

Make the new dummy file executable:

$ sudo chmod 755 /lib/udev/devkit-disks-probe-ata-smart

That's it.

When the bug gets really fixed, we need to remove the dummy file and divert:

$ sudo rm /lib/udev/devkit-disks-probe-ata-smart
$ dpkg-divert --rename --remove /lib/udev/devkit-disks-probe-ata-smart