fs/exfat: build exfat lib as DLKM

Build exfat lib as exfat.ko.

Change-Id: I653e944607f0d05e6f5ff8af4743291567d824c3
Signed-off-by: Shiyong Li <a22381@motorola.com>
Reviewed-on: https://gerrit.mot.com/1102175
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Shiyong Li 2017-12-08 11:32:14 -08:00 • committed by Shi-Yong Li
commit 89b6111d7d
3 changed files with 20 additions and 50 deletions

8
fs/exfat/Android.mk Normal file
View file

@ -0,0 +1,8 @@
DLKM_DIR := motorola/kernel/modules
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := exfat.ko
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
include $(DLKM_DIR)/AndroidKernelModule.mk

6
fs/exfat/Kbuild Normal file
View file

@ -0,0 +1,6 @@
# add -Wall to try to catch everything we can.
EXTRA_CFLAGS += -Wall
exfat-y := exfat_core.o exfat_super.o exfat_api.o exfat_blkdev.o exfat_cache.o \
exfat_data.o exfat_bitmap.o exfat_nls.o exfat_oal.o exfat_upcase.o
obj-m += exfat.o

View file

@ -1,54 +1,10 @@
#
# Makefile for Linux FAT12/FAT16/FAT32(VFAT)/FAT64(ExFAT) filesystem driver.
#
ifneq ($(KERNELRELEASE),)
# call from kernel build system
obj-$(CONFIG_EXFAT_FS) += exfat.o
exfat-objs := exfat_core.o exfat_super.o exfat_api.o exfat_blkdev.o exfat_cache.o \
exfat_data.o exfat_bitmap.o exfat_nls.o exfat_oal.o exfat_upcase.o
else
# external module build
EXTRA_FLAGS += -I$(PWD)
#
# KDIR is a path to a directory containing kernel source.
# It can be specified on the command line passed to make to enable the module to
# be built and installed for a kernel other than the one currently running.
# By default it is the path to the symbolic link created when
# the current kernel's modules were installed, but
# any valid path to the directory in which the target kernel's source is located
# can be provided on the command line.
#
KDIR ?= /lib/modules/$(shell uname -r)/build
MDIR ?= /lib/modules/$(shell uname -r)
PWD := $(shell pwd)
PWD := $(shell pwd)
export CONFIG_EXFAT_FS := m
KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
$(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
modules_install:
$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
help:
$(MAKE) -C $(KDIR) M=$(PWD) help
install: exfat.ko
rm -f ${MDIR}/kernel/fs/exfat/exfat.ko
install -m644 -b -D exfat.ko ${MDIR}/kernel/fs/exfat/exfat.ko
depmod -aq
uninstall:
rm -rf ${MDIR}/kernel/fs/exfat
depmod -aq
endif
.PHONY : all clean install uninstall
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean