Skip to content

Commit

Permalink
fstools: fix ntfs3 mount with utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Dec 22, 2022
1 parent d2460df commit 317d92d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/lean/automount/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=automount
PKG_VERSION:=1
PKG_RELEASE:=38
PKG_RELEASE:=39
PKG_ARCH:=all

include $(INCLUDE_DIR)/package.mk
Expand All @@ -18,7 +18,7 @@ define Package/automount
TITLE:=Mount autoconfig hotplug script.
MAINTAINER:=Lean
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

define Package/automount/description
Expand Down
23 changes: 23 additions & 0 deletions package/system/fstools/patches/0200-ntfs3-with-utf8.patch
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 317d92d

Please sign in to comment.