未验证 提交 7f57e11e 编写于 作者: O openharmony_ci 提交者: Gitee

!881 修改jffs2引用路径

Merge pull request !881 from xuxinyu/master
......@@ -33,6 +33,7 @@ group("fs") {
deps = [
"fat",
"fat/virpart",
"jffs2",
"nfs",
"patchfs",
"proc",
......
......@@ -31,19 +31,86 @@ import("//kernel/liteos_a/liteos.gni")
module_switch = defined(LOSCFG_FS_JFFS)
module_name = get_path_info(rebase_path("."), "name")
linux_path = rebase_path("//kernel/linux/linux-5.10")
out_path = rebase_path(target_out_dir)
kernel_module(module_name) {
patch_path = rebase_path(".")
cmd = "if [ -d ${out_path}/jffs2_build ]; then rm -r ${out_path}/jffs2_build; fi && mkdir -p ${out_path}/jffs2_build/fs"
cmd += " && cp ${linux_path}/fs/jffs2 ${out_path}/jffs2_build/fs/. -r"
cmd += " && pushd ${out_path}/jffs2_build/"
cmd += " && patch -p1 < ${patch_path}/jffs2.patch && popd"
exec_script("//build/lite/run_shell_cmd.py", [ cmd ])
sources = [
"src/jffs2_hash.c",
"src/vfs_jffs2.c",
]
sources += LINUX_KERNEL_FS_JFFS2_SRC_FILES
sources += [
"${out_path}/jffs2_build/fs/jffs2/background.c",
"${out_path}/jffs2_build/fs/jffs2/build.c",
"${out_path}/jffs2_build/fs/jffs2/compr.c",
"${out_path}/jffs2_build/fs/jffs2/compr_rtime.c",
"${out_path}/jffs2_build/fs/jffs2/compr_rubin.c",
"${out_path}/jffs2_build/fs/jffs2/compr_zlib.c",
"${out_path}/jffs2_build/fs/jffs2/debug.c",
"${out_path}/jffs2_build/fs/jffs2/dir.c",
"${out_path}/jffs2_build/fs/jffs2/erase.c",
"${out_path}/jffs2_build/fs/jffs2/file.c",
"${out_path}/jffs2_build/fs/jffs2/fs.c",
"${out_path}/jffs2_build/fs/jffs2/gc.c",
"${out_path}/jffs2_build/fs/jffs2/malloc.c",
"${out_path}/jffs2_build/fs/jffs2/nodelist.c",
"${out_path}/jffs2_build/fs/jffs2/nodemgmt.c",
"${out_path}/jffs2_build/fs/jffs2/read.c",
"${out_path}/jffs2_build/fs/jffs2/readinode.c",
"${out_path}/jffs2_build/fs/jffs2/scan.c",
"${out_path}/jffs2_build/fs/jffs2/summary.c",
"${out_path}/jffs2_build/fs/jffs2/super.c",
"${out_path}/jffs2_build/fs/jffs2/write.c",
"${out_path}/jffs2_build/fs/jffs2/writev.c",
]
include_dirs = LINUX_KERNEL_FS_JFFS2_INCLUDE_DIRS
include_dirs = [
"${out_path}/jffs2_build/fs",
"${out_path}/jffs2_build/fs/jffs2",
]
public_configs = [ ":public" ]
deps = [ ":cp_jffs2_src" ]
}
config("public") {
include_dirs = [ "include" ]
}
action("cp_jffs2_src") {
script = "//build/lite/run_shell_cmd.py"
outputs = [
"${target_out_dir}/jffs2_build/fs/jffs2/background.c",
"${target_out_dir}/jffs2_build/fs/jffs2/build.c",
"${target_out_dir}/jffs2_build/fs/jffs2/compr.c",
"${target_out_dir}/jffs2_build/fs/jffs2/compr_rtime.c",
"${target_out_dir}/jffs2_build/fs/jffs2/compr_rubin.c",
"${target_out_dir}/jffs2_build/fs/jffs2/compr_zlib.c",
"${target_out_dir}/jffs2_build/fs/jffs2/debug.c",
"${target_out_dir}/jffs2_build/fs/jffs2/dir.c",
"${target_out_dir}/jffs2_build/fs/jffs2/erase.c",
"${target_out_dir}/jffs2_build/fs/jffs2/file.c",
"${target_out_dir}/jffs2_build/fs/jffs2/fs.c",
"${target_out_dir}/jffs2_build/fs/jffs2/gc.c",
"${target_out_dir}/jffs2_build/fs/jffs2/malloc.c",
"${target_out_dir}/jffs2_build/fs/jffs2/nodelist.c",
"${target_out_dir}/jffs2_build/fs/jffs2/nodemgmt.c",
"${target_out_dir}/jffs2_build/fs/jffs2/read.c",
"${target_out_dir}/jffs2_build/fs/jffs2/readinode.c",
"${target_out_dir}/jffs2_build/fs/jffs2/scan.c",
"${target_out_dir}/jffs2_build/fs/jffs2/summary.c",
"${target_out_dir}/jffs2_build/fs/jffs2/super.c",
"${target_out_dir}/jffs2_build/fs/jffs2/write.c",
"${target_out_dir}/jffs2_build/fs/jffs2/writev.c",
]
}
......@@ -31,13 +31,51 @@ include $(LITEOSTOPDIR)/config.mk
MODULE_NAME := $(notdir $(shell pwd))
LOCAL_SRCS := $(wildcard src/*.c) \
$(wildcard $(LITEOSTOPDIR)/../linux/linux-5.10/fs/jffs2/*.c)
LINUX_PATH := $(LITEOSTOPDIR)/../linux/linux-5.10
LOCAL_PATH := $(shell pwd)
TEMP_SRC_PATH := $(OUT)/jffs2_build
LOCAL_SRCS := \
$(TEMP_SRC_PATH)/fs/jffs2/background.c \
$(TEMP_SRC_PATH)/fs/jffs2/build.c \
$(TEMP_SRC_PATH)/fs/jffs2/compr.c \
$(TEMP_SRC_PATH)/fs/jffs2/compr_rtime.c \
$(TEMP_SRC_PATH)/fs/jffs2/compr_rubin.c \
$(TEMP_SRC_PATH)/fs/jffs2/compr_zlib.c \
$(TEMP_SRC_PATH)/fs/jffs2/debug.c \
$(TEMP_SRC_PATH)/fs/jffs2/dir.c \
$(TEMP_SRC_PATH)/fs/jffs2/erase.c \
$(TEMP_SRC_PATH)/fs/jffs2/file.c \
$(TEMP_SRC_PATH)/fs/jffs2/fs.c \
$(TEMP_SRC_PATH)/fs/jffs2/gc.c \
$(TEMP_SRC_PATH)/fs/jffs2/malloc.c \
$(TEMP_SRC_PATH)/fs/jffs2/nodelist.c \
$(TEMP_SRC_PATH)/fs/jffs2/nodemgmt.c \
$(TEMP_SRC_PATH)/fs/jffs2/read.c \
$(TEMP_SRC_PATH)/fs/jffs2/readinode.c \
$(TEMP_SRC_PATH)/fs/jffs2/scan.c \
$(TEMP_SRC_PATH)/fs/jffs2/summary.c \
$(TEMP_SRC_PATH)/fs/jffs2/super.c \
$(TEMP_SRC_PATH)/fs/jffs2/write.c \
$(TEMP_SRC_PATH)/fs/jffs2/writev.c \
$(LOCAL_PATH)/src/jffs2_hash.c \
$(LOCAL_PATH)/src/vfs_jffs2.c \
LOCAL_INCLUDE := \
-I $(LITEOSTOPDIR)/fs/jffs2/include \
-I $(LITEOSTOPDIR)/../linux/linux-5.10/fs/jffs2 \
-I $(LITEOSTOPDIR)/../linux/linux-5.10/fs
-I $(TEMP_SRC_PATH)/fs/jffs2 \
-I $(TEMP_SRC_PATH)/fs
LOCAL_FLAGS := $(LOCAL_INCLUDE)
.PHONY: patch patch_clean
$(LOCAL_SRCS): patch
patch: patch_clean
cp $(LINUX_PATH)/fs/jffs2 $(TEMP_SRC_PATH)/fs/. -r
cd $(TEMP_SRC_PATH) && patch -p1 < $(LOCAL_PATH)/jffs2.patch
patch_clean:
$(HIDE) $(RM) -rf $(TEMP_SRC_PATH)
include $(MODULE)
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册