forked from Lainports/freebsd-ports
sysutils/fusefs-exfat, sysutils/exfat-utils: Update to 1.3.0
PR: 239954 Submitted by: samm@os2.kiev.ua (maintainer)
This commit is contained in:
parent
0e6ea8195e
commit
ede0dbff6c
8 changed files with 10 additions and 384 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
PORTNAME= exfat
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 1.2.8
|
||||
DISTVERSION= 1.3.0
|
||||
CATEGORIES= sysutils
|
||||
PKGNAMESUFFIX= -utils
|
||||
|
||||
|
|
@ -12,13 +12,13 @@ COMMENT= Utilities to create, check, label and dump exFAT filesystem
|
|||
|
||||
LICENSE= GPLv2+ MSPAT
|
||||
LICENSE_COMB= multi
|
||||
LICENSE_FILE_GPLv2+ = ${WRKSRC}/COPYING
|
||||
LICENSE_NAME_MSPAT= Microsoft exFAT Patent License
|
||||
LICENSE_TEXT_MSPAT= It is important to note that open source and other publicly \
|
||||
available implementations of exFAT do not include a patent \
|
||||
license from Microsoft. A license is required in order to \
|
||||
implement exFAT and use it in a product or device. \
|
||||
https://www.microsoft.com/en-us/legal/intellectualproperty/mtl/exfat-licensing.aspx
|
||||
LICENSE_FILE_GPLv2+ = ${WRKSRC}/COPYING
|
||||
LICENSE_PERMS_MSPAT= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
|
||||
|
||||
LIB_DEPENDS= libublio.so:devel/libublio
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
TIMESTAMP = 1521383513
|
||||
SHA256 (relan-exfat-v1.2.8_GH0.tar.gz) = 778474bfbcd92e35bba5b88bd7ad3f6400328256636abb9031bfcc1ce15ed887
|
||||
SIZE (relan-exfat-v1.2.8_GH0.tar.gz) = 55911
|
||||
TIMESTAMP = 1566154695
|
||||
SHA256 (relan-exfat-v1.3.0_GH0.tar.gz) = 689bcb4a639acd2d45e6fa0ff455f7f18edb2421d4f4f42909943775adc0e375
|
||||
SIZE (relan-exfat-v1.3.0_GH0.tar.gz) = 57846
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
--- libexfat/platform.h.orig 2016-06-03 05:30:35 UTC
|
||||
+++ libexfat/platform.h
|
||||
@@ -46,7 +46,7 @@
|
||||
#define EXFAT_LITTLE_ENDIAN LITTLE_ENDIAN
|
||||
#define EXFAT_BIG_ENDIAN BIG_ENDIAN
|
||||
|
||||
-#elif defined(__FreeBSD__) || defined(__DragonFlyBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
|
||||
#include <sys/endian.h>
|
||||
#define exfat_bswap16(x) bswap16(x)
|
||||
|
|
@ -1,176 +0,0 @@
|
|||
# Revert 3959f7d to restore ublio support and add autoconf glue.
|
||||
|
||||
diff --git README.md README.md
|
||||
index 60d5c71..81446a6 100644
|
||||
--- README.md
|
||||
+++ README.md
|
||||
@@ -7,6 +7,7 @@ Supported operating systems:
|
||||
|
||||
* GNU/Linux
|
||||
* Mac OS X 10.5 or later
|
||||
+* FreeBSD
|
||||
* OpenBSD
|
||||
|
||||
Most GNU/Linux distributions already have fuse-exfat and exfat-utils in their repositories, so you can just install and use them. The next chapter describes how to compile them from source.
|
||||
diff --git configure.ac configure.ac
|
||||
index b45db3f..2bcda4b 100644
|
||||
--- configure.ac
|
||||
+++ configure.ac
|
||||
@@ -31,6 +31,12 @@ AC_PROG_CC_C99
|
||||
AC_PROG_RANLIB
|
||||
AM_PROG_AR
|
||||
AC_SYS_LARGEFILE
|
||||
+PKG_CHECK_MODULES([UBLIO], [libublio], [
|
||||
+ CFLAGS="$CFLAGS $UBLIO_CFLAGS"
|
||||
+ LIBS="$LIBS $UBLIO_LIBS"
|
||||
+ AC_DEFINE([USE_UBLIO], [1],
|
||||
+ [Define if block devices are not supported.])
|
||||
+], [:])
|
||||
PKG_CHECK_MODULES([FUSE], [fuse])
|
||||
AC_CONFIG_HEADERS([libexfat/config.h])
|
||||
AC_CONFIG_FILES([
|
||||
diff --git libexfat/io.c libexfat/io.c
|
||||
index 60f28e2..14c0151 100644
|
||||
--- libexfat/io.c 2018-02-03 09:01:42.000000000 +0100
|
||||
+++ libexfat/io.c 2018-03-18 15:45:43.573290677 +0100
|
||||
@@ -38,12 +38,20 @@
|
||||
#elif __linux__
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
+#ifdef USE_UBLIO
|
||||
+#include <sys/uio.h>
|
||||
+#include <ublio.h>
|
||||
+#endif
|
||||
|
||||
struct exfat_dev
|
||||
{
|
||||
int fd;
|
||||
enum exfat_mode mode;
|
||||
off_t size; /* in bytes */
|
||||
+#ifdef USE_UBLIO
|
||||
+ off_t pos;
|
||||
+ ublio_filehandle_t ufh;
|
||||
+#endif
|
||||
};
|
||||
|
||||
static bool is_open(int fd)
|
||||
@@ -80,6 +88,9 @@
|
||||
{
|
||||
struct exfat_dev* dev;
|
||||
struct stat stbuf;
|
||||
+#ifdef USE_UBLIO
|
||||
+ struct ublio_param up;
|
||||
+#endif
|
||||
|
||||
/* The system allocates file descriptors sequentially. If we have been
|
||||
started with stdin (0), stdout (1) or stderr (2) closed, the system
|
||||
@@ -235,6 +246,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef USE_UBLIO
|
||||
+ memset(&up, 0, sizeof(struct ublio_param));
|
||||
+ up.up_blocksize = 256 * 1024;
|
||||
+ up.up_items = 64;
|
||||
+ up.up_grace = 32;
|
||||
+ up.up_priv = &dev->fd;
|
||||
+
|
||||
+ dev->pos = 0;
|
||||
+ dev->ufh = ublio_open(&up);
|
||||
+ if (dev->ufh == NULL)
|
||||
+ {
|
||||
+ close(dev->fd);
|
||||
+ free(dev);
|
||||
+ exfat_error("failed to initialize ublio");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
return dev;
|
||||
}
|
||||
|
||||
@@ -242,6 +271,13 @@
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
+#ifdef USE_UBLIO
|
||||
+ if (ublio_close(dev->ufh) != 0)
|
||||
+ {
|
||||
+ exfat_error("failed to close ublio");
|
||||
+ rc = -EIO;
|
||||
+ }
|
||||
+#endif
|
||||
if (close(dev->fd) != 0)
|
||||
{
|
||||
exfat_error("failed to close device: %s", strerror(errno));
|
||||
@@ -255,6 +291,13 @@
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
+#ifdef USE_UBLIO
|
||||
+ if (ublio_fsync(dev->ufh) != 0)
|
||||
+ {
|
||||
+ exfat_error("ublio fsync failed");
|
||||
+ rc = -EIO;
|
||||
+ }
|
||||
+#endif
|
||||
if (fsync(dev->fd) != 0)
|
||||
{
|
||||
exfat_error("fsync failed: %s", strerror(errno));
|
||||
@@ -275,29 +318,56 @@
|
||||
|
||||
off_t exfat_seek(struct exfat_dev* dev, off_t offset, int whence)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ /* XXX SEEK_CUR will be handled incorrectly */
|
||||
+ return dev->pos = lseek(dev->fd, offset, whence);
|
||||
+#else
|
||||
return lseek(dev->fd, offset, whence);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_read(struct exfat_dev* dev, void* buffer, size_t size)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ ssize_t result = ublio_pread(dev->ufh, buffer, size, dev->pos);
|
||||
+ if (result >= 0)
|
||||
+ dev->pos += size;
|
||||
+ return result;
|
||||
+#else
|
||||
return read(dev->fd, buffer, size);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_write(struct exfat_dev* dev, const void* buffer, size_t size)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ ssize_t result = ublio_pwrite(dev->ufh, buffer, size, dev->pos);
|
||||
+ if (result >= 0)
|
||||
+ dev->pos += size;
|
||||
+ return result;
|
||||
+#else
|
||||
return write(dev->fd, buffer, size);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_pread(struct exfat_dev* dev, void* buffer, size_t size,
|
||||
off_t offset)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ return ublio_pread(dev->ufh, buffer, size, offset);
|
||||
+#else
|
||||
return pread(dev->fd, buffer, size, offset);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_pwrite(struct exfat_dev* dev, const void* buffer, size_t size,
|
||||
off_t offset)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ return ublio_pwrite(dev->ufh, buffer, size, offset);
|
||||
+#else
|
||||
return pwrite(dev->fd, buffer, size, offset);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node,
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
PORTNAME= exfat
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 1.2.8
|
||||
DISTVERSION= 1.3.0
|
||||
CATEGORIES= sysutils
|
||||
PKGNAMEPREFIX= fusefs-
|
||||
|
||||
|
|
@ -12,13 +12,13 @@ COMMENT= Full-featured exFAT FS implementation as a FUSE module
|
|||
|
||||
LICENSE= GPLv2+ MSPAT
|
||||
LICENSE_COMB= multi
|
||||
LICENSE_FILE_GPLv2+ = ${WRKSRC}/COPYING
|
||||
LICENSE_NAME_MSPAT= Microsoft exFAT Patent License
|
||||
LICENSE_TEXT_MSPAT= It is important to note that open source and other publicly \
|
||||
available implementations of exFAT do not include a patent \
|
||||
license from Microsoft. A license is required in order to \
|
||||
implement exFAT and use it in a product or device. \
|
||||
https://www.microsoft.com/en-us/legal/intellectualproperty/mtl/exfat-licensing.aspx
|
||||
LICENSE_FILE_GPLv2+ = ${WRKSRC}/COPYING
|
||||
LICENSE_PERMS_MSPAT= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
|
||||
|
||||
LIB_DEPENDS= libublio.so:devel/libublio
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
TIMESTAMP = 1521383763
|
||||
SHA256 (relan-exfat-v1.2.8_GH0.tar.gz) = 778474bfbcd92e35bba5b88bd7ad3f6400328256636abb9031bfcc1ce15ed887
|
||||
SIZE (relan-exfat-v1.2.8_GH0.tar.gz) = 55911
|
||||
TIMESTAMP = 1566155165
|
||||
SHA256 (relan-exfat-v1.3.0_GH0.tar.gz) = 689bcb4a639acd2d45e6fa0ff455f7f18edb2421d4f4f42909943775adc0e375
|
||||
SIZE (relan-exfat-v1.3.0_GH0.tar.gz) = 57846
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
--- libexfat/platform.h.orig 2016-06-03 05:30:35 UTC
|
||||
+++ libexfat/platform.h
|
||||
@@ -46,7 +46,7 @@
|
||||
#define EXFAT_LITTLE_ENDIAN LITTLE_ENDIAN
|
||||
#define EXFAT_BIG_ENDIAN BIG_ENDIAN
|
||||
|
||||
-#elif defined(__FreeBSD__) || defined(__DragonFlyBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
|
||||
#include <sys/endian.h>
|
||||
#define exfat_bswap16(x) bswap16(x)
|
||||
|
|
@ -1,176 +0,0 @@
|
|||
# Revert 3959f7d to restore ublio support and add autoconf glue.
|
||||
|
||||
diff --git README.md README.md
|
||||
index 60d5c71..81446a6 100644
|
||||
--- README.md
|
||||
+++ README.md
|
||||
@@ -7,6 +7,7 @@ Supported operating systems:
|
||||
|
||||
* GNU/Linux
|
||||
* Mac OS X 10.5 or later
|
||||
+* FreeBSD
|
||||
* OpenBSD
|
||||
|
||||
Most GNU/Linux distributions already have fuse-exfat and exfat-utils in their repositories, so you can just install and use them. The next chapter describes how to compile them from source.
|
||||
diff --git configure.ac configure.ac
|
||||
index b45db3f..2bcda4b 100644
|
||||
--- configure.ac
|
||||
+++ configure.ac
|
||||
@@ -31,6 +31,12 @@ AC_PROG_CC_C99
|
||||
AC_PROG_RANLIB
|
||||
AM_PROG_AR
|
||||
AC_SYS_LARGEFILE
|
||||
+PKG_CHECK_MODULES([UBLIO], [libublio], [
|
||||
+ CFLAGS="$CFLAGS $UBLIO_CFLAGS"
|
||||
+ LIBS="$LIBS $UBLIO_LIBS"
|
||||
+ AC_DEFINE([USE_UBLIO], [1],
|
||||
+ [Define if block devices are not supported.])
|
||||
+], [:])
|
||||
PKG_CHECK_MODULES([FUSE], [fuse])
|
||||
AC_CONFIG_HEADERS([libexfat/config.h])
|
||||
AC_CONFIG_FILES([
|
||||
diff --git libexfat/io.c libexfat/io.c
|
||||
index 60f28e2..14c0151 100644
|
||||
--- libexfat/io.c 2018-02-03 09:01:42.000000000 +0100
|
||||
+++ libexfat/io.c 2018-03-18 15:45:43.573290677 +0100
|
||||
@@ -38,12 +38,20 @@
|
||||
#elif __linux__
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
+#ifdef USE_UBLIO
|
||||
+#include <sys/uio.h>
|
||||
+#include <ublio.h>
|
||||
+#endif
|
||||
|
||||
struct exfat_dev
|
||||
{
|
||||
int fd;
|
||||
enum exfat_mode mode;
|
||||
off_t size; /* in bytes */
|
||||
+#ifdef USE_UBLIO
|
||||
+ off_t pos;
|
||||
+ ublio_filehandle_t ufh;
|
||||
+#endif
|
||||
};
|
||||
|
||||
static bool is_open(int fd)
|
||||
@@ -80,6 +88,9 @@
|
||||
{
|
||||
struct exfat_dev* dev;
|
||||
struct stat stbuf;
|
||||
+#ifdef USE_UBLIO
|
||||
+ struct ublio_param up;
|
||||
+#endif
|
||||
|
||||
/* The system allocates file descriptors sequentially. If we have been
|
||||
started with stdin (0), stdout (1) or stderr (2) closed, the system
|
||||
@@ -235,6 +246,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef USE_UBLIO
|
||||
+ memset(&up, 0, sizeof(struct ublio_param));
|
||||
+ up.up_blocksize = 256 * 1024;
|
||||
+ up.up_items = 64;
|
||||
+ up.up_grace = 32;
|
||||
+ up.up_priv = &dev->fd;
|
||||
+
|
||||
+ dev->pos = 0;
|
||||
+ dev->ufh = ublio_open(&up);
|
||||
+ if (dev->ufh == NULL)
|
||||
+ {
|
||||
+ close(dev->fd);
|
||||
+ free(dev);
|
||||
+ exfat_error("failed to initialize ublio");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
return dev;
|
||||
}
|
||||
|
||||
@@ -242,6 +271,13 @@
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
+#ifdef USE_UBLIO
|
||||
+ if (ublio_close(dev->ufh) != 0)
|
||||
+ {
|
||||
+ exfat_error("failed to close ublio");
|
||||
+ rc = -EIO;
|
||||
+ }
|
||||
+#endif
|
||||
if (close(dev->fd) != 0)
|
||||
{
|
||||
exfat_error("failed to close device: %s", strerror(errno));
|
||||
@@ -255,6 +291,13 @@
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
+#ifdef USE_UBLIO
|
||||
+ if (ublio_fsync(dev->ufh) != 0)
|
||||
+ {
|
||||
+ exfat_error("ublio fsync failed");
|
||||
+ rc = -EIO;
|
||||
+ }
|
||||
+#endif
|
||||
if (fsync(dev->fd) != 0)
|
||||
{
|
||||
exfat_error("fsync failed: %s", strerror(errno));
|
||||
@@ -275,29 +318,56 @@
|
||||
|
||||
off_t exfat_seek(struct exfat_dev* dev, off_t offset, int whence)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ /* XXX SEEK_CUR will be handled incorrectly */
|
||||
+ return dev->pos = lseek(dev->fd, offset, whence);
|
||||
+#else
|
||||
return lseek(dev->fd, offset, whence);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_read(struct exfat_dev* dev, void* buffer, size_t size)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ ssize_t result = ublio_pread(dev->ufh, buffer, size, dev->pos);
|
||||
+ if (result >= 0)
|
||||
+ dev->pos += size;
|
||||
+ return result;
|
||||
+#else
|
||||
return read(dev->fd, buffer, size);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_write(struct exfat_dev* dev, const void* buffer, size_t size)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ ssize_t result = ublio_pwrite(dev->ufh, buffer, size, dev->pos);
|
||||
+ if (result >= 0)
|
||||
+ dev->pos += size;
|
||||
+ return result;
|
||||
+#else
|
||||
return write(dev->fd, buffer, size);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_pread(struct exfat_dev* dev, void* buffer, size_t size,
|
||||
off_t offset)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ return ublio_pread(dev->ufh, buffer, size, offset);
|
||||
+#else
|
||||
return pread(dev->fd, buffer, size, offset);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_pwrite(struct exfat_dev* dev, const void* buffer, size_t size,
|
||||
off_t offset)
|
||||
{
|
||||
+#ifdef USE_UBLIO
|
||||
+ return ublio_pwrite(dev->ufh, buffer, size, offset);
|
||||
+#else
|
||||
return pwrite(dev->fd, buffer, size, offset);
|
||||
+#endif
|
||||
}
|
||||
|
||||
ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node,
|
||||
Loading…
Add table
Reference in a new issue