From cdfdc8b2b4f0b3b9ff3d4ad439376eb61b595fa9 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sun, 10 Oct 2021 16:50:01 +1100 Subject: [PATCH 01/18] ntfs-3g_ntfsprogs: remove NTFS3G from LibreELEC options Linux Kernel 5.15 includes a new NTFS driver (ntfs3) - https://www.kernel.org/doc/html/latest//filesystems/ntfs3.html - https://lore.kernel.org/lkml/aa4aa155-b9b2-9099-b7a2-349d8d9d8fbd@paragon-software.com/ --- distributions/LibreELEC/options | 3 --- 1 file changed, 3 deletions(-) diff --git a/distributions/LibreELEC/options b/distributions/LibreELEC/options index e0939356c4..80ecc2ac3e 100644 --- a/distributions/LibreELEC/options +++ b/distributions/LibreELEC/options @@ -193,9 +193,6 @@ # This adds support for parted and mkfs.ext3/4 to initramfs for OEM usage INITRAMFS_PARTED_SUPPORT="no" -# build and install NTFS-3G fuse support (yes / no) - NTFS3G="yes" - # build and install hfs filesystem utilities (yes / no) HFSTOOLS="yes" From b1a58b21d44aeaf02e75facecdbc9043677386f7 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sun, 10 Oct 2021 16:59:02 +1100 Subject: [PATCH 02/18] ntfs-3g_ntfsprogs: remove NTFS3G from ARM options --- projects/ARM/options | 3 --- 1 file changed, 3 deletions(-) diff --git a/projects/ARM/options b/projects/ARM/options index b24fa32182..574a621325 100644 --- a/projects/ARM/options +++ b/projects/ARM/options @@ -99,9 +99,6 @@ # build and install diskmounter support (udevil) UDEVIL="no" - # build and install NTFS-3G fuse support (yes / no) - NTFS3G="no" - # build and install hfs filesystem utilities (yes / no) HFSTOOLS="no" From 93eee675fb7e9e7501c45b91cb081a331acd36e4 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:44:04 +1100 Subject: [PATCH 03/18] linux (Samsung Exynos): enable kernel ntfs3 --- projects/Samsung/linux/linux.arm.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Samsung/linux/linux.arm.conf b/projects/Samsung/linux/linux.arm.conf index fcf34acde3..d2a630a2b0 100644 --- a/projects/Samsung/linux/linux.arm.conf +++ b/projects/Samsung/linux/linux.arm.conf @@ -5014,7 +5014,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="ascii" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m # CONFIG_NTFS3_LZX_XPRESS is not set # CONFIG_NTFS3_FS_POSIX_ACL is not set # end of DOS/FAT/EXFAT/NT Filesystems From b1255973359905235a7cc3778d168bc46f5caf60 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:44:54 +1100 Subject: [PATCH 04/18] linux (Rockchip RK3288): enable kernel ntfs3 --- projects/Rockchip/devices/RK3288/linux/default/linux.arm.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Rockchip/devices/RK3288/linux/default/linux.arm.conf b/projects/Rockchip/devices/RK3288/linux/default/linux.arm.conf index 6b12a19ade..7a8cc8e220 100644 --- a/projects/Rockchip/devices/RK3288/linux/default/linux.arm.conf +++ b/projects/Rockchip/devices/RK3288/linux/default/linux.arm.conf @@ -5658,7 +5658,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m # CONFIG_NTFS3_LZX_XPRESS is not set # CONFIG_NTFS3_FS_POSIX_ACL is not set # end of DOS/FAT/EXFAT/NT Filesystems From 04842c073ee9543b438233579d52799d66d44217 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:45:26 +1100 Subject: [PATCH 05/18] linux (Rockchip RK3328): enable kernel ntfs3 --- .../Rockchip/devices/RK3328/linux/default/linux.aarch64.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Rockchip/devices/RK3328/linux/default/linux.aarch64.conf b/projects/Rockchip/devices/RK3328/linux/default/linux.aarch64.conf index 086320a862..744e5588cb 100644 --- a/projects/Rockchip/devices/RK3328/linux/default/linux.aarch64.conf +++ b/projects/Rockchip/devices/RK3328/linux/default/linux.aarch64.conf @@ -5654,7 +5654,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m # CONFIG_NTFS3_64BIT_CLUSTER is not set # CONFIG_NTFS3_LZX_XPRESS is not set # CONFIG_NTFS3_FS_POSIX_ACL is not set From aee04d4fa209c5b53ce2884e6229f99544f856d3 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:45:46 +1100 Subject: [PATCH 06/18] linux (Rockchip RK3399): enable kernel ntfs3 --- .../Rockchip/devices/RK3399/linux/default/linux.aarch64.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Rockchip/devices/RK3399/linux/default/linux.aarch64.conf b/projects/Rockchip/devices/RK3399/linux/default/linux.aarch64.conf index f3bda50807..e96c42acbd 100644 --- a/projects/Rockchip/devices/RK3399/linux/default/linux.aarch64.conf +++ b/projects/Rockchip/devices/RK3399/linux/default/linux.aarch64.conf @@ -6363,7 +6363,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m # CONFIG_NTFS3_64BIT_CLUSTER is not set # CONFIG_NTFS3_LZX_XPRESS is not set # CONFIG_NTFS3_FS_POSIX_ACL is not set From 140a1dd4a633fcac133994cc48dcb59013206417 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:46:59 +1100 Subject: [PATCH 07/18] linux (Qualcomm Dragonboard): enable kernel ntfs3 --- projects/Qualcomm/devices/Dragonboard/linux/linux.aarch64.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Qualcomm/devices/Dragonboard/linux/linux.aarch64.conf b/projects/Qualcomm/devices/Dragonboard/linux/linux.aarch64.conf index 818a2bfe39..0530a897ec 100644 --- a/projects/Qualcomm/devices/Dragonboard/linux/linux.aarch64.conf +++ b/projects/Qualcomm/devices/Dragonboard/linux/linux.aarch64.conf @@ -6230,7 +6230,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_FAT_DEFAULT_UTF8 is not set # CONFIG_EXFAT_FS is not set # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m # CONFIG_NTFS3_64BIT_CLUSTER is not set # CONFIG_NTFS3_LZX_XPRESS is not set # CONFIG_NTFS3_FS_POSIX_ACL is not set From 7d4b408f8d869d3c05ccb19a492ff0899f628d7c Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:47:48 +1100 Subject: [PATCH 08/18] linux (NXP iMX6): enable kernel ntfs3 --- projects/NXP/devices/iMX6/linux/linux.arm.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/NXP/devices/iMX6/linux/linux.arm.conf b/projects/NXP/devices/iMX6/linux/linux.arm.conf index 2a37707664..7ebbcea723 100644 --- a/projects/NXP/devices/iMX6/linux/linux.arm.conf +++ b/projects/NXP/devices/iMX6/linux/linux.arm.conf @@ -6041,7 +6041,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m # CONFIG_NTFS3_LZX_XPRESS is not set # CONFIG_NTFS3_FS_POSIX_ACL is not set # end of DOS/FAT/EXFAT/NT Filesystems From 2cc5f1715714ba7d63c81efdc9fb9282abbf014b Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:48:16 +1100 Subject: [PATCH 09/18] linux (NXP iMX8): enable kernel ntfs3 --- projects/NXP/devices/iMX8/linux/linux.aarch64.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/NXP/devices/iMX8/linux/linux.aarch64.conf b/projects/NXP/devices/iMX8/linux/linux.aarch64.conf index d4c8e96340..746180a3a1 100644 --- a/projects/NXP/devices/iMX8/linux/linux.aarch64.conf +++ b/projects/NXP/devices/iMX8/linux/linux.aarch64.conf @@ -5856,7 +5856,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="ascii" # CONFIG_FAT_DEFAULT_UTF8 is not set # CONFIG_EXFAT_FS is not set # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m # CONFIG_NTFS3_64BIT_CLUSTER is not set # CONFIG_NTFS3_LZX_XPRESS is not set # CONFIG_NTFS3_FS_POSIX_ACL is not set From 06e0ebc4fe612f50c0877b7e199a08fcc17ba71c Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:49:01 +1100 Subject: [PATCH 10/18] linux (Generic): enable kernel ntfs3 --- projects/Generic/linux/linux.x86_64.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/Generic/linux/linux.x86_64.conf b/projects/Generic/linux/linux.x86_64.conf index 9c20f6a375..daf8c387f3 100644 --- a/projects/Generic/linux/linux.x86_64.conf +++ b/projects/Generic/linux/linux.x86_64.conf @@ -5875,7 +5875,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="ascii" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m +# CONFIG_NTFS3_64BIT_CLUSTER is not set +# CONFIG_NTFS3_LZX_XPRESS is not set +# CONFIG_NTFS3_FS_POSIX_ACL is not set # end of DOS/FAT/EXFAT/NT Filesystems # From d9135c8035a27c7a3ad1e5d246c1dbd3bdac36cb Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:49:49 +1100 Subject: [PATCH 11/18] linux (Allwinner arm): enable kernel ntfs3 --- projects/Allwinner/linux/linux.arm.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/Allwinner/linux/linux.arm.conf b/projects/Allwinner/linux/linux.arm.conf index 1a96796e08..420bdc5418 100644 --- a/projects/Allwinner/linux/linux.arm.conf +++ b/projects/Allwinner/linux/linux.arm.conf @@ -5630,7 +5630,9 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m +# CONFIG_NTFS3_LZX_XPRESS is not set +# CONFIG_NTFS3_FS_POSIX_ACL is not set # end of DOS/FAT/EXFAT/NT Filesystems # From 8a93094c6eb443295bcd2f629af96ef8d7e91a89 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Fri, 5 Nov 2021 01:50:21 +1100 Subject: [PATCH 12/18] linux (Allwinner aarch64): enable kernel ntfs3 --- projects/Allwinner/linux/linux.aarch64.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Allwinner/linux/linux.aarch64.conf b/projects/Allwinner/linux/linux.aarch64.conf index 6191a0d416..41dc2df693 100644 --- a/projects/Allwinner/linux/linux.aarch64.conf +++ b/projects/Allwinner/linux/linux.aarch64.conf @@ -6024,7 +6024,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m # CONFIG_NTFS3_64BIT_CLUSTER is not set # CONFIG_NTFS3_LZX_XPRESS is not set # CONFIG_NTFS3_FS_POSIX_ACL is not set From 8b2d79b7ca06d269eba2436e770db0a483c0a258 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sat, 6 Nov 2021 10:31:32 +1100 Subject: [PATCH 13/18] linux (RPi): enable kernel ntfs3 --- projects/RPi/devices/RPi/linux/linux.arm.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/RPi/devices/RPi/linux/linux.arm.conf b/projects/RPi/devices/RPi/linux/linux.arm.conf index f08d380a78..b099c1c4ea 100644 --- a/projects/RPi/devices/RPi/linux/linux.arm.conf +++ b/projects/RPi/devices/RPi/linux/linux.arm.conf @@ -4963,7 +4963,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="ascii" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m +# CONFIG_NTFS3_64BIT_CLUSTER is not set +# CONFIG_NTFS3_LZX_XPRESS is not set +# CONFIG_NTFS3_FS_POSIX_ACL is not set # end of DOS/FAT/EXFAT/NT Filesystems # From 3d5330ac293bb863e7a010c3589f9396198c235a Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sat, 6 Nov 2021 10:31:53 +1100 Subject: [PATCH 14/18] linux (RPi2): enable kernel ntfs3 --- projects/RPi/devices/RPi2/linux/linux.arm.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/RPi/devices/RPi2/linux/linux.arm.conf b/projects/RPi/devices/RPi2/linux/linux.arm.conf index 42d050e52b..70c914ac95 100644 --- a/projects/RPi/devices/RPi2/linux/linux.arm.conf +++ b/projects/RPi/devices/RPi2/linux/linux.arm.conf @@ -5108,7 +5108,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="ascii" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m +# CONFIG_NTFS3_64BIT_CLUSTER is not set +# CONFIG_NTFS3_LZX_XPRESS is not set +# CONFIG_NTFS3_FS_POSIX_ACL is not set # end of DOS/FAT/EXFAT/NT Filesystems # From 5795746d4f9e870421e2815540cc86916c29aaac Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sat, 6 Nov 2021 10:32:06 +1100 Subject: [PATCH 15/18] linux (RPi4): enable kernel ntfs3 --- projects/RPi/devices/RPi4/linux/linux.aarch64.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/RPi/devices/RPi4/linux/linux.aarch64.conf b/projects/RPi/devices/RPi4/linux/linux.aarch64.conf index 5744b21f15..a9d42dcf24 100644 --- a/projects/RPi/devices/RPi4/linux/linux.aarch64.conf +++ b/projects/RPi/devices/RPi4/linux/linux.aarch64.conf @@ -5796,7 +5796,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="ascii" CONFIG_EXFAT_FS=m CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8" # CONFIG_NTFS_FS is not set -# CONFIG_NTFS3_FS is not set +CONFIG_NTFS3_FS=m +# CONFIG_NTFS3_64BIT_CLUSTER is not set +# CONFIG_NTFS3_LZX_XPRESS is not set +# CONFIG_NTFS3_FS_POSIX_ACL is not set # end of DOS/FAT/EXFAT/NT Filesystems # From 1b87c37092e2d1481d2dc919869d1157afb19b2a Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sat, 4 Dec 2021 03:12:36 +0000 Subject: [PATCH 16/18] udevil: add handler for ntfs3 --- packages/sysutils/udevil/config/udevil.conf | 2 +- packages/sysutils/udevil/package.mk | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/sysutils/udevil/config/udevil.conf b/packages/sysutils/udevil/config/udevil.conf index 4211a25c2b..08f085bd63 100644 --- a/packages/sysutils/udevil/config/udevil.conf +++ b/packages/sysutils/udevil/config/udevil.conf @@ -221,7 +221,7 @@ default_options_vfat = nosuid, noexec, nodev, noatime, fmask=0133, dmask=00 default_options_exfat = nosuid, noexec, nodev, noatime default_options_msdos = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID default_options_umsdos = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID -default_options_ntfs = nosuid, noexec, nodev, noatime, big_writes, fmask=0133, uid=$UID, gid=$GID, utf8 +default_options_ntfs = nosuid, noexec, nodev, noatime, fmask=0133, uid=$UID, gid=$GID default_options_cifs = nosuid, noexec, nodev, uid=$UID, gid=$GID default_options_smbfs = nosuid, noexec, nodev, uid=$UID, gid=$GID default_options_sshfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, nonempty, allow_other diff --git a/packages/sysutils/udevil/package.mk b/packages/sysutils/udevil/package.mk index 6e70b8751b..562649abf0 100644 --- a/packages/sysutils/udevil/package.mk +++ b/packages/sysutils/udevil/package.mk @@ -26,6 +26,12 @@ post_makeinstall_target() { mkdir -p ${INSTALL}/usr/bin cp -PR src/udevil ${INSTALL}/usr/bin + + mkdir -p ${INSTALL}/usr/sbin + echo '#!/bin/sh' > ${INSTALL}/usr/sbin/mount.ntfs + echo '/usr/sbin/modprobe ntfs3' >> ${INSTALL}/usr/sbin/mount.ntfs + echo '/usr/bin/mount "$@"' >> ${INSTALL}/usr/sbin/mount.ntfs + chmod 755 ${INSTALL}/usr/sbin/mount.ntfs } post_install() { From a3a8d4b31ecff52645e17d4aa739059be3fdb01e Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sat, 4 Dec 2021 04:31:13 +0000 Subject: [PATCH 17/18] ntfs3: patches since 5.15 --- .../patches/default/fs-ntfs3-since-5-15.patch | 593 ++++++++++++++++++ 1 file changed, 593 insertions(+) create mode 100644 packages/linux/patches/default/fs-ntfs3-since-5-15.patch diff --git a/packages/linux/patches/default/fs-ntfs3-since-5-15.patch b/packages/linux/patches/default/fs-ntfs3-since-5-15.patch new file mode 100644 index 0000000000..2fb16c72ff --- /dev/null +++ b/packages/linux/patches/default/fs-ntfs3-since-5-15.patch @@ -0,0 +1,593 @@ +From e589f9b7078e1c0191613cd736f598e81d2390de Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Thu, 11 Nov 2021 08:45:44 +0100 +Subject: [PATCH 1/9] fs/ntfs3: Fix some memory leaks in an error handling path + of 'log_replay()' + +All error handling paths lead to 'out' where many resources are freed. + +Do it as well here instead of a direct return, otherwise 'log', 'ra' and +'log->one_page_buf' (at least) will leak. + +Fixes: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal") +Signed-off-by: Christophe JAILLET +Signed-off-by: Konstantin Komarov +--- + fs/ntfs3/fslog.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c +index 06492f088d60..915f42cf07bc 100644 +--- a/fs/ntfs3/fslog.c ++++ b/fs/ntfs3/fslog.c +@@ -4085,8 +4085,10 @@ int log_replay(struct ntfs_inode *ni, bool *initialized) + if (client == LFS_NO_CLIENT_LE) { + /* Insert "NTFS" client LogFile. */ + client = ra->client_idx[0]; +- if (client == LFS_NO_CLIENT_LE) +- return -EINVAL; ++ if (client == LFS_NO_CLIENT_LE) { ++ err = -EINVAL; ++ goto out; ++ } + + t16 = le16_to_cpu(client); + cr = ca + t16; +-- +2.25.1 + +From e95113ed4d428219e3395044e29f5713fc446720 Mon Sep 17 00:00:00 2001 +From: Konstantin Komarov +Date: Fri, 22 Oct 2021 17:37:52 +0300 +Subject: [PATCH 2/9] fs/ntfs3: Keep preallocated only if option prealloc + enabled + +If size of file was reduced, we still kept allocated blocks. +This commit makes ntfs3 work as other fs like btrfs. +Link: https://bugzilla.kernel.org/show_bug.cgi?id=214719 +Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") + +Reported-by: Ganapathi Kamath +Tested-by: Ganapathi Kamath +Reviewed-by: Kari Argillander +Signed-off-by: Konstantin Komarov +--- + fs/ntfs3/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c +index 43b1451bff53..3ac0482c6880 100644 +--- a/fs/ntfs3/file.c ++++ b/fs/ntfs3/file.c +@@ -494,7 +494,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size) + + down_write(&ni->file.run_lock); + err = attr_set_size(ni, ATTR_DATA, NULL, 0, &ni->file.run, new_size, +- &new_valid, true, NULL); ++ &new_valid, ni->mi.sbi->options->prealloc, NULL); + up_write(&ni->file.run_lock); + + if (new_valid < ni->i_valid) +-- +2.25.1 + +From 87e21c99bad763524c953ff4d1a61ee19038ddc2 Mon Sep 17 00:00:00 2001 +From: Konstantin Komarov +Date: Fri, 22 Oct 2021 18:15:36 +0300 +Subject: [PATCH 3/9] fs/ntfs3: Restore ntfs_xattr_get_acl and + ntfs_xattr_set_acl functions + +Apparently we need to maintain these functions with +ntfs_get_acl_ex and ntfs_set_acl_ex. +This commit fixes xfstest generic/099 +Fixes: 95dd8b2c1ed0 ("fs/ntfs3: Remove unnecessary functions") + +Reviewed-by: Kari Argillander +Signed-off-by: Konstantin Komarov +--- + fs/ntfs3/xattr.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 95 insertions(+), 1 deletion(-) + +diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c +index afd0ddad826f..56e774d0f56a 100644 +--- a/fs/ntfs3/xattr.c ++++ b/fs/ntfs3/xattr.c +@@ -112,7 +112,7 @@ static int ntfs_read_ea(struct ntfs_inode *ni, struct EA_FULL **ea, + return -ENOMEM; + + if (!size) { +- ; ++ /* EA info persists, but xattr is empty. Looks like EA problem. */ + } else if (attr_ea->non_res) { + struct runs_tree run; + +@@ -619,6 +619,67 @@ int ntfs_set_acl(struct user_namespace *mnt_userns, struct inode *inode, + return ntfs_set_acl_ex(mnt_userns, inode, acl, type); + } + ++static int ntfs_xattr_get_acl(struct user_namespace *mnt_userns, ++ struct inode *inode, int type, void *buffer, ++ size_t size) ++{ ++ struct posix_acl *acl; ++ int err; ++ ++ if (!(inode->i_sb->s_flags & SB_POSIXACL)) { ++ ntfs_inode_warn(inode, "add mount option \"acl\" to use acl"); ++ return -EOPNOTSUPP; ++ } ++ ++ acl = ntfs_get_acl(inode, type, false); ++ if (IS_ERR(acl)) ++ return PTR_ERR(acl); ++ ++ if (!acl) ++ return -ENODATA; ++ ++ err = posix_acl_to_xattr(mnt_userns, acl, buffer, size); ++ posix_acl_release(acl); ++ ++ return err; ++} ++ ++static int ntfs_xattr_set_acl(struct user_namespace *mnt_userns, ++ struct inode *inode, int type, const void *value, ++ size_t size) ++{ ++ struct posix_acl *acl; ++ int err; ++ ++ if (!(inode->i_sb->s_flags & SB_POSIXACL)) { ++ ntfs_inode_warn(inode, "add mount option \"acl\" to use acl"); ++ return -EOPNOTSUPP; ++ } ++ ++ if (!inode_owner_or_capable(mnt_userns, inode)) ++ return -EPERM; ++ ++ if (!value) { ++ acl = NULL; ++ } else { ++ acl = posix_acl_from_xattr(mnt_userns, value, size); ++ if (IS_ERR(acl)) ++ return PTR_ERR(acl); ++ ++ if (acl) { ++ err = posix_acl_valid(mnt_userns, acl); ++ if (err) ++ goto release_and_out; ++ } ++ } ++ ++ err = ntfs_set_acl(mnt_userns, inode, acl, type); ++ ++release_and_out: ++ posix_acl_release(acl); ++ return err; ++} ++ + /* + * ntfs_init_acl - Initialize the ACLs of a new inode. + * +@@ -785,6 +846,23 @@ static int ntfs_getxattr(const struct xattr_handler *handler, struct dentry *de, + goto out; + } + ++#ifdef CONFIG_NTFS3_FS_POSIX_ACL ++ if ((name_len == sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1 && ++ !memcmp(name, XATTR_NAME_POSIX_ACL_ACCESS, ++ sizeof(XATTR_NAME_POSIX_ACL_ACCESS))) || ++ (name_len == sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) - 1 && ++ !memcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT, ++ sizeof(XATTR_NAME_POSIX_ACL_DEFAULT)))) { ++ /* TODO: init_user_ns? */ ++ err = ntfs_xattr_get_acl( ++ &init_user_ns, inode, ++ name_len == sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1 ++ ? ACL_TYPE_ACCESS ++ : ACL_TYPE_DEFAULT, ++ buffer, size); ++ goto out; ++ } ++#endif + /* Deal with NTFS extended attribute. */ + err = ntfs_get_ea(inode, name, name_len, buffer, size, NULL); + +@@ -897,6 +975,22 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler, + goto out; + } + ++#ifdef CONFIG_NTFS3_FS_POSIX_ACL ++ if ((name_len == sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1 && ++ !memcmp(name, XATTR_NAME_POSIX_ACL_ACCESS, ++ sizeof(XATTR_NAME_POSIX_ACL_ACCESS))) || ++ (name_len == sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) - 1 && ++ !memcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT, ++ sizeof(XATTR_NAME_POSIX_ACL_DEFAULT)))) { ++ err = ntfs_xattr_set_acl( ++ mnt_userns, inode, ++ name_len == sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1 ++ ? ACL_TYPE_ACCESS ++ : ACL_TYPE_DEFAULT, ++ value, size); ++ goto out; ++ } ++#endif + /* Deal with NTFS extended attribute. */ + err = ntfs_set_ea(inode, name, name_len, value, size, flags); + +-- +2.25.1 + +From 2d44667c306e7806848a3478820f87343feb5421 Mon Sep 17 00:00:00 2001 +From: Konstantin Komarov +Date: Fri, 22 Oct 2021 18:35:43 +0300 +Subject: [PATCH 4/9] fs/ntfs3: Update i_ctime when xattr is added + +Ctime wasn't updated after setfacl command. +This commit fixes xfstest generic/307 +Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations") + +Signed-off-by: Konstantin Komarov +--- + fs/ntfs3/xattr.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c +index 56e774d0f56a..af818300493d 100644 +--- a/fs/ntfs3/xattr.c ++++ b/fs/ntfs3/xattr.c +@@ -995,6 +995,9 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler, + err = ntfs_set_ea(inode, name, name_len, value, size, flags); + + out: ++ inode->i_ctime = current_time(inode); ++ mark_inode_dirty(inode); ++ + return err; + } + +-- +2.25.1 + +From 3a2154b25a9f461a1848371b3e8f6f316434ae1f Mon Sep 17 00:00:00 2001 +From: Konstantin Komarov +Date: Fri, 22 Oct 2021 18:30:22 +0300 +Subject: [PATCH 5/9] fs/ntfs3: Optimize locking in ntfs_save_wsl_perm + +Right now in ntfs_save_wsl_perm we lock/unlock 4 times. +This commit fixes this situation. +We add "locked" argument to ntfs_set_ea. + +Suggested-by: Kari Argillander +Reviewed-by: Kari Argillander +Signed-off-by: Konstantin Komarov +--- + fs/ntfs3/xattr.c | 24 ++++++++++++++---------- + 1 file changed, 14 insertions(+), 10 deletions(-) + +diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c +index af818300493d..94a277615b62 100644 +--- a/fs/ntfs3/xattr.c ++++ b/fs/ntfs3/xattr.c +@@ -259,7 +259,7 @@ static int ntfs_get_ea(struct inode *inode, const char *name, size_t name_len, + + static noinline int ntfs_set_ea(struct inode *inode, const char *name, + size_t name_len, const void *value, +- size_t val_size, int flags) ++ size_t val_size, int flags, bool locked) + { + struct ntfs_inode *ni = ntfs_i(inode); + struct ntfs_sb_info *sbi = ni->mi.sbi; +@@ -278,7 +278,8 @@ static noinline int ntfs_set_ea(struct inode *inode, const char *name, + u64 new_sz; + void *p; + +- ni_lock(ni); ++ if (!locked) ++ ni_lock(ni); + + run_init(&ea_run); + +@@ -467,7 +468,8 @@ static noinline int ntfs_set_ea(struct inode *inode, const char *name, + mark_inode_dirty(&ni->vfs_inode); + + out: +- ni_unlock(ni); ++ if (!locked) ++ ni_unlock(ni); + + run_close(&ea_run); + kfree(ea_all); +@@ -598,7 +600,7 @@ static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_userns, + flags = 0; + } + +- err = ntfs_set_ea(inode, name, name_len, value, size, flags); ++ err = ntfs_set_ea(inode, name, name_len, value, size, flags, 0); + if (err == -ENODATA && !size) + err = 0; /* Removing non existed xattr. */ + if (!err) +@@ -992,7 +994,7 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler, + } + #endif + /* Deal with NTFS extended attribute. */ +- err = ntfs_set_ea(inode, name, name_len, value, size, flags); ++ err = ntfs_set_ea(inode, name, name_len, value, size, flags, 0); + + out: + inode->i_ctime = current_time(inode); +@@ -1010,35 +1012,37 @@ int ntfs_save_wsl_perm(struct inode *inode) + { + int err; + __le32 value; ++ struct ntfs_inode *ni = ntfs_i(inode); + +- /* TODO: refactor this, so we don't lock 4 times in ntfs_set_ea */ ++ ni_lock(ni); + value = cpu_to_le32(i_uid_read(inode)); + err = ntfs_set_ea(inode, "$LXUID", sizeof("$LXUID") - 1, &value, +- sizeof(value), 0); ++ sizeof(value), 0, true); /* true == already locked. */ + if (err) + goto out; + + value = cpu_to_le32(i_gid_read(inode)); + err = ntfs_set_ea(inode, "$LXGID", sizeof("$LXGID") - 1, &value, +- sizeof(value), 0); ++ sizeof(value), 0, true); + if (err) + goto out; + + value = cpu_to_le32(inode->i_mode); + err = ntfs_set_ea(inode, "$LXMOD", sizeof("$LXMOD") - 1, &value, +- sizeof(value), 0); ++ sizeof(value), 0, true); + if (err) + goto out; + + if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) { + value = cpu_to_le32(inode->i_rdev); + err = ntfs_set_ea(inode, "$LXDEV", sizeof("$LXDEV") - 1, &value, +- sizeof(value), 0); ++ sizeof(value), 0, true); + if (err) + goto out; + } + + out: ++ ni_unlock(ni); + /* In case of error should we delete all WSL xattr? */ + return err; + } +-- +2.25.1 + +From 9186d472ee780fabf74424756c4c00545166157e Mon Sep 17 00:00:00 2001 +From: Konstantin Komarov +Date: Wed, 24 Nov 2021 15:08:19 +0300 +Subject: [PATCH 6/9] fs/ntfs3: In function ntfs_set_acl_ex do not change + inode->i_mode if called from function ntfs_init_acl + +ntfs_init_acl sets mode. ntfs_init_acl calls ntfs_set_acl_ex. +ntfs_set_acl_ex must not change this mode. +Fixes xfstest generic/444 +Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations") + +Reviewed-by: Joe Perches +Signed-off-by: Konstantin Komarov +--- + fs/ntfs3/xattr.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c +index 94a277615b62..5e0e0280e70d 100644 +--- a/fs/ntfs3/xattr.c ++++ b/fs/ntfs3/xattr.c +@@ -543,7 +543,7 @@ struct posix_acl *ntfs_get_acl(struct inode *inode, int type, bool rcu) + + static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_userns, + struct inode *inode, struct posix_acl *acl, +- int type) ++ int type, bool init_acl) + { + const char *name; + size_t size, name_len; +@@ -556,8 +556,9 @@ static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_userns, + + switch (type) { + case ACL_TYPE_ACCESS: +- if (acl) { +- umode_t mode = inode->i_mode; ++ /* Do not change i_mode if we are in init_acl */ ++ if (acl && !init_acl) { ++ umode_t mode; + + err = posix_acl_update_mode(mnt_userns, inode, &mode, + &acl); +@@ -618,7 +619,7 @@ static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_userns, + int ntfs_set_acl(struct user_namespace *mnt_userns, struct inode *inode, + struct posix_acl *acl, int type) + { +- return ntfs_set_acl_ex(mnt_userns, inode, acl, type); ++ return ntfs_set_acl_ex(mnt_userns, inode, acl, type, false); + } + + static int ntfs_xattr_get_acl(struct user_namespace *mnt_userns, +@@ -699,7 +700,7 @@ int ntfs_init_acl(struct user_namespace *mnt_userns, struct inode *inode, + + if (default_acl) { + err = ntfs_set_acl_ex(mnt_userns, inode, default_acl, +- ACL_TYPE_DEFAULT); ++ ACL_TYPE_DEFAULT, true); + posix_acl_release(default_acl); + } else { + inode->i_default_acl = NULL; +@@ -710,7 +711,7 @@ int ntfs_init_acl(struct user_namespace *mnt_userns, struct inode *inode, + else { + if (!err) + err = ntfs_set_acl_ex(mnt_userns, inode, acl, +- ACL_TYPE_ACCESS); ++ ACL_TYPE_ACCESS, true); + posix_acl_release(acl); + } + +-- +2.25.1 + +From 3880f2b816a7e4ca889b7e8a42e6c62c5706ed36 Mon Sep 17 00:00:00 2001 +From: Konstantin Komarov +Date: Mon, 25 Oct 2021 18:31:28 +0300 +Subject: [PATCH 7/9] fs/ntfs3: Fix fiemap + fix shrink file size (to remove + preallocated space) + +Two problems: +1. ntfs3_setattr can't truncate preallocated space; +2. if allocated fragment "cross" valid size, then fragment splits into two parts: +- normal part; +- unwritten part (here we must return FIEMAP_EXTENT_LAST). +Before this commit we returned FIEMAP_EXTENT_LAST for whole fragment. +Fixes xfstest generic/092 +Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") + +Signed-off-by: Konstantin Komarov +--- + fs/ntfs3/file.c | 2 +- + fs/ntfs3/frecord.c | 10 +++++++--- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c +index 3ac0482c6880..6242708980d0 100644 +--- a/fs/ntfs3/file.c ++++ b/fs/ntfs3/file.c +@@ -761,7 +761,7 @@ int ntfs3_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, + } + inode_dio_wait(inode); + +- if (attr->ia_size < oldsize) ++ if (attr->ia_size <= oldsize) + err = ntfs_truncate(inode, attr->ia_size); + else if (attr->ia_size > oldsize) + err = ntfs_extend(inode, attr->ia_size, 0, NULL); +diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c +index 6f47a9c17f89..18842998c8fa 100644 +--- a/fs/ntfs3/frecord.c ++++ b/fs/ntfs3/frecord.c +@@ -1964,10 +1964,8 @@ int ni_fiemap(struct ntfs_inode *ni, struct fiemap_extent_info *fieinfo, + + vcn += clen; + +- if (vbo + bytes >= end) { ++ if (vbo + bytes >= end) + bytes = end - vbo; +- flags |= FIEMAP_EXTENT_LAST; +- } + + if (vbo + bytes <= valid) { + ; +@@ -1977,6 +1975,9 @@ int ni_fiemap(struct ntfs_inode *ni, struct fiemap_extent_info *fieinfo, + /* vbo < valid && valid < vbo + bytes */ + u64 dlen = valid - vbo; + ++ if (vbo + dlen >= end) ++ flags |= FIEMAP_EXTENT_LAST; ++ + err = fiemap_fill_next_extent(fieinfo, vbo, lbo, dlen, + flags); + if (err < 0) +@@ -1995,6 +1996,9 @@ int ni_fiemap(struct ntfs_inode *ni, struct fiemap_extent_info *fieinfo, + flags |= FIEMAP_EXTENT_UNWRITTEN; + } + ++ if (vbo + bytes >= end) ++ flags |= FIEMAP_EXTENT_LAST; ++ + err = fiemap_fill_next_extent(fieinfo, vbo, lbo, bytes, flags); + if (err < 0) + break; +-- +2.25.1 + +From 114346978cf61de02832cc3cc68432a3de70fb38 Mon Sep 17 00:00:00 2001 +From: Konstantin Komarov +Date: Mon, 25 Oct 2021 18:34:06 +0300 +Subject: [PATCH 8/9] fs/ntfs3: Check new size for limits + +We must check size before trying to allocate. +Size can be set for example by "ulimit -f". +Fixes xfstest generic/228 +Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") + +Reviewed-by: Kari Argillander +Signed-off-by: Konstantin Komarov +--- + fs/ntfs3/file.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c +index 6242708980d0..f8360f9bfaf0 100644 +--- a/fs/ntfs3/file.c ++++ b/fs/ntfs3/file.c +@@ -661,7 +661,13 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len) + /* + * Normal file: Allocate clusters, do not change 'valid' size. + */ +- err = ntfs_set_size(inode, max(end, i_size)); ++ loff_t new_size = max(end, i_size); ++ ++ err = inode_newsize_ok(inode, new_size); ++ if (err) ++ goto out; ++ ++ err = ntfs_set_size(inode, new_size); + if (err) + goto out; + +-- +2.25.1 + +From 52e00ea6b26e45fb8159e3b57cdde8d3f9bdd8e9 Mon Sep 17 00:00:00 2001 +From: Konstantin Komarov +Date: Mon, 25 Oct 2021 18:48:38 +0300 +Subject: [PATCH 9/9] fs/ntfs3: Update valid size if -EIOCBQUEUED + +Update valid size if write is still in I/O queue. +Fixes xfstest generic/240 +Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") + +Signed-off-by: Konstantin Komarov +--- + fs/ntfs3/inode.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c +index 859951d785cb..879952254071 100644 +--- a/fs/ntfs3/inode.c ++++ b/fs/ntfs3/inode.c +@@ -757,6 +757,7 @@ static ssize_t ntfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter) + loff_t vbo = iocb->ki_pos; + loff_t end; + int wr = iov_iter_rw(iter) & WRITE; ++ size_t iter_count = iov_iter_count(iter); + loff_t valid; + ssize_t ret; + +@@ -770,10 +771,13 @@ static ssize_t ntfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter) + wr ? ntfs_get_block_direct_IO_W + : ntfs_get_block_direct_IO_R); + +- if (ret <= 0) ++ if (ret > 0) ++ end = vbo + ret; ++ else if (wr && ret == -EIOCBQUEUED) ++ end = vbo + iter_count; ++ else + goto out; + +- end = vbo + ret; + valid = ni->i_valid; + if (wr) { + if (end > valid && !S_ISBLK(inode->i_mode)) { +-- +2.25.1 + From f6e648aad8c5725f22a60fd6ffded6e7cdd33566 Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sat, 27 Nov 2021 10:17:41 +0000 Subject: [PATCH 18/18] ntfs-3g_ntfsprogs: drop package --- config/show_config | 1 - .../sysutils/ntfs-3g_ntfsprogs/package.mk | 42 ------------------- packages/virtual/image/package.mk | 3 -- 3 files changed, 46 deletions(-) delete mode 100644 packages/sysutils/ntfs-3g_ntfsprogs/package.mk diff --git a/config/show_config b/config/show_config index 374aa67b36..f9c2fca0ce 100644 --- a/config/show_config +++ b/config/show_config @@ -68,7 +68,6 @@ show_config() { if [ "${SWAP_SUPPORT}" = "yes" ]; then config_message+="\n - Swapfile default size:\t\t ${SWAPFILESIZE}" fi - config_message+="\n - NTFS Support (via Fuse):\t\t ${NTFS3G}" config_message+="\n - Install HFS Tools:\t\t\t ${HFSTOOLS}" # Network service configuration diff --git a/packages/sysutils/ntfs-3g_ntfsprogs/package.mk b/packages/sysutils/ntfs-3g_ntfsprogs/package.mk deleted file mode 100644 index dee9595d5f..0000000000 --- a/packages/sysutils/ntfs-3g_ntfsprogs/package.mk +++ /dev/null @@ -1,42 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) -# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) - -PKG_NAME="ntfs-3g_ntfsprogs" -PKG_VERSION="2021.8.22" -PKG_SHA256="55b883aa05d94b2ec746ef3966cb41e66bed6db99f22ddd41d1b8b94bb202efb" -PKG_LICENSE="GPL" -PKG_SITE="https://github.com/tuxera/ntfs-3g" -PKG_URL="https://tuxera.com/opensource/${PKG_NAME}-${PKG_VERSION}.tgz" -PKG_DEPENDS_TARGET="toolchain fuse libgcrypt" -PKG_LONGDESC="A NTFS driver with read and write support." -PKG_TOOLCHAIN="autotools" -PKG_BUILD_FLAGS="+lto" - -PKG_CONFIGURE_OPTS_TARGET="--exec-prefix=/usr/ \ - --disable-dependency-tracking \ - --disable-library \ - --enable-posix-acls \ - --enable-mtab \ - --enable-ntfsprogs \ - --disable-crypto \ - --with-fuse=external \ - --with-uuid" - -post_makeinstall_target() { - # dont include ntfsprogs. - for i in ${INSTALL}/usr/bin/*; do - if [ "$(basename ${i})" != "ntfs-3g" ]; then - rm ${i} - fi - done - - rm -rf ${INSTALL}/sbin - rm -rf ${INSTALL}/usr/sbin/ntfsclone - rm -rf ${INSTALL}/usr/sbin/ntfscp - rm -rf ${INSTALL}/usr/sbin/ntfsundelete - - mkdir -p ${INSTALL}/usr/sbin - ln -sf /usr/bin/ntfs-3g ${INSTALL}/usr/sbin/mount.ntfs - ln -sf /usr/sbin/mkntfs ${INSTALL}/usr/sbin/mkfs.ntfs -} diff --git a/packages/virtual/image/package.mk b/packages/virtual/image/package.mk index 5c2ea09af8..8888a25bb6 100644 --- a/packages/virtual/image/package.mk +++ b/packages/virtual/image/package.mk @@ -23,9 +23,6 @@ PKG_LONGDESC="Root package used to build and create complete image" # HFS filesystem tools [ "${HFSTOOLS}" = "yes" ] && PKG_DEPENDS_TARGET+=" diskdev_cmds" -# NTFS 3G support -[ "${NTFS3G}" = "yes" ] && PKG_DEPENDS_TARGET+=" ntfs-3g_ntfsprogs" - # Remote support [ "${REMOTE_SUPPORT}" = "yes" ] && PKG_DEPENDS_TARGET+=" remote"