找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 6187|回复: 33

OpenWrt AVM aNTFS驱动测试

[复制链接]
发表于 2020-1-28 18:34 | 显示全部楼层 |阅读模式
本帖最后由 haxc 于 2020-1-29 22:39 编辑

https://www.right.com.cn/forum/thread-1276306-2-1.html
根据hanwckf大神帖子启发,移植到openwrt下
https://github.com/Sembedded/antfs

搜到一个antfs的源码,op下可以编译出来ko文件,但是我没有时间测试是否可以正常使用,大家编译了试试看怎么样?

新的makefile文件,直接编译进内核模块:
https://github.com/openwrt/packa ... c4bbffbff7319f2cc41

kernel/antfs/Makefile
  1. include $(TOPDIR)/rules.mk
  2. include $(INCLUDE_DIR)/kernel.mk

  3. PKG_NAME:=antfs
  4. PKG_RELEASE:=1

  5. PKG_SOURCE_URL:=https://github.com/Sembedded/antfs.git
  6. PKG_SOURCE_PROTO:=git
  7. PKG_SOURCE_DATE:=2018-08-14
  8. PKG_SOURCE_VERSION:=002407a1b4f1bc9ec19fb07a4c01fc5348d216a6
  9. PKG_MIRROR_HASH:=d1c44b2be92531c2caa4fa00b620591f95104436920640e94861f8207d6e9082

  10. PKG_LICENSE:=GPL-2.0-only
  11. PKG_LICENSE_FILES:=LICENSE

  12. include $(INCLUDE_DIR)/package.mk

  13. define KernelPackage/fs-antfs
  14.         SUBMENU:=Filesystems
  15.         TITLE:=AVM NTFS Read/Write Driver
  16.         FILES:=$(PKG_BUILD_DIR)/antfs.ko
  17.         AUTOLOAD:=$(call AutoLoad,30,antfs,1)
  18.         DEPENDS:=+kmod-nls-base
  19. endef

  20. define KernelPackage/fs-antfs/description
  21.         Kernel module for NTFS Filesytem
  22. endef

  23. MAKE_OPTS:= \
  24.         ARCH="$(LINUX_KARCH)" \
  25.         CROSS_COMPILE="$(TARGET_CROSS)" \
  26.         M="$(PKG_BUILD_DIR)"

  27. define Build/Compile
  28.         $(MAKE) -C "$(LINUX_DIR)" \
  29.                 $(MAKE_OPTS) \
  30.                 CONFIG_ANTFS_FS=m \
  31.                 CONFIG_ANTFS_SYMLINKS=y \
  32.                 modules
  33. endef

  34. $(eval $(call KernelPackage,fs-antfs))
复制代码


