aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/highlevel.h8
-rw-r--r--lib/Makemodule.am2
-rw-r--r--lib/sqfs/write_xattr.c (renamed from mkfs/xattr.c)5
-rw-r--r--mkfs/Makemodule.am3
-rw-r--r--mkfs/mkfs.h3
5 files changed, 14 insertions, 7 deletions
diff --git a/include/highlevel.h b/include/highlevel.h
index f61ad0b..4bc3b7a 100644
--- a/include/highlevel.h
+++ b/include/highlevel.h
@@ -67,4 +67,12 @@ tree_node_t *tree_node_from_inode(sqfs_inode_generic_t *inode,
int deserialize_fstree(fstree_t *out, sqfs_super_t *super, compressor_t *cmp,
int fd, int flags);
+/*
+ Generate a squahfs xattr table from a file system tree.
+
+ Returns 0 on success. Prints error messages to stderr on failure.
+ */
+int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
+ compressor_t *cmp);
+
#endif /* HIGHLEVEL_H */
diff --git a/lib/Makemodule.am b/lib/Makemodule.am
index 1b99a05..3c1ef12 100644
--- a/lib/Makemodule.am
+++ b/lib/Makemodule.am
@@ -22,7 +22,7 @@ libsquashfs_a_SOURCES += lib/sqfs/write_dir.c lib/sqfs/write_inode.c
libsquashfs_a_SOURCES += lib/sqfs/serialize_fstree.c
libsquashfs_a_SOURCES += lib/sqfs/tree_node_from_inode.c
libsquashfs_a_SOURCES += lib/sqfs/deserialize_fstree.c
-libsquashfs_a_SOURCES += lib/sqfs/data_writer.c
+libsquashfs_a_SOURCES += lib/sqfs/data_writer.c lib/sqfs/write_xattr.c
libsquashfs_a_SOURCES += include/data_writer.h
libsquashfs_a_SOURCES += include/frag_reader.h
diff --git a/mkfs/xattr.c b/lib/sqfs/write_xattr.c
index 237f5d4..b6198b4 100644
--- a/mkfs/xattr.c
+++ b/lib/sqfs/write_xattr.c
@@ -1,9 +1,12 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
#include "meta_writer.h"
-#include "mkfs.h"
+#include "highlevel.h"
#include "util.h"
#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
static const struct {
const char *prefix;
diff --git a/mkfs/Makemodule.am b/mkfs/Makemodule.am
index 3dd639d..fac5eec 100644
--- a/mkfs/Makemodule.am
+++ b/mkfs/Makemodule.am
@@ -1,5 +1,4 @@
-gensquashfs_SOURCES = mkfs/mkfs.c mkfs/mkfs.h mkfs/block.c
-gensquashfs_SOURCES += mkfs/options.c mkfs/xattr.c
+gensquashfs_SOURCES = mkfs/mkfs.c mkfs/mkfs.h mkfs/block.c mkfs/options.c
gensquashfs_LDADD = libsquashfs.a libfstree.a libcompress.a libutil.a
gensquashfs_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/mkfs/mkfs.h b/mkfs/mkfs.h
index f08ef5a..e7a339f 100644
--- a/mkfs/mkfs.h
+++ b/mkfs/mkfs.h
@@ -49,9 +49,6 @@ typedef struct {
void process_command_line(options_t *opt, int argc, char **argv);
-int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
- compressor_t *cmp);
-
int write_data_to_image(data_writer_t *data, sqfs_info_t *info);
#endif /* MKFS_H */