代码拉取完成,页面将自动刷新
From b4d9c6ec4b948c8e3bc0113699b8914f84531215 Mon Sep 17 00:00:00 2001
From: heppen <hepeng68@huawei.com>
Date: Tue, 16 May 2023 11:49:24 +0800
Subject: [PATCH 1/2] add makefile used on openeuler, the new makefile could make hmdfs as a kernel object.
---
Kbuild | 17 +++++++++++++++++
Makefile | 25 +++++++++++++------------
2 files changed, 30 insertions(+), 12 deletions(-)
create mode 100644 Kbuild
diff --git a/Kbuild b/Kbuild
new file mode 100644
index 000000000000..cbb7852cb090
--- /dev/null
+++ b/Kbuild
@@ -0,0 +1,17 @@
+obj-$(CONFIG_HMDFS_FS) += hmdfs.o
+ccflags-y += -I$(src) -Werror -Wall
+ccflags-$(CONFIG_HMDFS_FS_ENCRYPTION) += -DCONFIG_HMDFS_FS_ENCRYPTION
+ccflags-$(CONFIG_HMDFS_FS_PERMISSION) += -DCONFIG_HMDFS_FS_PERMISSION
+
+hmdfs-y := main.o super.o inode.o dentry.o inode_root.o file_merge.o
+hmdfs-y += hmdfs_client.o hmdfs_server.o inode_local.o inode_remote.o
+hmdfs-y += inode_merge.o hmdfs_dentryfile.o file_root.o file_remote.o
+hmdfs-y += file_local.o client_writeback.o server_writeback.o stash.o
+hmdfs-y += hmdfs_share.o
+
+hmdfs-y += comm/device_node.o comm/message_verify.o comm/node_cb.o
+hmdfs-y += comm/connection.o comm/socket_adapter.o comm/transport.o
+
+hmdfs-$(CONFIG_HMDFS_FS_ENCRYPTION) += comm/crypto.o
+hmdfs-$(CONFIG_HMDFS_FS_PERMISSION) += authority/authentication.o
+hmdfs-$(CONFIG_HMDFS_FS_PERMISSION) += authority/config.o
diff --git a/Makefile b/Makefile
index 20896e71636a..689db2b9db1e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,16 @@
-obj-$(CONFIG_HMDFS_FS) += hmdfs.o
-ccflags-y += -I$(src)
+ifneq ($(KERNELRELEASE),)
+include Kbuild
-hmdfs-y := main.o super.o inode.o dentry.o inode_root.o file_merge.o
-hmdfs-y += hmdfs_client.o hmdfs_server.o inode_local.o inode_remote.o
-hmdfs-y += inode_merge.o hmdfs_dentryfile.o file_root.o file_remote.o
-hmdfs-y += file_local.o client_writeback.o server_writeback.o stash.o
-hmdfs-y += hmdfs_share.o
+else
+KERNELDIR := /lib/modules/$(shell rpm -aq kernel-devel | cut -d "-" -f 3,4)/build
+$(info KERNELDIR=$(KERNELDIR))
-hmdfs-y += comm/device_node.o comm/message_verify.o comm/node_cb.o
-hmdfs-y += comm/connection.o comm/socket_adapter.o comm/transport.o
+export CONFIG_HMDFS_FS := m
+export CONFIG_HMDFS_FS_ENCRYPTION := y
+export CONFIG_HMDFS_FS_PERMISSION := y
-hmdfs-$(CONFIG_HMDFS_FS_ENCRYPTION) += comm/crypto.o
-hmdfs-$(CONFIG_HMDFS_FS_PERMISSION) += authority/authentication.o
-hmdfs-$(CONFIG_HMDFS_FS_PERMISSION) += authority/config.o
+all:
+ $(MAKE) -C $(KERNELDIR) M=$$PWD modules
+clean:
+ $(MAKE) -C $(KERNELDIR) M=$$PWD clean
+endif
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。