Disable mount option in fsutil. No need for libfuse anymore.

Fix build issues in virtualmips simulator.
This commit is contained in:
Serge Vakulenko
2022-05-25 16:11:07 -07:00
parent a0c256c1f0
commit 71faeb6c76
6 changed files with 31 additions and 10 deletions

View File

@@ -5,14 +5,21 @@ OBJS = fsutil.o superblock.o block.c inode.o create.o check.o \
file.o mount.o manifest.o
PROG = fsutil
# Enable mount option.
#ENABLE_FUSE = 1
# For Mac OS X
ifneq ($(wildcard /usr/local/lib/pkgconfig),)
FUSE_PATH = /usr/local/lib/pkgconfig
endif
# Fuse
MOUNT_CFLAGS = $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --cflags)
LIBS += $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --libs)
ifneq ($(ENABLE_FUSE),)
CFLAGS += -DENABLE_FUSE
MOUNT_CFLAGS = -DFUSE_USE_VERSION=26
MOUNT_CFLAGS += $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --cflags)
LIBS += $(shell PKG_CONFIG_PATH=$(FUSE_PATH) pkg-config fuse --libs)
endif
all: $(PROG)

View File

@@ -85,7 +85,9 @@ static void print_help (char *progname)
printf (" %s [--verbose] [--partition=n] disk.img\n", progname);
printf (" %s --check [--fix] [--partition=n] disk.img\n", progname);
printf (" %s --new [--size=kbytes | --partition=n] [--manifest=file] disk.img [dir]\n", progname);
#ifdef ENABLE_FUSE
printf (" %s --mount [--partition=n] disk.img dir\n", progname);
#endif
printf (" %s --add [--partition=n] disk.img files...\n", progname);
printf (" %s --extract [--partition=n] disk.img\n", progname);
printf (" %s --repartition=format disk.img\n", progname);
@@ -99,7 +101,9 @@ static void print_help (char *progname)
printf (" -s NUM, --size=NUM Size of filesystem in kbytes.\n");
printf (" -M file, --manifest=file\n");
printf (" List of files and attributes to create.\n");
#ifdef ENABLE_FUSE
printf (" -m, --mount Mount the filesystem.\n");
#endif
printf (" -a, --add Add files to filesystem.\n");
printf (" -x, --extract Extract all files.\n");
printf (" -r format, --repartition=format\n");
@@ -889,7 +893,12 @@ int main (int argc, char **argv)
print_help (argv[0]);
return -1;
}
#ifdef ENABLE_FUSE
return fs_mount(&fs, argv[i+1]);
#else
fprintf (stderr, "fsutil: -m, --mount options are not supported in this version.\n");
return -1;
#endif
}
/* Print the structure of flesystem. */

View File

@@ -28,7 +28,7 @@
#include <unistd.h>
#include <errno.h>
#define FUSE_USE_VERSION 26
#ifdef ENABLE_FUSE
#include <fuse.h>
#include "bsdfs.h"
@@ -909,3 +909,5 @@ int fs_mount(fs_t *fs, char *dirname)
printf ("\nFilesystem %s unmounted\n", dirname);
return ret;
}
#endif /* ENABLE_FUSE */