volume_id: provide libvolume_id.a file

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This commit is contained in:
Kay Sievers 2005-11-09 15:08:45 +01:00
parent 09c2bab517
commit accff72685
70 changed files with 190 additions and 714 deletions

View File

@ -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

View File

@ -0,0 +1,66 @@
# Makefile for udev extra invoked from the udev main Makefile
#
# Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
#
# 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

View File

@ -26,7 +26,6 @@
#include "volume_id.h"
#include "logging.h"
#include "util.h"
#include "cramfs.h"
struct cramfs_super {
uint8_t magic[4];

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -26,7 +26,6 @@
#include "volume_id.h"
#include "logging.h"
#include "util.h"
#include "highpoint.h"
struct hpt37x_meta {
uint8_t filler1[32];

View File

@ -26,7 +26,6 @@
#include "volume_id.h"
#include "logging.h"
#include "util.h"
#include "hpfs.h"
struct hpfs_super
{

View File

@ -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

View File

@ -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];

View File

@ -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];

View File

@ -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;

View File

@ -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];

View File

@ -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];

View File

@ -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)

View File

@ -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];

View File

@ -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];

View File

@ -26,7 +26,6 @@
#include "volume_id.h"
#include "logging.h"
#include "util.h"
#include "minix.h"
struct minix_super_block
{

View File

@ -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;

View File

@ -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];

View File

@ -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];

View File

@ -27,7 +27,6 @@
#include "volume_id.h"
#include "logging.h"
#include "util.h"
#include "ocfs.h"
struct ocfs1_super_block_header {

View File

@ -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];

View File

@ -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;

View File

@ -26,7 +26,6 @@
#include "volume_id.h"
#include "logging.h"
#include "util.h"
#include "romfs.h"
struct romfs_super {
uint8_t magic[8];

View File

@ -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];

View File

@ -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

View File

@ -26,7 +26,6 @@
#include "volume_id.h"
#include "logging.h"
#include "util.h"
#include "udf.h"
struct volume_descriptor {
struct descriptor_tag {

View File

@ -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;

View File

@ -26,7 +26,6 @@
#include "volume_id.h"
#include "logging.h"
#include "util.h"
#include "via_raid.h"
struct via_meta {
uint16_t signature;

View File

@ -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)

View File

@ -0,0 +1,116 @@
/*
* volume_id - reads partition label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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 <stdint.h>
#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

View File

@ -26,7 +26,6 @@
#include "volume_id.h"
#include "logging.h"
#include "util.h"
#include "vxfs.h"
#define VXFS_SUPER_MAGIC 0xa501FCF5

View File

@ -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];

View File

@ -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)

View File

@ -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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,17 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 W. Michael Petullo <mike@flyn.org>
*
* 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

View File

@ -1,17 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,18 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Andre Masella <andre@masella.no-ip.org>
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,74 +0,0 @@
/*
* volume_id - reads partition label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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 <stdint.h>
#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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
*
* 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

View File

@ -1,16 +0,0 @@
/*
* volume_id - reads filesystem label and uuid
*
* Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
*
* 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