summaryrefslogtreecommitdiff
path: root/libfstools/common.h
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-02-26 19:45:55 +0000
committerDaniel Golle <daniel@makrotopia.org>2021-02-27 22:15:58 +0000
commitbad1835f27ec31dbc30060b03cc714212275168a (patch)
treec9d3b2a7fae94ca0aa013addcc3892228f3b78df /libfstools/common.h
parentc53b18820756f6f32ad0782d3bf489422b7c4ad3 (diff)
downloadfstools-bad1835f27ec31dbc30060b03cc714212275168a.tar.gz
fstools: add partname volume driver
Add driver to handle block devices with (GPT) partition table which can include a partition name. If 'root=' is set on the kernel cmdline, only search for partitions on the same device. Among with other changes (ptgen, image*.mk, base-files, ...) this allows for a much more straight forward storage model on block based devices. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'libfstools/common.h')
-rw-r--r--libfstools/common.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/libfstools/common.h b/libfstools/common.h
new file mode 100644
index 0000000..6798a54
--- /dev/null
+++ b/libfstools/common.h
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#define _FILE_OFFSET_BITS 64
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include <glob.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stropts.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <libgen.h>
+
+#include "libfstools.h"
+#include "volume.h"
+
+#define F2FS_MINSIZE (100ULL * 1024ULL * 1024ULL)
+
+int read_uint_from_file(char *dirname, char *filename, unsigned int *i);
+char *read_string_from_file(const char *dirname, const char *filename, char *buf, size_t bufsz);
+int block_file_identify(FILE *f, uint64_t offset);
+int block_volume_format(struct volume *v, uint64_t offset, const char *bdev);