summaryrefslogtreecommitdiff
path: root/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2024-11-11 16:36:33 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2024-11-11 10:32:45 +0100
commit03ec75b9e6ad4cb372f86d1581c2b1b2ef987c72 (patch)
tree4d5e45faa1772cbb5b07e5dc0a78a4398de11d11 /ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
parente7e19cd9d8cc0f54ca463c4aebf7c4ef5e4f84f8 (diff)
ubifs-utils: Decouple mkfs.ubifs.h out of other modules
Header file mkfs.ubifs.h is included in other modules(eg. compr.c, lpt.c, fscrypt.h, sign.c), decouple it out of other modules. There are two parts in mkfs.ubifs.h: 1. common functions, for example dbg_msg, err_msg and write_leb, move these functions into common/defs.h and common/ubifs.h. 2. devtable related definations, move them into a new header file common/devtable.h. Splitting common functions from mkfs.ubifs.h is also a preparation for importing libubifs(from linux kernel) to replace current UBIFS libs. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/mkfs.ubifs/mkfs.ubifs.c')
-rw-r--r--ubifs-utils/mkfs.ubifs/mkfs.ubifs.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
index f4cb512..0304ae7 100644
--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
+++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
@@ -22,10 +22,17 @@
#define _XOPEN_SOURCE 500 /* For realpath() */
-#include "mkfs.ubifs.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <libgen.h>
+#include <getopt.h>
+#include <dirent.h>
#include <crc32.h>
-#include "common.h"
+#include <uuid.h>
+#include <linux/fs.h>
#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
#ifdef WITH_XATTR
#include <sys/xattr.h>
#endif
@@ -39,8 +46,18 @@
#include <zstd.h>
#endif
+/* common.h requires the PROGRAM_NAME macro */
+#define PROGRAM_NAME "mkfs.ubifs"
+#include "common.h"
+#include "defs.h"
#include "crypto.h"
#include "fscrypt.h"
+#include "ubifs.h"
+#include "lpt.h"
+#include "compr.h"
+#include "key.h"
+#include "sign.h"
+#include "devtable.h"
/* Size (prime number) of hash table for link counting */
#define HASH_TABLE_SIZE 10099