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

@@ -36,7 +36,7 @@ Berkeley YACC, GNU bison, flex, groff, ELF library and FUSE library.
Under Ubuntu, for example, you can do it by command:
```shell
$ sudo apt-get install bison byacc flex groff-base libelf-dev libfuse-dev
$ sudo apt-get install bison byacc flex groff-base libelf-dev
```
You can change a desired filesystem size and swap area size, as required.

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 */

View File

@@ -16,8 +16,11 @@ CFLAGS = -DSIM_PIC32 -DPIC32MX7 -DMAX32
#CFLAGS = -DSIM_PIC32 -DPIC32MX7 -DUBW32
CC = gcc -g
CFLAGS += -Wall -Werror -MT $@ -MD -MP -MF .deps/$*.dep -I/opt/local/include -I/opt/local/include/libelf
LIBS = -lpthread -lelf
CFLAGS += -Wall -Werror -MT $@ -MD -MP -MF .deps/$*.dep
LIBS = -lpthread
CFLAGS += $(shell pkg-config libelf --cflags)
LIBS += $(shell pkg-config libelf --libs)
ifneq ($(wildcard /usr/lib/librt.a),)
LIBS += -lrt # Linux

View File

@@ -803,12 +803,12 @@ static void vtty_read_and_store (vtty_t * vtty)
vtty->telnet_opt = c;
/* if telnet client can support ttype, ask it to send ttype string */
if ((vtty->telnet_cmd == WILL) && (vtty->telnet_opt == TELOPT_TTYPE)) {
vtty_put_char (vtty, IAC);
vtty_put_char (vtty, SB);
vtty_put_char (vtty, (char)IAC);
vtty_put_char (vtty, (char)SB);
vtty_put_char (vtty, TELOPT_TTYPE);
vtty_put_char (vtty, TELQUAL_SEND);
vtty_put_char (vtty, IAC);
vtty_put_char (vtty, SE);
vtty_put_char (vtty, (char)IAC);
vtty_put_char (vtty, (char)SE);
}
vtty->input_state = VTTY_INPUT_TEXT;
return;