FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

LinkBack Thread Tools
Old 05-06-2010, 08:54 PM
David Cantrell
Default Add udev_device_get_by_path() to return /dev/disk/by-path link

The ID_PATH for a device is not the same as the link in
/dev/disk/by-path. Based on what I'm seeing, the symlinks list is what
we want to scan for a possible /dev/disk/by-path link. You cannot use
the ID_PATH value directly because it does not refer to partitions, only
whole devices.

Related: rhbz#589717
Related: rhbz#589713
storage/udev.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/storage/udev.py b/storage/udev.py
index 9ee052b..c9e3ce5 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -292,6 +292,14 @@ def udev_device_get_bus(udev_info):
def udev_device_get_path(info):
return info["ID_PATH"]

+def udev_device_get_by_path(info):
+ if info.has_key('symlinks'):
+ for link in info['symlinks']:
+ if link.startswith('/dev/disk/by-path/'):
+ return link
+ return None
def udev_device_get_sysfs_path(info):
return info['sysfs_path']


Anaconda-devel-list mailing list

Thread Tools

All times are GMT. The time now is 09:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org