From: Kay Sievers Date: Wed, 9 Nov 2005 14:08:45 +0000 (+0100) Subject: volume_id: provide libvolume_id.a file X-Git-Tag: 174~2473^2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=accff726856a0b3258a413d823a534f4f437e6b2 volume_id: provide libvolume_id.a file Signed-off-by: Kay Sievers --- diff --git a/extras/volume_id/Makefile b/extras/volume_id/Makefile index 23de2ba09..30c0abb9a 100644 --- a/extras/volume_id/Makefile +++ b/extras/volume_id/Makefile @@ -5,12 +5,8 @@ # Released under the GNU General Public License, version 2. # -VOLUME_ID_BASE=volume_id -include $(VOLUME_ID_BASE)/Makefile.inc - PROG = vol_id -OBJS = $(VOLUME_ID_OBJS) -HEADERS = $(VOLUME_ID_HEADERS) +LIBVOLUME_ID = libvolume_id/libvolume_id.a GEN_HEADERS = MAN_PAGES = @@ -36,8 +32,11 @@ all: $(PROG) $(MAN_PAGES) %.o: %.c $(GEN_HEADERS) $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ -$(PROG): %: $(HEADERS) %.o $(OBJS) - $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) +$(LIBVOLUME_ID): + $(MAKE) -C libvolume_id + +$(PROG): %: $(HEADERS) %.o $(LIBVOLUME_ID) + $(QUIET) $(LD) $(LDFLAGS) $@.o $(LIBVOLUME_ID) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS) ifneq ($(strip $(STRIPCMD)),) $(QUIET) $(STRIPCMD) $@ endif @@ -49,6 +48,7 @@ endif clean: rm -f $(PROG) $(OBJS) $(GEN_HEADERS) + $(MAKE) -C libvolume_id clean .PHONY: clean install-bin: all diff --git a/extras/volume_id/libvolume_id/Makefile b/extras/volume_id/libvolume_id/Makefile new file mode 100644 index 000000000..02c24eae0 --- /dev/null +++ b/extras/volume_id/libvolume_id/Makefile @@ -0,0 +1,66 @@ +# Makefile for udev extra invoked from the udev main Makefile +# +# Copyright (C) 2004-2005 Kay Sievers +# +# Released under the GNU General Public License, version 2. +# + +LIBVOLUME_ID = libvolume_id.a + +OBJS= \ + ext.o \ + fat.o \ + hfs.o \ + highpoint.o \ + isw_raid.o \ + lsi_raid.o \ + via_raid.o \ + silicon_raid.o \ + nvidia_raid.o \ + promise_raid.o \ + iso9660.o \ + jfs.o \ + linux_raid.o \ + linux_swap.o \ + lvm.o \ + mac.o \ + msdos.o \ + ntfs.o \ + reiserfs.o \ + udf.o \ + ufs.o \ + xfs.o \ + cramfs.o \ + hpfs.o \ + romfs.o \ + sysv.o \ + minix.o \ + luks.o \ + ocfs.o \ + vxfs.o \ + volume_id.o \ + util.o + +HEADERS= \ + volume_id.h \ + util.h + +AR = $(CROSS)ar +RANLIB = $(CROSS)ranlib + +all: $(LIBVOLUME_ID) +.PHONY: all +.DEFAULT: all + +%.o: %.c + $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ + +$(LIBVOLUME_ID): $(HEADERS) $(OBJS) + @rm -f $@ + $(QUIET) $(AR) cq $@ $(OBJS) + $(QUIET) $(RANLIB) $@ + +clean: + rm -f $(LIBVOLUME_ID) $(OBJS) +.PHONY: clean + diff --git a/extras/volume_id/volume_id/cramfs.c b/extras/volume_id/libvolume_id/cramfs.c similarity index 98% rename from extras/volume_id/volume_id/cramfs.c rename to extras/volume_id/libvolume_id/cramfs.c index 85a1bc8c5..0ad5886b3 100644 --- a/extras/volume_id/volume_id/cramfs.c +++ b/extras/volume_id/libvolume_id/cramfs.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "cramfs.h" struct cramfs_super { uint8_t magic[4]; diff --git a/extras/volume_id/volume_id/ext.c b/extras/volume_id/libvolume_id/ext.c similarity index 99% rename from extras/volume_id/volume_id/ext.c rename to extras/volume_id/libvolume_id/ext.c index a3e20d315..d1f62dfb6 100644 --- a/extras/volume_id/volume_id/ext.c +++ b/extras/volume_id/libvolume_id/ext.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "util.h" #include "logging.h" -#include "ext.h" struct ext2_super_block { uint32_t s_inodes_count; diff --git a/extras/volume_id/volume_id/fat.c b/extras/volume_id/libvolume_id/fat.c similarity index 99% rename from extras/volume_id/volume_id/fat.c rename to extras/volume_id/libvolume_id/fat.c index 74f2bb919..26d0fe74a 100644 --- a/extras/volume_id/volume_id/fat.c +++ b/extras/volume_id/libvolume_id/fat.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "fat.h" #define FAT12_MAX 0xff5 #define FAT16_MAX 0xfff5 diff --git a/extras/volume_id/volume_id/hfs.c b/extras/volume_id/libvolume_id/hfs.c similarity index 99% rename from extras/volume_id/volume_id/hfs.c rename to extras/volume_id/libvolume_id/hfs.c index 8de8b9aaa..27a8ac999 100644 --- a/extras/volume_id/volume_id/hfs.c +++ b/extras/volume_id/libvolume_id/hfs.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "hfs.h" struct hfs_finder_info{ uint32_t boot_folder; diff --git a/extras/volume_id/volume_id/highpoint.c b/extras/volume_id/libvolume_id/highpoint.c similarity index 98% rename from extras/volume_id/volume_id/highpoint.c rename to extras/volume_id/libvolume_id/highpoint.c index 33c4a8c9c..721b7ab26 100644 --- a/extras/volume_id/volume_id/highpoint.c +++ b/extras/volume_id/libvolume_id/highpoint.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "highpoint.h" struct hpt37x_meta { uint8_t filler1[32]; diff --git a/extras/volume_id/volume_id/hpfs.c b/extras/volume_id/libvolume_id/hpfs.c similarity index 98% rename from extras/volume_id/volume_id/hpfs.c rename to extras/volume_id/libvolume_id/hpfs.c index 3b97d9339..52cb47be3 100644 --- a/extras/volume_id/volume_id/hpfs.c +++ b/extras/volume_id/libvolume_id/hpfs.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "hpfs.h" struct hpfs_super { diff --git a/extras/volume_id/volume_id/iso9660.c b/extras/volume_id/libvolume_id/iso9660.c similarity index 99% rename from extras/volume_id/volume_id/iso9660.c rename to extras/volume_id/libvolume_id/iso9660.c index 3999a1e7b..b6654cecf 100644 --- a/extras/volume_id/volume_id/iso9660.c +++ b/extras/volume_id/libvolume_id/iso9660.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "iso9660.h" #define ISO_SUPERBLOCK_OFFSET 0x8000 #define ISO_SECTOR_SIZE 0x800 diff --git a/extras/volume_id/volume_id/isw_raid.c b/extras/volume_id/libvolume_id/isw_raid.c similarity index 98% rename from extras/volume_id/volume_id/isw_raid.c rename to extras/volume_id/libvolume_id/isw_raid.c index 745b42f2d..1f49959ff 100644 --- a/extras/volume_id/volume_id/isw_raid.c +++ b/extras/volume_id/libvolume_id/isw_raid.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "isw_raid.h" struct isw_meta { uint8_t sig[32]; diff --git a/extras/volume_id/volume_id/jfs.c b/extras/volume_id/libvolume_id/jfs.c similarity index 98% rename from extras/volume_id/volume_id/jfs.c rename to extras/volume_id/libvolume_id/jfs.c index 1b2bfdf0e..b6ae9624d 100644 --- a/extras/volume_id/volume_id/jfs.c +++ b/extras/volume_id/libvolume_id/jfs.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "jfs.h" struct jfs_super_block { uint8_t magic[4]; diff --git a/extras/volume_id/volume_id/linux_raid.c b/extras/volume_id/libvolume_id/linux_raid.c similarity index 98% rename from extras/volume_id/volume_id/linux_raid.c rename to extras/volume_id/libvolume_id/linux_raid.c index eb37dba36..d90510a81 100644 --- a/extras/volume_id/volume_id/linux_raid.c +++ b/extras/volume_id/libvolume_id/linux_raid.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "linux_raid.h" struct mdp_super_block { uint32_t md_magic; diff --git a/extras/volume_id/volume_id/linux_swap.c b/extras/volume_id/libvolume_id/linux_swap.c similarity index 98% rename from extras/volume_id/volume_id/linux_swap.c rename to extras/volume_id/libvolume_id/linux_swap.c index b3e22f6db..18928b835 100644 --- a/extras/volume_id/volume_id/linux_swap.c +++ b/extras/volume_id/libvolume_id/linux_swap.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "linux_swap.h" struct swap_header_v1_2 { uint8_t bootbits[1024]; diff --git a/extras/volume_id/volume_id/logging.h b/extras/volume_id/libvolume_id/logging.h similarity index 100% rename from extras/volume_id/volume_id/logging.h rename to extras/volume_id/libvolume_id/logging.h diff --git a/extras/volume_id/volume_id/lsi_raid.c b/extras/volume_id/libvolume_id/lsi_raid.c similarity index 98% rename from extras/volume_id/volume_id/lsi_raid.c rename to extras/volume_id/libvolume_id/lsi_raid.c index e5da28120..2720de763 100644 --- a/extras/volume_id/volume_id/lsi_raid.c +++ b/extras/volume_id/libvolume_id/lsi_raid.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "lsi_raid.h" struct lsi_meta { uint8_t sig[6]; diff --git a/extras/volume_id/volume_id/luks.c b/extras/volume_id/libvolume_id/luks.c similarity index 99% rename from extras/volume_id/volume_id/luks.c rename to extras/volume_id/libvolume_id/luks.c index ff90f5d3d..43f326e17 100644 --- a/extras/volume_id/volume_id/luks.c +++ b/extras/volume_id/libvolume_id/luks.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "util.h" #include "logging.h" -#include "luks.h" #define SECTOR_SHIFT 9 #define SECTOR_SIZE (1 << SECTOR_SHIFT) diff --git a/extras/volume_id/volume_id/lvm.c b/extras/volume_id/libvolume_id/lvm.c similarity index 99% rename from extras/volume_id/volume_id/lvm.c rename to extras/volume_id/libvolume_id/lvm.c index a188402da..650986256 100644 --- a/extras/volume_id/volume_id/lvm.c +++ b/extras/volume_id/libvolume_id/lvm.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "lvm.h" struct lvm1_super_block { uint8_t id[2]; diff --git a/extras/volume_id/volume_id/mac.c b/extras/volume_id/libvolume_id/mac.c similarity index 99% rename from extras/volume_id/volume_id/mac.c rename to extras/volume_id/libvolume_id/mac.c index 1587f4882..99bcbde6b 100644 --- a/extras/volume_id/volume_id/mac.c +++ b/extras/volume_id/libvolume_id/mac.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "mac.h" struct mac_driver_desc { uint8_t signature[2]; diff --git a/extras/volume_id/volume_id/minix.c b/extras/volume_id/libvolume_id/minix.c similarity index 98% rename from extras/volume_id/volume_id/minix.c rename to extras/volume_id/libvolume_id/minix.c index b081afab4..ca57745f7 100644 --- a/extras/volume_id/volume_id/minix.c +++ b/extras/volume_id/libvolume_id/minix.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "minix.h" struct minix_super_block { diff --git a/extras/volume_id/volume_id/msdos.c b/extras/volume_id/libvolume_id/msdos.c similarity index 99% rename from extras/volume_id/volume_id/msdos.c rename to extras/volume_id/libvolume_id/msdos.c index ab18fc358..a66046052 100644 --- a/extras/volume_id/volume_id/msdos.c +++ b/extras/volume_id/libvolume_id/msdos.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "msdos.h" struct msdos_partition_entry { uint8_t boot_ind; diff --git a/extras/volume_id/volume_id/ntfs.c b/extras/volume_id/libvolume_id/ntfs.c similarity index 99% rename from extras/volume_id/volume_id/ntfs.c rename to extras/volume_id/libvolume_id/ntfs.c index 39aa2d73c..de9ad6d65 100644 --- a/extras/volume_id/volume_id/ntfs.c +++ b/extras/volume_id/libvolume_id/ntfs.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "ntfs.h" struct ntfs_super_block { uint8_t jump[3]; diff --git a/extras/volume_id/volume_id/nvidia_raid.c b/extras/volume_id/libvolume_id/nvidia_raid.c similarity index 98% rename from extras/volume_id/volume_id/nvidia_raid.c rename to extras/volume_id/libvolume_id/nvidia_raid.c index 9198f1e06..3b967e697 100644 --- a/extras/volume_id/volume_id/nvidia_raid.c +++ b/extras/volume_id/libvolume_id/nvidia_raid.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "nvidia_raid.h" struct nvidia_meta { uint8_t vendor[8]; diff --git a/extras/volume_id/volume_id/ocfs.c b/extras/volume_id/libvolume_id/ocfs.c similarity index 99% rename from extras/volume_id/volume_id/ocfs.c rename to extras/volume_id/libvolume_id/ocfs.c index 88064ed19..faf89bd3e 100644 --- a/extras/volume_id/volume_id/ocfs.c +++ b/extras/volume_id/libvolume_id/ocfs.c @@ -27,7 +27,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "ocfs.h" struct ocfs1_super_block_header { diff --git a/extras/volume_id/volume_id/promise_raid.c b/extras/volume_id/libvolume_id/promise_raid.c similarity index 98% rename from extras/volume_id/volume_id/promise_raid.c rename to extras/volume_id/libvolume_id/promise_raid.c index 54832a888..6611aeab3 100644 --- a/extras/volume_id/volume_id/promise_raid.c +++ b/extras/volume_id/libvolume_id/promise_raid.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "promise_raid.h" struct promise_meta { uint8_t sig[24]; diff --git a/extras/volume_id/volume_id/reiserfs.c b/extras/volume_id/libvolume_id/reiserfs.c similarity index 99% rename from extras/volume_id/volume_id/reiserfs.c rename to extras/volume_id/libvolume_id/reiserfs.c index e64b08acd..0eecbda5c 100644 --- a/extras/volume_id/volume_id/reiserfs.c +++ b/extras/volume_id/libvolume_id/reiserfs.c @@ -27,7 +27,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "reiserfs.h" struct reiserfs_super_block { uint32_t blocks_count; diff --git a/extras/volume_id/volume_id/romfs.c b/extras/volume_id/libvolume_id/romfs.c similarity index 98% rename from extras/volume_id/volume_id/romfs.c rename to extras/volume_id/libvolume_id/romfs.c index 3373f3649..51ef3739b 100644 --- a/extras/volume_id/volume_id/romfs.c +++ b/extras/volume_id/libvolume_id/romfs.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "romfs.h" struct romfs_super { uint8_t magic[8]; diff --git a/extras/volume_id/volume_id/silicon_raid.c b/extras/volume_id/libvolume_id/silicon_raid.c similarity index 98% rename from extras/volume_id/volume_id/silicon_raid.c rename to extras/volume_id/libvolume_id/silicon_raid.c index 5f68127c4..a30776473 100644 --- a/extras/volume_id/volume_id/silicon_raid.c +++ b/extras/volume_id/libvolume_id/silicon_raid.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "silicon_raid.h" struct silicon_meta { uint8_t unknown0[0x2E]; diff --git a/extras/volume_id/volume_id/sysv.c b/extras/volume_id/libvolume_id/sysv.c similarity index 99% rename from extras/volume_id/volume_id/sysv.c rename to extras/volume_id/libvolume_id/sysv.c index 610edb887..fc874d5be 100644 --- a/extras/volume_id/volume_id/sysv.c +++ b/extras/volume_id/libvolume_id/sysv.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "sysv.h" #define SYSV_NICINOD 100 #define SYSV_NICFREE 50 diff --git a/extras/volume_id/volume_id/udf.c b/extras/volume_id/libvolume_id/udf.c similarity index 99% rename from extras/volume_id/volume_id/udf.c rename to extras/volume_id/libvolume_id/udf.c index f54ca87c8..fede1ce68 100644 --- a/extras/volume_id/volume_id/udf.c +++ b/extras/volume_id/libvolume_id/udf.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "udf.h" struct volume_descriptor { struct descriptor_tag { diff --git a/extras/volume_id/volume_id/ufs.c b/extras/volume_id/libvolume_id/ufs.c similarity index 99% rename from extras/volume_id/volume_id/ufs.c rename to extras/volume_id/libvolume_id/ufs.c index a7bd091c5..ace61db65 100644 --- a/extras/volume_id/volume_id/ufs.c +++ b/extras/volume_id/libvolume_id/ufs.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "ufs.h" struct ufs_super_block { uint32_t fs_link; diff --git a/extras/volume_id/volume_id/util.c b/extras/volume_id/libvolume_id/util.c similarity index 100% rename from extras/volume_id/volume_id/util.c rename to extras/volume_id/libvolume_id/util.c diff --git a/extras/volume_id/volume_id/util.h b/extras/volume_id/libvolume_id/util.h similarity index 100% rename from extras/volume_id/volume_id/util.h rename to extras/volume_id/libvolume_id/util.h diff --git a/extras/volume_id/volume_id/via_raid.c b/extras/volume_id/libvolume_id/via_raid.c similarity index 98% rename from extras/volume_id/volume_id/via_raid.c rename to extras/volume_id/libvolume_id/via_raid.c index 2b7412301..66962cd7f 100644 --- a/extras/volume_id/volume_id/via_raid.c +++ b/extras/volume_id/libvolume_id/via_raid.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "via_raid.h" struct via_meta { uint16_t signature; diff --git a/extras/volume_id/volume_id/volume_id.c b/extras/volume_id/libvolume_id/volume_id.c similarity index 78% rename from extras/volume_id/volume_id/volume_id.c rename to extras/volume_id/libvolume_id/volume_id.c index b92269863..09d1e3172 100644 --- a/extras/volume_id/volume_id/volume_id.c +++ b/extras/volume_id/libvolume_id/volume_id.c @@ -30,36 +30,6 @@ #include "logging.h" #include "util.h" -#include "ext.h" -#include "reiserfs.h" -#include "fat.h" -#include "hfs.h" -#include "jfs.h" -#include "xfs.h" -#include "ufs.h" -#include "ntfs.h" -#include "iso9660.h" -#include "udf.h" -#include "highpoint.h" -#include "isw_raid.h" -#include "lsi_raid.h" -#include "via_raid.h" -#include "silicon_raid.h" -#include "nvidia_raid.h" -#include "promise_raid.h" -#include "luks.h" -#include "linux_swap.h" -#include "linux_raid.h" -#include "lvm.h" -#include "cramfs.h" -#include "hpfs.h" -#include "romfs.h" -#include "sysv.h" -#include "minix.h" -#include "mac.h" -#include "msdos.h" -#include "ocfs.h" -#include "vxfs.h" int volume_id_probe_all(struct volume_id *id, uint64_t off, uint64_t size) { @@ -213,28 +183,6 @@ struct volume_id *volume_id_open_node(const char *path) return id; } -/* open volume by major/minor */ -struct volume_id *volume_id_open_dev_t(dev_t devt) -{ - struct volume_id *id; - char tmp_node[VOLUME_ID_PATH_MAX]; - - snprintf(tmp_node, VOLUME_ID_PATH_MAX, - "/dev/.volume_id-%u-%u-%u", getpid(), major(devt), minor(devt)); - tmp_node[VOLUME_ID_PATH_MAX-1] = '\0'; - - /* create tempory node to open the block device */ - unlink(tmp_node); - if (mknod(tmp_node, (S_IFBLK | 0600), devt) != 0) - return NULL; - - id = volume_id_open_node(tmp_node); - - unlink(tmp_node); - - return id; -} - void volume_id_close(struct volume_id *id) { if (id == NULL) diff --git a/extras/volume_id/libvolume_id/volume_id.h b/extras/volume_id/libvolume_id/volume_id.h new file mode 100644 index 000000000..f2f3a0d00 --- /dev/null +++ b/extras/volume_id/libvolume_id/volume_id.h @@ -0,0 +1,116 @@ +/* + * volume_id - reads partition label and uuid + * + * Copyright (C) 2005 Kay Sievers + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2 of the License. + */ + +#ifndef _VOLUME_ID_H_ +#define _VOLUME_ID_H_ + +#include + +#define VOLUME_ID_VERSION 53 + +#define VOLUME_ID_LABEL_SIZE 64 +#define VOLUME_ID_UUID_SIZE 36 +#define VOLUME_ID_FORMAT_SIZE 32 +#define VOLUME_ID_PATH_MAX 256 +#define VOLUME_ID_PARTITIONS_MAX 256 + +enum volume_id_usage { + VOLUME_ID_UNUSED, + VOLUME_ID_UNPROBED, + VOLUME_ID_OTHER, + VOLUME_ID_FILESYSTEM, + VOLUME_ID_PARTITIONTABLE, + VOLUME_ID_RAID, + VOLUME_ID_DISKLABEL, + VOLUME_ID_CRYPTO, +}; + +struct volume_id_partition { + enum volume_id_usage usage_id; + char *usage; + char *type; + uint64_t off; + uint64_t len; + uint8_t partition_type_raw; +}; + +struct volume_id { + uint8_t label_raw[VOLUME_ID_LABEL_SIZE]; + size_t label_raw_len; + char label[VOLUME_ID_LABEL_SIZE+1]; + uint8_t uuid_raw[VOLUME_ID_UUID_SIZE]; + size_t uuid_raw_len; + char uuid[VOLUME_ID_UUID_SIZE+1]; + enum volume_id_usage usage_id; + char *usage; + char *type; + char type_version[VOLUME_ID_FORMAT_SIZE]; + + struct volume_id_partition *partitions; + size_t partition_count; + + int fd; + uint8_t *sbbuf; + size_t sbbuf_len; + uint8_t *seekbuf; + uint64_t seekbuf_off; + size_t seekbuf_len; + int fd_close:1; +}; + +extern struct volume_id *volume_id_open_fd(int fd); +extern struct volume_id *volume_id_open_node(const char *path); +extern int volume_id_probe_all(struct volume_id *id, uint64_t off, uint64_t size); +extern void volume_id_close(struct volume_id *id); + +/* filesystems */ +extern int volume_id_probe_cramfs(struct volume_id *id, uint64_t off); +extern int volume_id_probe_ext(struct volume_id *id, uint64_t off); +extern int volume_id_probe_vfat(struct volume_id *id, uint64_t off); +extern int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off); +extern int volume_id_probe_hpfs(struct volume_id *id, uint64_t off); +extern int volume_id_probe_iso9660(struct volume_id *id, uint64_t off); +extern int volume_id_probe_jfs(struct volume_id *id, uint64_t off); +extern int volume_id_probe_minix(struct volume_id *id, uint64_t off); +extern int volume_id_probe_ntfs(struct volume_id *id, uint64_t off); +extern int volume_id_probe_ocfs1(struct volume_id *id, uint64_t off); +extern int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off); +extern int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off); +extern int volume_id_probe_romfs(struct volume_id *id, uint64_t off); +extern int volume_id_probe_sysv(struct volume_id *id, uint64_t off); +extern int volume_id_probe_udf(struct volume_id *id, uint64_t off); +extern int volume_id_probe_ufs(struct volume_id *id, uint64_t off); +extern int volume_id_probe_vxfs(struct volume_id *id, uint64_t off); +extern int volume_id_probe_xfs(struct volume_id *id, uint64_t off); + +/* special formats */ +extern int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off); +extern int volume_id_probe_luks(struct volume_id *id, uint64_t off); + +/* raid */ +extern int volume_id_probe_linux_raid(struct volume_id *id, uint64_t off, uint64_t size); +extern int volume_id_probe_lvm1(struct volume_id *id, uint64_t off); +extern int volume_id_probe_lvm2(struct volume_id *id, uint64_t off); + +/* bios raid */ +extern int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint64_t size); +extern int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off); +extern int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint64_t size); +extern int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t size); +extern int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t size); +extern int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, uint64_t off, uint64_t size); +extern int volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t off, uint64_t size); +extern int volume_id_probe_via_raid(struct volume_id *id, uint64_t off, uint64_t size); + +/* partition tables */ +extern int volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t off); +extern int volume_id_probe_mac_partition_map(struct volume_id *id, uint64_t off); + +#endif diff --git a/extras/volume_id/volume_id/vxfs.c b/extras/volume_id/libvolume_id/vxfs.c similarity index 98% rename from extras/volume_id/volume_id/vxfs.c rename to extras/volume_id/libvolume_id/vxfs.c index c4a9ace98..0aef36989 100644 --- a/extras/volume_id/volume_id/vxfs.c +++ b/extras/volume_id/libvolume_id/vxfs.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "vxfs.h" #define VXFS_SUPER_MAGIC 0xa501FCF5 diff --git a/extras/volume_id/volume_id/xfs.c b/extras/volume_id/libvolume_id/xfs.c similarity index 98% rename from extras/volume_id/volume_id/xfs.c rename to extras/volume_id/libvolume_id/xfs.c index 7fd629099..a5f5d8432 100644 --- a/extras/volume_id/volume_id/xfs.c +++ b/extras/volume_id/libvolume_id/xfs.c @@ -26,7 +26,6 @@ #include "volume_id.h" #include "logging.h" #include "util.h" -#include "xfs.h" struct xfs_super_block { uint8_t magic[4]; diff --git a/extras/volume_id/vol_id.c b/extras/volume_id/vol_id.c index 2b53085c7..6f99c5272 100644 --- a/extras/volume_id/vol_id.c +++ b/extras/volume_id/vol_id.c @@ -31,7 +31,7 @@ #include "../../udev_utils.h" #include "../../logging.h" -#include "volume_id/volume_id.h" +#include "libvolume_id/volume_id.h" #define BLKGETSIZE64 _IOR(0x12,114,size_t) diff --git a/extras/volume_id/volume_id/Makefile.inc b/extras/volume_id/volume_id/Makefile.inc deleted file mode 100644 index 6f8dceea4..000000000 --- a/extras/volume_id/volume_id/Makefile.inc +++ /dev/null @@ -1,66 +0,0 @@ -VOLUME_ID_OBJS= \ - $(VOLUME_ID_BASE)/ext.o \ - $(VOLUME_ID_BASE)/fat.o \ - $(VOLUME_ID_BASE)/hfs.o \ - $(VOLUME_ID_BASE)/highpoint.o \ - $(VOLUME_ID_BASE)/isw_raid.o \ - $(VOLUME_ID_BASE)/lsi_raid.o \ - $(VOLUME_ID_BASE)/via_raid.o \ - $(VOLUME_ID_BASE)/silicon_raid.o \ - $(VOLUME_ID_BASE)/nvidia_raid.o \ - $(VOLUME_ID_BASE)/promise_raid.o \ - $(VOLUME_ID_BASE)/iso9660.o \ - $(VOLUME_ID_BASE)/jfs.o \ - $(VOLUME_ID_BASE)/linux_raid.o \ - $(VOLUME_ID_BASE)/linux_swap.o \ - $(VOLUME_ID_BASE)/lvm.o \ - $(VOLUME_ID_BASE)/mac.o \ - $(VOLUME_ID_BASE)/msdos.o \ - $(VOLUME_ID_BASE)/ntfs.o \ - $(VOLUME_ID_BASE)/reiserfs.o \ - $(VOLUME_ID_BASE)/udf.o \ - $(VOLUME_ID_BASE)/ufs.o \ - $(VOLUME_ID_BASE)/xfs.o \ - $(VOLUME_ID_BASE)/cramfs.o \ - $(VOLUME_ID_BASE)/hpfs.o \ - $(VOLUME_ID_BASE)/romfs.o \ - $(VOLUME_ID_BASE)/sysv.o \ - $(VOLUME_ID_BASE)/minix.o \ - $(VOLUME_ID_BASE)/luks.o \ - $(VOLUME_ID_BASE)/ocfs.o \ - $(VOLUME_ID_BASE)/vxfs.o \ - $(VOLUME_ID_BASE)/volume_id.o \ - $(VOLUME_ID_BASE)/util.o - -VOLUME_ID_HEADERS= \ - $(VOLUME_ID_BASE)/ext.h \ - $(VOLUME_ID_BASE)/fat.h \ - $(VOLUME_ID_BASE)/hfs.h \ - $(VOLUME_ID_BASE)/highpoint.h \ - $(VOLUME_ID_BASE)/isw_raid.h \ - $(VOLUME_ID_BASE)/lsi_raid.h \ - $(VOLUME_ID_BASE)/via_raid.h \ - $(VOLUME_ID_BASE)/silicon_raid.h \ - $(VOLUME_ID_BASE)/nvidia_raid.h \ - $(VOLUME_ID_BASE)/promise_raid.h \ - $(VOLUME_ID_BASE)/iso9660.h \ - $(VOLUME_ID_BASE)/jfs.h \ - $(VOLUME_ID_BASE)/linux_raid.h \ - $(VOLUME_ID_BASE)/linux_swap.h \ - $(VOLUME_ID_BASE)/lvm.h \ - $(VOLUME_ID_BASE)/mac.h \ - $(VOLUME_ID_BASE)/msdos.h \ - $(VOLUME_ID_BASE)/ntfs.h \ - $(VOLUME_ID_BASE)/reiserfs.h \ - $(VOLUME_ID_BASE)/udf.h \ - $(VOLUME_ID_BASE)/ufs.h \ - $(VOLUME_ID_BASE)/xfs.h \ - $(VOLUME_ID_BASE)/cramfs.h \ - $(VOLUME_ID_BASE)/romfs.h \ - $(VOLUME_ID_BASE)/sysv.h \ - $(VOLUME_ID_BASE)/minix.h \ - $(VOLUME_ID_BASE)/luks.h \ - $(VOLUME_ID_BASE)/ocfs.h \ - $(VOLUME_ID_BASE)/vxfs.h \ - $(VOLUME_ID_BASE)/volume_id.h \ - $(VOLUME_ID_BASE)/util.h diff --git a/extras/volume_id/volume_id/cramfs.h b/extras/volume_id/volume_id/cramfs.h deleted file mode 100644 index 0ff19c342..000000000 --- a/extras/volume_id/volume_id/cramfs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_CRAMFS_ -#define _VOLUME_ID_CRAMFS_ - -extern int volume_id_probe_cramfs(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/ext.h b/extras/volume_id/volume_id/ext.h deleted file mode 100644 index dfda2074b..000000000 --- a/extras/volume_id/volume_id/ext.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_EXT_ -#define _VOLUME_ID_EXT_ - -extern int volume_id_probe_ext(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/fat.h b/extras/volume_id/volume_id/fat.h deleted file mode 100644 index 92fa953b1..000000000 --- a/extras/volume_id/volume_id/fat.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_FAT_ -#define _VOLUME_ID_FAT_ - -extern int volume_id_probe_vfat(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/hfs.h b/extras/volume_id/volume_id/hfs.h deleted file mode 100644 index 4f732b672..000000000 --- a/extras/volume_id/volume_id/hfs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_HFS_ -#define _VOLUME_ID_HFS_ - -extern int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/highpoint.h b/extras/volume_id/volume_id/highpoint.h deleted file mode 100644 index f04d5f168..000000000 --- a/extras/volume_id/volume_id/highpoint.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_HIGHPOINT_ -#define _VOLUME_ID_HIGHPOINT_ - -extern int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off); -extern int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint64_t size); - -#endif diff --git a/extras/volume_id/volume_id/hpfs.h b/extras/volume_id/volume_id/hpfs.h deleted file mode 100644 index d33e43a11..000000000 --- a/extras/volume_id/volume_id/hpfs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_HPFS_ -#define _VOLUME_ID_HPFS_ - -extern int volume_id_probe_hpfs(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/iso9660.h b/extras/volume_id/volume_id/iso9660.h deleted file mode 100644 index c407d416a..000000000 --- a/extras/volume_id/volume_id/iso9660.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_ISO9660_ -#define _VOLUME_ID_ISO9660_ - -extern int volume_id_probe_iso9660(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/isw_raid.h b/extras/volume_id/volume_id/isw_raid.h deleted file mode 100644 index 55d8c4926..000000000 --- a/extras/volume_id/volume_id/isw_raid.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_ISW_RAID_ -#define _VOLUME_ID_ISW_RAID_ - -extern int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint64_t size); - -#endif diff --git a/extras/volume_id/volume_id/jfs.h b/extras/volume_id/volume_id/jfs.h deleted file mode 100644 index 4ef0d8763..000000000 --- a/extras/volume_id/volume_id/jfs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_JFS_ -#define _VOLUME_ID_JFS_ - -extern int volume_id_probe_jfs(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/linux_raid.h b/extras/volume_id/volume_id/linux_raid.h deleted file mode 100644 index 8fdeebf5c..000000000 --- a/extras/volume_id/volume_id/linux_raid.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_LINUX_RAID_ -#define _VOLUME_ID_LINUX_RAID_ - -extern int volume_id_probe_linux_raid(struct volume_id *id, uint64_t off, uint64_t size); - -#endif diff --git a/extras/volume_id/volume_id/linux_swap.h b/extras/volume_id/volume_id/linux_swap.h deleted file mode 100644 index e31ee6eb9..000000000 --- a/extras/volume_id/volume_id/linux_swap.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_LINUX_SWAP_ -#define _VOLUME_ID_LINUX_SWAP_ - -extern int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/lsi_raid.h b/extras/volume_id/volume_id/lsi_raid.h deleted file mode 100644 index 51a0bfbcc..000000000 --- a/extras/volume_id/volume_id/lsi_raid.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_LSI_RAID_ -#define _VOLUME_ID_LSI_RAID_ - -extern int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t size); - -#endif diff --git a/extras/volume_id/volume_id/luks.h b/extras/volume_id/volume_id/luks.h deleted file mode 100644 index fbf3fcd84..000000000 --- a/extras/volume_id/volume_id/luks.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 W. Michael Petullo - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_LUKS_ -#define _VOLUME_ID_LUKS_ - -extern int volume_id_probe_luks(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/lvm.h b/extras/volume_id/volume_id/lvm.h deleted file mode 100644 index d07cb53af..000000000 --- a/extras/volume_id/volume_id/lvm.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_LVM_ -#define _VOLUME_ID_LVM_ - -extern int volume_id_probe_lvm1(struct volume_id *id, uint64_t off); -extern int volume_id_probe_lvm2(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/mac.h b/extras/volume_id/volume_id/mac.h deleted file mode 100644 index 77b8ccda6..000000000 --- a/extras/volume_id/volume_id/mac.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_MAC_ -#define _VOLUME_ID_MAC_ - -extern int volume_id_probe_mac_partition_map(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/minix.h b/extras/volume_id/volume_id/minix.h deleted file mode 100644 index 3020cc046..000000000 --- a/extras/volume_id/volume_id/minix.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_MINIX_ -#define _VOLUME_ID_MINIX_ - -extern int volume_id_probe_minix(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/msdos.h b/extras/volume_id/volume_id/msdos.h deleted file mode 100644 index b319f05d6..000000000 --- a/extras/volume_id/volume_id/msdos.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_MSDOS_ -#define _VOLUME_ID_MSDOS_ - -extern int volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/ntfs.h b/extras/volume_id/volume_id/ntfs.h deleted file mode 100644 index 8d5915968..000000000 --- a/extras/volume_id/volume_id/ntfs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_NTFS_ -#define _VOLUME_ID_NTFS_ - -extern int volume_id_probe_ntfs(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/nvidia_raid.h b/extras/volume_id/volume_id/nvidia_raid.h deleted file mode 100644 index 80c51692a..000000000 --- a/extras/volume_id/volume_id/nvidia_raid.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_NVIDIA_RAID_ -#define _VOLUME_ID_NVIDIA_RAID_ - -extern int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t size); - -#endif diff --git a/extras/volume_id/volume_id/ocfs.h b/extras/volume_id/volume_id/ocfs.h deleted file mode 100644 index 9d46b28dc..000000000 --- a/extras/volume_id/volume_id/ocfs.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Andre Masella - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_OCFS1_ -#define _VOLUME_ID_OCFS1_ - -extern int volume_id_probe_ocfs1(struct volume_id *id, uint64_t off); -extern int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/promise_raid.h b/extras/volume_id/volume_id/promise_raid.h deleted file mode 100644 index a46b06201..000000000 --- a/extras/volume_id/volume_id/promise_raid.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_PROMISE_RAID_ -#define _VOLUME_ID_PROMISE_RAID_ - -extern int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, uint64_t off, uint64_t size); - -#endif diff --git a/extras/volume_id/volume_id/reiserfs.h b/extras/volume_id/volume_id/reiserfs.h deleted file mode 100644 index 57ee05ea2..000000000 --- a/extras/volume_id/volume_id/reiserfs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_REISERFS_ -#define _VOLUME_ID_REISERFS_ - -extern int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/romfs.h b/extras/volume_id/volume_id/romfs.h deleted file mode 100644 index 5fe56dcdf..000000000 --- a/extras/volume_id/volume_id/romfs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_ROMFS_ -#define _VOLUME_ID_ROMFS_ - -extern int volume_id_probe_romfs(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/silicon_raid.h b/extras/volume_id/volume_id/silicon_raid.h deleted file mode 100644 index f80c1a4a3..000000000 --- a/extras/volume_id/volume_id/silicon_raid.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_SILICON_RAID_ -#define _VOLUME_ID_SILICON_RAID_ - -extern int volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t off, uint64_t size); - -#endif diff --git a/extras/volume_id/volume_id/sysv.h b/extras/volume_id/volume_id/sysv.h deleted file mode 100644 index b8c369ec0..000000000 --- a/extras/volume_id/volume_id/sysv.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_SYSV_ -#define _VOLUME_ID_SYSV_ - -extern int volume_id_probe_sysv(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/udf.h b/extras/volume_id/volume_id/udf.h deleted file mode 100644 index ff95cc105..000000000 --- a/extras/volume_id/volume_id/udf.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_UDF_ -#define _VOLUME_ID_UDF_ - -extern int volume_id_probe_udf(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/ufs.h b/extras/volume_id/volume_id/ufs.h deleted file mode 100644 index ae46a924b..000000000 --- a/extras/volume_id/volume_id/ufs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_UFS_ -#define _VOLUME_ID_UFS_ - -extern int volume_id_probe_ufs(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/via_raid.h b/extras/volume_id/volume_id/via_raid.h deleted file mode 100644 index 3eeaa2cee..000000000 --- a/extras/volume_id/volume_id/via_raid.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_VIA_RAID_ -#define _VOLUME_ID_VIA_RAID_ - -extern int volume_id_probe_via_raid(struct volume_id *id, uint64_t off, uint64_t size); - -#endif diff --git a/extras/volume_id/volume_id/volume_id.h b/extras/volume_id/volume_id/volume_id.h deleted file mode 100644 index 9994615c6..000000000 --- a/extras/volume_id/volume_id/volume_id.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * volume_id - reads partition label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_H_ -#define _VOLUME_ID_H_ - -#include - -#define VOLUME_ID_VERSION 52 - -#define VOLUME_ID_LABEL_SIZE 64 -#define VOLUME_ID_UUID_SIZE 36 -#define VOLUME_ID_FORMAT_SIZE 32 -#define VOLUME_ID_PATH_MAX 256 -#define VOLUME_ID_PARTITIONS_MAX 256 - -enum volume_id_usage { - VOLUME_ID_UNUSED, - VOLUME_ID_UNPROBED, - VOLUME_ID_OTHER, - VOLUME_ID_FILESYSTEM, - VOLUME_ID_PARTITIONTABLE, - VOLUME_ID_RAID, - VOLUME_ID_DISKLABEL, - VOLUME_ID_CRYPTO, -}; - -struct volume_id_partition { - enum volume_id_usage usage_id; - char *usage; - char *type; - uint64_t off; - uint64_t len; - uint8_t partition_type_raw; -}; - -struct volume_id { - uint8_t label_raw[VOLUME_ID_LABEL_SIZE]; - size_t label_raw_len; - char label[VOLUME_ID_LABEL_SIZE+1]; - uint8_t uuid_raw[VOLUME_ID_UUID_SIZE]; - size_t uuid_raw_len; - char uuid[VOLUME_ID_UUID_SIZE+1]; - enum volume_id_usage usage_id; - char *usage; - char *type; - char type_version[VOLUME_ID_FORMAT_SIZE]; - - struct volume_id_partition *partitions; - size_t partition_count; - - int fd; - uint8_t *sbbuf; - size_t sbbuf_len; - uint8_t *seekbuf; - uint64_t seekbuf_off; - size_t seekbuf_len; - int fd_close:1; -}; - -extern struct volume_id *volume_id_open_fd(int fd); -extern struct volume_id *volume_id_open_node(const char *path); -extern struct volume_id *volume_id_open_dev_t(dev_t devt); -extern int volume_id_probe_all(struct volume_id *id, uint64_t off, uint64_t size); -extern void volume_id_close(struct volume_id *id); - -#endif diff --git a/extras/volume_id/volume_id/vxfs.h b/extras/volume_id/volume_id/vxfs.h deleted file mode 100644 index 8ca45c3fd..000000000 --- a/extras/volume_id/volume_id/vxfs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID_VXFS_ -#define _VOLUME_ID_VXFS_ - -extern int volume_id_probe_vxfs(struct volume_id *id, uint64_t off); - -#endif diff --git a/extras/volume_id/volume_id/xfs.h b/extras/volume_id/volume_id/xfs.h deleted file mode 100644 index f21cc5f92..000000000 --- a/extras/volume_id/volume_id/xfs.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * volume_id - reads filesystem label and uuid - * - * Copyright (C) 2004 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - */ - -#ifndef _VOLUME_ID__ -#define _VOLUME_ID__ - -extern int volume_id_probe_xfs(struct volume_id *id, uint64_t off); - -#endif