fstools: fix ntfs3 mount with utf-8

This commit is contained in:
coolsnowwolf 2022-12-23 02:32:52 +08:00
parent d2460dfb82
commit 317d92dd3e
2 changed files with 25 additions and 2 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=automount PKG_NAME:=automount
PKG_VERSION:=1 PKG_VERSION:=1
PKG_RELEASE:=38 PKG_RELEASE:=39
PKG_ARCH:=all PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -18,7 +18,7 @@ define Package/automount
TITLE:=Mount autoconfig hotplug script. TITLE:=Mount autoconfig hotplug script.
MAINTAINER:=Lean MAINTAINER:=Lean
DEPENDS:=+block-mount +kmod-fs-exfat +kmod-fs-ext4 +kmod-fs-vfat +libblkid \ DEPENDS:=+block-mount +kmod-fs-exfat +kmod-fs-ext4 +kmod-fs-vfat +libblkid \
+kmod-usb-storage +kmod-usb-storage-extras +!TARGET_ramips:kmod-usb-storage-uas +ntfs3-mount +kmod-usb-storage +kmod-usb-storage-extras +!TARGET_ramips:kmod-usb-storage-uas
endef endef
define Package/automount/description define Package/automount/description

View File

@ -0,0 +1,23 @@
--- a/block.c
+++ b/block.c
@@ -943,6 +943,11 @@
{
size_t mount_opts_len;
char *mount_opts = NULL, *ptr;
+ char _data[128] = {0};
+ if (strstr(fstype, "fat") || strstr(fstype, "ntfs")) {
+ snprintf(_data, sizeof(_data), "%s", "iocharset=utf8,uid=65534,gid=65534");
+ }
+
const char * const *filesystems;
int err = -EINVAL;
size_t count;
@@ -960,7 +965,7 @@
const char *fs = filesystems[i];
err = mount(source, target, fs, m ? m->flags : 0,
- (m && m->options) ? m->options : "");
+ (m && m->options) ? m->options : _data);
if (!err || errno != ENODEV)
break;
}