|
本帖最后由 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
- include $(TOPDIR)/rules.mk
- include $(INCLUDE_DIR)/kernel.mk
- PKG_NAME:=antfs
- PKG_RELEASE:=1
- PKG_SOURCE_URL:=https://github.com/Sembedded/antfs.git
- PKG_SOURCE_PROTO:=git
- PKG_SOURCE_DATE:=2018-08-14
- PKG_SOURCE_VERSION:=002407a1b4f1bc9ec19fb07a4c01fc5348d216a6
- PKG_MIRROR_HASH:=d1c44b2be92531c2caa4fa00b620591f95104436920640e94861f8207d6e9082
- PKG_LICENSE:=GPL-2.0-only
- PKG_LICENSE_FILES:=LICENSE
- include $(INCLUDE_DIR)/package.mk
- define KernelPackage/fs-antfs
- SUBMENU:=Filesystems
- TITLE:=AVM NTFS Read/Write Driver
- FILES:=$(PKG_BUILD_DIR)/antfs.ko
- AUTOLOAD:=$(call AutoLoad,30,antfs,1)
- DEPENDS:=+kmod-nls-base
- endef
- define KernelPackage/fs-antfs/description
- Kernel module for NTFS Filesytem
- endef
- MAKE_OPTS:= \
- ARCH="$(LINUX_KARCH)" \
- CROSS_COMPILE="$(TARGET_CROSS)" \
- M="$(PKG_BUILD_DIR)"
- define Build/Compile
- $(MAKE) -C "$(LINUX_DIR)" \
- $(MAKE_OPTS) \
- CONFIG_ANTFS_FS=m \
- CONFIG_ANTFS_SYMLINKS=y \
- modules
- endef
- $(eval $(call KernelPackage,fs-antfs))
复制代码
kernel/antfs/patches/001-4.18.patch
- --- a/dir.c
- +++ b/dir.c
- @@ -1133,9 +1133,12 @@ static int antfs_setattr(struct dentry *
- }
- #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
- inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
- -#else
- +#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
- ktime_get_real_ts(&inode->i_mtime);
- ktime_get_real_ts(&inode->i_ctime);
- +#else
- + ktime_get_real_ts64(&inode->i_mtime);
- + ktime_get_real_ts64(&inode->i_ctime);
- #endif
- if (inode_needs_sync(inode)) {
- sync_mapping_buffers(inode->i_mapping);
- --- a/include/ntfstime.h
- +++ b/include/ntfstime.h
- @@ -47,9 +47,15 @@
- *
- * Return: A Unix time (number of seconds since 1970, and nanoseconds)
- */
- +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
- static inline struct timespec ntfs2timespec(sle64 ntfstime)
- {
- struct timespec spec;
- +#else
- +static inline struct timespec64 ntfs2timespec(sle64 ntfstime)
- +{
- + struct timespec64 spec;
- +#endif
- uint64_t cputime;
- cputime = sle64_to_cpu(ntfstime) - NTFS_TIME_OFFSET;
- @@ -79,7 +85,11 @@ static inline struct timespec ntfs2times
- *
- * Return: An NTFS time (100ns units since Jan 1601)
- */
- +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
- static inline sle64 timespec2ntfs(struct timespec spec)
- +#else
- +static inline sle64 timespec2ntfs(struct timespec64 spec)
- +#endif
- {
- s64 units;
- @@ -94,10 +104,15 @@ static inline sle64 timespec2ntfs(struct
- static inline sle64 ntfs_current_time(void)
- {
- +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
- struct timespec ts;
- getnstimeofday(&ts);
- +#else
- + struct timespec64 ts;
- + getnstimeofday64(&ts);
- +#endif
- return timespec2ntfs(ts);
- }
- --- a/inode.c
- +++ b/inode.c
- @@ -435,7 +435,11 @@ int antfs_inode_init(struct inode *inode
- inode->i_ino ==
- (unsigned long)FILE_ROOT))) {
- struct antfs_sb_info *sbi = ANTFS_SB(inode->i_sb);
- +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
- struct timespec ts;
- +#else
- + struct timespec64 ts;
- +#endif
- /* Init a base mft record ("regular" inode):
- * this has to be done in context of either:
复制代码
|
评分
-
查看全部评分
|