kernel/antfs/patches/001-4.18.patch
  1. --- a/dir.c
  2. +++ b/dir.c
  3. @@ -1133,9 +1133,12 @@ static int antfs_setattr(struct dentry *
  4.                  }
  5. #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
  6.                  inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
  7. -#else
  8. +#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
  9.                  ktime_get_real_ts(&inode->i_mtime);
  10.                  ktime_get_real_ts(&inode->i_ctime);
  11. +#else
  12. +                ktime_get_real_ts64(&inode->i_mtime);
  13. +                ktime_get_real_ts64(&inode->i_ctime);
  14. #endif
  15.                  if (inode_needs_sync(inode)) {
  16.                          sync_mapping_buffers(inode->i_mapping);
  17. --- a/include/ntfstime.h
  18. +++ b/include/ntfstime.h
  19. @@ -47,9 +47,15 @@
  20.   *
  21.   * Return:  A Unix time (number of seconds since 1970, and nanoseconds)
  22.   */
  23. +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
  24. static inline struct timespec ntfs2timespec(sle64 ntfstime)
  25. {
  26.          struct timespec spec;
  27. +#else
  28. +static inline struct timespec64 ntfs2timespec(sle64 ntfstime)
  29. +{
  30. +        struct timespec64 spec;
  31. +#endif
  32.          uint64_t cputime;

  33.          cputime = sle64_to_cpu(ntfstime) - NTFS_TIME_OFFSET;
  34. @@ -79,7 +85,11 @@ static inline struct timespec ntfs2times
  35.   *
  36.   * Return:  An NTFS time (100ns units since Jan 1601)
  37.   */
  38. +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
  39. static inline sle64 timespec2ntfs(struct timespec spec)
  40. +#else
  41. +static inline sle64 timespec2ntfs(struct timespec64 spec)
  42. +#endif
  43. {
  44.          s64 units;

  45. @@ -94,10 +104,15 @@ static inline sle64 timespec2ntfs(struct

  46. static inline sle64 ntfs_current_time(void)
  47. {
  48. +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
  49.          struct timespec ts;

  50.          getnstimeofday(&ts);
  51. +#else
  52. +        struct timespec64 ts;

  53. +        getnstimeofday64(&ts);
  54. +#endif
  55.          return timespec2ntfs(ts);
  56. }

  57. --- a/inode.c
  58. +++ b/inode.c
  59. @@ -435,7 +435,11 @@ int antfs_inode_init(struct inode *inode
  60.                                          inode->i_ino ==
  61.                                          (unsigned long)FILE_ROOT))) {
  62.                  struct antfs_sb_info *sbi = ANTFS_SB(inode->i_sb);
  63. +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
  64.                  struct timespec ts;
  65. +#else
  66. +                struct timespec64 ts;
  67. +#endif

  68.                  /* Init a base mft record ("regular" inode):
  69.                   * this has to be done in context of either:
复制代码

评分

参与人数 2恩山币 +4 收起 理由
ZHIZ*** + 2 一看就是觉得高端、大气、上档次!
lis*** + 2 恩山全体路由党向你学习!

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
发表于 2020-1-28 19:26 | 显示全部楼层
之前看到过,只是性能并不比原版NTFS-3G强多少,就没有搞

点评

多一种选择也好啊,记得以前NTFS-3G速度比较慢  详情 回复 发表于 2020-1-28 20:44
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-28 19:33 | 显示全部楼层
opener 下NTFS驱动需要给力啊!

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-1-28 20:44 | 显示全部楼层
wulishui 发表于 2020-1-28 19:26
之前看到过,只是性能并不比原版NTFS-3G强多少,就没有搞

多一种选择也好啊,记得以前NTFS-3G速度比较慢

点评

现在都还是慢。到顶也只有40M。已经五六年前的东西了,不在一个时代。  详情 回复 发表于 2020-1-28 22:41
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-28 22:41 | 显示全部楼层
haxc 发表于 2020-1-28 20:44
多一种选择也好啊,记得以前NTFS-3G速度比较慢

现在都还是慢。到顶也只有40M。已经五六年前的东西了,不在一个时代。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-1-28 23:11 | 显示全部楼层
wulishui 发表于 2020-1-28 22:41
现在都还是慢。到顶也只有40M。已经五六年前的东西了,不在一个时代。


ufsd是不错,但是没有源码,不支持新内核,QNTFS也是没源码,商业版的ntfs就不说了,没得下载,ntfs-3g是鸡肋,你说用啥好呢?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-29 02:07 | 显示全部楼层
我老实给硬盘格式化成EXT4格式了,NTFS格式我用得真心少,基本上都是HFS Plus 和 EXT4格式,都已经不怎么用WIN了,NTFS格式对于我来说是鸡肋
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-29 08:37 | 显示全部楼层
恩山全体路由党向你学习!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-29 17:54 | 显示全部楼层
本帖最后由 zbcxq2011 于 2020-1-29 18:06 编辑

:/usr/lib# modprobe antfs.ko
failed to find a module named antfs
:/usr/lib# insmod antfs.ko
failed to insert antfs.ko
编译成功(ipk和antfs.ko都有),但无法使用(错误如上)。(编译环境 :ubuntu18,lean最新,内核4.14.162,硬件tp-wdr4310)

点评

以前ufsd.ko是这样挂载的:放到/lib/modules/3.10.44里,modprobe ufsd 你试试  详情 回复 发表于 2020-1-29 20:08
我没得测试到,大家研究研究  发表于 2020-1-29 19:50
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-1-29 20:08 | 显示全部楼层
本帖最后由 haxc 于 2020-1-29 20:11 编辑
zbcxq2011 发表于 2020-1-29 17:54
:/usr/lib# modprobe antfs.ko
failed to find a module named antfs
:/usr/lib# insmod antfs.ko

以前ufsd.ko是这样加载的:放到/lib/modules/3.10.44里,modprobe ufsd。然后加载硬盘: mount -t ufsd /dev/sda2 /disk ,把/dev/sda2改成你的硬盘dev,把/disk改成你想要加载到的路径。

你试试

makefile编译集成到固件里面应该不用加载了。直接mount -t ufsd /dev/sda2 /disk



点评

非常感谢,上述方法也测试了,无法使用。 改用LGA1150提供的方式(内核模式),重新编译,成功,可以使用,但读写速度比NTFS强一些,比UFSD还是差的多。 LGA1150提供的方式,是已经有人提供了make和patch到官方ope  详情 回复 发表于 2020-1-30 00:23
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-29 20:17 来自手机 | 显示全部楼层
你的 Makefile 有问题,试试这个

https://github.com/openwrt/packages/pull/11154

点评

新的makefile文件: https://github.com/openwrt/packages/commit/1cb4f75662cf636c5ed9bc4bbffbff7319f2cc41 谢谢,我的编译环境有问题,一直不能生成固件,本来我也想直接编译进内核模块的。  详情 回复 发表于 2020-1-29 22:35
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-1-29 22:35 | 显示全部楼层
本帖最后由 haxc 于 2020-1-29 22:40 编辑

谢谢,我的编译环境有问题,一直不能生成固件,本来我也想直接编译进内核模块的。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-30 00:08 | 显示全部楼层
反正我都要编译,我来试试看
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-30 00:23 | 显示全部楼层
haxc 发表于 2020-1-29 20:08
以前ufsd.ko是这样加载的:放到/lib/modules/3.10.44里,modprobe ufsd。然后加载硬盘: mount -t ufsd / ...

非常感谢,上述方法也测试了,无法使用。
改用LGA1150提供的方式(内核模式),重新编译,成功,可以使用,但读写速度比NTFS强一些,比UFSD还是差的多。
LGA1150提供的方式,是已经有人提供了make和patch到官方openwrt,估计不久官方会正式支持。
本次编译时,只是用了其make, 看到patch是针对4.18的,没有加入,编译通过
新手也是好多不懂。
再次感谢各位大老的辛苦努力。

点评

你能用?哪个内核?我官方19.070,4.14.162,完全无法挂载。  详情 回复 发表于 2020-1-30 02:28
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-30 01:46 | 显示全部楼层
试了,编译倒无报错,但完全无法挂载,扔了。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-26 11:19

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表