* How to trigger a udev rule
From: Thomas Bechtold @ 2011-03-03 6:21 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
Hi,
i have a udev rule and want to trigger this rule with "udevadm trigger".
The rule is:
### only check /dev/ttyS1 (atmel_usart.1) for modem ###
ACTION!="add|change", GOTO="mm_platform_device_whitelist_end"
SUBSYSTEM!="platform", GOTO="mm_platform_device_whitelist_end"
DRIVERS=="atmel_usart",KERNELS=="atmel_usart.1",ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1"
LABEL="mm_platform_device_whitelist_end"
Any idea how to trigger this?
Cheers,
Tom
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: How to trigger a udev rule
From: Andrey Borzenkov @ 2011-03-03 6:36 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <1299133287.2394.10.camel@salbei>
On Thu, Mar 3, 2011 at 9:21 AM, Thomas Bechtold
<thomasbechtold@jpberlin.de> wrote:
> Hi,
>
> i have a udev rule and want to trigger this rule with "udevadm trigger".
> The rule is:
>
> ### only check /dev/ttyS1 (atmel_usart.1) for modem ###
> ACTION!="add|change", GOTO="mm_platform_device_whitelist_end"
> SUBSYSTEM!="platform", GOTO="mm_platform_device_whitelist_end"
> DRIVERS="atmel_usart",KERNELS="atmel_usart.1",ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1"
> LABEL="mm_platform_device_whitelist_end"
>
>
> Any idea how to trigger this?
>
You can't trigger specific rule. You can trigger processing for
specific device; and check whether this rule is executed as part of
it.
^ permalink raw reply
* Re: How to trigger a udev rule
From: J. Bakshi @ 2011-03-03 6:49 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <1299133287.2394.10.camel@salbei>
On Thu, 03 Mar 2011 07:21:27 +0100
Thomas Bechtold <thomasbechtold@jpberlin.de> wrote:
> Hi,
>
> i have a udev rule and want to trigger this rule with "udevadm trigger".
>
I am also interested to know how to trigger udev rule / event
Thank
^ permalink raw reply
* Re: How to trigger a udev rule
From: Martin Pitt @ 2011-03-03 8:54 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <1299133287.2394.10.camel@salbei>
[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]
Hello Thomas,
funny that you ask, a few days ago someone asked exactly the same
thing in #udev.
Thomas Bechtold [2011-03-03 7:21 +0100]:
> ### only check /dev/ttyS1 (atmel_usart.1) for modem ###
> ACTION!="add|change", GOTO="mm_platform_device_whitelist_end"
> SUBSYSTEM!="platform", GOTO="mm_platform_device_whitelist_end"
> DRIVERS=="atmel_usart",KERNELS=="atmel_usart.1",ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1"
> LABEL="mm_platform_device_whitelist_end"
I'm afraid udevadm trigger doesn't support the same parental matching
as udev rules themselves do, so I don't think there can be a precise
trigger unless you already know the corresponding /dev/ttySn device
node. If you do, then just do
udevadm trigger --sysname-match=ttySn
If you dont, it shouldn't matter much to trigger all ttyS devices:
udevadm trigger --sysname-match=ttyS*
BTW, you can also try with --verbose --dry-run (also works as user) to
see what it would do, and refine the match until it works to your
needs.
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH 0/2] libudev: Get all sysfs attrs for a device
From: Thomas Egerer @ 2011-03-03 9:17 UTC (permalink / raw)
To: linux-hotplug
Hi folks,
I recently took part in writing an application using libudev to retrieve
information on devices present on a linux system. It became evident that
apparently there is no way to retrieve all possible sysfs attributes for a
particular device (the same way it is possible to get all of its properties).
The matter kept nagging me -- even though we worked our way around this using
sysfs directly -- and I decided to add a udev_device_get_sysattr_list_entry. For
this matter the behavior of udev_device_get_sysattr_value had to be modified (a
little): on first access of any sysattr, it create an list including _all_
sysfs-attributes as name (with an empty value, except for the symlinks). The
values are cached as soon as thery're requested. Negative entries do not exist
anymore.
Cheers, Thomas
^ permalink raw reply
* [PATCH 1/2] libudev: modify sysfs attr caching behavior
From: Thomas Egerer @ 2011-03-03 9:17 UTC (permalink / raw)
To: linux-hotplug
In order to get a complete list of sysfs attributes for a given
udev_device a complete list of all sysfs attributes is created on first
access (with values being empty). Values themselves are filled in, as
soon as a particular sysfs attribute is read.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
---
libudev/libudev-device.c | 145 ++++++++++++++++++++++++++++++++--------------
1 files changed, 101 insertions(+), 44 deletions(-)
diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c
index 16bee19..5baff49 100644
--- a/libudev/libudev-device.c
+++ b/libudev/libudev-device.c
@@ -78,6 +78,7 @@ struct udev_device {
bool devlinks_uptodate;
bool envp_uptodate;
bool tags_uptodate;
+ bool sysattrs_cached;
bool driver_set;
bool info_loaded;
bool db_loaded;
@@ -1136,6 +1137,79 @@ void udev_device_set_usec_initialized(struct udev_device
*udev_device, unsigned
udev_device->usec_initialized = usec_initialized;
}
+static int cache_sysattrs(struct udev_device *udev_device)
+{
+ struct udev_list_entry *list_entry;
+ struct dirent *entry;
+ DIR *dir;
+ int num = 0;
+
+ if (udev_device = NULL)
+ return -1;
+ /* caching already done? */
+ if (true = udev_device->sysattrs_cached)
+ return 0;
+
+ dir = opendir(udev_device_get_syspath(udev_device));
+ if (!dir) {
+ dbg(udev_device->udev, "sysfs dir '%s' can not be opened\n",
+ udev_device_get_syspath(udev_device));
+ return -1;
+ }
+
+ while (NULL != (entry = readdir(dir))) {
+ char path[UTIL_PATH_SIZE];
+ struct stat statbuf;
+
+ /* only handle symlinks and regular files */
+ if (DT_LNK != entry->d_type && DT_REG != entry->d_type)
+ continue;
+
+ util_strscpyl(path, sizeof(path), udev_device_get_syspath(udev_device),
+ "/", entry->d_name, NULL);
+ if (0 != lstat(path, &statbuf))
+ continue;
+
+ if (0 = (statbuf.st_mode & S_IRUSR))
+ continue;
+
+ if (DT_LNK = entry->d_type) {
+ /* symlink */
+ char target[UTIL_NAME_SIZE];
+ int len;
+ char *pos;
+
+ /* these values are cached immediately */
+ if (strcmp(entry->d_name, "driver") != 0 &&
+ strcmp(entry->d_name, "subsystem") != 0 &&
+ strcmp(entry->d_name, "module") != 0)
+ continue;
+
+ len = readlinkat(dirfd(dir), entry->d_name, target, sizeof(target));
+ if (len <= 0 || len = sizeof(target))
+ continue;
+ target[len] = '\0';
+
+ pos = strrchr(target, '/');
+ if (pos != NULL) {
+ pos = &pos[1];
+ dbg(udev_device->udev, "cache '%s' with link value '%s'\n", entry->d_name,
pos);
+ list_entry = udev_list_entry_add(udev_device->udev,
+ &udev_device->sysattr_list, entry->d_name, pos, 1, 0);
+ }
+ } else {
+ /* regular file */
+ dbg(udev_device->udev, "cache '%s' empty sysattr\n", entry->d_name);
+ list_entry = udev_list_entry_add(udev_device->udev,
+ &udev_device->sysattr_list, entry->d_name, NULL, 0, 0);
+ }
+ ++num;
+ }
+
+ udev_device->sysattrs_cached = true;
+ return num;
+}
+
/**
* udev_device_get_sysattr_value:
* @udev_device: udev device
@@ -1143,6 +1217,9 @@ void udev_device_set_usec_initialized(struct udev_device
*udev_device, unsigned
*
* The retrieved value is cached in the device. Repeated calls will return the same
* value and not open the attribute again.
+ * Upon first call a list of available sysfs attributes is assembled and saved in
+ * sysattr_list -- while the actual value of the sysattr is -- except for
symlinks --
+ * not read.
*
* Returns: the content of a sys attribute file, or #NULL if there is no sys
attribute value.
**/
@@ -1151,66 +1228,46 @@ const char *udev_device_get_sysattr_value(struct
udev_device *udev_device, const
struct udev_list_entry *list_entry;
char path[UTIL_PATH_SIZE];
char value[4096];
- struct stat statbuf;
int fd;
ssize_t size;
const char *val = NULL;
+ bool found = false;
if (udev_device = NULL)
return NULL;
if (sysattr = NULL)
return NULL;
- /* look for possibly already cached result */
+ /* perform initial caching of sysattr list */
+ if (!udev_device->sysattrs_cached) {
+ int ret;
+ ret = cache_sysattrs(udev_device);
+ if (0 > ret)
+ return NULL;
+ }
+
+ /* does the desired sysattr exist? */
udev_list_entry_foreach(list_entry,
udev_list_get_entry(&udev_device->sysattr_list)) {
if (strcmp(udev_list_entry_get_name(list_entry), sysattr) = 0) {
- dbg(udev_device->udev, "got '%s' (%s) from cache\n",
- sysattr, udev_list_entry_get_value(list_entry));
- return udev_list_entry_get_value(list_entry);
+ found = true;
+ val = udev_list_entry_get_value(list_entry);
+ break;
}
}
- util_strscpyl(path, sizeof(path), udev_device_get_syspath(udev_device), "/",
sysattr, NULL);
- if (lstat(path, &statbuf) != 0) {
- dbg(udev_device->udev, "no attribute '%s', keep negative entry\n", path);
- udev_list_entry_add(udev_device->udev, &udev_device->sysattr_list, sysattr,
NULL, 0, 0);
- goto out;
+ if (false = found) {
+ dbg(udev_device->udev, "no attribute '%s/%s' found\n",
+ udev_device_get_syspath(udev_device), sysattr);
+ return NULL;
}
- if (S_ISLNK(statbuf.st_mode)) {
- char target[UTIL_NAME_SIZE];
- int len;
- char *pos;
-
- /* some core links return the last element of the target path */
- if (strcmp(sysattr, "driver") != 0 &&
- strcmp(sysattr, "subsystem") != 0 &&
- strcmp(sysattr, "module") != 0)
- goto out;
-
- len = readlink(path, target, sizeof(target));
- if (len <= 0 || len = sizeof(target))
- goto out;
- target[len] = '\0';
-
- pos = strrchr(target, '/');
- if (pos != NULL) {
- pos = &pos[1];
- dbg(udev_device->udev, "cache '%s' with link value '%s'\n", sysattr, pos);
- list_entry = udev_list_entry_add(udev_device->udev,
&udev_device->sysattr_list, sysattr, pos, 0, 0);
- val = udev_list_entry_get_value(list_entry);
- }
-
- goto out;
+ if (NULL != val) {
+ dbg(udev_device->udev, "got '%s' (%s) from cache\n",
+ sysattr, udev_list_entry_get_value(list_entry));
+ return val;
}
- /* skip directories */
- if (S_ISDIR(statbuf.st_mode))
- goto out;
-
- /* skip non-readable files */
- if ((statbuf.st_mode & S_IRUSR) = 0)
- goto out;
+ util_strscpyl(path, sizeof(path), udev_device_get_syspath(udev_device), "/",
sysattr, NULL);
/* read attribute value */
fd = open(path, O_RDONLY|O_CLOEXEC);
@@ -1225,11 +1282,11 @@ const char *udev_device_get_sysattr_value(struct
udev_device *udev_device, const
if (size = sizeof(value))
goto out;
- /* got a valid value, store it in cache and return it */
+ /* got a valid value, update in cache and return it */
value[size] = '\0';
util_remove_trailing_chars(value, '\n');
dbg(udev_device->udev, "'%s' has attribute value '%s'\n", path, value);
- list_entry = udev_list_entry_add(udev_device->udev,
&udev_device->sysattr_list, sysattr, value, 0, 0);
+ list_entry = udev_list_entry_add(udev_device->udev,
&udev_device->sysattr_list, sysattr, value, 1, 0);
val = udev_list_entry_get_value(list_entry);
out:
return val;
--
1.7.2.2
^ permalink raw reply related
* [PATCH 2/2] libudev: Get all sysfs attrs for a device
From: Thomas Egerer @ 2011-03-03 9:17 UTC (permalink / raw)
To: linux-hotplug
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
---
libudev/exported_symbols | 1 +
libudev/libudev-device.c | 23 +++++++++++++++++++++++
libudev/libudev.h | 1 +
3 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/libudev/exported_symbols b/libudev/exported_symbols
index 2e6a9b7..500e981 100644
--- a/libudev/exported_symbols
+++ b/libudev/exported_symbols
@@ -32,6 +32,7 @@ udev_device_get_is_initialized
udev_device_get_devlinks_list_entry
udev_device_get_properties_list_entry
udev_device_get_tags_list_entry
+udev_device_get_sysattr_list_entry
udev_device_get_property_value
udev_device_get_action
udev_device_get_driver
diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c
index 5baff49..0874041 100644
--- a/libudev/libudev-device.c
+++ b/libudev/libudev-device.c
@@ -1292,6 +1292,29 @@ out:
return val;
}
+/**
+ * udev_device_get_properties_list_entry:
+ * @udev_device: udev device
+ *
+ * Retrieve the list of sysattr key/value pairs, where value might be empty;
+ * This is to be able to read all available sysfs attributes for a particular
+ * device without the necessity to access sysfs from outside libudev.
+ *
+ * Returns: the first entry of the property list
+ **/
+struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device
*udev_device)
+{
+ /* perform initial caching of sysattr list */
+ if (!udev_device->sysattrs_cached) {
+ int ret;
+ ret = cache_sysattrs(udev_device);
+ if (0 > ret)
+ return NULL;
+ }
+
+ return udev_list_get_entry(&udev_device->sysattr_list);
+}
+
int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath)
{
const char *pos;
diff --git a/libudev/libudev.h b/libudev/libudev.h
index 0abd7c8..892530b 100644
--- a/libudev/libudev.h
+++ b/libudev/libudev.h
@@ -92,6 +92,7 @@ int udev_device_get_is_initialized(struct udev_device
*udev_device);
struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device
*udev_device);
struct udev_list_entry *udev_device_get_properties_list_entry(struct
udev_device *udev_device);
struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device
*udev_device);
+struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device
*udev_device);
const char *udev_device_get_property_value(struct udev_device *udev_device,
const char *key);
const char *udev_device_get_driver(struct udev_device *udev_device);
dev_t udev_device_get_devnum(struct udev_device *udev_device);
--
1.7.2.2
^ permalink raw reply related
* Re: How to trigger a udev rule
From: Thomas Bechtold @ 2011-03-03 9:52 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <1299133287.2394.10.camel@salbei>
Hi Martin,
On 03/03/11 09:54, Martin Pitt wrote:
> Hello Thomas,
>
> funny that you ask, a few days ago someone asked exactly the same
> thing in #udev.
that was me:)
> Thomas Bechtold [2011-03-03 7:21 +0100]:
>> ### only check /dev/ttyS1 (atmel_usart.1) for modem ###
>> ACTION!="add|change", GOTO="mm_platform_device_whitelist_end"
>> SUBSYSTEM!="platform", GOTO="mm_platform_device_whitelist_end"
>> DRIVERS="atmel_usart",KERNELS="atmel_usart.1",ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1"
>> LABEL="mm_platform_device_whitelist_end"
>
> I'm afraid udevadm trigger doesn't support the same parental matching
> as udev rules themselves do, so I don't think there can be a precise
> trigger unless you already know the corresponding /dev/ttySn device
> node. If you do, then just do
>
> udevadm trigger --sysname-match=ttySn
i know the device name. it's always ttyS1. But your trigger does not
match the rule:
# udevadm trigger --sysname-match=ttyS1 --verbose
/sys/devices/platform/atmel_usart.1/tty/ttyS1
I tried to do this with udevadm (modemmanager is running in background
and log is written to sdtout):
# udevadm trigger --actiond --subsystem-match=tty
--subsystem-match=platform --sysname-match=ttyS1 --verbose
/sys/devices/platform/atmel_usart.1/tty/ttyS1
Here, ModemManager does nothing.
When i execute the command with ttyS0, the output is:
# udevadm trigger --actiond --subsystem-match=tty
--subsystem-match=platform --sysname-match=ttyS0 --verbose
/sys/devices/platform/atmel_usart.1/tty/ttyS0
modem-manager[772]: <debug> [1299145393.216952] [mm-manager.c:802]
device_added(): (tty/ttyS0): port's parent platform driver is not
whitelisted
Here, ModemManager detects the trigger.
I think the question is how to set DRIVERS="atmel_usart" and
KERNELS="atmel_usart.1" !?
Cheers,
Tom
^ permalink raw reply
* Re: How to trigger a udev rule
From: Andrey Borzenkov @ 2011-03-03 10:39 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <1299133287.2394.10.camel@salbei>
On Thu, Mar 3, 2011 at 12:52 PM, Thomas Bechtold
<thomasbechtold@jpberlin.de> wrote:
> i know the device name. it's always ttyS1. But your trigger does not match
> the rule:
>
Then you have to fix the rule :) because it won't be applied to real
device as well.
^ permalink raw reply
* Re: [PATCH 0/2] libudev: Get all sysfs attrs for a device
From: Kay Sievers @ 2011-03-03 14:11 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <4D6F5CA6.2010905@secunet.com>
On Thu, Mar 3, 2011 at 10:17, Thomas Egerer <thomas.egerer@secunet.com> wrote:
First, the patch seems line-wrapped.
> I recently took part in writing an application using libudev to retrieve
> information on devices present on a linux system. It became evident that
> apparently there is no way to retrieve all possible sysfs attributes for a
> particular device (the same way it is possible to get all of its properties).
Keep in mind, that if you are root, you can do really nasty things if
you open/read binary files. Sysfs is not meant to be used to blindly
open "random" files. Think of it as device ioctl()s -- nobody would
expect to just issue all numbers to a device, to check what comes back
:) Things can go very wrong here.
It is actually the reason libudev does not support anything like this.
People must exactly know what they want to read, and need to be very
careful here, unlike it it with udev properties managed by udev.
If this is about a generic device browser, you would need to make sure
nobody does weird things with it.
> The matter kept nagging me -- even though we worked our way around this using
> sysfs directly -- and I decided to add a udev_device_get_sysattr_list_entry.
I don't mind in general to have such a list. But we need to think
about the above first, if that is really stuff we should offer.
> For
> this matter the behavior of udev_device_get_sysattr_value had to be modified (a
> little): on first access of any sysattr, it create an list including _all_
> sysfs-attributes as name (with an empty value, except for the symlinks). The
> values are cached as soon as thery're requested. Negative entries do not exist
> anymore.
The same code is used by udevd. For performance reasons, we can not
afford to call readdir() for every device we look at. We don't want to
cache anything which we don't need.
Thanks,
Kay
^ permalink raw reply
* Re: [PATCH 0/2] libudev: Get all sysfs attrs for a device
From: Martin Pitt @ 2011-03-03 17:00 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <4D6F5CA6.2010905@secunet.com>
Kay Sievers [2011-03-03 15:11 +0100]:
> Keep in mind, that if you are root, you can do really nasty things if
> you open/read binary files. Sysfs is not meant to be used to blindly
> open "random" files. Think of it as device ioctl()s -- nobody would
> expect to just issue all numbers to a device, to check what comes back
> :) Things can go very wrong here.
The current patches don't actually open the attribute files, just read
the dir and stat the files; but I guess that was meant as a general
"never try to iterate over all of them" warning.
> The same code is used by udevd. For performance reasons, we can not
> afford to call readdir() for every device we look at. We don't want to
> cache anything which we don't need.
Indeed, and I actually see no reason why
udev_device_get_sysattr_value() would cause the building of the cache;
shouldn't that be done in the new udev_device_get_sysattr_list_entry()
instead, where it actually belongs?
(Note that you have the wrong function name in the doc comment of
udev_device_get_sysattr_list_entry()).
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
^ permalink raw reply
* Re: [PATCH 0/2] libudev: Get all sysfs attrs for a device
From: Kay Sievers @ 2011-03-03 17:15 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <4D6F5CA6.2010905@secunet.com>
On Thu, Mar 3, 2011 at 18:00, Martin Pitt <martin.pitt@ubuntu.com> wrote:
> Kay Sievers [2011-03-03 15:11 +0100]:
>> Keep in mind, that if you are root, you can do really nasty things if
>> you open/read binary files. Sysfs is not meant to be used to blindly
>> open "random" files. Think of it as device ioctl()s -- nobody would
>> expect to just issue all numbers to a device, to check what comes back
>> :) Things can go very wrong here.
>
> The current patches don't actually open the attribute files, just read
> the dir and stat the files; but I guess that was meant as a general
> "never try to iterate over all of them" warning.
Sure, it's not about the patch, it's about what this patch offers to
users, and might suggest the wrong thing to do.
>> The same code is used by udevd. For performance reasons, we can not
>> afford to call readdir() for every device we look at. We don't want to
>> cache anything which we don't need.
>
> Indeed, and I actually see no reason why
> udev_device_get_sysattr_value() would cause the building of the cache;
> shouldn't that be done in the new udev_device_get_sysattr_list_entry()
> instead, where it actually belongs?
Maybe. As said, we shoudl be careful here. Sysfs is really not meant
to be blindly iterated over. But if there is a good use case, we can
certainly do that. The "udevadm info -a" attribute stuff might even
use that.
Kay
^ permalink raw reply
* Re: [PATCH 0/2] libudev: Get all sysfs attrs for a device
From: Thomas Egerer @ 2011-03-03 17:38 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <4D6F5CA6.2010905@secunet.com>
Kay,
The approach shown in the patch may have indeed a performance impact which we
understand must be avoided. But I take it you are not generally opposed to
providing such an interface, assuming it is implemented in a way that does not
interfere with the existing mode of operation?
Let me explain a little bit why we think this interface would be helpful... We
want to write unit tests for applications that interact with udev (get
notified when devices pop up/disappear), and for this we need an abstraction
layer that we can mock. libudev has a nice clean interface that fits this
purpose very well actually, but we cannot obtain a list of attributes through
libudev (why we sometimes need that, see below). This means that we are
building a secondary abstraction to just obtain the list of attributes, and
strictly funnel everything else through libudev. We then provide "mock"
and "real" implementations of both, and make sure to "tie" the two different
implementations properly (which deeply interact for the "mock" case under the
hood). As you can imagine, this is "a bit" messy.
The test cases to be injected into the applications are usually generated
from "traces" captured from live systems, possibly filtered and post-processed
to simulate exactly the interaction we want to see. It is sometimes useful
to "recapture" from test-data instead of a live system, and when we capture
things, we don't always know what attributes a subsequent test might actually
want. To faithfully replay the interaction later we therefore need to
preserve "as much as we can".
We are aware that poking random things in sysfs can have rather "undesirable"
consequences, so there is probably not much one can do with such an interface
outside the scope of such testing scenarios. It is on the other hand very
difficult to provide good testability without it.
Cheers, Thomas
^ permalink raw reply
* Re: [PATCH 0/2] libudev: Get all sysfs attrs for a device
From: Kay Sievers @ 2011-03-03 17:47 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <4D6F5CA6.2010905@secunet.com>
On Thu, Mar 3, 2011 at 18:38, Thomas Egerer <thomas.egerer@secunet.com> wrote:
> The approach shown in the patch may have indeed a performance impact which we
> understand must be avoided. But I take it you are not generally opposed to
> providing such an interface, assuming it is implemented in a way that does not
> interfere with the existing mode of operation?
Sure, sounds fine to have that.
Maybe just use the interface for:
udevadm info -a
and replace:
http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=udev/udevadm-info.c;hE10f4aa907dc56a22544564ec1e10045046bf61;hb=HEAD#l34
with the same patch, and check that all works fine.
> Let me explain a little bit why we think this interface would be helpful... We
> want to write unit tests for applications that interact with udev (get
> notified when devices pop up/disappear), and for this we need an abstraction
> layer that we can mock. libudev has a nice clean interface that fits this
> purpose very well actually, but we cannot obtain a list of attributes through
> libudev (why we sometimes need that, see below). This means that we are
> building a secondary abstraction to just obtain the list of attributes, and
> strictly funnel everything else through libudev. We then provide "mock"
> and "real" implementations of both, and make sure to "tie" the two different
> implementations properly (which deeply interact for the "mock" case under the
> hood). As you can imagine, this is "a bit" messy.
>
> The test cases to be injected into the applications are usually generated
> from "traces" captured from live systems, possibly filtered and post-processed
> to simulate exactly the interaction we want to see. It is sometimes useful
> to "recapture" from test-data instead of a live system, and when we capture
> things, we don't always know what attributes a subsequent test might actually
> want. To faithfully replay the interaction later we therefore need to
> preserve "as much as we can".
>
> We are aware that poking random things in sysfs can have rather "undesirable"
> consequences, so there is probably not much one can do with such an interface
> outside the scope of such testing scenarios. It is on the other hand very
> difficult to provide good testability without it.
Sounds all fine, just be careful. :)
Kay
^ permalink raw reply
* Re: [PATCH V6 0/2] tracing, perf: cpu hotplug trace events
From: Steven Rostedt @ 2011-03-03 22:42 UTC (permalink / raw)
To: Thomas Renninger
Cc: Vincent Guittot, Ingo Molnar, linux-kernel, linux-hotplug,
fweisbec, amit.kucheria, rusty, tglx, Arjan van de Ven, Alan Cox,
Peter Zijlstra, H. Peter Anvin, Andrew Morton, linux-perf-users
In-Reply-To: <201103022307.46694.trenn@suse.de>
On Wed, 2011-03-02 at 23:07 +0100, Thomas Renninger wrote:
> I doubt cpu offlining is the proper instrument to save power.
> You want to prevent the CPU of being used by ripping it out from scheduler decisions and
> make sure it doesn't get interrupts by offlining. But the (latency) price is high.
I could imagine that a server could use this for power savings to take
down all but 1 CPU on off hours. When it knows its not going to get much
action but still needs to remain online. Then just before peak times
begin, online the other CPUs.
But anything more dynamic than that, I can't see it really worth it. As
the latency to bring the other CPU online, may miss a peak when it was
needed.
-- Steve
^ permalink raw reply
* Re: [PATCH 0/2] libudev: Get all sysfs attrs for a device
From: Thomas Egerer @ 2011-03-04 16:06 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <4D6F5CA6.2010905@secunet.com>
Kay Sievers schrobtete:
> On Thu, Mar 3, 2011 at 18:38, Thomas Egerer <thomas.egerer@secunet.com> wrote:
>> The approach shown in the patch may have indeed a performance impact which we
>> understand must be avoided. But I take it you are not generally opposed to
>> providing such an interface, assuming it is implemented in a way that does not
>> interfere with the existing mode of operation?
>
> Sure, sounds fine to have that.
>
> Maybe just use the interface for:
> udevadm info -a
> and replace:
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=udev/udevadm-info.c;hE10f4aa907dc56a22544564ec1e10045046bf61;hb=HEAD#l34
In regard to your objection concerning performance, I rewrote the original
patch, using a separate list for the means of retrieving all sysfs attributes.
The newly introduced interface is now being used in udevadm, too. Patches (not
linewrapped, this time) follow.
Cheers, Thomas
^ permalink raw reply
* [PATCH 1/2] libudev: Get available sysfs attrs for a device
From: Thomas Egerer @ 2011-03-04 16:06 UTC (permalink / raw)
To: linux-hotplug
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
---
libudev/exported_symbols | 1 +
libudev/libudev-device.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++
libudev/libudev.h | 1 +
3 files changed, 83 insertions(+), 0 deletions(-)
diff --git a/libudev/exported_symbols b/libudev/exported_symbols
index 2e6a9b7..500e981 100644
--- a/libudev/exported_symbols
+++ b/libudev/exported_symbols
@@ -32,6 +32,7 @@ udev_device_get_is_initialized
udev_device_get_devlinks_list_entry
udev_device_get_properties_list_entry
udev_device_get_tags_list_entry
+udev_device_get_sysattr_list_entry
udev_device_get_property_value
udev_device_get_action
udev_device_get_driver
diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c
index 16bee19..af0bc2e 100644
--- a/libudev/libudev-device.c
+++ b/libudev/libudev-device.c
@@ -61,6 +61,7 @@ struct udev_device {
struct udev_list_node devlinks_list;
struct udev_list_node properties_list;
struct udev_list_node sysattr_list;
+ struct udev_list_node available_sysattr_list;
struct udev_list_node tags_list;
unsigned long long int seqnum;
unsigned long long int usec_initialized;
@@ -83,6 +84,7 @@ struct udev_device {
bool db_loaded;
bool uevent_loaded;
bool is_initialized;
+ bool sysattrs_cached;
};
struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value)
@@ -361,6 +363,7 @@ struct udev_device *udev_device_new(struct udev *udev)
udev_list_init(&udev_device->devlinks_list);
udev_list_init(&udev_device->properties_list);
udev_list_init(&udev_device->sysattr_list);
+ udev_list_init(&udev_device->available_sysattr_list);
udev_list_init(&udev_device->tags_list);
udev_device->event_timeout = -1;
udev_device->watch_handle = -1;
@@ -785,6 +788,7 @@ void udev_device_unref(struct udev_device *udev_device)
udev_list_cleanup_entries(udev_device->udev, &udev_device->devlinks_list);
udev_list_cleanup_entries(udev_device->udev, &udev_device->properties_list);
udev_list_cleanup_entries(udev_device->udev, &udev_device->sysattr_list);
+ udev_list_cleanup_entries(udev_device->udev, &udev_device->available_sysattr_list);
udev_list_cleanup_entries(udev_device->udev, &udev_device->tags_list);
free(udev_device->action);
free(udev_device->driver);
@@ -1235,6 +1239,83 @@ out:
return val;
}
+static int udev_device_cache_sysattrs(struct udev_device *udev_device)
+{
+ struct dirent *entry;
+ DIR *dir;
+ int num = 0;
+
+ if (udev_device = NULL)
+ return -1;
+ /* caching already done? */
+ if (udev_device->sysattrs_cached)
+ return 0;
+
+ dir = opendir(udev_device_get_syspath(udev_device));
+ if (!dir) {
+ dbg(udev_device->udev, "sysfs dir '%s' can not be opened\n",
+ udev_device_get_syspath(udev_device));
+ return -1;
+ }
+
+ while (NULL != (entry = readdir(dir))) {
+ char path[UTIL_PATH_SIZE];
+ struct stat statbuf;
+
+ /* only handle symlinks and regular files */
+ if (DT_LNK != entry->d_type && DT_REG != entry->d_type)
+ continue;
+
+ util_strscpyl(path, sizeof(path), udev_device_get_syspath(udev_device),
+ "/", entry->d_name, NULL);
+ if (0 != lstat(path, &statbuf))
+ continue;
+
+ if (0 = (statbuf.st_mode & S_IRUSR))
+ continue;
+
+ if (DT_LNK = entry->d_type) {
+ if (strcmp(entry->d_name, "driver") != 0 &&
+ strcmp(entry->d_name, "subsystem") != 0 &&
+ strcmp(entry->d_name, "module") != 0)
+ continue;
+ }
+ udev_list_entry_add(udev_device->udev,
+ &udev_device->available_sysattr_list, entry->d_name,
+ DT_LNK = entry->d_type ? "s" : "r", 0, 0);
+ ++num;
+ }
+
+ dbg(udev_device->udev, "found %d sysattrs for '%s'\n", num,
+ udev_device_get_syspath(udev_device));
+ udev_device->sysattrs_cached = true;
+
+ return num;
+}
+
+/**
+ * udev_device_get_sysattr_list_entry:
+ * @udev_device: udev device
+ *
+ * Retrieve the list of available sysattrs, with value being empty;
+ * This is to be able to read all available sysfs attributes for a particular
+ * device without the necessity to access sysfs from outside libudev.
+ *
+ * Returns: the first entry of the property list
+ **/
+struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device)
+{
+ /* perform initial caching of sysattr list */
+ if (!udev_device->sysattrs_cached) {
+ int ret;
+ ret = udev_device_cache_sysattrs(udev_device);
+ if (0 > ret)
+ return NULL;
+ }
+
+ return udev_list_get_entry(&udev_device->available_sysattr_list);
+}
+
int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath)
{
const char *pos;
diff --git a/libudev/libudev.h b/libudev/libudev.h
index 0abd7c8..892530b 100644
--- a/libudev/libudev.h
+++ b/libudev/libudev.h
@@ -92,6 +92,7 @@ int udev_device_get_is_initialized(struct udev_device *udev_device);
struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device);
struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device);
struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device);
+struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device);
const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key);
const char *udev_device_get_driver(struct udev_device *udev_device);
dev_t udev_device_get_devnum(struct udev_device *udev_device);
^ permalink raw reply related
* [PATCH 2/2] libudev: Use sysfs attr interface for attribute walk
From: Thomas Egerer @ 2011-03-04 16:06 UTC (permalink / raw)
To: linux-hotplug
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
---
libudev/docs/libudev-sections.txt | 1 +
udev/udevadm-info.c | 62 ++++++++++++++++---------------------
2 files changed, 28 insertions(+), 35 deletions(-)
diff --git a/libudev/docs/libudev-sections.txt b/libudev/docs/libudev-sections.txt
index 7db9c1b..918344d 100644
--- a/libudev/docs/libudev-sections.txt
+++ b/libudev/docs/libudev-sections.txt
@@ -54,6 +54,7 @@ udev_device_get_driver
udev_device_get_devnum
udev_device_get_action
udev_device_get_sysattr_value
+udev_device_get_sysattr_list_entry
udev_device_get_seqnum
udev_device_get_usec_since_initialized
</SECTION>
diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c
index 4510f4a..f60ad2c 100644
--- a/udev/udevadm-info.c
+++ b/udev/udevadm-info.c
@@ -33,47 +33,39 @@
static void print_all_attributes(struct udev_device *device, const char *key)
{
- struct udev *udev = udev_device_get_udev(device);
- DIR *dir;
- struct dirent *dent;
-
- dir = opendir(udev_device_get_syspath(device));
- if (dir != NULL) {
- for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
- struct stat statbuf;
- const char *value;
- size_t len;
-
- if (dent->d_name[0] = '.')
- continue;
-
- if (strcmp(dent->d_name, "uevent") = 0)
- continue;
- if (strcmp(dent->d_name, "dev") = 0)
- continue;
-
- if (fstatat(dirfd(dir), dent->d_name, &statbuf, AT_SYMLINK_NOFOLLOW) != 0)
- continue;
- if (S_ISLNK(statbuf.st_mode))
- continue;
-
- value = udev_device_get_sysattr_value(device, dent->d_name);
- if (value = NULL)
- continue;
- dbg(udev, "attr '%s'='%s'\n", dent->d_name, value);
-
- /* skip nonprintable attributes */
- len = strlen(value);
- while (len > 0 && isprint(value[len-1]))
- len--;
- if (len > 0) {
- dbg(udev, "attribute value of '%s' non-printable, skip\n", dent->d_name);
- continue;
- }
-
- printf(" %s{%s}=\"%s\"\n", key, dent->d_name, value);
+ struct udev_list_entry *sysattr;
+
+ udev_list_entry_foreach(sysattr, udev_device_get_sysattr_list_entry(device)) {
+ const char *name;
+ const char *value;
+ size_t len;
+
+ /* skip symlinks */
+ if (0 = strcmp("s", udev_list_entry_get_value(sysattr)))
+ continue;
+
+ name = udev_list_entry_get_name(sysattr);
+ if (strcmp(name, "uevent") = 0)
+ continue;
+ if (strcmp(name, "dev") = 0)
+ continue;
+
+ value = udev_device_get_sysattr_value(device, name);
+ if (value = NULL)
+ continue;
+ dbg(udev_device_get_udev(device), "attr '%s'='%s'\n", name, value);
+
+ /* skip nonprintable attributes */
+ len = strlen(value);
+ while (len > 0 && isprint(value[len-1]))
+ len--;
+ if (len > 0) {
+ dbg(udev_device_get_udev(device),
+ "attribute value of '%s' non-printable, skip\n", name);
+ continue;
}
- closedir(dir);
+
+ printf(" %s{%s}=\"%s\"\n", key, name, value);
}
printf("\n");
}
^ permalink raw reply related
* Re: [PATCH V4] Export ACPI _DSM provided firmware instance number
From: Narendra_K @ 2011-03-04 16:28 UTC (permalink / raw)
To: linux-pci, linux-hotplug
Cc: netdev, mjg, Matt_Domsch, Charles_Rose, Jordan_Hargrave,
Shyam_Iyer, sfr
In-Reply-To: <20110302172508.GA2794@fedora14-r610.oslab.blr.amer.dell.com>
On Wed, Mar 02, 2011 at 10:34:17PM +0530, K, Narendra wrote:
> On Wed, Feb 23, 2011 at 06:06:42PM +0530, K, Narendra wrote:
> > Hello,
> >
> > This patch exports ACPI _DSM provided firmware instance number and
> > string name to sysfs.
> >
> > V1 -> V2:
> > The attribute 'index' is changed to 'acpi_index' as the semantics of
> > SMBIOS provided device type instance and ACPI _DSM provided firmware
> > instance number are different.
> >
> > V2 -> V3:
> > Matthew Garrett pointed out that 'sysfs_create_groups' does return an
> > error when there are no ACPI _DSM attributes available and because of
> > that the fallback to SMBIOS will not happen. As a result SMBIOS provided
> > attributes are not created. This version of the patch addresses the issue.
> >
>
> V3 -> V4:
> Select NLS if (DMI || ACPI) in drivers/pci/Kconfig to prevent build
> breakage from an 'allmodconfig'
>
> Matthew,
> Thanks for the suggestion.
>
> From: Narendra K <narendra_k@dell.com>
> Subject: [PATCH] Export ACPI _DSM provided firmware instance number and string to sysfs
>
Hi Jesse,
Does Version 4 of the patch look good for inclusion ? Please let us know
if there are any concerns.
With regards,
Narendra K
^ permalink raw reply
* Re: [PATCH V4] Export ACPI _DSM provided firmware instance number
From: Jesse Barnes @ 2011-03-04 18:38 UTC (permalink / raw)
To: Narendra_K
Cc: linux-pci, linux-hotplug, netdev, mjg, Matt_Domsch, Charles_Rose,
Jordan_Hargrave, Shyam_Iyer, sfr
In-Reply-To: <20110304164957.GA2913@fedora14-r610.oslab.blr.amer.dell.com>
On Fri, 4 Mar 2011 08:28:59 -0800
<Narendra_K@Dell.com> wrote:
> On Wed, Mar 02, 2011 at 10:34:17PM +0530, K, Narendra wrote:
> > On Wed, Feb 23, 2011 at 06:06:42PM +0530, K, Narendra wrote:
> > > Hello,
> > >
> > > This patch exports ACPI _DSM provided firmware instance number and
> > > string name to sysfs.
> > >
> > > V1 -> V2:
> > > The attribute 'index' is changed to 'acpi_index' as the semantics of
> > > SMBIOS provided device type instance and ACPI _DSM provided firmware
> > > instance number are different.
> > >
> > > V2 -> V3:
> > > Matthew Garrett pointed out that 'sysfs_create_groups' does return an
> > > error when there are no ACPI _DSM attributes available and because of
> > > that the fallback to SMBIOS will not happen. As a result SMBIOS provided
> > > attributes are not created. This version of the patch addresses the issue.
> > >
> >
> > V3 -> V4:
> > Select NLS if (DMI || ACPI) in drivers/pci/Kconfig to prevent build
> > breakage from an 'allmodconfig'
> >
> > Matthew,
> > Thanks for the suggestion.
> >
> > From: Narendra K <narendra_k@dell.com>
> > Subject: [PATCH] Export ACPI _DSM provided firmware instance number and string to sysfs
> >
>
> Hi Jesse,
>
> Does Version 4 of the patch look good for inclusion ? Please let us know
> if there are any concerns.
Oh sorry, I was looking in the wrong mailbox, I'll pull this one in now.
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply
* Re: [PATCH V4] Export ACPI _DSM provided firmware instance number
From: Jesse Barnes @ 2011-03-04 18:43 UTC (permalink / raw)
To: Narendra_K
Cc: linux-pci, linux-hotplug, netdev, mjg, Matt_Domsch, Charles_Rose,
Jordan_Hargrave, Shyam_Iyer, sfr
In-Reply-To: <20110302172508.GA2794@fedora14-r610.oslab.blr.amer.dell.com>
On Wed, 2 Mar 2011 22:34:17 +0530
<Narendra_K@Dell.com> wrote:
> On Wed, Feb 23, 2011 at 06:06:42PM +0530, K, Narendra wrote:
> > Hello,
> >
> > This patch exports ACPI _DSM provided firmware instance number and
> > string name to sysfs.
> >
> > V1 -> V2:
> > The attribute 'index' is changed to 'acpi_index' as the semantics of
> > SMBIOS provided device type instance and ACPI _DSM provided firmware
> > instance number are different.
> >
> > V2 -> V3:
> > Matthew Garrett pointed out that 'sysfs_create_groups' does return an
> > error when there are no ACPI _DSM attributes available and because of
> > that the fallback to SMBIOS will not happen. As a result SMBIOS provided
> > attributes are not created. This version of the patch addresses the issue.
> >
>
> V3 -> V4:
> Select NLS if (DMI || ACPI) in drivers/pci/Kconfig to prevent build
> breakage from an 'allmodconfig'
Applied, fingers crossed this time. :)
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply
* Re: [PATCH 0/2] libudev: Get all sysfs attrs for a device
From: Kay Sievers @ 2011-03-04 22:14 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <4D6F5CA6.2010905@secunet.com>
On Fri, Mar 4, 2011 at 17:06, Thomas Egerer <thomas.egerer@secunet.com> wrote:
> In regard to your objection concerning performance, I rewrote the original
> patch, using a separate list for the means of retrieving all sysfs attributes.
> The newly introduced interface is now being used in udevadm, too. Patches (not
> linewrapped, this time) follow.
Applied, with a few variable renames, a missing closedir(). We don't
magically return the type of the attribute: reading a non-core link
will fail just fine. The newly added entries to the blacklist in the
info command makes sure we don't return the core links.
Thanks,
Kay
^ permalink raw reply
* [PATCH] add ACLs to /dev/sgX nodes for CD-ROM
From: Andrey Borzenkov @ 2011-03-06 9:01 UTC (permalink / raw)
To: linux-hotplug
Current wine is using /dev/sgX to access CD-ROM devices. Since
distributions switched to using ACL instead of group membership
to control device access, wine is not able to access them.
Add ACL to device nodes that already get GROUP="cdrom".
Ref: https://qa.mandriva.com/show_bug.cgi?idb114
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
---
| 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
--git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules
index 0717d25..b0015b6 100644
--- a/extras/udev-acl/70-acl.rules
+++ b/extras/udev-acl/70-acl.rules
@@ -63,6 +63,9 @@ ENV{DDC_DEVICE}="*?", TAG+="udev-acl"
# media player raw devices (for user-mode drivers, Android SDK, etc.)
SUBSYSTEM="usb", ENV{ID_MEDIA_PLAYER}="?*", TAG+="udev-acl"
+# /dev/sgX nodes for CD-ROM drives
+SUBSYSTEM="scsi_generic", SUBSYSTEMS="scsi", ATTRS{type}="4|5", TAG+="udev-acl"
+
# apply ACL for all locally logged in users
LABEL="acl_apply", TAG="udev-acl", TEST="/var/run/ConsoleKit/database", \
RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}"
--
tg: (218e47a..) upstream/cdrom-sg-acl (depends on: master)
^ permalink raw reply related
* Re: [PATCH] add ACLs to /dev/sgX nodes for CD-ROM
From: Kay Sievers @ 2011-03-06 15:33 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <1299402082-4796-1-git-send-email-arvidjaar@mail.ru>
On Sun, Mar 6, 2011 at 10:01, Andrey Borzenkov <arvidjaar@mail.ru> wrote:
> Current wine is using /dev/sgX to access CD-ROM devices. Since
> distributions switched to using ACL instead of group membership
> to control device access, wine is not able to access them.
>
> Add ACL to device nodes that already get GROUP="cdrom".
sg is kind of deprecated and should really not be used anymore by
anything. Ideally we would start no even loading the module.
Who exactly depends on it and can not be fixed? Why does Fedora and
SUSE does not seem to have any problem the last couple of years?
Kay
^ permalink raw reply
* Re: [PATCH] add ACLs to /dev/sgX nodes for CD-ROM
From: Nicolas Pomarède @ 2011-03-06 17:21 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <1299402082-4796-1-git-send-email-arvidjaar@mail.ru>
Le 06/03/2011 16:33, Kay Sievers a écrit :
> On Sun, Mar 6, 2011 at 10:01, Andrey Borzenkov<arvidjaar@mail.ru> wrote:
>> Current wine is using /dev/sgX to access CD-ROM devices. Since
>> distributions switched to using ACL instead of group membership
>> to control device access, wine is not able to access them.
>>
>> Add ACL to device nodes that already get GROUP="cdrom".
>
> sg is kind of deprecated and should really not be used anymore by
> anything. Ideally we would start no even loading the module.
>
> Who exactly depends on it and can not be fixed? Why does Fedora and
> SUSE does not seem to have any problem the last couple of years?
>
> Kay
Other distribs are also having problem with this :
gentoo : http://bugs.gentoo.org/321007
fedora 13 : http://bugs.winehq.org/show_bug.cgi?id#313
Wine's code is using /dev/sgX, I don't know if there're some patches
around to change this.
It seems an usual fix is to add oneself to the cdrom group, but this is
hardly an out of the box solution for a non technical user that would
just install his linux distro of choice.
The fact that this problem is often related to users wanting to run
protected games under Wine is certainly another reason why it didn't get
much attention or fixes so far (in my case I want to access low level
scsi functions with EAC).
Using acl in udev would provide a solution that automatically enables
access to /dev/sgX for any logged user, without having to change /etc/group.
Nicolas
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox