diff options
| author | Rodrigo Balerdi | 2024-09-25 03:31:36 +0000 |
|---|---|---|
| committer | Daniel Golle | 2026-03-17 16:16:16 +0000 |
| commit | e600d842ce81b776dc8e2c7aaf39bb923e446c45 (patch) | |
| tree | ca459cf7378c36d84751522b86eda056a70b73f1 | |
| parent | 0b6022439cadf5928d0c657f16cf5af354eff3ff (diff) | |
| download | fstools-master.tar.gz | |
The kernel parameter 'fstools_overlay_fstype' can now be used to specify
the preferred overlay fileystem type. The supported values are 'ext4',
'f2fs' and 'auto'. Type 'auto' is the default and represents the usual
behavior of selecting the filesystem type based on available space.
Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
| -rw-r--r-- | libfstools/common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libfstools/common.c b/libfstools/common.c index 46b8114..1492793 100644 --- a/libfstools/common.c +++ b/libfstools/common.c @@ -128,10 +128,20 @@ int block_file_identify(FILE *f, uint64_t offset) static bool use_f2fs(struct volume *v, uint64_t offset, const char *bdev) { + char typeparam[BUFLEN]; uint64_t size = 0; bool ret = false; int fd; + if (get_var_from_file("/proc/cmdline", "fstools_overlay_fstype", typeparam, sizeof(typeparam))) { + if (!strcmp("f2fs", typeparam)) + return true; + else if (!strcmp("ext4", typeparam)) + return false; + else if (strcmp("auto", typeparam)) + ULOG_ERR("unsupported overlay filesystem type: %s\n", typeparam); + } + fd = open(bdev, O_RDONLY); if (fd < 0) return false; |