volume_id: disable detection routines which are not setting label and uuid anyway
function old new delta
static.warn 1 - -1
static.drive_name_string 14 12 -2
static.offsets 8 - -8
static.sectors 10 - -10
fs2 60 48 -12
raid2 16 - -16
uuidcache_init 704 677 -27
raid1 32 - -32
volume_id_probe_all 198 158 -40
volume_id_probe_lvm1 58 - -58
volume_id_probe_highpoint_37x_raid 63 - -63
volume_id_probe_hpfs 67 - -67
volume_id_probe_minix 74 - -74
volume_id_probe_lvm2 78 - -78
volume_id_probe_silicon_medley_raid 97 - -97
volume_id_probe_via_raid 101 - -101
volume_id_probe_highpoint_45x_raid 104 - -104
volume_id_probe_nvidia_raid 108 - -108
volume_id_probe_lsi_mega_raid 108 - -108
volume_id_probe_intel_software_raid 108 - -108
volume_id_probe_ufs 126 - -126
volume_id_probe_promise_fasttrack_raid 144 - -144
------------------------------------------------------------------------------
(add/remove: 0/18 grow/shrink: 0/4 up/down: 0/-1384) Total: -1384 bytes
text data bss dec hex filename
794244 662 7420 802326 c3e16 busybox_old
792698 662 7420 800780 c380c busybox_unstripped
diff --git a/util-linux/Config.in b/util-linux/Config.in
index a1e843a..1c3fe88 100644
--- a/util-linux/Config.in
+++ b/util-linux/Config.in
@@ -159,7 +159,7 @@
package. However, the e2fsprogs version only support ext2/3. This
version supports those in addition to FAT, swap, and ReiserFS.
WARNING:
- With all submodules selected, it will add ~9k to busybox.
+ With all submodules selected, it will add ~8k to busybox.
config FREERAMDISK
bool "freeramdisk"
@@ -427,12 +427,12 @@
help
TODO
-config FEATURE_VOLUMEID_UFS
- bool "ufs filesystem"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_UFS
+### bool "ufs filesystem"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
config FEATURE_VOLUMEID_XFS
bool "xfs filesystem"
@@ -476,12 +476,12 @@
help
TODO
-config FEATURE_VOLUMEID_LVM
- bool "lvm"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_LVM
+### bool "lvm"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
config FEATURE_VOLUMEID_CRAMFS
bool "cramfs filesystem"
@@ -490,12 +490,12 @@
help
TODO
-config FEATURE_VOLUMEID_HPFS
- bool "hpfs filesystem"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_HPFS
+### bool "hpfs filesystem"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
config FEATURE_VOLUMEID_ROMFS
bool "romfs filesystem"
@@ -511,27 +511,27 @@
help
TODO
-config FEATURE_VOLUMEID_MINIX
- bool "minix filesystem"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_MINIX
+### bool "minix filesystem"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
### These only detect partition tables - not used (yet?)
### config FEATURE_VOLUMEID_MAC
-### bool "mac filesystem"
-### default n
-### depends on VOLUMEID
-### help
-### TODO
+### bool "mac filesystem"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
###
### config FEATURE_VOLUMEID_MSDOS
-### bool "msdos filesystem"
-### default n
-### depends on VOLUMEID
-### help
-### TODO
+### bool "msdos filesystem"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
config FEATURE_VOLUMEID_OCFS2
bool "ocfs2 filesystem"
@@ -540,54 +540,54 @@
help
TODO
-config FEATURE_VOLUMEID_HIGHPOINTRAID
- bool "highpoint raid"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_HIGHPOINTRAID
+### bool "highpoint raid"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
-config FEATURE_VOLUMEID_ISWRAID
- bool "intel raid"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_ISWRAID
+### bool "intel raid"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
-config FEATURE_VOLUMEID_LSIRAID
- bool "lsi raid"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_LSIRAID
+### bool "lsi raid"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
-config FEATURE_VOLUMEID_VIARAID
- bool "via raid"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_VIARAID
+### bool "via raid"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
-config FEATURE_VOLUMEID_SILICONRAID
- bool "silicon raid"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_SILICONRAID
+### bool "silicon raid"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
-config FEATURE_VOLUMEID_NVIDIARAID
- bool "nvidia raid"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_NVIDIARAID
+### bool "nvidia raid"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
-config FEATURE_VOLUMEID_PROMISERAID
- bool "promise raid"
- default n
- depends on VOLUMEID
- help
- TODO
+### config FEATURE_VOLUMEID_PROMISERAID
+### bool "promise raid"
+### default n
+### depends on VOLUMEID
+### help
+### TODO
config FEATURE_VOLUMEID_LINUXRAID
bool "linuxraid"
diff --git a/util-linux/volume_id/Kbuild b/util-linux/volume_id/Kbuild
index 96cd880..54b95f0 100644
--- a/util-linux/volume_id/Kbuild
+++ b/util-linux/volume_id/Kbuild
@@ -13,30 +13,29 @@
lib-$(CONFIG_FEATURE_VOLUMEID_EXT) += ext.o
lib-$(CONFIG_FEATURE_VOLUMEID_FAT) += fat.o
lib-$(CONFIG_FEATURE_VOLUMEID_HFS) += hfs.o
-lib-$(CONFIG_FEATURE_VOLUMEID_HIGHPOINTRAID) += highpoint.o
-lib-$(CONFIG_FEATURE_VOLUMEID_ISWRAID) += isw_raid.o
-lib-$(CONFIG_FEATURE_VOLUMEID_LSIRAID) += lsi_raid.o
-lib-$(CONFIG_FEATURE_VOLUMEID_VIARAID) += via_raid.o
-lib-$(CONFIG_FEATURE_VOLUMEID_SILICONRAID) += silicon_raid.o
-lib-$(CONFIG_FEATURE_VOLUMEID_NVIDIARAID) += nvidia_raid.o
-lib-$(CONFIG_FEATURE_VOLUMEID_PROMISERAID) += promise_raid.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_HIGHPOINTRAID) += highpoint.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_ISWRAID) += isw_raid.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_LSIRAID) += lsi_raid.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_VIARAID) += via_raid.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_SILICONRAID) += silicon_raid.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_NVIDIARAID) += nvidia_raid.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_PROMISERAID) += promise_raid.o
lib-$(CONFIG_FEATURE_VOLUMEID_ISO9660) += iso9660.o
lib-$(CONFIG_FEATURE_VOLUMEID_JFS) += jfs.o
lib-$(CONFIG_FEATURE_VOLUMEID_LINUXRAID) += linux_raid.o
lib-$(CONFIG_FEATURE_VOLUMEID_LINUXSWAP) += linux_swap.o
-lib-$(CONFIG_FEATURE_VOLUMEID_LVM) += lvm.o
-### unused
+### lib-$(CONFIG_FEATURE_VOLUMEID_LVM) += lvm.o
### lib-$(CONFIG_FEATURE_VOLUMEID_MAC) += mac.o
### lib-$(CONFIG_FEATURE_VOLUMEID_MSDOS) += msdos.o
lib-$(CONFIG_FEATURE_VOLUMEID_NTFS) += ntfs.o
lib-$(CONFIG_FEATURE_VOLUMEID_REISERFS) += reiserfs.o
lib-$(CONFIG_FEATURE_VOLUMEID_UDF) += udf.o
-lib-$(CONFIG_FEATURE_VOLUMEID_UFS) += ufs.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_UFS) += ufs.o
lib-$(CONFIG_FEATURE_VOLUMEID_XFS) += xfs.o
lib-$(CONFIG_FEATURE_VOLUMEID_CRAMFS) += cramfs.o
-lib-$(CONFIG_FEATURE_VOLUMEID_HPFS) += hpfs.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_HPFS) += hpfs.o
lib-$(CONFIG_FEATURE_VOLUMEID_ROMFS) += romfs.o
lib-$(CONFIG_FEATURE_VOLUMEID_SYSV) += sysv.o
-lib-$(CONFIG_FEATURE_VOLUMEID_MINIX) += minix.o
+### lib-$(CONFIG_FEATURE_VOLUMEID_MINIX) += minix.o
lib-$(CONFIG_FEATURE_VOLUMEID_LUKS) += luks.o
lib-$(CONFIG_FEATURE_VOLUMEID_OCFS2) += ocfs2.o
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c
index bb3043c..b46aad4 100644
--- a/util-linux/volume_id/get_devname.c
+++ b/util-linux/volume_id/get_devname.c
@@ -243,8 +243,8 @@
colon = strchr(dev, ':');
if (!colon)
goto ret;
- *major = strtol(dev, NULL, 10);
- *minor = strtol(colon + 1, NULL, 10);
+ *major = bb_strtou(dev, NULL, 10);
+ *minor = bb_strtou(colon + 1, NULL, 10);
ret:
free(dev_path);
@@ -261,27 +261,28 @@
proccd = fopen(PROC_CDROMS, "r");
if (!proccd) {
- static smallint warn = 0;
- if (!warn) {
- warn = 1;
- bb_error_msg("mount: could not open %s, so UUID and LABEL "
- "conversion cannot be done for CD-Roms.",
- PROC_CDROMS);
- }
+// static smallint warn = 0;
+// if (!warn) {
+// warn = 1;
+// bb_error_msg("can't open %s, UUID and LABEL "
+// "conversion cannot be done for CD-Roms",
+// PROC_CDROMS);
+// }
return;
}
while (fgets(line, sizeof(line), proccd)) {
- static const char drive_name_string[] ALIGN1 = "drive name:\t\t";
+ static const char drive_name_string[] ALIGN1 = "drive name:";
if (strncmp(line, drive_name_string, sizeof(drive_name_string) - 1) == 0) {
char *device_name;
- device_name = strtok(line + sizeof(drive_name_string) - 1, "\t\n");
- while (device_name) {
+
+ device_name = strtok(skip_whitespace(line + sizeof(drive_name_string) - 1), " \t\n");
+ while (device_name && device_name[0]) {
ma = mi = -1;
dev_get_major_minor(device_name, &ma, &mi);
uuidcache_check_device(device_name, ma, mi, 1);
- device_name = strtok(NULL, "\t\n");
+ device_name = strtok(NULL, " \t\n");
}
break;
}
@@ -418,7 +419,8 @@
uuidcache_init();
uc = uuidCache;
while (uc) {
- if (strcmp(spec, uc->uc_uuid) == 0) {
+ /* case of hex numbers doesn't matter */
+ if (strcasecmp(spec, uc->uc_uuid) == 0) {
return xstrdup(uc->device);
}
uc = uc->next;
diff --git a/util-linux/volume_id/ocfs2.c b/util-linux/volume_id/ocfs2.c
index 9fd4565..8bcaac0 100644
--- a/util-linux/volume_id/ocfs2.c
+++ b/util-linux/volume_id/ocfs2.c
@@ -80,7 +80,7 @@
uint8_t s_uuid[OCFS2_VOL_UUID_LEN]; /* 128-bit uuid */
} __attribute__((__packed__));
-int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off)
+int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off)
{
struct ocfs2_super_block *os;
diff --git a/util-linux/volume_id/highpoint.c b/util-linux/volume_id/unused_highpoint.c
similarity index 100%
rename from util-linux/volume_id/highpoint.c
rename to util-linux/volume_id/unused_highpoint.c
diff --git a/util-linux/volume_id/hpfs.c b/util-linux/volume_id/unused_hpfs.c
similarity index 100%
rename from util-linux/volume_id/hpfs.c
rename to util-linux/volume_id/unused_hpfs.c
diff --git a/util-linux/volume_id/isw_raid.c b/util-linux/volume_id/unused_isw_raid.c
similarity index 100%
rename from util-linux/volume_id/isw_raid.c
rename to util-linux/volume_id/unused_isw_raid.c
diff --git a/util-linux/volume_id/lsi_raid.c b/util-linux/volume_id/unused_lsi_raid.c
similarity index 100%
rename from util-linux/volume_id/lsi_raid.c
rename to util-linux/volume_id/unused_lsi_raid.c
diff --git a/util-linux/volume_id/lvm.c b/util-linux/volume_id/unused_lvm.c
similarity index 93%
rename from util-linux/volume_id/lvm.c
rename to util-linux/volume_id/unused_lvm.c
index f9f9395..caee04b 100644
--- a/util-linux/volume_id/lvm.c
+++ b/util-linux/volume_id/unused_lvm.c
@@ -36,17 +36,14 @@
int volume_id_probe_lvm1(struct volume_id *id, uint64_t off)
{
- const uint8_t *buf;
struct lvm1_super_block *lvm;
dbg("probing at offset 0x%llx", (unsigned long long) off);
- buf = volume_id_get_buffer(id, off + LVM1_SB_OFF, 0x800);
- if (buf == NULL)
+ lvm = volume_id_get_buffer(id, off + LVM1_SB_OFF, 0x800);
+ if (lvm == NULL)
return -1;
- lvm = (struct lvm1_super_block *) buf;
-
if (lvm->id[0] != 'H' || lvm->id[1] != 'M')
return -1;
diff --git a/util-linux/volume_id/mac.c b/util-linux/volume_id/unused_mac.c
similarity index 70%
rename from util-linux/volume_id/mac.c
rename to util-linux/volume_id/unused_mac.c
index 94a99be..8eaa173 100644
--- a/util-linux/volume_id/mac.c
+++ b/util-linux/volume_id/unused_mac.c
@@ -49,17 +49,18 @@
return -1;
part = (struct mac_partition *) buf;
- if ((memcmp(part->signature, "PM", 2) == 0) &&
- (memcmp(part->type, "Apple_partition_map", 19) == 0)) {
+ if (part->signature[0] == 'P' && part->signature[1] == 'M' /* "PM" */
+ && (memcmp(part->type, "Apple_partition_map", 19) == 0)
+ ) {
/* linux creates an own subdevice for the map
* just return the type if the drive header is missing */
- volume_id_set_usage(id, VOLUME_ID_PARTITIONTABLE);
- id->type = "mac_partition_map";
+// volume_id_set_usage(id, VOLUME_ID_PARTITIONTABLE);
+// id->type = "mac_partition_map";
return 0;
}
driver = (struct mac_driver_desc *) buf;
- if (memcmp(driver->signature, "ER", 2) == 0) {
+ if (driver->signature[0] == 'E' && driver->signature[1] == 'R') { /* "ER" */
/* we are on a main device, like a CD
* just try to probe the first partition from the map */
unsigned bsize = be16_to_cpu(driver->block_size);
@@ -72,7 +73,7 @@
return -1;
part = (struct mac_partition *) buf;
- if (memcmp(part->signature, "PM", 2) != 0)
+ if (part->signature[0] != 'P' || part->signature[1] != 'M') /* not "PM" */
return -1;
part_count = be32_to_cpu(part->map_count);
@@ -80,11 +81,7 @@
if (id->partitions != NULL)
free(id->partitions);
- id->partitions =
- malloc(part_count * sizeof(struct volume_id_partition));
- if (id->partitions == NULL)
- return -1;
- memset(id->partitions, 0x00, sizeof(struct volume_id_partition));
+ id->partitions = xzalloc(part_count * sizeof(struct volume_id_partition));
id->partition_count = part_count;
@@ -97,27 +94,28 @@
return -1;
part = (struct mac_partition *) buf;
- if (memcmp(part->signature, "PM", 2) != 0)
+ if (part->signature[0] != 'P' || part->signature[1] != 'M') /* not "PM" */
return -1;
poff = be32_to_cpu(part->start_block) * bsize;
plen = be32_to_cpu(part->block_count) * bsize;
dbg("found '%s' partition entry at 0x%llx, len 0x%llx",
- part->type, (unsigned long long) poff, (unsigned long long) plen);
+ part->type, (unsigned long long) poff,
+ (unsigned long long) plen);
- id->partitions[i].off = poff;
- id->partitions[i].len = plen;
+// id->partitions[i].pt_off = poff;
+// id->partitions[i].pt_len = plen;
- if (memcmp(part->type, "Apple_Free", 10) == 0) {
- volume_id_set_usage_part(&id->partitions[i], VOLUME_ID_UNUSED);
- } else if (memcmp(part->type, "Apple_partition_map", 19) == 0) {
- volume_id_set_usage_part(&id->partitions[i], VOLUME_ID_PARTITIONTABLE);
- } else {
- volume_id_set_usage_part(&id->partitions[i], VOLUME_ID_UNPROBED);
- }
+// if (memcmp(part->type, "Apple_Free", 10) == 0) {
+// volume_id_set_usage_part(&id->partitions[i], VOLUME_ID_UNUSED);
+// } else if (memcmp(part->type, "Apple_partition_map", 19) == 0) {
+// volume_id_set_usage_part(&id->partitions[i], VOLUME_ID_PARTITIONTABLE);
+// } else {
+// volume_id_set_usage_part(&id->partitions[i], VOLUME_ID_UNPROBED);
+// }
}
- volume_id_set_usage(id, VOLUME_ID_PARTITIONTABLE);
- id->type = "mac_partition_map";
+// volume_id_set_usage(id, VOLUME_ID_PARTITIONTABLE);
+// id->type = "mac_partition_map";
return 0;
}
diff --git a/util-linux/volume_id/minix.c b/util-linux/volume_id/unused_minix.c
similarity index 100%
rename from util-linux/volume_id/minix.c
rename to util-linux/volume_id/unused_minix.c
diff --git a/util-linux/volume_id/msdos.c b/util-linux/volume_id/unused_msdos.c
similarity index 78%
rename from util-linux/volume_id/msdos.c
rename to util-linux/volume_id/unused_msdos.c
index b4b6711..097ee67 100644
--- a/util-linux/volume_id/msdos.c
+++ b/util-linux/volume_id/unused_msdos.c
@@ -33,7 +33,6 @@
uint32_t nr_sects;
} __attribute__((packed));
-#define MSDOS_MAGIC "\x55\xaa"
#define MSDOS_PARTTABLE_OFFSET 0x1be
#define MSDOS_SIG_OFF 0x1fe
#define BSIZE 0x200
@@ -68,7 +67,7 @@
if (buf == NULL)
return -1;
- if (memcmp(&buf[MSDOS_SIG_OFF], MSDOS_MAGIC, 2) != 0)
+ if (buf[MSDOS_SIG_OFF] != 0x55 || buf[MSDOS_SIG_OFF + 1] != 0xaa)
return -1;
/* check flags on all entries for a valid partition table */
@@ -86,12 +85,8 @@
if (id->partitions != NULL)
free(id->partitions);
- id->partitions = malloc(VOLUME_ID_PARTITIONS_MAX *
+ id->partitions = xzalloc(VOLUME_ID_PARTITIONS_MAX *
sizeof(struct volume_id_partition));
- if (id->partitions == NULL)
- return -1;
- memset(id->partitions, 0x00,
- VOLUME_ID_PARTITIONS_MAX * sizeof(struct volume_id_partition));
for (i = 0; i < 4; i++) {
poff = (uint64_t) le32_to_cpu(part[i].start_sect) * BSIZE;
@@ -102,26 +97,26 @@
p = &id->partitions[i];
- p->partition_type_raw = part[i].sys_ind;
+// p->pt_type_raw = part[i].sys_ind;
if (is_extended(part[i].sys_ind)) {
dbg("found extended partition at 0x%llx", (unsigned long long) poff);
- volume_id_set_usage_part(p, VOLUME_ID_PARTITIONTABLE);
- p->type = "msdos_extended_partition";
+// volume_id_set_usage_part(p, VOLUME_ID_PARTITIONTABLE);
+// p->type = "msdos_extended_partition";
if (extended == 0)
extended = off + poff;
} else {
dbg("found 0x%x data partition at 0x%llx, len 0x%llx",
part[i].sys_ind, (unsigned long long) poff, (unsigned long long) plen);
- if (is_raid(part[i].sys_ind))
- volume_id_set_usage_part(p, VOLUME_ID_RAID);
- else
- volume_id_set_usage_part(p, VOLUME_ID_UNPROBED);
+// if (is_raid(part[i].sys_ind))
+// volume_id_set_usage_part(p, VOLUME_ID_RAID);
+// else
+// volume_id_set_usage_part(p, VOLUME_ID_UNPROBED);
}
- p->off = off + poff;
- p->len = plen;
+// p->pt_off = off + poff;
+// p->pt_len = plen;
id->partition_count = i+1;
}
@@ -142,7 +137,7 @@
part = (struct msdos_partition_entry*) &buf[MSDOS_PARTTABLE_OFFSET];
- if (memcmp(&buf[MSDOS_SIG_OFF], MSDOS_MAGIC, 2) != 0)
+ if (buf[MSDOS_SIG_OFF] != 0x55 || buf[MSDOS_SIG_OFF + 1] != 0xaa)
break;
next = 0;
@@ -163,21 +158,23 @@
part[i].sys_ind, (unsigned long long) poff, (unsigned long long) plen);
/* we always start at the 5th entry */
- while (id->partition_count < 4)
- volume_id_set_usage_part(&id->partitions[id->partition_count++], VOLUME_ID_UNUSED);
+// while (id->partition_count < 4)
+// volume_id_set_usage_part(&id->partitions[id->partition_count++], VOLUME_ID_UNUSED);
+ if (id->partition_count < 4)
+ id->partition_count = 4;
p = &id->partitions[id->partition_count];
- if (is_raid(part[i].sys_ind))
- volume_id_set_usage_part(p, VOLUME_ID_RAID);
- else
- volume_id_set_usage_part(p, VOLUME_ID_UNPROBED);
+// if (is_raid(part[i].sys_ind))
+// volume_id_set_usage_part(p, VOLUME_ID_RAID);
+// else
+// volume_id_set_usage_part(p, VOLUME_ID_UNPROBED);
- p->off = current + poff;
- p->len = plen;
+// p->pt_off = current + poff;
+// p->pt_len = plen;
id->partition_count++;
- p->partition_type_raw = part[i].sys_ind;
+// p->pt_type_raw = part[i].sys_ind;
if (id->partition_count >= VOLUME_ID_PARTITIONS_MAX) {
dbg("too many partitions");
@@ -189,8 +186,8 @@
current = next;
}
- volume_id_set_usage(id, VOLUME_ID_PARTITIONTABLE);
- id->type = "msdos_partition_table";
+// volume_id_set_usage(id, VOLUME_ID_PARTITIONTABLE);
+// id->type = "msdos_partition_table";
return 0;
}
diff --git a/util-linux/volume_id/nvidia_raid.c b/util-linux/volume_id/unused_nvidia_raid.c
similarity index 100%
rename from util-linux/volume_id/nvidia_raid.c
rename to util-linux/volume_id/unused_nvidia_raid.c
diff --git a/util-linux/volume_id/promise_raid.c b/util-linux/volume_id/unused_promise_raid.c
similarity index 100%
rename from util-linux/volume_id/promise_raid.c
rename to util-linux/volume_id/unused_promise_raid.c
diff --git a/util-linux/volume_id/silicon_raid.c b/util-linux/volume_id/unused_silicon_raid.c
similarity index 100%
rename from util-linux/volume_id/silicon_raid.c
rename to util-linux/volume_id/unused_silicon_raid.c
diff --git a/util-linux/volume_id/ufs.c b/util-linux/volume_id/unused_ufs.c
similarity index 100%
rename from util-linux/volume_id/ufs.c
rename to util-linux/volume_id/unused_ufs.c
diff --git a/util-linux/volume_id/via_raid.c b/util-linux/volume_id/unused_via_raid.c
similarity index 97%
rename from util-linux/volume_id/via_raid.c
rename to util-linux/volume_id/unused_via_raid.c
index a3e94e0..4332946 100644
--- a/util-linux/volume_id/via_raid.c
+++ b/util-linux/volume_id/unused_via_raid.c
@@ -53,7 +53,7 @@
if (via == NULL)
return -1;
- if (via->signature != cpu_to_le16(VIA_SIGNATURE))
+ if (via->signature != cpu_to_le16(VIA_SIGNATURE))
return -1;
if (via->version_number > 1)
diff --git a/util-linux/volume_id/volume_id.c b/util-linux/volume_id/volume_id.c
index a26e2bc..de9aae2 100644
--- a/util-linux/volume_id/volume_id.c
+++ b/util-linux/volume_id/volume_id.c
@@ -20,6 +20,31 @@
#include "volume_id_internal.h"
+
+/* Some detection routines do not set label or uuid anyway,
+ * so they are disabled. */
+
+/* Looks for partitions, we don't use it: */
+#define ENABLE_FEATURE_VOLUMEID_MAC 0
+/* #define ENABLE_FEATURE_VOLUMEID_MSDOS 0 - NB: this one
+ * was not properly added to probe table anyway - ??! */
+
+/* None of RAIDs have label or uuid, except LinuxRAID: */
+#define ENABLE_FEATURE_VOLUMEID_HIGHPOINTRAID 0
+#define ENABLE_FEATURE_VOLUMEID_ISWRAID 0
+#define ENABLE_FEATURE_VOLUMEID_LSIRAID 0
+#define ENABLE_FEATURE_VOLUMEID_LVM 0
+#define ENABLE_FEATURE_VOLUMEID_NVIDIARAID 0
+#define ENABLE_FEATURE_VOLUMEID_PROMISERAID 0
+#define ENABLE_FEATURE_VOLUMEID_SILICONRAID 0
+#define ENABLE_FEATURE_VOLUMEID_VIARAID 0
+
+/* These filesystems also have no label or uuid: */
+#define ENABLE_FEATURE_VOLUMEID_MINIX 0
+#define ENABLE_FEATURE_VOLUMEID_HPFS 0
+#define ENABLE_FEATURE_VOLUMEID_UFS 0
+
+
typedef int (*raid_probe_fptr)(struct volume_id *id, uint64_t off, uint64_t size);
typedef int (*probe_fptr)(struct volume_id *id, uint64_t off);
@@ -68,10 +93,9 @@
#if ENABLE_FEATURE_VOLUMEID_FAT
volume_id_probe_vfat,
#endif
-// This one only looks for partitions, we don't use it
-//#if ENABLE_FEATURE_VOLUMEID_MAC
-// volume_id_probe_mac_partition_map,
-//#endif
+#if ENABLE_FEATURE_VOLUMEID_MAC
+ volume_id_probe_mac_partition_map,
+#endif
#if ENABLE_FEATURE_VOLUMEID_XFS
volume_id_probe_xfs,
#endif
diff --git a/util-linux/volume_id/volume_id_internal.h b/util-linux/volume_id/volume_id_internal.h
index 8c7ca03..78b4a7b 100644
--- a/util-linux/volume_id/volume_id_internal.h
+++ b/util-linux/volume_id/volume_id_internal.h
@@ -163,25 +163,25 @@
/* RAID */
-int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off);
-int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint64_t size);
+//int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off);
+//int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint64_t size);
-int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint64_t size);
+//int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint64_t size);
int volume_id_probe_linux_raid(struct volume_id *id, uint64_t off, uint64_t size);
-int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t size);
+//int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t size);
-int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t size);
+//int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t size);
-int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, uint64_t off, uint64_t size);
+//int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, uint64_t off, uint64_t size);
-int volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t off, uint64_t size);
+//int volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t off, uint64_t size);
-int volume_id_probe_via_raid(struct volume_id *id, uint64_t off, uint64_t size);
+//int volume_id_probe_via_raid(struct volume_id *id, uint64_t off, uint64_t size);
-int volume_id_probe_lvm1(struct volume_id *id, uint64_t off);
-int volume_id_probe_lvm2(struct volume_id *id, uint64_t off);
+//int volume_id_probe_lvm1(struct volume_id *id, uint64_t off);
+//int volume_id_probe_lvm2(struct volume_id *id, uint64_t off);
/* FS */
@@ -193,7 +193,7 @@
int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off);
-int volume_id_probe_hpfs(struct volume_id *id, uint64_t off);
+//int volume_id_probe_hpfs(struct volume_id *id, uint64_t off);
int volume_id_probe_iso9660(struct volume_id *id, uint64_t off);
@@ -205,7 +205,7 @@
//int volume_id_probe_mac_partition_map(struct volume_id *id, uint64_t off);
-int volume_id_probe_minix(struct volume_id *id, uint64_t off);
+//int volume_id_probe_minix(struct volume_id *id, uint64_t off);
//int volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t off);
@@ -221,6 +221,6 @@
int volume_id_probe_udf(struct volume_id *id, uint64_t off);
-int volume_id_probe_ufs(struct volume_id *id, uint64_t off);
+//int volume_id_probe_ufs(struct volume_id *id, uint64_t off);
int volume_id_probe_xfs(struct volume_id *id, uint64_t off);