2
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
4
* Inspired by libvolume_id by
5
* Kay Sievers <kay.sievers@vrfy.org>
7
* This file may be redistributed under the terms of the
8
* GNU Lesser General Public License.
16
#include "bitops.h" /* swab16() */
17
#include "superblocks.h"
19
struct sqsh_super_block {
22
uint32_t bytes_used_2;
24
uint32_t guid_start_2;
25
uint32_t inode_table_start_2;
26
uint32_t directory_table_start_2;
29
} __attribute__((packed));
31
static int probe_squashfs(blkid_probe pr, const struct blkid_idmag *mag)
33
struct sqsh_super_block *sq;
35
sq = blkid_probe_get_sb(pr, mag, struct sqsh_super_block);
39
if (strcmp(mag->magic, "sqsh") == 0 ||
40
strcmp(mag->magic, "qshs") == 0)
41
blkid_probe_sprintf_version(pr, "%u.%u",
45
blkid_probe_sprintf_version(pr, "%u.%u",
51
const struct blkid_idinfo squashfs_idinfo =
54
.usage = BLKID_USAGE_FILESYSTEM,
55
.probefunc = probe_squashfs,
58
{ .magic = "sqsh", .len = 4 },
59
{ .magic = "hsqs", .len = 4 }, /* swap */
62
{ .magic = "qshs", .len = 4 },
63
{ .magic = "shsq", .len = 4 }, /* swap */