zdev: limit the derivation of ZDEV_SITE_ID

Currently ZDEV_SITE_ID is derived with the help of an additional
udev-rule, 40-zdev-id.rules. The sole purpose of this rule is to
determine the ZDEV_SITE_ID environment value with the help of zdev_id
binary. This solution is minimal, but this has some unwanted side-
effects. The zdev_id logic get executed for all the events, even
those completely unrelated to zdev/or site, and imports the unneeded
envionment values to the udev-db.

Instead of having an additional rule file, add this logic as part of
the udev-rule of those devices which are configured with site-support.
The logic will then be available on all those rules with the
site-supported devices only.

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Vineeth Vijayan
2023-09-18 17:54:53 +02:00
committed by Jan Höppner
parent 5637799c92
commit 07ff9e1da0
5 changed files with 30 additions and 66 deletions

View File

@@ -404,13 +404,3 @@ char *path_get_bus_attr(const char *bus, const char *attr)
{
return path_get("/sys/bus/%s/%s", bus, attr);
}
/* Return path will be with ZDEV_PREFIX oon PATH_UDEV_RULES */
char *path_get_zdev_rule(const char *name)
{
const char *path = PATH_UDEV_RULES;
/* Create file. */
return path_get("%s/%s-%s%s", path,
ZDEV_PREFIX, name, UDEV_SUFFIX);
}