From bb74cf4e9bdc6b5f864b7e7e8a1b4e4c1f388209 Mon Sep 17 00:00:00 2001 From: Daniel Engberg Date: Fri, 8 Jun 2018 10:00:28 +0200 Subject: [PATCH] kernel-sdfat: Add to repo Add kernel-sdfat to repo Patch adapted from https://github.com/cryptomilk/kernel-sdfat/issues/4 Updated/Successor to exfat-nofuse module Signed-off-by: Daniel Engberg --- kernel/kernel-sdfat/Makefile | 49 +++++++++++++++++++ .../kernel-sdfat/patches/001-module-fix.patch | 20 ++++++++ 2 files changed, 69 insertions(+) create mode 100644 kernel/kernel-sdfat/Makefile create mode 100644 kernel/kernel-sdfat/patches/001-module-fix.patch diff --git a/kernel/kernel-sdfat/Makefile b/kernel/kernel-sdfat/Makefile new file mode 100644 index 00000000000000..ab3e68ec3c32d5 --- /dev/null +++ b/kernel/kernel-sdfat/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2018 Daniel Engberg +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=kernel-sdfat +PKG_VERSION:=20180522 +PKG_RELEASE:=1 +PKG_MAINTAINER:= +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=LICENSE + +PKG_SOURCE_URL:=https://codeload.github.com/cryptomilk/$(PKG_NAME)/tar.gz/aa8183f?dummy=/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=17e171bd9d6cdcb617d2e92ec8c06c308108e61fdf6ff70bcb1335b59d4d2c44 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-aa8183f + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/fs-sdfat + SUBMENU:=Filesystems + TITLE:=sdFAT kernel driver + FILES:=$(PKG_BUILD_DIR)/sdfat_fs.ko + AUTOLOAD:=$(call AutoLoad,30,sdfat_fs,1) + DEPENDS:=+kmod-nls-base +kmod-nls-utf8 +kmod-nls-cp437 +kmod-nls-iso8859-1 @BUILD_PATENTED +endef + +define KernelPackage/fs-sdfat/description + Kernel module for FAT12/16/32/VFAT and exFAT filesytems +endef + +MAKE_OPTS:= \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + M="$(PKG_BUILD_DIR)" + +define Build/Compile + $(MAKE) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + CONFIG_SDFAT_FS=m \ + modules +endef + +$(eval $(call KernelPackage,fs-sdfat)) diff --git a/kernel/kernel-sdfat/patches/001-module-fix.patch b/kernel/kernel-sdfat/patches/001-module-fix.patch new file mode 100644 index 00000000000000..7a22e8d5b0b66c --- /dev/null +++ b/kernel/kernel-sdfat/patches/001-module-fix.patch @@ -0,0 +1,20 @@ +diff --git a/blkdev.c b/blkdev.c +index 264c670..046f688 100644 +--- a/blkdev.c ++++ b/blkdev.c +@@ -118,8 +118,14 @@ s32 bdev_readahead(struct super_block *sb, u64 secno, u64 num_secs) + + blk_start_plug(&plug); + for (i = 0; i < num_secs; i++) { +- if (i && !(i & (sects_per_page - 1))) ++ if (i && !(i & (sects_per_page - 1))) { ++#ifdef MODULE ++ blk_finish_plug(&plug); ++ blk_start_plug(&plug); ++#else + blk_flush_plug(current); ++#endif ++ } + sb_breadahead(sb, (sector_t)(secno + i)); + } + blk_finish_plug(&plug);