chiark / gitweb /
vol_id: add --skip-raid and --probe-all option
[elogind.git] / extras / volume_id / lib / volume_id.c
index 9f8e39b51814f28928b2db02ac110b07c0b4c51a..f74319fb9696aca13e256cffe6c9e423822b4b20 100644 (file)
@@ -21,7 +21,6 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <errno.h>
 #include <ctype.h>
 #include <fcntl.h>
 #include <sys/stat.h>
@@ -42,6 +41,9 @@ int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size)
        if (id == NULL)
                return -EINVAL;
 
+       info("probing at offset 0x%llx, size 0x%llx",
+           (unsigned long long) off, (unsigned long long) size);
+
        /* probe for raid first, because fs probes may be successful on raid members */
        if (size) {
                if (volume_id_probe_linux_raid(id, off, size) == 0)
@@ -67,6 +69,12 @@ int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size)
 
                if (volume_id_probe_highpoint_45x_raid(id, off, size) == 0)
                        goto found;
+
+               if (volume_id_probe_adaptec_raid(id, off, size) == 0)
+                       goto found;
+
+               if (volume_id_probe_jmicron_raid(id, off, size) == 0)
+                       goto found;
        }
 
        if (volume_id_probe_lvm1(id, off) == 0)
@@ -91,22 +99,24 @@ int volume_id_probe_filesystem(struct volume_id *id, uint64_t off, uint64_t size
        if (id == NULL)
                return -EINVAL;
 
-       if (volume_id_probe_luks(id, off) == 0)
-               goto found;
+       info("probing at offset 0x%llx, size 0x%llx",
+           (unsigned long long) off, (unsigned long long) size);
 
-       /* signature in the first block, only small buffer needed */
        if (volume_id_probe_vfat(id, off) == 0)
                goto found;
 
-       if (volume_id_probe_xfs(id, off) == 0)
-               goto found;
-
        /* fill buffer with maximum */
        volume_id_get_buffer(id, 0, SB_BUFFER_SIZE);
 
        if (volume_id_probe_linux_swap(id, off) == 0)
                goto found;
 
+       if (volume_id_probe_luks(id, off) == 0)
+               goto found;
+
+       if (volume_id_probe_xfs(id, off) == 0)
+               goto found;
+
        if (volume_id_probe_ext(id, off) == 0)
                goto found;
 
@@ -158,6 +168,15 @@ int volume_id_probe_filesystem(struct volume_id *id, uint64_t off, uint64_t size
        if (volume_id_probe_squashfs(id, off) == 0)
                goto found;
 
+       if (volume_id_probe_netware(id, off) == 0)
+               goto found;
+
+       if (volume_id_probe_gfs(id, off) == 0)
+               goto found;
+
+       if (volume_id_probe_gfs2(id, off) == 0)
+               goto found;
+
        return -1;
 
 found: