summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-12 20:34:28 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-13 10:51:06 +0200
commit6e4768e67394566cbacdb5338dd776781277ff00 (patch)
tree5eebf3b2dafb84d2a3887241ee2705395e5f5e96
parentca59def8890febdb600df07b48b53ad32b05d333 (diff)
Add yet another magic clutch to squashfs dir entry generation
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--include/squashfs.h2
-rw-r--r--mkfs/meta.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/include/squashfs.h b/include/squashfs.h
index 2d27cc1..e599863 100644
--- a/include/squashfs.h
+++ b/include/squashfs.h
@@ -13,6 +13,8 @@
#define SQFS_DEVBLK_SIZE 4096
#define SQFS_MAX_DIR_ENT 256
+#define SQFS_DIR_TYPE_MOD 8
+
typedef struct {
uint32_t magic;
uint32_t inode_count;
diff --git a/mkfs/meta.c b/mkfs/meta.c
index 4513733..7ee5dd4 100644
--- a/mkfs/meta.c
+++ b/mkfs/meta.c
@@ -121,7 +121,7 @@ static int write_dir(meta_writer_t *dm, dir_info_t *dir, dir_index_t **index)
for (i = 0; i < count; ++i) {
ent.offset = htole16(c->inode_ref & 0x0000FFFF);
ent.inode_number = htole16(c->inode_num - d->inode_num);
- ent.type = htole16(c->type);
+ ent.type = htole16(c->type % SQFS_DIR_TYPE_MOD);
ent.size = htole16(strlen(c->name) - 1);
dir->size += sizeof(ent) + strlen(c->name);