diff options
author | Karel Zak | 2008-11-25 13:59:26 +0100 |
---|---|---|
committer | Karel Zak | 2009-02-11 23:21:47 +0100 |
commit | 681ff570f02aa0be17de63daabd8efec931afb61 (patch) | |
tree | c5b272a264c86281b0c8e363ff1e79538cb0d76f /libs/blkid | |
parent | blkid: add vxfs (diff) | |
download | kernel-qcow2-util-linux-681ff570f02aa0be17de63daabd8efec931afb61.tar.gz kernel-qcow2-util-linux-681ff570f02aa0be17de63daabd8efec931afb61.tar.xz kernel-qcow2-util-linux-681ff570f02aa0be17de63daabd8efec931afb61.zip |
blkid: add minix
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libs/blkid')
-rw-r--r-- | libs/blkid/src/probe.c | 2 | ||||
-rw-r--r-- | libs/blkid/src/probers/Makefile.am | 1 | ||||
-rw-r--r-- | libs/blkid/src/probers/minix.c | 59 | ||||
-rw-r--r-- | libs/blkid/src/probers/probers.h | 1 |
4 files changed, 62 insertions, 1 deletions
diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index f1fb76ab7..fb1615b7f 100644 --- a/libs/blkid/src/probe.c +++ b/libs/blkid/src/probe.c @@ -77,7 +77,7 @@ static const struct blkid_idinfo *idinfos[] = &ntfs_idinfo, &cramfs_idinfo, &romfs_idinfo, - /* TODO: minix */ + &minix_idinfo, &gfs_idinfo, &gfs2_idinfo, &ocfs_idinfo, diff --git a/libs/blkid/src/probers/Makefile.am b/libs/blkid/src/probers/Makefile.am index fe13031b9..a09608b9f 100644 --- a/libs/blkid/src/probers/Makefile.am +++ b/libs/blkid/src/probers/Makefile.am @@ -32,6 +32,7 @@ libprobers_a_SOURCES = probers.h \ luks.c \ highpoint_raid.c \ vxfs.c \ + minix.c \ lvm.c all-local: $(lib_LIBRARIES) diff --git a/libs/blkid/src/probers/minix.c b/libs/blkid/src/probers/minix.c new file mode 100644 index 000000000..09d454371 --- /dev/null +++ b/libs/blkid/src/probers/minix.c @@ -0,0 +1,59 @@ +/* + * Copyright (C) 1999 by Andries Brouwer + * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o + * Copyright (C) 2001 by Andreas Dilger + * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org> + * Copyright (C) 2008 Karel Zak <kzak@redhat.com> + * + * This file 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; either version 2 of the License, or + * (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include "blkidP.h" + +static int probe_minix(blkid_probe pr, const struct blkid_idmag *mag) +{ + /* for more details see magic strings below */ + switch(mag->magic[1]) { + case '\023': + blkid_probe_set_version(pr, "1"); + break; + case '\044': + blkid_probe_set_version(pr, "2"); + break; + case '\115': + blkid_probe_set_version(pr, "3"); + break; + } + return 0; +} + + +const struct blkid_idinfo minix_idinfo = +{ + .name = "minix", + .usage = BLKID_USAGE_FILESYSTEM, + .probefunc = probe_minix, + .magics = + { + /* version 1 */ + { .magic = "\177\023", .len = 2, .kboff = 1, .sboff = 0x10 }, + { .magic = "\217\023", .len = 2, .kboff = 1, .sboff = 0x10 }, + + /* version 2 */ + { .magic = "\150\044", .len = 2, .kboff = 1, .sboff = 0x10 }, + { .magic = "\170\044", .len = 2, .kboff = 1, .sboff = 0x10 }, + + /* version 3 */ + { .magic = "\132\115", .len = 2, .kboff = 1, .sboff = 0x18 }, + { NULL } + } +}; + diff --git a/libs/blkid/src/probers/probers.h b/libs/blkid/src/probers/probers.h index 394607085..36271275b 100644 --- a/libs/blkid/src/probers/probers.h +++ b/libs/blkid/src/probers/probers.h @@ -49,6 +49,7 @@ extern const struct blkid_idinfo ntfs_idinfo; extern const struct blkid_idinfo iso9660_idinfo; extern const struct blkid_idinfo udf_idinfo; extern const struct blkid_idinfo vxfs_idinfo; +extern const struct blkid_idinfo minix_idinfo; extern const struct blkid_idinfo vfat_idinfo; extern const struct blkid_idinfo lvm2_idinfo; extern const struct blkid_idinfo lvm1_idinfo; |