probe: fallback to libblkid.so.1 when libblkid.so does not exist
authorJo-Philipp Wich <jo@mein.io>
Wed, 28 Aug 2019 10:19:29 +0000 (12:19 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 28 Aug 2019 10:19:29 +0000 (12:19 +0200)
OpenWrt commit 0e70f69a35 ("treewide: revise library packaging") removed
the unversioned library symlink from the libblkid package, breaking
dynamic loading of the library at runtime.

Add a fallback to "libblkid.so.1" to allow using the dynamic library
for filesystem probing again.

Fixes: FS#2274
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
probe-libblkid.c

index ad9f371f5fc2f5fcfbb285ab2b730d657a06b886..870965e0528faedca15dbd042a0d25feff4785e5 100644 (file)
@@ -37,6 +37,9 @@ load_libblkid(void)
        if (!libblkid.loaded) {
                lib = dlopen("libblkid.so", RTLD_GLOBAL);
 
+               if (lib == NULL)
+                       lib = dlopen("libblkid.so.1", RTLD_GLOBAL);
+
                if (lib) {
                        libblkid.alloc  = dlsym(lib, "blkid_new_probe_from_filename");
                        libblkid.probe  = dlsym(lib, "blkid_do_probe");