diff options
author | Andy Grover <agrover@redhat.com> | 2012-08-07 11:38:59 -0700 |
---|---|---|
committer | Andy Grover <agrover@redhat.com> | 2012-08-07 11:38:59 -0700 |
commit | 7e7870004066c27d075788028d69c84fb6d86c23 (patch) | |
tree | 7ffef8a0927cbd4cc2c94577c9c5b26bee1bd904 | |
parent | d7b27b5e3085da5ca89a43b0fdd07340b0d9a118 (diff) | |
download | rtslib-fb-2.1.fb20.tar.gz |
Update sbp spec to return proper guidv2.1.fb20
Check is_local and return first guid where is_local is 1.
Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r-- | specs/sbp.spec | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/specs/sbp.spec b/specs/sbp.spec index 1e09ba6..a1fea94 100644 --- a/specs/sbp.spec +++ b/specs/sbp.spec @@ -6,10 +6,14 @@ features = () # Non-standard module naming scheme kernel_module = "sbp_target" -# This *will* return the first local 1394 device's guid, but until -# 3.6 when is_local is available, return an arbitrary value +# We need a single unique value to create the target. +# Return the first local 1394 device's guid. def wwns(): - return ["1234567890abcdef"] + import os + for fname in glob("/sys/bus/firewire/devices/fw*/is_local"): + if bool(int(fread(fname))): + guid_path = os.path.dirname(fname) + "/guid" + return [fread(guid_path)[2:]] # The configfs group configfs_group = "sbp" |