commit 36ebbd09837da7f25efa8bbdfea3842885c30d31 Author: shadichy Date: Thu Oct 23 02:01:48 2025 +0700 Initial Signed-off-by: shadichy diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..2127085892d5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,36 @@ +pkgbase = ntfsplus-dkms-git + pkgdesc = A new NTFS driver for Linux promised to be better than NTFS3. These patches are directly taken from the maintainer's mailing list posts. Backported to 6.17. + pkgver = 2025.10.20.r20.c8a1f11f2 + pkgrel = 1 + epoch = 1 + url = https://lore.kernel.org/all/20251020021227.5965-6-linkinjeon@kernel.org + arch = any + license = GPL-2.0-only + makedepends = git + provides = ntfsplus + provides = NTFSPLUS-MODULE + conflicts = ntfsplus + options = !strip + options = !emptydirs + source = linux::shallowclone+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git + source = 00-05.mbox.gz::https://lore.kernel.org/all/20251020020749.5522-1-linkinjeon@kernel.org/t.mbox.gz + source = 06-11.mbox.gz::https://lore.kernel.org/all/20251020021227.5965-6-linkinjeon@kernel.org/t.mbox.gz + source = 0001-fs-ntfsplus-inode.c-Resolve-import-for-inode_generic.patch + source = 0001-fs-ntfsplus-Makefile-DKMS-patch.patch + source = dkms.conf + source = 90-udev-prefer-ntfsplus.rules + sha256sums = SKIP + sha256sums = 00415c42fa5809da14b84a2ecc6623e3e859fa803dfa7bdfa407a83d21d9b744 + sha256sums = bede30ed663dada47c946f74a314b8e25817c4cd8b6c39e0cd5810bbd1cddca2 + sha256sums = 6e65520477bf80c9ac76cfc49e2e65eba0d63f1c846d1876c1874bdf2ac24a6c + sha256sums = e217fa145f507b1e07e228e746528554f705f44fd5744f293b302b29df764b96 + sha256sums = ed9db8ec0caa09c977529c7ae89b808ee8c238331ec0fdf873525c115fcdfb7c + sha256sums = e3866cac3d71da15740159c89b233d4d1f61981dbf737d4e3bc9a4c56bfa24be + +pkgname = ntfsplus-dkms-git + pkgdesc = DKMS module for ntfsplus (A new NTFS driver for Linux promised to be better than NTFS3.) + depends = dkms + +pkgname = ntfsplus-udev + pkgdesc = udev rules for ntfsplus + depends = udev diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..c8cc03779669 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Sources +linux.part/ +linux/ +*.gz + +# Download agent +DLAGENTS + +# Build directories +src/ +pkg/ + +# Build artifacts +*.pkg.tar* + +# Editor +.vscode/ diff --git a/0001-fs-ntfsplus-Makefile-DKMS-patch.patch b/0001-fs-ntfsplus-Makefile-DKMS-patch.patch new file mode 100644 index 000000000000..24140a6b31fd --- /dev/null +++ b/0001-fs-ntfsplus-Makefile-DKMS-patch.patch @@ -0,0 +1,32 @@ +From 06fb2343f2c0e4540b60a0e5ed84d6754d877b46 Mon Sep 17 00:00:00 2001 +From: shadichy +Date: Thu, 23 Oct 2025 00:04:34 +0700 +Subject: [PATCH] fs/ntfsplus/Makefile: DKMS patch + +--- + fs/ntfsplus/Makefile | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/fs/ntfsplus/Makefile b/fs/ntfsplus/Makefile +index 1e7e830db..84f208ce1 100644 +--- a/fs/ntfsplus/Makefile ++++ b/fs/ntfsplus/Makefile +@@ -16,3 +16,15 @@ ntfsplus-y := aops.o attrib.o collate.o misc.o dir.o file.o index.o inode.o \ + ntfs_iomap.o + + ccflags-$(CONFIG_NTFSPLUS_DEBUG) += -DDEBUG ++ ++ccflags-$(CONFIG_NTFSPLUS_FS_POSIX_ACL) += -DCONFIG_NTFSPLUS_FS_POSIX_ACL ++ ++KERNEL_SRC ?= /lib/modules/$(KVERSION)/build ++ ++ccflags-y += -I$(PWD)/include ++ ++all: ++ make -C $(KERNEL_SRC) M=$(PWD) modules ++ ++clean: ++ make -C $(KERNEL_SRC) M=$(PWD) clean +-- +2.51.0 + diff --git a/0001-fs-ntfsplus-inode.c-Resolve-import-for-inode_generic.patch b/0001-fs-ntfsplus-inode.c-Resolve-import-for-inode_generic.patch new file mode 100644 index 000000000000..cc25ad70af73 --- /dev/null +++ b/0001-fs-ntfsplus-inode.c-Resolve-import-for-inode_generic.patch @@ -0,0 +1,30 @@ +From d2ba1de6dfcda1ce56b700b1b6853231860c448b Mon Sep 17 00:00:00 2001 +From: shadichy +Date: Thu, 23 Oct 2025 01:19:10 +0700 +Subject: [PATCH] fs/ntfsplus/inode.c: Resolve import for inode_generic_drop + (temporarily) for kernels older than 6.18 + +--- + fs/ntfsplus/inode.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/fs/ntfsplus/inode.c b/fs/ntfsplus/inode.c +index 2b8e0d67c..28925d204 100644 +--- a/fs/ntfsplus/inode.c ++++ b/fs/ntfsplus/inode.c +@@ -9,6 +9,12 @@ + #include + #include + ++// Replace inode_generic_drop with generic_drop_inode ++// for backward compatibility with pre 6.18 kernels ++#ifndef inode_generic_drop ++#define inode_generic_drop generic_drop_inode ++#endif ++ + #include "lcnalloc.h" + #include "misc.h" + #include "ntfs.h" +-- +2.51.0 + diff --git a/90-udev-prefer-ntfsplus.rules b/90-udev-prefer-ntfsplus.rules new file mode 100644 index 000000000000..fb96b60a4743 --- /dev/null +++ b/90-udev-prefer-ntfsplus.rules @@ -0,0 +1 @@ +SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="ntfs", ENV{ID_FS_TYPE}="ntfsplus" \ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..43f861819264 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,133 @@ +# shellcheck shell=bash +# AUR Maintainer: Shadichy + +pkgbase=ntfsplus-dkms-git +pkgname=("$pkgbase" "ntfsplus-udev") +pkgver=2025.10.20.r20.c8a1f11f2 +pkgrel=1 +epoch=1 +pkgdesc="A new NTFS driver for Linux promised to be better than NTFS3. These patches are directly taken from the maintainer's mailing list posts. Backported to 6.17." +arch=('any') +url="https://lore.kernel.org/all/20251020021227.5965-6-linkinjeon@kernel.org" +license=('GPL-2.0-only') +makedepends=('git') +provides=('ntfsplus' 'NTFSPLUS-MODULE') +conflicts=('ntfsplus') +options=('!strip' '!emptydirs') + +# Using custom download agent to shallow clone the repo +cat <<'EOF' >DLAGENTS +#!/bin/sh + +ORIGIN=${1#shallowclone+} +DEST=${2} +REAL_DEST=${DEST%.part} + +# Verify if destination already exists and is a valid git repository with the correct remote URL + +verify_dest() { + local dest=$1 current_url + if [ -d "${dest}/.git" ]; then + cd "${dest}" + current_url=$(git config --get remote.origin.url) + if [ "${current_url}" = "${ORIGIN}" ]; then + git fetch --depth 1 + git reset --hard FETCH_HEAD + exit 0 + fi + fi +} + +verify_dest "${DEST}" +verify_dest "${REAL_DEST}" + +# If not, perform a fresh shallow clone +rm -rf "${DEST}" +git clone --depth 1 --branch master --single-branch --no-tags "${ORIGIN}" "${DEST}" + +echo ${REAL_DEST} +EOF +chmod +x DLAGENTS +export DLAGENTS="shallowclone::$(realpath "./DLAGENTS") %u %o" + +source=( + 'linux::shallowclone+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git' + '00-05.mbox.gz::https://lore.kernel.org/all/20251020020749.5522-1-linkinjeon@kernel.org/t.mbox.gz' + '06-11.mbox.gz::https://lore.kernel.org/all/20251020021227.5965-6-linkinjeon@kernel.org/t.mbox.gz' + '0001-fs-ntfsplus-inode.c-Resolve-import-for-inode_generic.patch' + '0001-fs-ntfsplus-Makefile-DKMS-patch.patch' + 'dkms.conf' + '90-udev-prefer-ntfsplus.rules' +) +sha256sums=( + SKIP + 00415c42fa5809da14b84a2ecc6623e3e859fa803dfa7bdfa407a83d21d9b744 + bede30ed663dada47c946f74a314b8e25817c4cd8b6c39e0cd5810bbd1cddca2 + 6e65520477bf80c9ac76cfc49e2e65eba0d63f1c846d1876c1874bdf2ac24a6c + e217fa145f507b1e07e228e746528554f705f44fd5744f293b302b29df764b96 + ed9db8ec0caa09c977529c7ae89b808ee8c238331ec0fdf873525c115fcdfb7c + e3866cac3d71da15740159c89b233d4d1f61981dbf737d4e3bc9a4c56bfa24be +) + +_mailbox_last_date= + +prepare() { + if [ ! -e "$srcdir/linux" ]; then + ln -s ../linux "$srcdir/linux" + fi + + cd "$srcdir/linux" + + # Apply the ntfsplus patches from the mailing list + git am --empty=keep "$srcdir/00-05.mbox" "$srcdir/06-11.mbox" + _mailbox_last_date=$(git log -1 --format='%ad' --date=iso-strict) + + # Apply the inode.c import fix patch + git apply "$srcdir/0001-fs-ntfsplus-inode.c-Resolve-import-for-inode_generic.patch" + + # Apply the dkms Makefile patch + patch -p1 <"$srcdir/0001-fs-ntfsplus-Makefile-DKMS-patch.patch" +} + +pkgver() { + cd "$srcdir/linux" + + # Version format: YYYY.MM.DD.r. + # with date from _mailbox_last_date + local commit_count commit_sha + commit_count=$(git rev-list --count ORIG_HEAD..HEAD) + commit_sha=$(git rev-parse --short HEAD) + date +'%Y.%m.%d.r'"${commit_count}"'.'"${commit_sha}" -d "$_mailbox_last_date" +} + +build() { + cd "$srcdir" + + sed -i "s/@PKGVER@/${pkgver}/" dkms.conf +} + +package_ntfsplus-dkms-git() { + pkgdesc="DKMS module for ntfsplus (A new NTFS driver for Linux promised to be better than NTFS3.)" + depends=('dkms') + opdepends+=( + 'ntfsprogs-plus: Recommended NTFS utilities' + 'ntfsplus-udev: udev rules for ntfsplus' + ) + + cd "$srcdir" + + local dest="$pkgdir/usr/src/ntfsplus-${pkgver}" + install -Dm644 "$(readlink -f dkms.conf)" "$dest/dkms.conf" + cp -rpT "$srcdir/linux/fs/ntfsplus" "$dest" + install -Dm644 "$srcdir/linux/include/uapi/linux/ntfs.h" "$dest/include/uapi/linux/ntfs.h" +} + +package_ntfsplus-udev() { + pkgdesc="udev rules for ntfsplus" + depends=('udev') + + cd "$srcdir" + + local rule='90-udev-prefer-ntfsplus.rules' + install -Dm644 "$(readlink -f "$rule")" "$pkgdir/usr/lib/udev/rules.d/$rule" +} diff --git a/dkms.conf b/dkms.conf new file mode 100644 index 000000000000..b5bdd4b068f5 --- /dev/null +++ b/dkms.conf @@ -0,0 +1,9 @@ +PACKAGE_NAME="ntfsplus" +PACKAGE_VERSION="@PKGVER@" + +BUILT_MODULE_NAME[0]="ntfsplus" +DEST_MODULE_LOCATION[0]="/extra" + +AUTOINSTALL="yes" + +MAKE[0]="KVERSION=${kernelver} CONFIG_NTFSPLUS_FS=m CONFIG_NTFSPLUS_FS_POSIX_ACL=y make KDIR=${kernel_source_dir}" diff --git a/linux.src b/linux.src new file mode 160000 index 000000000000..dd72c8fcf6d3 --- /dev/null +++ b/linux.src @@ -0,0 +1 @@ +Subproject commit dd72c8fcf6d35de5d6d976f20dc1ae84ce7af08b