about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.patch
blob: d53231a84fd6eb9df9da7882b8d2c38fd5393397 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff --git a/blivet/pyudev.py b/blivet/pyudev.py
index 705b93d..7268d71 100644
--- a/blivet/pyudev.py
+++ b/blivet/pyudev.py
@@ -7,9 +7,9 @@ from ctypes import *
 
 
 # XXX this one may need some tweaking...
-def find_library(name, somajor=0):
+def find_library(name):
     env = os.environ.get("LD_LIBRARY_PATH")
-    common = ["/lib64", "/lib"]
+    common = ["/lib64", "/lib", "/lib/x86_64-linux-gnu", "/lib/i686-linux-gnu"]
 
     if env:
         libdirs = env.split(":") + common
@@ -19,7 +19,7 @@ def find_library(name, somajor=0):
     libdirs = filter(os.path.isdir, libdirs)
 
     for dir in libdirs:
-        files = fnmatch.filter(os.listdir(dir), "lib%s.so.%d" % (name, somajor))
+        files = fnmatch.filter(os.listdir(dir), "lib%s.so.*" % name)
         files = [os.path.join(dir, file) for file in files]
 
         if files:
@@ -32,11 +32,10 @@ def find_library(name, somajor=0):
 
 # find the udev library
 name = "udev"
-somajor = 1
-libudev = find_library(name=name, somajor=somajor)
+libudev = find_library(name)
 
 if not libudev or not os.path.exists(libudev):
-    raise ImportError, "No library named %s.%d" % (name, somajor)
+    raise ImportError, "No library named lib%s.so" % name
 
 # load the udev library
 libudev = CDLL(libudev)
diff --git a/blivet/deviceaction.py b/blivet/deviceaction.py
index 705b93d..60f8f32 100644
--- a/blivet/deviceaction.py
+++ b/blivet/deviceaction.py
@@ -467,6 +467,7 @@ def execute(self):
 
                 self.device.disk.format.commitToDisk()
 
+            self.device.setup()
             self.device.format.create(device=self.device.path,
                                       options=self.device.formatArgs)