例如要生成文件fs/configfs/configfs.ko。

打开Kconfig 和 Makefile。
Kconfig
config CONFIGFS_FS
tristate "Userspace-driven configuration filesystem"
select SYSFS
help
configfs is a RAM-based filesystem that provides the converse
of sysfs's functionality. Where sysfs is a filesystem-based
view of kernel objects, configfs is a filesystem-based manager
of kernel objects, or config_items.
Both sysfs and configfs can and should exist together on the
same system. One is not a replacement for the other.
Makefile
#
# Makefile for the configfs virtual filesystem
#
obj-$(CONFIG_CONFIGFS_FS) += configfs.o
configfs-objs := inode.o file.o dir.o symlink.o mount.o item.o
根据Makefile。需要定义了CONFIG_CONFIGFS_FS 才可以编译 configfs
make menuconfig. 后输入/CONIFIGFS_FS 。回车搜索。

可以找到配置CONIFIGFS_FS。 在 File systems/Pseudo filesystems/Userspace-driven configuration filesystem 选择M.

然后 make moudules 可以生成 configfs.ko
文章讲述了如何生成configfs内核模块,包括打开并编辑Kconfig和Makefile文件,设置CONFIG_CONFIGFS_FS选项,使用makemenuconfig进行配置,以及通过makemodules编译生成configfs.ko文件。configfs是一个基于内存的文件系统,用于用户空间驱动的配置。

6215

被折叠的 条评论
为什么被折叠?



